Skip to content

Commit

Permalink
Push B in wild battle moves to Run (#3362)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo Quezada D'Ottone <[email protected]>
  • Loading branch information
voloved and AsparagusEduardo authored Oct 21, 2023
1 parent 33a0fdb commit ebdf14c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@
#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)
#define B_CATCHING_CHARM_BOOST 20 // % boost in Critical Capture odds if player has the Catching Charm.
#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.
Expand Down
10 changes: 10 additions & 0 deletions src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
7 changes: 7 additions & 0 deletions src/battle_controller_safari.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ebdf14c

Please sign in to comment.