Expand usage of FaintedActions enum in HandleFaintedMonActions (#8346)

This commit is contained in:
PhallenTree 2025-11-25 17:04:30 +00:00 committed by GitHub
parent a4482f0ee2
commit 9fde188033
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1846,18 +1846,18 @@ bool32 HandleFaintedMonActions(void)
&& !(gAbsentBattlerFlags & (1u << gBattleStruct->eventState.faintedActionBattler)))
{
BattleScriptExecute(BattleScript_GiveExp);
gBattleStruct->eventState.faintedAction = 2;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_SET_ABSENT_FLAGS;
return TRUE;
}
} while (++gBattleStruct->eventState.faintedActionBattler != gBattlersCount);
gBattleStruct->eventState.faintedAction = 3;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_WAIT_STATE;
break;
case FAINTED_ACTIONS_SET_ABSENT_FLAGS:
OpponentSwitchInResetSentPokesToOpponentValue(gBattlerFainted);
if (++gBattleStruct->eventState.faintedActionBattler == gBattlersCount)
gBattleStruct->eventState.faintedAction = 3;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_WAIT_STATE;
else
gBattleStruct->eventState.faintedAction = 1;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_GIVE_EXP;
// Don't switch mons until all pokemon performed their actions or the battle's over.
if (B_FAINT_SWITCH_IN >= GEN_4
&& gBattleOutcome == 0
@ -1865,7 +1865,7 @@ bool32 HandleFaintedMonActions(void)
&& gCurrentTurnActionNumber != gBattlersCount)
{
gAbsentBattlerFlags |= 1u << gBattlerFainted;
if (gBattleStruct->eventState.faintedAction != 1)
if (gBattleStruct->eventState.faintedAction != FAINTED_ACTIONS_GIVE_EXP)
return FALSE;
}
break;
@ -1889,7 +1889,7 @@ bool32 HandleFaintedMonActions(void)
&& !(gAbsentBattlerFlags & (1u << gBattleStruct->eventState.faintedActionBattler)))
{
BattleScriptExecute(BattleScript_HandleFaintedMon);
gBattleStruct->eventState.faintedAction = 5;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_HANDLE_NEXT_BATTLER;
return TRUE;
}
} while (++gBattleStruct->eventState.faintedActionBattler != gBattlersCount);
@ -1899,7 +1899,7 @@ bool32 HandleFaintedMonActions(void)
if (++gBattleStruct->eventState.faintedActionBattler == gBattlersCount)
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_MAX_CASE;
else
gBattleStruct->eventState.faintedAction = 4;
gBattleStruct->eventState.faintedAction = FAINTED_ACTIONS_HANDLE_FAINTED_MON;
break;
case FAINTED_ACTIONS_MAX_CASE:
break;