Pokedex5E icon indicating copy to clipboard operation
Pokedex5E copied to clipboard

Refactor evolution logic

Open Jerakin opened this issue 4 years ago • 0 comments

The "check" for checking if a evolution is possible is currently not enough, we do this in edit.gui_script. We should only have to check against evolution_possible.

local evolution_possible = _pokemon.get_evolution_possible(self.pokemon)
local evolution_level = evolution_possible and _pokemon.get_evolution_level(self.pokemon)
if not _pokemon.get_consumed_eviolite(self.pokemon) and evolution_possible and evolution_level <= _pokemon.get_current_level(self.pokemon) then
  -- evolution is actually possible
end

Jerakin avatar Sep 14 '20 22:09 Jerakin