Merge pull request #10 from jonisavo/additional-refactoring

Additional #isSpecies? and #hasItem? refactoring
This commit is contained in:
Maruno17
2020-09-06 19:21:17 +01:00
committed by GitHub
8 changed files with 13 additions and 17 deletions

View File

@@ -338,9 +338,9 @@ class PokemonEncounters
end
firstPkmn = $Trainer.firstPokemon
if firstPkmn
if isConst?(firstPkmn.item,PBItems,:CLEANSETAG)
if firstPkmn.hasItem?(:CLEANSETAG)
encount = encount*2/3
elsif isConst?(firstPkmn.item,PBItems,:PUREINCENSE)
elsif firstPkmn.hasItem?(:PUREINCENSE)
encount = encount*2/3
else # Ignore ability effects if an item effect applies
if isConst?(firstPkmn.ability,PBAbilities,:STENCH)

View File

@@ -220,7 +220,7 @@ def pbDayCareGenerateEgg
isConst?(babyspecies,PBSpecies,:ROCKRUFF) ||
isConst?(babyspecies,PBSpecies,:MINIOR)
newForm = mother.form
newForm = 0 if isConst?(mother.species,PBSpecies,:MOTHIM)
newForm = 0 if mother.isSpecies?(:MOTHIM)
egg.form = newForm
end
# Inheriting Alolan form
@@ -280,13 +280,11 @@ def pbDayCareGenerateEgg
end
# Volt Tackle
lightball = false
if (isConst?(father.species,PBSpecies,:PIKACHU) ||
isConst?(father.species,PBSpecies,:RAICHU)) &&
if (father.isSpecies?(:PIKACHU) || father.isSpecies?(:RAICHU)) &&
father.hasItem?(:LIGHTBALL)
lightball = true
end
if (isConst?(mother.species,PBSpecies,:PIKACHU) ||
isConst?(mother.species,PBSpecies,:RAICHU)) &&
if (mother.isSpecies?(:PIKACHU) || mother.isSpecies?(:RAICHU)) &&
mother.hasItem?(:LIGHTBALL)
lightball = true
end