From ebdf14c62096e4ea8e175ce10621a5e67b1c08dc Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Sat, 21 Oct 2023 11:45:40 -0400 Subject: [PATCH] Push B in wild battle moves to Run (#3362) Co-authored-by: Eduardo Quezada D'Ottone --- include/config/battle.h | 3 ++- src/battle_controller_player.c | 10 ++++++++++ src/battle_controller_safari.c | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/config/battle.h b/include/config/battle.h index bf210c1021..480107ab3b 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -191,6 +191,7 @@ #define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations. #define B_EXPANDED_MOVE_NAMES FALSE // If set to TRUE, move names are increased from 12 characters to 16 characters. #define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles. +#define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option // Catching settings #define B_SEMI_INVULNERABLE_CATCH GEN_LATEST // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) @@ -198,7 +199,7 @@ #define B_CRITICAL_CAPTURE TRUE // If set to TRUE, Critical Capture will be enabled. #define B_LAST_USED_BALL TRUE // If TRUE, the "last used ball" feature from Gen 7 will be implemented #define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball. -#define B_LAST_USED_BALL_CYCLE TRUE // If TRUE, then holding B_LAST_USED_BALL_BUTTON while pressing the D-Pad cycles through the balls +#define B_LAST_USED_BALL_CYCLE TRUE // If TRUE, then holding B_LAST_USED_BALL_BUTTON while pressing the D-Pad cycles through the balls // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index feabb2863a..e59ea5ba28 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -389,6 +389,16 @@ static void HandleInputChooseAction(u32 battler) BtlController_EmitTwoReturnValues(battler, BUFFER_B, B_ACTION_CANCEL_PARTNER, 0); PlayerBufferExecCompleted(battler); } + else if (B_QUICK_MOVE_CURSOR_TO_RUN) + { + if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER)) // If wild battle, pressing B moves cursor to "Run". + { + PlaySE(SE_SELECT); + ActionSelectionDestroyCursorAt(gActionSelectionCursor[battler]); + gActionSelectionCursor[battler] = 3; + ActionSelectionCreateCursorAt(gActionSelectionCursor[battler], 0); + } + } } else if (JOY_NEW(START_BUTTON)) { diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 2069082d8c..b5a64c286b 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -184,6 +184,13 @@ static void HandleInputChooseAction(u32 battler) ActionSelectionCreateCursorAt(gActionSelectionCursor[battler], 0); } } + else if (B_QUICK_MOVE_CURSOR_TO_RUN && JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + ActionSelectionDestroyCursorAt(gActionSelectionCursor[battler]); + gActionSelectionCursor[battler] = 3; + ActionSelectionCreateCursorAt(gActionSelectionCursor[battler], 0); + } } static void Controller_WaitForHealthbox(u32 battler)