From bfb86fdc866e67c97856d364e0bfc4fe879fed0b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 24 Jul 2022 14:57:47 -0400 Subject: [PATCH] Config for Gen 3 faint switch mechanics --- include/constants/battle_config.h | 1 + src/battle_util.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 566a239822..006add36de 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -180,6 +180,7 @@ #define B_SPORT_TURNS GEN_7 // In Gen6+, Water/Mud Sport last 5 turns, even if the user switches out. #define B_MEGA_EVO_TURN_ORDER GEN_7 // In Gen7, a Pokémon's Speed after Mega Evolution is used to determine turn order, not its Speed before. #define B_RECALC_TURN_AFTER_ACTIONS GEN_8 // In Gen8, switching/using a move affects the current turn's order of actions. +#define B_FAINT_SWITCH_IN GEN_7 // In Gen4+, sending out a new Pokémon after the previous one fainted happens at the end of the turn. Before, it would happen after each action. // Move data settings #define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc. diff --git a/src/battle_util.c b/src/battle_util.c index 830fb83793..4c3786f0c2 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3292,7 +3292,7 @@ bool8 HandleFaintedMonActions(void) gBattleStruct->faintedActionsState = 3; else gBattleStruct->faintedActionsState = 1; - + #if B_FAINT_SWITCH_IN >= GEN_4 // Don't switch mons until all pokemon performed their actions or the battle's over. if (gBattleOutcome == 0 && !NoAliveMonsForEitherParty() @@ -3301,8 +3301,10 @@ bool8 HandleFaintedMonActions(void) gAbsentBattlerFlags |= gBitTable[gBattlerFainted]; return FALSE; } + #endif break; case 3: + #if B_FAINT_SWITCH_IN >= GEN_4 // Don't switch mons until all pokemon performed their actions or the battle's over. if (gBattleOutcome == 0 && !NoAliveMonsForEitherParty() @@ -3310,6 +3312,7 @@ bool8 HandleFaintedMonActions(void) { return FALSE; } + #endif gBattleStruct->faintedActionsBattlerId = 0; gBattleStruct->faintedActionsState++; // fall through