ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
if pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
end
# Fusing
if pkmn.fused==nil
$game_variables[100]=pkmn.form
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."))
poke2 = nil
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
poke2 = nil
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
poke2 = nil
end
newForm = 0
newForm = pkmn.form+poke2.species if poke2 != nil
pkmn.setForm(newForm) {
pkmn.fused = poke2
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($game_variables[100]) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
poke2 = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
})