correct move target defines
This commit is contained in:
@@ -45,7 +45,6 @@ in order to read the next command correctly. refer to battle_ai_scripts.s for th
|
||||
AI scripts.
|
||||
*/
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u8 * const gBattleAI_ScriptsTable[];
|
||||
|
||||
extern u32 GetAiScriptsInRecordedBattle();
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "util.h"
|
||||
#include "constants/items.h"
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u8 gTypeEffectiveness[];
|
||||
extern const u8 * const gItemEffectTable[]; // todo: fix once struct is declared
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
|
||||
extern void sub_806A068(u16, u8);
|
||||
|
||||
@@ -31,7 +31,6 @@ extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
|
||||
extern void sub_806A068(u16, u8);
|
||||
|
||||
@@ -35,7 +35,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
|
||||
extern void sub_806A068(u16, u8);
|
||||
@@ -1563,7 +1562,7 @@ static void OpponentHandleChooseMove(void)
|
||||
BtlController_EmitTwoReturnValues(1, 15, gBattlerTarget);
|
||||
break;
|
||||
default:
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_x10))
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
|
||||
gBattlerTarget = gActiveBattler;
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH)
|
||||
{
|
||||
@@ -1585,7 +1584,7 @@ static void OpponentHandleChooseMove(void)
|
||||
move = moveInfo->moves[chosenMoveId];
|
||||
} while (move == MOVE_NONE);
|
||||
|
||||
if (gBattleMoves[move].target & (MOVE_TARGET_USER | MOVE_TARGET_x10))
|
||||
if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
|
||||
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gActiveBattler << 8));
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8));
|
||||
|
||||
@@ -43,7 +43,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 +431,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 +473,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 +507,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 +516,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 +551,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);
|
||||
|
||||
@@ -31,7 +31,6 @@ extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_81358F4(void);
|
||||
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
|
||||
@@ -1521,7 +1520,7 @@ static void PlayerPartnerHandleChooseMove(void)
|
||||
BattleAI_SetupAIData(0xF);
|
||||
chosenMoveId = BattleAI_ChooseMoveOrAction();
|
||||
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_x10 | MOVE_TARGET_USER))
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED))
|
||||
gBattlerTarget = gActiveBattler;
|
||||
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,6 @@ extern struct UnusedControllerStruct gUnknown_02022D0C;
|
||||
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
|
||||
extern void sub_806A068(u16, u8);
|
||||
|
||||
@@ -36,7 +36,6 @@ extern u8 gBattleBuffersTransferData[0x100];
|
||||
|
||||
static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {};
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void task00_08081A90(u8 taskId); // cable_club
|
||||
extern void sub_81B8D64(u8 bank, u8 arg1); // party_menu
|
||||
|
||||
@@ -28,7 +28,6 @@ extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u8 gUnknown_0831C604[];
|
||||
extern const u8 * const gBattleAnims_VariousTable[];
|
||||
extern const u8 * const gBattleAnims_Special[];
|
||||
@@ -237,7 +236,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
if (moveInfo->moves[chosenMoveId] == MOVE_CURSE)
|
||||
{
|
||||
if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST)
|
||||
var1 = MOVE_TARGET_x10;
|
||||
var1 = MOVE_TARGET_USER;
|
||||
else
|
||||
var1 = MOVE_TARGET_SELECTED;
|
||||
}
|
||||
@@ -246,7 +245,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
var1 = gBattleMoves[moveInfo->moves[chosenMoveId]].target;
|
||||
}
|
||||
|
||||
if (var1 & MOVE_TARGET_x10)
|
||||
if (var1 & MOVE_TARGET_USER)
|
||||
chosenMoveId |= (gActiveBattler << 8);
|
||||
else if (var1 == MOVE_TARGET_SELECTED)
|
||||
chosenMoveId |= (BattlePalaceGetTargetRetValue());
|
||||
@@ -261,7 +260,7 @@ static u8 sub_805D4A8(u16 move)
|
||||
switch (gBattleMoves[move].target)
|
||||
{
|
||||
case MOVE_TARGET_SELECTED:
|
||||
case MOVE_TARGET_USER:
|
||||
case MOVE_TARGET_USER_OR_SELECTED:
|
||||
case MOVE_TARGET_RANDOM:
|
||||
case MOVE_TARGET_BOTH:
|
||||
case MOVE_TARGET_FOES_AND_ALLY:
|
||||
@@ -273,7 +272,7 @@ static u8 sub_805D4A8(u16 move)
|
||||
case MOVE_TARGET_DEPENDS:
|
||||
case MOVE_TARGET_OPPONENTS_FIELD:
|
||||
return 2;
|
||||
case MOVE_TARGET_x10:
|
||||
case MOVE_TARGET_USER:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -81,7 +81,6 @@ extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern u8 gUnknown_0203CF00[];
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u16 gBattleTextboxPalette[]; // battle textbox palette
|
||||
extern const struct BgTemplate gUnknown_0831AA08[];
|
||||
extern const struct WindowTemplate * const gUnknown_0831ABA0[];
|
||||
@@ -5133,7 +5132,7 @@ static void HandleAction_UseMove(void)
|
||||
else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
&& gSideTimers[side].followmeTimer == 0
|
||||
&& (gBattleMoves[gCurrentMove].power != 0
|
||||
|| gBattleMoves[gCurrentMove].target != MOVE_TARGET_x10)
|
||||
|| gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER)
|
||||
&& gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD
|
||||
&& gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,6 @@ struct TrainerMoney
|
||||
u8 value;
|
||||
};
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u8 gTypeEffectiveness[336];
|
||||
extern const struct TrainerMoney gTrainerMoneyTable[];
|
||||
extern const u8* const gBattleScriptsForMoveEffects[];
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "link.h"
|
||||
#include "berry.h"
|
||||
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
|
||||
extern u8 weather_get_current(void);
|
||||
|
||||
@@ -3255,8 +3254,8 @@ u8 GetMoveTarget(u16 move, u8 useMoveTarget)
|
||||
else
|
||||
targetBank = GetBattlerAtPosition((GetBattlerPosition(gBattlerAttacker) & BIT_SIDE) ^ BIT_SIDE);
|
||||
break;
|
||||
case MOVE_TARGET_USER_OR_SELECTED:
|
||||
case MOVE_TARGET_USER:
|
||||
case MOVE_TARGET_x10:
|
||||
targetBank = gBattlerAttacker;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -328,7 +328,6 @@ extern u8* gReturnToXStringsTable[];
|
||||
extern u32 gUnknown_0203CE5E[];
|
||||
extern u8 EventScript_2736B3[];
|
||||
extern const u16 gUnknown_0860F074[];
|
||||
extern struct BattleMove gBattleMoves[];
|
||||
|
||||
void ResetBagScrollPositions(void)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,6 @@ extern const union AnimCmd *gUnknown_082FF70C[];
|
||||
extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[];
|
||||
extern const union AnimCmd *const *const gUnknown_08305D0C[];
|
||||
extern const union AnimCmd *const *const gUnknown_0830536C[];
|
||||
extern const struct BattleMove gBattleMoves[];
|
||||
extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
|
||||
extern const struct UnknownPokemonStruct3 gUnknown_08610970[];
|
||||
extern const struct CompressedSpritePalette gMonPaletteTable[];
|
||||
|
||||
@@ -146,7 +146,6 @@ extern u8 gText_OneDash[];
|
||||
extern u8 gText_TwoDashes[];
|
||||
extern u8 gText_ThreeDashes[];
|
||||
extern u8 gUnknown_0861CE97[];
|
||||
extern struct BattleMove gBattleMoves[];
|
||||
|
||||
extern void sub_8199C30(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f);
|
||||
extern bool8 sub_81A6BF4();
|
||||
|
||||
Reference in New Issue
Block a user