From 0eccbdf980e09c4de4a11f63ea1cad2db7d9d9f7 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 6 Nov 2022 00:36:25 -0300 Subject: [PATCH] Primal Reversion at the beginning of a battle now happens in the switchin ability loop, making it happen by speed order. --- src/battle_main.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 1aefd71b0..6abc19083 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3678,18 +3678,6 @@ static void TryDoEventsBeforeFirstTurn(void) } memset(gTotemBoosts, 0, sizeof(gTotemBoosts)); // erase all totem boosts just to be safe - // Primal Reversion - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB - && GetBattleFormChangeTargetSpecies(i, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE) - { - gBattlerAttacker = i; - BattleScriptExecute(BattleScript_PrimalReversion); - return; - } - } - // Check neutralizing gas if (AbilityBattleEffects(ABILITYEFFECT_NEUTRALIZINGGAS, 0, 0, 0, 0) != 0) return; @@ -3698,6 +3686,14 @@ static void TryDoEventsBeforeFirstTurn(void) while (gBattleStruct->switchInAbilitiesCounter < gBattlersCount) { gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->switchInAbilitiesCounter++]; + + // Primal Reversion + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_PRIMAL_ORB + && GetBattleFormChangeTargetSpecies(gBattlerAttacker, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE) + { + BattleScriptExecute(BattleScript_PrimalReversion); + return; + } if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gBattlerAttacker, 0, 0, 0) != 0) return; }