diff options
Diffstat (limited to 'src/battle_controller_player.c')
-rw-r--r-- | src/battle_controller_player.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 8847715f6..2a1c0feb6 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -42,8 +42,6 @@ extern struct SpriteTemplate gUnknown_0202499C; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; -extern const u8 gTypeNames[][7]; -extern const struct BattleMove gBattleMoves[]; extern const u8 gText_BattleSwitchWhich[]; extern const u8 gText_MoveInterfacePP[]; @@ -432,7 +430,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER) + else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -474,7 +472,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER) + else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -508,7 +506,7 @@ static void HandleInputChooseMove(void) if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_CURSE) { if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST) - moveTarget = MOVE_TARGET_x10; + moveTarget = MOVE_TARGET_USER; else moveTarget = MOVE_TARGET_SELECTED; } @@ -517,26 +515,26 @@ static void HandleInputChooseMove(void) moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; } - if (moveTarget & MOVE_TARGET_x10) + if (moveTarget & MOVE_TARGET_USER) gMultiUsePlayerCursor = gActiveBattler; else gMultiUsePlayerCursor = GetBattlerAtPosition((GetBattlerPosition(gActiveBattler) & BIT_SIDE) ^ BIT_SIDE); if (!gBattleBufferA[gActiveBattler][1]) // not a double battle { - if (moveTarget & MOVE_TARGET_USER && !gBattleBufferA[gActiveBattler][2]) + if (moveTarget & MOVE_TARGET_USER_OR_SELECTED && !gBattleBufferA[gActiveBattler][2]) canSelectTarget++; } else // double battle { - if (!(moveTarget & (MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH | MOVE_TARGET_DEPENDS | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_x10))) + if (!(moveTarget & (MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH | MOVE_TARGET_DEPENDS | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) canSelectTarget++; // either selected or user if (moveInfo->currentPp[gMoveSelectionCursor[gActiveBattler]] == 0) { canSelectTarget = FALSE; } - else if (!(moveTarget & (MOVE_TARGET_x10 | MOVE_TARGET_USER)) && CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) <= 1) + else if (!(moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) && CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) <= 1) { gMultiUsePlayerCursor = GetDefaultMoveTarget(gActiveBattler); canSelectTarget = FALSE; @@ -552,7 +550,7 @@ static void HandleInputChooseMove(void) { gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseTarget; - if (moveTarget & (MOVE_TARGET_x10 | MOVE_TARGET_USER)) + if (moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gMultiUsePlayerCursor = gActiveBattler; else if (gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)]) gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); |