So, I'm using 17.2 and when a foe trainer uses Mega evolution (this only happens with other trainers, my Pokémon always mega evolves correctly idk why) it never mega evolves. It says the usual "it is mega evolving!" but just retourns the form 0, not the mega one.
I have all the megas on the PokémonForms.txt, and, yeah when I use Mega Evolution it works it's just with foe trainers and idk why :(
I let my pbMegaEvolution Script here so you can check if I did anything wrong. However I just translated dialogues and never touched this code...
I have all the megas on the PokémonForms.txt, and, yeah when I use Mega Evolution it works it's just with foe trainers and idk why :(
I let my pbMegaEvolution Script here so you can check if I did anything wrong. However I just translated dialogues and never touched this code...
Spoiler:
def pbMegaEvolve(index)
return if !@battlers[index] || !@battlers[index].pokemon
return if !(@battlers[index].hasMega? rescue false)
return if (@battlers[index].isMega? rescue true)
ownername=pbGetOwner(index).fullname
ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
case (@battlers[index].pokemon.megaMessage rescue 0)
when 1 # Rayquaza
pbDisplay(_INTL("¡El deseo de {1} ha alcanzado a {2}!",ownername,@battlers[index].pbThis))
else
pbDisplay(_INTL("¡La {2} de {1} está reaccionado al {4} de {3}!",
@battlers[index].pbThis,PBItems.getName(@battlers[index].item),
ownername,pbGetMegaRingName(index)))
end
pbCommonAnimation("MegaEvolution",@battlers[index],nil)
@battlers[index].pokemon.makeMega
@battlers[index].form=@battlers[index].pokemon.form
@battlers[index].pbUpdate(true)
@scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
meganame=(@battlers[index].pokemon.megaName rescue nil)
if !meganame || meganame==""
meganame=_INTL("Mega {1}",PBSpecies.getName(@battlers[index].pokemon.species))
end
pbDisplay(_INTL("¡{1} ha megaevolucionado a {2}!",@battlers[index].pbThis,meganame))
PBDebug.log("[Mega Evolution] #{@battlers[index].pbThis} became #{meganame}")
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=-2
end
return if !@battlers[index] || !@battlers[index].pokemon
return if !(@battlers[index].hasMega? rescue false)
return if (@battlers[index].isMega? rescue true)
ownername=pbGetOwner(index).fullname
ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
case (@battlers[index].pokemon.megaMessage rescue 0)
when 1 # Rayquaza
pbDisplay(_INTL("¡El deseo de {1} ha alcanzado a {2}!",ownername,@battlers[index].pbThis))
else
pbDisplay(_INTL("¡La {2} de {1} está reaccionado al {4} de {3}!",
@battlers[index].pbThis,PBItems.getName(@battlers[index].item),
ownername,pbGetMegaRingName(index)))
end
pbCommonAnimation("MegaEvolution",@battlers[index],nil)
@battlers[index].pokemon.makeMega
@battlers[index].form=@battlers[index].pokemon.form
@battlers[index].pbUpdate(true)
@scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
meganame=(@battlers[index].pokemon.megaName rescue nil)
if !meganame || meganame==""
meganame=_INTL("Mega {1}",PBSpecies.getName(@battlers[index].pokemon.species))
end
pbDisplay(_INTL("¡{1} ha megaevolucionado a {2}!",@battlers[index].pbThis,meganame))
PBDebug.log("[Mega Evolution] #{@battlers[index].pbThis} became #{meganame}")
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=-2
end