Juno and Ice
Developer of Pokémon Floral Tempus
- 150
- Posts
- 7
- Years
- Seen Aug 6, 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:
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
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.
################################################################################
# Attack phase.
################################################################################
def pbAttackPhase
@scene.pbBeginAttackPhase
for i in 0...4
@successStates[i].clear
if @choices[i][0]!=1 && @choices[i][0]!=2
@battlers[i].effects[PBEffects::DestinyBond]=false
@battlers[i].effects[PBEffects::Grudge]=false
end
@battlers[i].turncount+=1 if !@battlers[i].fainted?
@battlers[i].effects[PBEffects::Rage]=false if !pbChoseMove?(i,:RAGE)
end
# Prepare for Z Moves
for i in 0..3
next if @choices[i][0]!=1
side=(pbIsOpposing?(i)) ? 1 : 0
owner=pbGetOwnerIndex(i)
if @zMove[side][owner]==i
@choices[i][2].zmove=true
end
end
# 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
After it mega evolves or after? Your question is kind of ambiguous there.
# 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
@usepriority=false
priority=pbPriority(false,true)