diff --git a/Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb b/Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb index 06a7d738b..dac3a3ded 100644 --- a/Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb +++ b/Data/Scripts/012_Battle/002_Move/002_Move_Usage.rb @@ -164,7 +164,7 @@ class PokeBattle_Move return end # Disguise will take the damage - if !@battle.moldBreaker && isConst?(target.species,PBSpecies,:MIMIKYU) && + if !@battle.moldBreaker && target.isSpecies?(:MIMIKYU) && target.form==0 && isConst?(target.ability,PBAbilities,:DISGUISE) target.damageState.disguise = true return diff --git a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb index 29e679297..5e1ae3943 100644 --- a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb +++ b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb @@ -852,7 +852,7 @@ BattleHandlers::DamageCalcTargetItem.add(:COLBURBERRY, BattleHandlers::DamageCalcTargetItem.add(:DEEPSEASCALE, proc { |item,user,target,move,mults,baseDmg,type| - if isConst?(target.species,PBSpecies,:CLAMPERL) && move.specialMove? + if target.isSpecies?(:CLAMPERL) && move.specialMove? mults[DEF_MULT] *= 2 end } @@ -889,8 +889,7 @@ BattleHandlers::DamageCalcTargetItem.add(:KEBIABERRY, BattleHandlers::DamageCalcTargetItem.add(:METALPOWDER, proc { |item,user,target,move,mults,baseDmg,type| - if isConst?(target.species,PBSpecies,:DITTO) && - !target.effects[PBEffects::Transform] + if target.isSpecies?(:DITTO) && !target.effects[PBEffects::Transform] mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round end } @@ -935,8 +934,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY, BattleHandlers::DamageCalcTargetItem.add(:SOULDEW, proc { |item,user,target,move,mults,baseDmg,type| next if NEWEST_BATTLE_MECHANICS - next if !isConst?(target.species,PBSpecies,:LATIAS) && - !isConst?(target.species,PBSpecies,:LATIOS) + next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS) if move.specialMove? && !user.battle.rules["souldewclause"] mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round end diff --git a/Data/Scripts/013_Overworld/007_PField_Encounters.rb b/Data/Scripts/013_Overworld/007_PField_Encounters.rb index 61e7fa6fe..1533f62c4 100644 --- a/Data/Scripts/013_Overworld/007_PField_Encounters.rb +++ b/Data/Scripts/013_Overworld/007_PField_Encounters.rb @@ -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) diff --git a/Data/Scripts/013_Overworld/013_PField_DayCare.rb b/Data/Scripts/013_Overworld/013_PField_DayCare.rb index b390142f0..cbf0ef25d 100644 --- a/Data/Scripts/013_Overworld/013_PField_DayCare.rb +++ b/Data/Scripts/013_Overworld/013_PField_DayCare.rb @@ -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 diff --git a/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb b/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb index c37278621..c32d1e77e 100644 --- a/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb +++ b/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb @@ -796,7 +796,7 @@ class PokeBattle_Pokemon if gain>0 gain += 1 if @obtainMap==$game_map.map_id gain += 1 if self.ballused==pbGetBallType(:LUXURYBALL) - gain = (gain*1.5).floor if isConst?(self.item,PBItems,:SOOTHEBELL) + gain = (gain*1.5).floor if self.hasItem?(:SOOTHEBELL) end @happiness += gain @happiness = [[255,@happiness].min,0].max diff --git a/Data/Scripts/017_UI/017_PScreen_PokemonStorage.rb b/Data/Scripts/017_UI/017_PScreen_PokemonStorage.rb index eaa0fa106..16158b79a 100644 --- a/Data/Scripts/017_UI/017_PScreen_PokemonStorage.rb +++ b/Data/Scripts/017_UI/017_PScreen_PokemonStorage.rb @@ -1715,7 +1715,7 @@ class PokemonStorageScreen if heldpoke || selected[0]==-1 p = (heldpoke) ? heldpoke : @storage[-1,index] p.formTime = nil if p.respond_to?("formTime") - p.form = 0 if isConst?(p.species,PBSpecies,:SHAYMIN) + p.form = 0 if p.isSpecies?(:SHAYMIN) p.heal end @scene.pbStore(selected,heldpoke,destbox,firstfree) diff --git a/Data/Scripts/017_UI/021_PScreen_Evolution.rb b/Data/Scripts/017_UI/021_PScreen_Evolution.rb index 7f52d431e..d1057cc85 100644 --- a/Data/Scripts/017_UI/021_PScreen_Evolution.rb +++ b/Data/Scripts/017_UI/021_PScreen_Evolution.rb @@ -587,7 +587,7 @@ class PokemonEvolutionScene # Modify Pokémon to make it evolved @pokemon.species = @newspecies @pokemon.name = newspeciesname if @pokemon.name==oldspeciesname - @pokemon.form = 0 if isConst?(@pokemon.species,PBSpecies,:MOTHIM) + @pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM) @pokemon.calcStats # See and own evolved species $Trainer.seen[@newspecies] = true diff --git a/Data/Scripts/017_UI/024_PScreen_PurifyChamber.rb b/Data/Scripts/017_UI/024_PScreen_PurifyChamber.rb index fc1df25be..941819788 100644 --- a/Data/Scripts/017_UI/024_PScreen_PurifyChamber.rb +++ b/Data/Scripts/017_UI/024_PScreen_PurifyChamber.rb @@ -182,7 +182,7 @@ class PurifyChamber # German: der Kryptorbis return false if !shadow return false if shadow.heartgauge!=0 # Define an exception for Lugia - if isConst?(shadow.species,PBSpecies,:LUGIA) + if shadow.isSpecies?(:LUGIA) maxtempo=PurifyChamber.maximumTempo() for i in 0...NUMSETS return false if @sets[i].tempo!=maxtempo