mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Use PokeBattle_Pokemon#isSpecies? instead of isConst?
This commit is contained in:
@@ -837,7 +837,7 @@ ItemHandlers::UseOnPokemon.add(:TAMATOBERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:GRACIDEA,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:GRACIDEA,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:SHAYMIN) || pkmn.form!=0 ||
|
if !pkmn.isSpecies?(:SHAYMIN) || pkmn.form!=0 ||
|
||||||
pkmn.status==PBStatuses::FROZEN || PBDayNight.isNight?
|
pkmn.status==PBStatuses::FROZEN || PBDayNight.isNight?
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
@@ -854,7 +854,7 @@ ItemHandlers::UseOnPokemon.add(:GRACIDEA,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:REDNECTAR,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:REDNECTAR,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:ORICORIO) || pkmn.form==0
|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==0
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -869,7 +869,7 @@ ItemHandlers::UseOnPokemon.add(:REDNECTAR,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:YELLOWNECTAR,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:YELLOWNECTAR,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:ORICORIO) || pkmn.form==1
|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==1
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -884,7 +884,7 @@ ItemHandlers::UseOnPokemon.add(:YELLOWNECTAR,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:PINKNECTAR,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:PINKNECTAR,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:ORICORIO) || pkmn.form==2
|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==2
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -899,7 +899,7 @@ ItemHandlers::UseOnPokemon.add(:PINKNECTAR,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:PURPLENECTAR,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:PURPLENECTAR,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:ORICORIO) || pkmn.form==3
|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==3
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -914,9 +914,9 @@ ItemHandlers::UseOnPokemon.add(:PURPLENECTAR,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:REVEALGLASS,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:REVEALGLASS,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:TORNADUS) &&
|
if !pkmn.isSpecies?(:TORNADUS) &&
|
||||||
!isConst?(pkmn.species,PBSpecies,:THUNDURUS) &&
|
!pkmn.isSpecies?(:THUNDURUS) &&
|
||||||
!isConst?(pkmn.species,PBSpecies,:LANDORUS)
|
!pkmn.isSpecies?(:LANDORUS)
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -933,7 +933,7 @@ ItemHandlers::UseOnPokemon.add(:REVEALGLASS,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:HOOPA)
|
if !pkmn.isSpecies?(:HOOPA)
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -949,7 +949,7 @@ ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:KYUREM)
|
if !pkmn.isSpecies?(:KYUREM)
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -967,13 +967,13 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
||||||
elsif poke2.fainted?
|
elsif poke2.fainted?
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
||||||
elsif !isConst?(poke2.species,PBSpecies,:RESHIRAM) &&
|
elsif !poke2.isSpecies?(:RESHIRAM) &&
|
||||||
!isConst?(poke2.species,PBSpecies,:ZEKROM)
|
!poke2.isSpecies?(:ZEKROM)
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
||||||
end
|
end
|
||||||
newForm = 0
|
newForm = 0
|
||||||
newForm = 1 if isConst?(poke2.species,PBSpecies,:RESHIRAM)
|
newForm = 1 if poke2.isSpecies?(:RESHIRAM)
|
||||||
newForm = 2 if isConst?(poke2.species,PBSpecies,:ZEKROM)
|
newForm = 2 if poke2.isSpecies?(:ZEKROM)
|
||||||
pkmn.setForm(newForm) {
|
pkmn.setForm(newForm) {
|
||||||
pkmn.fused = poke2
|
pkmn.fused = poke2
|
||||||
pbRemovePokemonAt(chosen)
|
pbRemovePokemonAt(chosen)
|
||||||
@@ -997,7 +997,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:NECROZMA) || pkmn.form==0
|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form==0
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -1015,7 +1015,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
||||||
elsif poke2.fainted?
|
elsif poke2.fainted?
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
||||||
elsif !isConst?(poke2.species,PBSpecies,:SOLGALEO)
|
elsif !poke2.isSpecies?(:SOLGALEO)
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
||||||
end
|
end
|
||||||
pkmn.setForm(1) {
|
pkmn.setForm(1) {
|
||||||
@@ -1041,7 +1041,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
||||||
if !isConst?(pkmn.species,PBSpecies,:NECROZMA) || pkmn.form==1
|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form==1
|
||||||
scene.pbDisplay(_INTL("It had no effect."))
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -1059,7 +1059,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
|
||||||
elsif poke2.fainted?
|
elsif poke2.fainted?
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
|
||||||
elsif !isConst?(poke2.species,PBSpecies,:LUNALA)
|
elsif !poke2.isSpecies?(:LUNALA)
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
|
||||||
end
|
end
|
||||||
pkmn.setForm(2) {
|
pkmn.setForm(2) {
|
||||||
@@ -1091,8 +1091,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc { |item,pkmn,scene|
|
|||||||
abil1 = i[0] if i[1]==0
|
abil1 = i[0] if i[1]==0
|
||||||
abil2 = i[0] if i[1]==1
|
abil2 = i[0] if i[1]==1
|
||||||
end
|
end
|
||||||
if abil1<=0 || abil2<=0 || pkmn.hasHiddenAbility? ||
|
if abil1<=0 || abil2<=0 || pkmn.hasHiddenAbility? || pkmn.isSpecies?(:ZYGARDE)
|
||||||
isConst?(pkmn.species,PBSpecies,:ZYGARDE)
|
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbIsPurifiable?(pkmn)
|
def pbIsPurifiable?(pkmn)
|
||||||
return false if !pkmn
|
return false if !pkmn
|
||||||
return false if isConst?(pkmn.species,PBSpecies,:LUGIA)
|
return false if pkmn.isSpecies?(:LUGIA)
|
||||||
return false if !pkmn.shadowPokemon? || pkmn.heartgauge>0
|
return false if !pkmn.shadowPokemon? || pkmn.heartgauge>0
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ class PokemonStorage
|
|||||||
pkmn = self[boxSrc,indexSrc]
|
pkmn = self[boxSrc,indexSrc]
|
||||||
raise "Trying to copy nil to storage" if !pkmn
|
raise "Trying to copy nil to storage" if !pkmn
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
||||||
pkmn.form = 0 if isConst?(pkmn.species,PBSpecies,:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
self[boxDst,indexDst] = pkmn
|
self[boxDst,indexDst] = pkmn
|
||||||
end
|
end
|
||||||
@@ -204,7 +204,7 @@ class PokemonStorage
|
|||||||
if self[box,i]==nil
|
if self[box,i]==nil
|
||||||
if box>=0
|
if box>=0
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime") && pkmn.formTime
|
pkmn.formTime = nil if pkmn.respond_to?("formTime") && pkmn.formTime
|
||||||
pkmn.form = 0 if isConst?(pkmn.species,PBSpecies,:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
end
|
end
|
||||||
self[box,i] = pkmn
|
self[box,i] = pkmn
|
||||||
@@ -217,7 +217,7 @@ class PokemonStorage
|
|||||||
def pbStoreCaught(pkmn)
|
def pbStoreCaught(pkmn)
|
||||||
if @currentBox>=0
|
if @currentBox>=0
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
||||||
pkmn.form = 0 if isConst?(pkmn.species,PBSpecies,:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
end
|
end
|
||||||
for i in 0...maxPokemon(@currentBox)
|
for i in 0...maxPokemon(@currentBox)
|
||||||
|
|||||||
@@ -1760,7 +1760,7 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
if box>=0
|
if box>=0
|
||||||
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
||||||
@heldpkmn.form = 0 if isConst?(@heldpkmn.species,PBSpecies,:SHAYMIN)
|
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
||||||
@heldpkmn.heal
|
@heldpkmn.heal
|
||||||
end
|
end
|
||||||
@scene.pbPlace(selected,@heldpkmn)
|
@scene.pbPlace(selected,@heldpkmn)
|
||||||
@@ -1789,7 +1789,7 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
if box>=0
|
if box>=0
|
||||||
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
||||||
@heldpkmn.form = 0 if isConst?(@heldpkmn.species,PBSpecies,:SHAYMIN)
|
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
||||||
@heldpkmn.heal
|
@heldpkmn.heal
|
||||||
end
|
end
|
||||||
@scene.pbSwap(selected,@heldpkmn)
|
@scene.pbSwap(selected,@heldpkmn)
|
||||||
|
|||||||
@@ -405,12 +405,12 @@ class StandardRestriction
|
|||||||
# Certain named species are not banned
|
# Certain named species are not banned
|
||||||
speciesWhitelist = [:DRAGONITE,:SALAMENCE,:TYRANITAR]
|
speciesWhitelist = [:DRAGONITE,:SALAMENCE,:TYRANITAR]
|
||||||
for i in speciesWhitelist
|
for i in speciesWhitelist
|
||||||
return true if isConst?(pokemon.species,PBSpecies,i)
|
return true if pokemon.isSpecies?(i)
|
||||||
end
|
end
|
||||||
# Certain named species are banned
|
# Certain named species are banned
|
||||||
speciesBlacklist = [:WYNAUT,:WOBBUFFET]
|
speciesBlacklist = [:WYNAUT,:WOBBUFFET]
|
||||||
for i in speciesBlacklist
|
for i in speciesBlacklist
|
||||||
return false if isConst?(pokemon.species,PBSpecies,i)
|
return false if pokemon.isSpecies?(i)
|
||||||
end
|
end
|
||||||
# Species with total base stat 600 or more are banned
|
# Species with total base stat 600 or more are banned
|
||||||
baseStats = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesBaseStats)
|
baseStats = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesBaseStats)
|
||||||
@@ -498,7 +498,7 @@ end
|
|||||||
|
|
||||||
class NegativeExtendedGameClause
|
class NegativeExtendedGameClause
|
||||||
def isValid?(pokemon)
|
def isValid?(pokemon)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:ARCEUS)
|
return false if pokemon.isSpecies?(:ARCEUS)
|
||||||
return false if isConst?(pokemon.item,PBItems,:MICLEBERRY)
|
return false if isConst?(pokemon.item,PBItems,:MICLEBERRY)
|
||||||
return false if isConst?(pokemon.item,PBItems,:CUSTAPBERRY)
|
return false if isConst?(pokemon.item,PBItems,:CUSTAPBERRY)
|
||||||
return false if isConst?(pokemon.item,PBItems,:JABOCABERRY)
|
return false if isConst?(pokemon.item,PBItems,:JABOCABERRY)
|
||||||
@@ -605,12 +605,12 @@ class LittleCupRestriction
|
|||||||
return false if isConst?(pokemon.item,PBItems,:DEEPSEATOOTH)
|
return false if isConst?(pokemon.item,PBItems,:DEEPSEATOOTH)
|
||||||
return false if pokemon.hasMove?(:SONICBOOM)
|
return false if pokemon.hasMove?(:SONICBOOM)
|
||||||
return false if pokemon.hasMove?(:DRAGONRAGE)
|
return false if pokemon.hasMove?(:DRAGONRAGE)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:SCYTHER)
|
return false if pokemon.isSpecies?(:SCYTHER)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:SNEASEL)
|
return false if pokemon.isSpecies?(:SNEASEL)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:MEDITITE)
|
return false if pokemon.isSpecies?(:MEDITITE)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:YANMA)
|
return false if pokemon.isSpecies?(:YANMA)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:TANGELA)
|
return false if pokemon.isSpecies?(:TANGELA)
|
||||||
return false if isConst?(pokemon.species,PBSpecies,:MURKROW)
|
return false if pokemon.isSpecies?(:MURKROW)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user