Fixed Pokémon-fusing items causing a fusion despite saying they

This commit is contained in:
Maruno17
2020-10-28 18:33:13 +00:00
parent f6d626e7dd
commit e290d1dd45
2 changed files with 18 additions and 3 deletions

View File

@@ -955,6 +955,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
end
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
# Fusing
if pkmn.fused==nil
@@ -963,13 +964,17 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:RESHIRAM) &&
!poke2.isSpecies?(:ZEKROM)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
newForm = 0
newForm = 1 if poke2.isSpecies?(:RESHIRAM)
@@ -997,12 +1002,13 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
})
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form==0
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 2
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
# Fusing
if pkmn.fused==nil
@@ -1011,12 +1017,16 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:SOLGALEO)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
pkmn.setForm(1) {
pkmn.fused = poke2
@@ -1041,12 +1051,13 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
})
ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form==1
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 1
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
# Fusing
if pkmn.fused==nil
@@ -1055,12 +1066,16 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:LUNALA)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
pkmn.setForm(2) {
pkmn.fused = poke2

View File

@@ -368,7 +368,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
battle = pbListScreen(_INTL("SINGLE TRAINER"),TrainerBattleLister.new(0,false))
if battle
trainerdata = battle[1]
pbTrainerBattle(trainerdata[0],trainerdata[1],"...",false,trainerdata[4],true)
pbTrainerBattle(trainerdata[0],trainerdata[1],nil,false,trainerdata[4],true)
end
when "testtrainerbattleadvanced"
trainers = []