Turned fusion items into two separate items for the sake of them having different descriptions, fixed ability-changing items not doing so, added Zygarde Cube's Gen 8 effect

This commit is contained in:
Maruno17
2021-08-21 18:26:48 +01:00
parent 41ce9309d7
commit 45fba56455
10 changed files with 335 additions and 129 deletions

View File

@@ -961,7 +961,7 @@ ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
})
ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:KYUREM)
if !pkmn.isSpecies?(:KYUREM) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -969,51 +969,59 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
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)
newForm = 2 if poke2.isSpecies?(:ZEKROM)
pkmn.setForm(newForm) {
pkmn.fused = poke2
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:RESHIRAM) && !other_pkmn.isSpecies?(:ZEKROM)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:RESHIRAM)
newForm = 2 if other_pkmn.isSpecies?(:ZEKROM)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:DNASPLICERS, :DNASPLICERSUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:DNASPLICERSUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:KYUREM) || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:DNASPLICERSUSED, :DNASPLICERS)
next true
})
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 2
if !pkmn.isSpecies?(:NECROZMA) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -1021,47 +1029,56 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
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
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:SOLGALEO)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
pkmn.setForm(1) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NSOLARIZER, :NSOLARIZERUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:NSOLARIZERUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form != 1 || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NSOLARIZERUSED, :NSOLARIZER)
next true
})
ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 1
if !pkmn.isSpecies?(:NECROZMA) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -1069,42 +1086,51 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
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
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:LUNALA)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
pkmn.setForm(2) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NLUNARIZER, :NLUNARIZERUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:NLUNARIZERUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form != 2 || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NLUNARIZERUSED, :NLUNARIZER)
next true
})
@@ -1124,6 +1150,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc { |item,pkmn,scene|
newabil = (pkmn.ability_index + 1) % 2
newabilname = GameData::Ability.get((newabil == 0) ? abil1 : abil2).name
pkmn.ability_index = newabil
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, newabilname))
next true

View File

@@ -216,7 +216,7 @@ ItemHandlers::BattleUseOnBattler.add(:MAXMUSHROOMS,proc { |item, battler, scene|
})
ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:CALYREX)
if !pkmn.isSpecies?(:CALYREX) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -224,46 +224,55 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:GLASTRIER) &&
!other_pkmn.isSpecies?(:SPECTRIER)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:GLASTRIER)
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:GLASTRIER) &&
!other_pkmn.isSpecies?(:SPECTRIER)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:GLASTRIER)
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:REINSOFUNITY, :REINSOFUNITYUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:REINSOFUNITYUSED, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:CALYREX) || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:REINSOFUNITYUSED, :REINSOFUNITY)
next true
})
@@ -278,6 +287,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, pkmn, scene|
end
new_ability_name = GameData::Ability.get(new_ability_id).name
pkmn.ability_index = 2
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!",
pkmn.name, new_ability_name))
@@ -340,6 +350,34 @@ BattleHandlers::ItemOnSwitchIn.add(:ROOMSERVICE,
}
)
ItemHandlers::UseOnPokemon.add(:ZYGARDECUBE, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:ZYGARDE)
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
case scene.pbShowCommands(_INTL("What will you do with {1}?", pkmn.name),
[_INTL("Change form"), _INTL("Change Ability"), _INTL("Cancel")])
when 0 # Change form
newForm = (pkmn.form == 0) ? 1 : 0
pkmn.setForm(newForm) {
scene.pbRefresh
scene.pbDisplay(_INTL("{1} transformed!", pkmn.name))
}
next true
when 1 # Change ability
new_abil = (pkmn.ability_index + 1) % 2
pkmn.ability_index = new_abil
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, pkmn.ability.name))
next true
end
next false
})
=begin