Refactored SetMoveEffect Inner Focus Case (#3885)

* Rollbacked SetMoveEffect Inner Focus logic

Co-authored-by: poetahto <walls.dk@gmail.com>

* Refactored else if

---------

Co-authored-by: poetahto <walls.dk@gmail.com>
This commit is contained in:
lordraindance2 2024-01-02 03:44:15 -05:00 committed by GitHub
parent 9191c22c63
commit 58a93a544f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))