Fixed not being able to detect a Pokémon being a Mega Evolution, fixed inadequate checking if a Mega Stone is unlosable

This commit is contained in:
Maruno17
2021-05-03 18:58:02 +01:00
parent 474281712b
commit c5cc1eadac
3 changed files with 13 additions and 6 deletions

View File

@@ -3,14 +3,14 @@ class Pokemon
# Mega Evolution
# NOTE: These are treated as form changes in Essentials.
#=============================================================================
def getMegaForm(checkItemOnly = false)
def getMegaForm
ret = 0
GameData::Species.each do |data|
next if data.species != @species || data.unmega_form != form_simple
if data.mega_stone && hasItem?(data.mega_stone)
ret = data.form
break
elsif !checkItemOnly && data.mega_move && hasMove?(data.mega_move)
elsif data.mega_move && hasMove?(data.mega_move)
ret = data.form
break
end
@@ -28,8 +28,7 @@ class Pokemon
end
def mega?
megaForm = self.getMegaForm
return megaForm > 0 && megaForm == form_simple
return (species_data.mega_stone || species_data.mega_move) ? true : false
end
def makeMega