ItemHandlers::UseOnPokemon.add(:TRISPLICERS,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:LUCARIO)
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."))
end
# Fusing
if pkmn.fused==nil
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
poke2 = $Trainer.party[chosen]
poke3 = $Trainer.party[chosen]
if pkmn==poke2 || pkmn==poke3
scene.pbDisplay(_INTL("It cannot be fused with itself."))
elsif poke2.egg? || poke3.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
elsif poke2.fainted? || poke3.fainted?
scene.pbDisplay(_INTL("It cannot be fused with a fainted Pokémon."))
elsif !poke2.isSpecies?(:MEWTWO) &&
!poke3.isSpecies?(:ALAKAZAM)
scene.pbDisplay(_INTL("It cannot be fused with those Pokémon."))
end
newForm = 0
newForm = 2 if poke2.isSpecies?(:MEWTWO) && poke3.isSpecies?(:ALAKAZAM)
pkmn.setForm(newForm) {
pkmn.fused = poke2 && pkmn.fused = poke3
pbRemovePokemonAt(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
end
# Unfusing
if $Trainer.party.length>=6
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
})