Fixed changing a Pokémon's form with an item not doing certain things, fixed alternate forms not inheriting certain properties from the base form

This commit is contained in:
Maruno17
2021-05-03 19:25:49 +01:00
parent c5cc1eadac
commit b563e73027
3 changed files with 15 additions and 1 deletions

View File

@@ -139,6 +139,18 @@ class Pokemon
end
def form=(value)
oldForm = @form
@form = value
@ability = nil
MultipleForms.call("onSetForm", self, value, oldForm)
calc_stats
$Trainer.pokedex.register(self)
end
# The same as def form=, but yields to a given block in the middle so that a
# message about the form changing can be shown before calling "onSetForm"
# which may have its own messages, e.g. learning a move.
def setForm(value)
oldForm = @form
@form = value
@ability = nil

View File

@@ -171,7 +171,6 @@ class Pokemon
deprecated_method_alias :isAble?, :able?, removal_in: 'v20'
deprecated_method_alias :isFainted?, :fainted?, removal_in: 'v20'
deprecated_method_alias :isShiny?, :shiny?, removal_in: 'v20'
deprecated_method_alias :setForm, :form=, removal_in: 'v20'
deprecated_method_alias :setGender, :gender=, removal_in: 'v20'
deprecated_method_alias :isMale?, :male?, removal_in: 'v20'
deprecated_method_alias :isFemale?, :female?, removal_in: 'v20'