mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
better handle throwing balls in a double wild battle (#2587)
* Handle throwing balls in a double wild battle where the player has only a single Pokémon.
This commit is contained in:
parent
1202f0366c
commit
f9bb0bfb29
@ -4005,7 +4005,8 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
else if (WILD_DOUBLE_BATTLE
|
||||
&& position == B_POSITION_PLAYER_RIGHT
|
||||
&& (gBattleStruct->throwingPokeBall || gChosenActionByBattler[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)] == B_ACTION_RUN))
|
||||
&& (gBattleStruct->throwingPokeBall || gChosenActionByBattler[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)] == B_ACTION_RUN)
|
||||
&& gChosenActionByBattler[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)] != B_ACTION_NOTHING_FAINTED)
|
||||
{
|
||||
gBattleStruct->throwingPokeBall = FALSE;
|
||||
gChosenActionByBattler[gActiveBattler] = B_ACTION_NOTHING_FAINTED; // Not fainted, but it cannot move, because of the throwing ball.
|
||||
@ -4419,10 +4420,13 @@ static void HandleTurnActionSelectionState(void)
|
||||
{
|
||||
RecordedBattle_CheckMovesetChanges(B_RECORD_MODE_RECORDING);
|
||||
|
||||
if (WILD_DOUBLE_BATTLE && gBattleStruct->throwingPokeBall) {
|
||||
if (WILD_DOUBLE_BATTLE
|
||||
&& gBattleStruct->throwingPokeBall
|
||||
&& gChosenActionByBattler[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)] != B_ACTION_NOTHING_FAINTED)
|
||||
{
|
||||
// if we choose to throw a ball with our second mon, skip the action of the first
|
||||
// (if we have chosen throw ball with first, second's is already skipped)
|
||||
gChosenActionByBattler[B_POSITION_PLAYER_LEFT] = B_ACTION_NOTHING_FAINTED;
|
||||
gChosenActionByBattler[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)] = B_ACTION_NOTHING_FAINTED;
|
||||
}
|
||||
|
||||
gBattleMainFunc = SetActionsAndBattlersTurnOrder;
|
||||
|
Loading…
Reference in New Issue
Block a user