From 58a93a544f9dad80e9170513ce96473c36ab18a6 Mon Sep 17 00:00:00 2001 From: lordraindance2 <47706100+lordraindance2@users.noreply.github.com> Date: Tue, 2 Jan 2024 03:44:15 -0500 Subject: [PATCH] Refactored SetMoveEffect Inner Focus Case (#3885) * Rollbacked SetMoveEffect Inner Focus logic Co-authored-by: poetahto * Refactored else if --------- Co-authored-by: poetahto --- src/battle_script_commands.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index fdf3da1912..b9ff7f63c8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3128,20 +3128,25 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_FLINCH: - if (battlerAbility == ABILITY_INNER_FOCUS - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + if (battlerAbility == ABILITY_INNER_FOCUS) { - gLastUsedAbility = ABILITY_INNER_FOCUS; - gBattlerAbility = gEffectBattler; - RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); - gBattlescriptCurrInstr = BattleScript_FlinchPrevention; + if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + { + gLastUsedAbility = ABILITY_INNER_FOCUS; + gBattlerAbility = gEffectBattler; + RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); + gBattlescriptCurrInstr = BattleScript_FlinchPrevention; + } else + { + gBattlescriptCurrInstr++; + } } else if (GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber - && !IsDynamaxed(gEffectBattler)) + && !IsDynamaxed(gEffectBattler)) { - gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]; + gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]; + gBattlescriptCurrInstr++; } - gBattlescriptCurrInstr++; break; case MOVE_EFFECT_UPROAR: if (!(gBattleMons[gEffectBattler].status2 & STATUS2_UPROAR))