/* Ensure poke exists */
if (poke == null) return false;
PokemonSpecies pokeData = PokemonSpecies.getDefaultData().getPokemonByName(
poke.getSpeciesName());
for (int j = 0; j < pokeData.getEvolutions().length; j++) {
PokemonEvolution evolution = pokeData.getEvolutions()[j];
/*
* Check if this pokemon evolves by item
*/
if (evolution.getType() == EvolutionTypes.Item) {
/*
* Check if the item is an evolution stone If so, evolve the
* Pokemon
*/
if (i.getName().equalsIgnoreCase("FIRE STONE")
&& evolution.getAttribute().equalsIgnoreCase("FIRESTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("WATER STONE")
&& evolution.getAttribute().equalsIgnoreCase("WATERSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("THUNDERSTONE")
&& evolution.getAttribute().equalsIgnoreCase("THUNDERSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("LEAF STONE")
&& evolution.getAttribute().equalsIgnoreCase("LEAFSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("MOON STONE")
&& evolution.getAttribute().equalsIgnoreCase("MOONSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("SUN STONE")
&& evolution.getAttribute().equalsIgnoreCase("SUNSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("SHINY STONE")
&& evolution.getAttribute().equalsIgnoreCase("SHINYSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("DUSK STONE")
&& evolution.getAttribute().equalsIgnoreCase("DUSKSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("DAWN STONE")
&& evolution.getAttribute().equalsIgnoreCase("DAWNSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
} else if (i.getName().equalsIgnoreCase("OVAL STONE")
&& evolution.getAttribute().equalsIgnoreCase("OVALSTONE")) {
poke.setEvolution(evolution);
poke.evolutionResponse(true, p);
return true;
}
}