• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Mega Evolution Speed

Juno and Ice

Developer of Pokémon Floral Tempus
150
Posts
5
Years
    • Seen Apr 30, 2024
    Is there a way to make mega evolution calculate turn order after it mega evolves rather than after? Like the gen 7 changes?
     
    Last edited:
    1,805
    Posts
    7
    Years
  • essentials is programed to gen 6 so that makes sense that youre curious about this.

    lessee.... you'll want to see the method def pbMegaEvolve

    Code:
      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("{1}'s fervent wish has reached {2}!",ownername,@battlers[index].pbThis))
        else
          pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!",
             @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} has Mega Evolved into {2}!",@battlers[index].pbThis,meganame))
        PBDebug.log("[Mega Evolution] #{@battlers[index].pbThis} became #{meganame}")
        side=(pbIsOpposing?(index)) ? 1 : 0
        owner=pbGetOwnerIndex(index)
        @megaEvolution[side][owner]=-2
      end

    hmmmm good question but my guess is to start there
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Code:
    Generation VII
    
    In Generation VII, a Pokémon's Speed after Mega Evolution is used to determine turn order, not its Speed before. Likewise, if a Pokémon only has an Ability such as Prankster before Mega Evolution, appropriate moves will not gain priority. If a Pokémon gains Prankster upon Mega Evolution, appropriate moves will gain priority.
    
    Rayquaza cannot Mega Evolve if it holds a Z-Crystal.
    
    In Pokémon: Let's Go, Pikachu! and Let's Go, Eevee!, as the Held item mechanic is not implemented, the player simply needs to have the compatible Mega Stone in their bag to access a Pokémon's Mega Evolution. The player can also manually pick which form Charizard or Mewtwo can become from the move menu.

    I will find a way too.

    Maybe here:
    Spoiler:
     
    Last edited:

    Juno and Ice

    Developer of Pokémon Floral Tempus
    150
    Posts
    5
    Years
    • Seen Apr 30, 2024
    After it mega evolves or after? Your question is kind of ambiguous there.

    Currently if a Beedrill mega evolves it will get outsped by everything because in Gen 6, mega evolution calculated turn order before mega evolution. In Gen 7 this was changed so that the turn order is counted after mega evolution, so Mega Beedrill will outspeed everything it's supposed to on the first turn of mega
    evolution.
     
    1,682
    Posts
    8
    Years
    • Seen today
    My guess for what needs to change is here, in def pbAttackPhase.
    Code:
        # Calculate priority at this time
        @usepriority=false
        priority=pbPriority(false,true)
        # Mega Evolution
        megaevolved=[]
        for i in priority
          if @choices[i.index][0]==1 && !i.effects[PBEffects::SkipTurn]
            side=(pbIsOpposing?(i.index)) ? 1 : 0
            owner=pbGetOwnerIndex(i.index)
            if @megaEvolution[side][owner]==i.index
              pbMegaEvolve(i.index)
              megaevolved.push(i.index)
            end
          end
        end
        if megaevolved.length>0
          for i in priority
            i.pbAbilitiesOnSwitchIn(true) if megaevolved.include?(i.index)
          end
        end
        # Call at Pokémon
        for i in priority
          if @choices[i.index][0]==4 && !i.effects[PBEffects::SkipTurn]
            pbCall(i.index)
          end
        end
    you'll want to recalulate priority, so these two lines will have to show up again after the mega evolution stuff.
    Code:
        @usepriority=false
        priority=pbPriority(false,true)
     
    Back
    Top