Solved Mega evolutions broken (16.2)


Lead Developer of Pokemon Sacred Johto
For ages my megas (official and custom) have worked fine, and just now, while working on a new mega, realised they are broken somehow.

They mega evolve fine and change correctly, but after the first attack, (either the user or opponent) the mega stays as a mega (with the icon) but "transform" back.
tested it with a new one and then an old one that has worked for awhile now.

This might be hard to solve, but ill try and post what i can about this issue.

the only change to the mega evolution section was adding the new tyrantrum mega:

   next 1 if isConst?(pokemon.item,PBItems,:TYRANTRITE)
   next [[getID(PBAbilities,:CARNIVORE),0]] if pokemon.form==1
then in PokeBattle_Battler; i had a code for a mega skarmory that changed like aegislash, which was broken but didn't affect other megas. (its also turned off with #)

# Armour Shift
    #if hasWorkingAbility(:ARMOURSHIFT) && isConst?(species,PBSpecies,:SKARMORY) &&
    #   !@effects[PBEffects::Transform]
    #  if thismove.pbIsDamaging? && self.form!=2
    #    self.form=2
    #    pbUpdate(true)
    #    @battle.scene.pbChangePokemon(self,@pokemon)
    #    @battle.pbDisplay(_INTL("{1} changed to Battle Armour!",pbThis))
    #    PBDebug.log("[Form changed] #{pbThis} changed to Battle Armour")
    #  elsif thismove.pbIsStatus? && self.form!=3
    #    self.form=3
    #    pbUpdate(true)
    #    @battle.scene.pbChangePokemon(self,@pokemon)
    #    @battle.pbDisplay(_INTL("{1} changed to Neautral Armour!",pbThis))
    #    PBDebug.log("[Form changed] #{pbThis} changed to Neautral Armour")
    #  end    
i looked for my hive mind changing combee which was similiar to the mega hydregion from insurgence, however i removed that code as it just didn't work.

without knowing what changes them back it might be hard to troubleshoot this issue...


Update: found the issue with a custom form change. all fixed now
Last edited: