summaryrefslogtreecommitdiff
path: root/src/battle_controller_player.c
diff options
context:
space:
mode:
authoraaaaaa123456789 <aaaaaa123456789@acidch.at>2020-09-13 04:22:50 -0300
committeraaaaaa123456789 <aaaaaa123456789@acidch.at>2020-09-13 06:30:55 -0300
commit7dc95a0103af08c95c9093b6efa6c77af77a2538 (patch)
tree663537916626ab264bbdef4ea3606415457c36a3 /src/battle_controller_player.c
parent58a2b62bae1406d2c768698ed13efcd6a5ffbeec (diff)
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183.
Diffstat (limited to 'src/battle_controller_player.c')
-rw-r--r--src/battle_controller_player.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index 7c34efd44..d8005e808 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -240,12 +240,12 @@ static void HandleInputChooseAction(void)
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
- if (JOY_REPEAT(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
+ if (gMain.newAndRepeatedKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
gPlayerDpadHoldFrames++;
else
gPlayerDpadHoldFrames = 0;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
@@ -266,7 +266,7 @@ static void HandleInputChooseAction(void)
}
PlayerBufferExecCompleted();
}
- else if (JOY_NEW(DPAD_LEFT))
+ else if (gMain.newKeys & DPAD_LEFT)
{
if (gActionSelectionCursor[gActiveBattler] & 1) // if is B_ACTION_USE_ITEM or B_ACTION_RUN
{
@@ -276,7 +276,7 @@ static void HandleInputChooseAction(void)
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
}
}
- else if (JOY_NEW(DPAD_RIGHT))
+ else if (gMain.newKeys & DPAD_RIGHT)
{
if (!(gActionSelectionCursor[gActiveBattler] & 1)) // if is B_ACTION_USE_MOVE or B_ACTION_SWITCH
{
@@ -286,7 +286,7 @@ static void HandleInputChooseAction(void)
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
}
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
if (gActionSelectionCursor[gActiveBattler] & 2) // if is B_ACTION_SWITCH or B_ACTION_RUN
{
@@ -296,7 +296,7 @@ static void HandleInputChooseAction(void)
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
}
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
if (!(gActionSelectionCursor[gActiveBattler] & 2)) // if is B_ACTION_USE_MOVE or B_ACTION_USE_ITEM
{
@@ -306,7 +306,7 @@ static void HandleInputChooseAction(void)
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
}
}
- else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
+ else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59)
{
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
&& GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT
@@ -326,7 +326,7 @@ static void HandleInputChooseAction(void)
PlayerBufferExecCompleted();
}
}
- else if (JOY_NEW(START_BUTTON))
+ else if (gMain.newKeys & START_BUTTON)
{
SwapHpBarsWithHpText();
}
@@ -359,12 +359,12 @@ static void HandleInputChooseTarget(void)
} while (i < gBattlersCount);
}
- if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
+ if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
gPlayerDpadHoldFrames++;
else
gPlayerDpadHoldFrames = 0;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
@@ -372,7 +372,7 @@ static void HandleInputChooseTarget(void)
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
PlayerBufferExecCompleted();
}
- else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
+ else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59)
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
@@ -381,7 +381,7 @@ static void HandleInputChooseTarget(void)
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
}
- else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
+ else if (gMain.newKeys & (DPAD_LEFT | DPAD_UP))
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
@@ -423,7 +423,7 @@ static void HandleInputChooseTarget(void)
} while (i == 0);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
}
- else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
+ else if (gMain.newKeys & (DPAD_RIGHT | DPAD_DOWN))
{
PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
@@ -472,12 +472,12 @@ static void HandleInputChooseMove(void)
bool32 canSelectTarget = FALSE;
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
- if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
+ if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
gPlayerDpadHoldFrames++;
else
gPlayerDpadHoldFrames = 0;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
u8 moveTarget;
@@ -539,13 +539,13 @@ static void HandleInputChooseMove(void)
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
}
}
- else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
+ else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59)
{
PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(1, 10, 0xFFFF);
PlayerBufferExecCompleted();
}
- else if (JOY_NEW(DPAD_LEFT))
+ else if (gMain.newKeys & DPAD_LEFT)
{
if (gMoveSelectionCursor[gActiveBattler] & 1)
{
@@ -557,7 +557,7 @@ static void HandleInputChooseMove(void)
MoveSelectionDisplayMoveType();
}
}
- else if (JOY_NEW(DPAD_RIGHT))
+ else if (gMain.newKeys & DPAD_RIGHT)
{
if (!(gMoveSelectionCursor[gActiveBattler] & 1)
&& (gMoveSelectionCursor[gActiveBattler] ^ 1) < gNumberOfMovesToChoose)
@@ -570,7 +570,7 @@ static void HandleInputChooseMove(void)
MoveSelectionDisplayMoveType();
}
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
if (gMoveSelectionCursor[gActiveBattler] & 2)
{
@@ -582,7 +582,7 @@ static void HandleInputChooseMove(void)
MoveSelectionDisplayMoveType();
}
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
if (!(gMoveSelectionCursor[gActiveBattler] & 2)
&& (gMoveSelectionCursor[gActiveBattler] ^ 2) < gNumberOfMovesToChoose)
@@ -595,7 +595,7 @@ static void HandleInputChooseMove(void)
MoveSelectionDisplayMoveType();
}
}
- else if (JOY_NEW(SELECT_BUTTON))
+ else if (gMain.newKeys & SELECT_BUTTON)
{
if (gNumberOfMovesToChoose > 1 && !(gBattleTypeFlags & BATTLE_TYPE_LINK))
{
@@ -617,26 +617,26 @@ u32 sub_8057FBC(void) // unused
{
u32 var = 0;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
var = 1;
}
- if (JOY_NEW(B_BUTTON))
+ if (gMain.newKeys & B_BUTTON)
{
PlaySE(SE_SELECT);
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0x140;
var = 0xFF;
}
- if (JOY_NEW(DPAD_LEFT) && gMoveSelectionCursor[gActiveBattler] & 1)
+ if (gMain.newKeys & DPAD_LEFT && gMoveSelectionCursor[gActiveBattler] & 1)
{
MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]);
gMoveSelectionCursor[gActiveBattler] ^= 1;
PlaySE(SE_SELECT);
MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0);
}
- if (JOY_NEW(DPAD_RIGHT) && !(gMoveSelectionCursor[gActiveBattler] & 1)
+ if (gMain.newKeys & DPAD_RIGHT && !(gMoveSelectionCursor[gActiveBattler] & 1)
&& (gMoveSelectionCursor[gActiveBattler] ^ 1) < gNumberOfMovesToChoose)
{
MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]);
@@ -644,14 +644,14 @@ u32 sub_8057FBC(void) // unused
PlaySE(SE_SELECT);
MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0);
}
- if (JOY_NEW(DPAD_UP) && gMoveSelectionCursor[gActiveBattler] & 2)
+ if (gMain.newKeys & DPAD_UP && gMoveSelectionCursor[gActiveBattler] & 2)
{
MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]);
gMoveSelectionCursor[gActiveBattler] ^= 2;
PlaySE(SE_SELECT);
MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0);
}
- if (JOY_NEW(DPAD_DOWN) && !(gMoveSelectionCursor[gActiveBattler] & 2)
+ if (gMain.newKeys & DPAD_DOWN && !(gMoveSelectionCursor[gActiveBattler] & 2)
&& (gMoveSelectionCursor[gActiveBattler] ^ 2) < gNumberOfMovesToChoose)
{
MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]);
@@ -669,7 +669,7 @@ static void HandleMoveSwitching(void)
struct ChooseMoveStruct moveStruct;
u8 totalPPBonuses;
- if (JOY_NEW(A_BUTTON | SELECT_BUTTON))
+ if (gMain.newKeys & (A_BUTTON | SELECT_BUTTON))
{
PlaySE(SE_SELECT);
@@ -763,7 +763,7 @@ static void HandleMoveSwitching(void)
MoveSelectionDisplayPpNumber();
MoveSelectionDisplayMoveType();
}
- else if (JOY_NEW(B_BUTTON | SELECT_BUTTON))
+ else if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON))
{
PlaySE(SE_SELECT);
MoveSelectionDestroyCursorAt(gMultiUsePlayerCursor);
@@ -773,7 +773,7 @@ static void HandleMoveSwitching(void)
MoveSelectionDisplayPpNumber();
MoveSelectionDisplayMoveType();
}
- else if (JOY_NEW(DPAD_LEFT))
+ else if (gMain.newKeys & DPAD_LEFT)
{
if (gMultiUsePlayerCursor & 1)
{
@@ -791,7 +791,7 @@ static void HandleMoveSwitching(void)
MoveSelectionCreateCursorAt(gMultiUsePlayerCursor, 27);
}
}
- else if (JOY_NEW(DPAD_RIGHT))
+ else if (gMain.newKeys & DPAD_RIGHT)
{
if (!(gMultiUsePlayerCursor & 1) && (gMultiUsePlayerCursor ^ 1) < gNumberOfMovesToChoose)
{
@@ -809,7 +809,7 @@ static void HandleMoveSwitching(void)
MoveSelectionCreateCursorAt(gMultiUsePlayerCursor, 27);
}
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
if (gMultiUsePlayerCursor & 2)
{
@@ -827,7 +827,7 @@ static void HandleMoveSwitching(void)
MoveSelectionCreateCursorAt(gMultiUsePlayerCursor, 27);
}
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
if (!(gMultiUsePlayerCursor & 2) && (gMultiUsePlayerCursor ^ 2) < gNumberOfMovesToChoose)
{
@@ -1402,21 +1402,21 @@ static void DoHitAnimBlinkSpriteEffect(void)
static void PlayerHandleUnknownYesNoInput(void)
{
- if (JOY_NEW(DPAD_UP) && gMultiUsePlayerCursor != 0)
+ if (gMain.newKeys & DPAD_UP && gMultiUsePlayerCursor != 0)
{
PlaySE(SE_SELECT);
BattleDestroyYesNoCursorAt(gMultiUsePlayerCursor);
gMultiUsePlayerCursor = 0;
BattleCreateYesNoCursorAt(0);
}
- if (JOY_NEW(DPAD_DOWN) && gMultiUsePlayerCursor == 0)
+ if (gMain.newKeys & DPAD_DOWN && gMultiUsePlayerCursor == 0)
{
PlaySE(SE_SELECT);
BattleDestroyYesNoCursorAt(gMultiUsePlayerCursor);
gMultiUsePlayerCursor = 1;
BattleCreateYesNoCursorAt(1);
}
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
PlaySE(SE_SELECT);
@@ -1428,7 +1428,7 @@ static void PlayerHandleUnknownYesNoInput(void)
PlayerBufferExecCompleted();
}
- if (JOY_NEW(B_BUTTON))
+ if (gMain.newKeys & B_BUTTON)
{
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
PlaySE(SE_SELECT);