I am trying to convert a chart of pokemon types into a PHP function so that it will return an attack multiplier based on the types that two pokemon have.
First, here is the chart that holds all of the different types: http://www.serebii.net/games/type.shtml
Other than making an insanely large function filled with if else conditions, is there any easier way for me to convert the chart data to PHP.
This is what I have so far:
Code:
Basically, I was wondering if anyone had any better ideas. There is most likely an easier way that I haven't discovered.
First, here is the chart that holds all of the different types: http://www.serebii.net/games/type.shtml
Other than making an insanely large function filled with if else conditions, is there any easier way for me to convert the chart data to PHP.
This is what I have so far:
Code:
function type($user_type1, $user_type2, $enemy_type1, $enemy_type2) {
$types = array(1 => "normal", "fire", "water", "electric", "grass", "ice", "fighting", "poison", "ground", "flying", "psychic", "bug", "rock", "ghost", "dragon", "dark", "steel");
return $multiplier;
}
Basically, I was wondering if anyone had any better ideas. There is most likely an easier way that I haven't discovered.