Update 001_PokeBattle_Pokemon.rb

- Fixed name resetting on Pokémon with new species assigned that wasn't working as intended
- Improved naming on a variable
This commit is contained in:
João Vítor Reis
2020-09-08 15:01:08 -03:00
committed by GitHub
parent 0236740ab6
commit 4d0e9cd331

View File

@@ -628,9 +628,9 @@ class PokeBattle_Pokemon
# Other # Other
#============================================================================= #=============================================================================
def species=(value) def species=(value)
resetName = nicknamed? hasNickname = nicknamed?
@species = value @species = value
@name = PBSpecies.getName(@species) if !resetName @name = PBSpecies.getName(@species) unless hasNickname
@level = nil # In case growth rate is different for the new species @level = nil # In case growth rate is different for the new species
@forcedForm = nil @forcedForm = nil
self.form = 0 # Also recalculates stats self.form = 0 # Also recalculates stats
@@ -647,7 +647,7 @@ class PokeBattle_Pokemon
end end
def nicknamed? def nicknamed?
return @name==self.speciesName return @name!=self.speciesName
end end
# Returns this Pokémon's language. # Returns this Pokémon's language.