Replace: moveId -> move, moveIdx -> moveIndex (#2134)

This commit is contained in:
Alex
2025-05-09 17:33:23 +02:00
committed by GitHub
parent 2044bea883
commit baf5be2035
23 changed files with 133 additions and 133 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ void SpriteCB_TrainerSlideIn(struct Sprite *sprite);
void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status);
bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument);
void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId); void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId);
bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); bool8 IsMoveWithoutAnimation(u16 move, u8 animationTurn);
bool8 IsBattleSEPlaying(u8 battler); bool8 IsBattleSEPlaying(u8 battler);
void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battler); void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battler);
void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battler); void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battler);
+1 -1
View File
@@ -6,6 +6,6 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc
void BattleTv_SetDataBasedOnAnimation(u8 animationId); void BattleTv_SetDataBasedOnAnimation(u8 animationId);
void TryPutLinkBattleTvShowOnAir(void); void TryPutLinkBattleTvShowOnAir(void);
void BattleTv_ClearExplosionFaintCause(void); void BattleTv_ClearExplosionFaintCause(void);
u8 GetBattlerMoveSlotId(u8 battler, u16 moveId); u8 GetBattlerMoveSlotId(u8 battler, u16 move);
#endif // GUARD_BATTLE_TV_H #endif // GUARD_BATTLE_TV_H
+1 -1
View File
@@ -459,7 +459,7 @@ struct ApprenticeQuestion
u8 moveSlot:2; u8 moveSlot:2;
u8 suggestedChange:2; // TRUE if told to use held item or second move, FALSE if told to use no item or first move u8 suggestedChange:2; // TRUE if told to use held item or second move, FALSE if told to use no item or first move
//u8 padding; //u8 padding;
u16 data; // used both as an itemId and a moveId u16 data; // used both as an itemId and a move
}; };
struct PlayersApprentice struct PlayersApprentice
+1 -1
View File
@@ -16,7 +16,7 @@ struct PartyMenu
s8 slotId2; s8 slotId2;
u8 action; u8 action;
u16 bagItem; u16 bagItem;
s16 data1; // used variously as a moveId, counter, moveSlotId, or cursorPos s16 data1; // used variously as a move, counter, moveSlotId, or cursorPos
s16 learnMoveState; // data2, used only as a learn move state s16 learnMoveState; // data2, used only as a learn move state
}; };
+1 -1
View File
@@ -57,7 +57,7 @@ bool8 CheckFreePokemonStorageSpace(void);
bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition);
u32 CountStorageNonEggMons(void); u32 CountStorageNonEggMons(void);
u32 CountAllStorageMons(void); u32 CountAllStorageMons(void);
bool32 AnyStorageMonWithMove(u16 moveId); bool32 AnyStorageMonWithMove(u16 move);
void ResetWaldaWallpaper(void); void ResetWaldaWallpaper(void);
void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked);
+1 -1
View File
@@ -5,7 +5,7 @@ extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void); void ClearTVShowData(void);
void TryPutBreakingNewsOnAir(void); void TryPutBreakingNewsOnAir(void);
void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIndex, const u16 *movePtr, u16 betterMove);
void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility);
void DoTVShow(void); void DoTVShow(void);
void DoTVShowInSearchOfTrainers(void); void DoTVShowInSearchOfTrainers(void);
+20 -20
View File
@@ -70,8 +70,8 @@ struct ApprenticeQuestionData
{ {
u16 speciesId; u16 speciesId;
u16 altSpeciesId; u16 altSpeciesId;
u16 moveId1; u16 move1;
u16 moveId2; u16 move2;
}; };
// IWRAM common // IWRAM common
@@ -81,7 +81,7 @@ COMMON_DATA void (*gApprenticeFunc)(void) = NULL;
// This file's functions. // This file's functions.
static u16 GetRandomAlternateMove(u8 monId); static u16 GetRandomAlternateMove(u8 monId);
static bool8 TrySetMove(u8 monId, u16 moveId); static bool8 TrySetMove(u8 monId, u16 move);
static void CreateChooseAnswerTask(bool8 noBButton, u8 itemsCount, u8 windowId); static void CreateChooseAnswerTask(bool8 noBButton, u8 itemsCount, u8 windowId);
static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height); static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height);
static void RemoveAndHideWindow(u8 windowId); static void RemoveAndHideWindow(u8 windowId);
@@ -337,7 +337,7 @@ static u16 GetRandomAlternateMove(u8 monId)
u16 species; u16 species;
const u16 *learnset; const u16 *learnset;
bool32 needTMs = FALSE; bool32 needTMs = FALSE;
u16 moveId = MOVE_NONE; u16 move = MOVE_NONE;
bool32 shouldUseMove; bool32 shouldUseMove;
u8 level; u8 level;
@@ -379,7 +379,7 @@ static u16 GetRandomAlternateMove(u8 monId)
} }
while (!shouldUseMove); while (!shouldUseMove);
moveId = ItemIdToBattleMoveId(ITEM_TM01 + id); move = ItemIdToBattleMoveId(ITEM_TM01 + id);
shouldUseMove = TRUE; shouldUseMove = TRUE;
if (numLearnsetMoves <= MAX_MON_MOVES) if (numLearnsetMoves <= MAX_MON_MOVES)
@@ -390,7 +390,7 @@ static u16 GetRandomAlternateMove(u8 monId)
for (; j < numLearnsetMoves; j++) for (; j < numLearnsetMoves; j++)
{ {
// Keep looking for TMs until one not in the level up learnset is found // Keep looking for TMs until one not in the level up learnset is found
if ((learnset[j] & LEVEL_UP_MOVE_ID) == moveId) if ((learnset[j] & LEVEL_UP_MOVE_ID) == move)
{ {
shouldUseMove = FALSE; shouldUseMove = FALSE;
break; break;
@@ -414,13 +414,13 @@ static u16 GetRandomAlternateMove(u8 monId)
{ {
// Get a random move excluding the 4 it would know at max level // Get a random move excluding the 4 it would know at max level
u8 learnsetId = Random() % (numLearnsetMoves - MAX_MON_MOVES); u8 learnsetId = Random() % (numLearnsetMoves - MAX_MON_MOVES);
moveId = learnset[learnsetId] & LEVEL_UP_MOVE_ID; move = learnset[learnsetId] & LEVEL_UP_MOVE_ID;
shouldUseMove = TRUE; shouldUseMove = TRUE;
for (j = numLearnsetMoves - MAX_MON_MOVES; j < numLearnsetMoves; j++) for (j = numLearnsetMoves - MAX_MON_MOVES; j < numLearnsetMoves; j++)
{ {
// Keep looking for moves until one not in the last 4 is found // Keep looking for moves until one not in the last 4 is found
if ((learnset[j] & LEVEL_UP_MOVE_ID) == moveId) if ((learnset[j] & LEVEL_UP_MOVE_ID) == move)
{ {
shouldUseMove = FALSE; shouldUseMove = FALSE;
break; break;
@@ -430,29 +430,29 @@ static u16 GetRandomAlternateMove(u8 monId)
} }
} }
if (TrySetMove(monId, moveId)) if (TrySetMove(monId, move))
{ {
if (sValidApprenticeMoves[moveId]) if (sValidApprenticeMoves[move])
break; break;
i++; i++;
} }
} }
gApprenticePartyMovesData->moveCounter++; gApprenticePartyMovesData->moveCounter++;
return moveId; return move;
} }
static bool8 TrySetMove(u8 monId, u16 moveId) static bool8 TrySetMove(u8 monId, u16 move)
{ {
u8 i; u8 i;
for (i = 0; i < NUM_WHICH_MOVE_QUESTIONS; i++) for (i = 0; i < NUM_WHICH_MOVE_QUESTIONS; i++)
{ {
if (gApprenticePartyMovesData->moves[monId][i] == moveId) if (gApprenticePartyMovesData->moves[monId][i] == move)
return FALSE; return FALSE;
} }
gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = moveId; gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = move;
return TRUE; return TRUE;
} }
@@ -605,8 +605,8 @@ static void CreateApprenticeMenu(u8 menu)
case APPRENTICE_ASK_MOVES: case APPRENTICE_ASK_MOVES:
left = 17; left = 17;
top = 8; top = 8;
strings[0] = gMoveNames[gApprenticeQuestionData->moveId1]; strings[0] = gMoveNames[gApprenticeQuestionData->move1];
strings[1] = gMoveNames[gApprenticeQuestionData->moveId2]; strings[1] = gMoveNames[gApprenticeQuestionData->move2];
break; break;
case APPRENTICE_ASK_GIVE: case APPRENTICE_ASK_GIVE:
left = 18; left = 18;
@@ -1006,8 +1006,8 @@ static void InitQuestionData(void)
count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId;
APPRENTICE_SPECIES_ID_NO_COND(id1, count); APPRENTICE_SPECIES_ID_NO_COND(id1, count);
gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1]; gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1];
gApprenticeQuestionData->moveId1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); gApprenticeQuestionData->move1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot);
gApprenticeQuestionData->moveId2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; gApprenticeQuestionData->move2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data;
} }
} }
else if (gSpecialVar_0x8005 == APPRENTICE_QUESTION_WHAT_ITEM) else if (gSpecialVar_0x8005 == APPRENTICE_QUESTION_WHAT_ITEM)
@@ -1062,10 +1062,10 @@ static void ApprenticeBufferString(void)
StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]); StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]);
break; break;
case APPRENTICE_BUFF_MOVE1: case APPRENTICE_BUFF_MOVE1:
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId1]); StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move1]);
break; break;
case APPRENTICE_BUFF_MOVE2: case APPRENTICE_BUFF_MOVE2:
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId2]); StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move2]);
break; break;
case APPRENTICE_BUFF_ITEM: case APPRENTICE_BUFF_ITEM:
StringCopy(stringDst, ItemId_GetName(PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data)); StringCopy(stringDst, ItemId_GetName(PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data));
+2 -2
View File
@@ -1419,9 +1419,9 @@ static void RecordedOpponentHandleChooseMove(void)
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveIndex = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveIndex | (target << 8));
} }
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
+2 -2
View File
@@ -1445,9 +1445,9 @@ static void RecordedPlayerHandleChooseMove(void)
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveIndex = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveIndex | (target << 8));
} }
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
+19 -19
View File
@@ -2678,24 +2678,24 @@ int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom)
{ {
int i, moveId, playerMonId; int i, moveIndex, playerMonId;
int partyMovePoints[FRONTIER_PARTY_SIZE]; int partyMovePoints[FRONTIER_PARTY_SIZE];
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
partyMovePoints[i] = 0; partyMovePoints[i] = 0;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
{ {
for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++) for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++)
{ {
if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
{ {
partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveIndex),
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD);
} }
else else
{ {
partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveIndex],
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD);
} }
} }
@@ -2707,24 +2707,24 @@ static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom)
// Identical to function above, but uses EFFECTIVENESS_MODE_BAD // Identical to function above, but uses EFFECTIVENESS_MODE_BAD
static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom) static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom)
{ {
int i, moveId, playerMonId; int i, moveIndex, playerMonId;
int partyMovePoints[FRONTIER_PARTY_SIZE]; int partyMovePoints[FRONTIER_PARTY_SIZE];
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
partyMovePoints[i] = 0; partyMovePoints[i] = 0;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
{ {
for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++) for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++)
{ {
if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
{ {
partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveIndex),
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD);
} }
else else
{ {
partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveIndex],
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD);
} }
} }
@@ -5222,7 +5222,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
{ {
int i, j, k; int i, j, k;
int moveScores[MAX_MON_MOVES * FRONTIER_PARTY_SIZE]; int moveScores[MAX_MON_MOVES * FRONTIER_PARTY_SIZE];
u16 moveIds[MAX_MON_MOVES * FRONTIER_PARTY_SIZE]; u16 moves[MAX_MON_MOVES * FRONTIER_PARTY_SIZE];
u16 bestScore = 0; u16 bestScore = 0;
u16 bestId = 0; u16 bestId = 0;
int movePower = 0; int movePower = 0;
@@ -5236,17 +5236,17 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
// TODO: Clean this up, looks like a different data structure (2D array) // TODO: Clean this up, looks like a different data structure (2D array)
moveScores[i * MAX_MON_MOVES + j] = 0; moveScores[i * MAX_MON_MOVES + j] = 0;
if (DOME_TRAINERS[winnerTournamentId].trainerId == TRAINER_FRONTIER_BRAIN) if (DOME_TRAINERS[winnerTournamentId].trainerId == TRAINER_FRONTIER_BRAIN)
moveIds[i * MAX_MON_MOVES + j] = GetFrontierBrainMonMove(i, j); moves[i * MAX_MON_MOVES + j] = GetFrontierBrainMonMove(i, j);
else else
moveIds[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j]; moves[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j];
movePower = gBattleMoves[moveIds[i * MAX_MON_MOVES + j]].power; movePower = gBattleMoves[moves[i * MAX_MON_MOVES + j]].power;
if (movePower == 0) if (movePower == 0)
movePower = 40; movePower = 40;
else if (movePower == 1) else if (movePower == 1)
movePower = 60; movePower = 60;
else if (moveIds[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT else if (moves[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT
|| moveIds[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION) || moves[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION)
movePower /= 2; movePower /= 2;
for (k = 0; k < FRONTIER_PARTY_SIZE; k++) for (k = 0; k < FRONTIER_PARTY_SIZE; k++)
@@ -5265,7 +5265,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
else else
targetAbility = gSpeciesInfo[targetSpecies].abilities[0]; targetAbility = gSpeciesInfo[targetSpecies].abilities[0];
var = AI_TypeCalc(moveIds[i * MAX_MON_MOVES + j], targetSpecies, targetAbility); var = AI_TypeCalc(moves[i * MAX_MON_MOVES + j], targetSpecies, targetAbility);
if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE && var & MOVE_RESULT_SUPER_EFFECTIVE) if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE && var & MOVE_RESULT_SUPER_EFFECTIVE)
moveScores[i * MAX_MON_MOVES + j] += movePower; moveScores[i * MAX_MON_MOVES + j] += movePower;
else if (var & MOVE_RESULT_NO_EFFECT) else if (var & MOVE_RESULT_NO_EFFECT)
@@ -5285,7 +5285,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
} }
else if (bestScore == moveScores[i * MAX_MON_MOVES + j]) else if (bestScore == moveScores[i * MAX_MON_MOVES + j])
{ {
if (moveIds[bestId] < moveIds[i * MAX_MON_MOVES + j]) // Why not use (Random() & 1) instead of promoting moves with a higher id? if (moves[bestId] < moves[i * MAX_MON_MOVES + j]) // Why not use (Random() & 1) instead of promoting moves with a higher id?
bestId = i * MAX_MON_MOVES + j; bestId = i * MAX_MON_MOVES + j;
} }
} }
@@ -5296,7 +5296,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
{ {
for (i = 0; i < roundId - 1; i++) for (i = 0; i < roundId - 1; i++)
{ {
if (gSaveBlock2Ptr->frontier.domeWinningMoves[GetOpposingNPCTournamentIdByRound(winnerTournamentId, i)] == moveIds[j]) if (gSaveBlock2Ptr->frontier.domeWinningMoves[GetOpposingNPCTournamentIdByRound(winnerTournamentId, i)] == moves[j])
break; break;
} }
if (i != roundId - 1) if (i != roundId - 1)
@@ -5316,7 +5316,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
j = k; j = k;
bestScore = moveScores[k]; bestScore = moveScores[k];
} }
else if (bestScore == moveScores[k] && moveIds[j] < moveIds[k]) // Yes, these conditions are redundant else if (bestScore == moveScores[k] && moves[j] < moves[k]) // Yes, these conditions are redundant
{ {
j = k; j = k;
bestScore = moveScores[k]; bestScore = moveScores[k];
@@ -5328,7 +5328,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
if (moveScores[j] == 0) if (moveScores[j] == 0)
j = bestId; j = bestId;
return moveIds[j]; return moves[j];
} }
static void Task_ShowTourneyTree(u8 taskId) static void Task_ShowTourneyTree(u8 taskId)
+1 -1
View File
@@ -545,7 +545,7 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId)
#undef tBattlerId #undef tBattlerId
// Great function to include newly added moves that don't have animation yet. // Great function to include newly added moves that don't have animation yet.
bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) bool8 IsMoveWithoutAnimation(u16 move, u8 animationTurn)
{ {
return FALSE; return FALSE;
} }
+6 -6
View File
@@ -5464,8 +5464,8 @@ static void Cmd_yesnoboxlearnmove(void)
} }
else else
{ {
u16 moveId = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); u16 move = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition);
if (IsHMMove2(moveId)) if (IsHMMove2(move))
{ {
PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, gActiveBattler); PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, gActiveBattler);
gBattleScripting.learnMoveState = 6; gBattleScripting.learnMoveState = 6;
@@ -5474,7 +5474,7 @@ static void Cmd_yesnoboxlearnmove(void)
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId) PREPARE_MOVE_BUFFER(gBattleTextBuff2, move)
RemoveMonPPBonus(&gPlayerParty[gBattleStruct->expGetterMonId], movePosition); RemoveMonPPBonus(&gPlayerParty[gBattleStruct->expGetterMonId], movePosition);
SetMonMoveSlot(&gPlayerParty[gBattleStruct->expGetterMonId], gMoveToLearn, movePosition); SetMonMoveSlot(&gPlayerParty[gBattleStruct->expGetterMonId], gMoveToLearn, movePosition);
@@ -9508,7 +9508,7 @@ static void Cmd_assistattackselect(void)
{ {
s32 chooseableMovesNo = 0; s32 chooseableMovesNo = 0;
struct Pokemon *party; struct Pokemon *party;
s32 monId, moveId; s32 monId, moveIndex;
u16 *validMoves = gBattleStruct->assistPossibleMoves; u16 *validMoves = gBattleStruct->assistPossibleMoves;
if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER)
@@ -9525,10 +9525,10 @@ static void Cmd_assistattackselect(void)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue; continue;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
{ {
s32 i = 0; s32 i = 0;
u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId); u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveIndex);
if (IsInvalidForSleepTalkOrAssist(move)) if (IsInvalidForSleepTalkOrAssist(move))
continue; continue;
+1 -1
View File
@@ -2417,7 +2417,7 @@ static void LoadMultiPartnerCandidatesData(void)
static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId) static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId)
{ {
u16 move = 0; u16 move = MOVE_NONE;
u16 species = 0; u16 species = 0;
SetFacilityPtrsGetLevel(); SetFacilityPtrsGetLevel();
+12 -12
View File
@@ -79,7 +79,7 @@ struct RectangularSpiralLine
{ {
u8 state; u8 state;
s16 position; s16 position;
u8 moveIdx; u8 moveIndex;
s16 reboundPosition; s16 reboundPosition;
bool8 outward; bool8 outward;
}; };
@@ -3204,28 +3204,28 @@ static bool8 RectangularSpiral_Init(struct Task *task)
// Line starting in top left // Line starting in top left
sRectangularSpiralLines[0].state = SPIRAL_INWARD_START; sRectangularSpiralLines[0].state = SPIRAL_INWARD_START;
sRectangularSpiralLines[0].position = -1; sRectangularSpiralLines[0].position = -1;
sRectangularSpiralLines[0].moveIdx = 1; sRectangularSpiralLines[0].moveIndex = 1;
sRectangularSpiralLines[0].reboundPosition = 308; sRectangularSpiralLines[0].reboundPosition = 308;
sRectangularSpiralLines[0].outward = FALSE; sRectangularSpiralLines[0].outward = FALSE;
// Line starting in bottom right // Line starting in bottom right
sRectangularSpiralLines[1].state = SPIRAL_INWARD_START; sRectangularSpiralLines[1].state = SPIRAL_INWARD_START;
sRectangularSpiralLines[1].position = -1; sRectangularSpiralLines[1].position = -1;
sRectangularSpiralLines[1].moveIdx = 1; sRectangularSpiralLines[1].moveIndex = 1;
sRectangularSpiralLines[1].reboundPosition = 308; sRectangularSpiralLines[1].reboundPosition = 308;
sRectangularSpiralLines[1].outward = FALSE; sRectangularSpiralLines[1].outward = FALSE;
// Line starting in top right // Line starting in top right
sRectangularSpiralLines[2].state = SPIRAL_INWARD_START; sRectangularSpiralLines[2].state = SPIRAL_INWARD_START;
sRectangularSpiralLines[2].position = -3; sRectangularSpiralLines[2].position = -3;
sRectangularSpiralLines[2].moveIdx = 1; sRectangularSpiralLines[2].moveIndex = 1;
sRectangularSpiralLines[2].reboundPosition = 307; sRectangularSpiralLines[2].reboundPosition = 307;
sRectangularSpiralLines[2].outward = FALSE; sRectangularSpiralLines[2].outward = FALSE;
// Line starting in bottom left // Line starting in bottom left
sRectangularSpiralLines[3].state = SPIRAL_INWARD_START; sRectangularSpiralLines[3].state = SPIRAL_INWARD_START;
sRectangularSpiralLines[3].position = -3; sRectangularSpiralLines[3].position = -3;
sRectangularSpiralLines[3].moveIdx = 1; sRectangularSpiralLines[3].moveIndex = 1;
sRectangularSpiralLines[3].reboundPosition = 307; sRectangularSpiralLines[3].reboundPosition = 307;
sRectangularSpiralLines[3].outward = FALSE; sRectangularSpiralLines[3].outward = FALSE;
@@ -3288,7 +3288,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
// Has spiral finished? // Has spiral finished?
// Note that most move data arrays endsin SPIRAL_END but it is // Note that most move data arrays endsin SPIRAL_END but it is
// only ever reached on the final array of spiraling outward. // only ever reached on the final array of spiraling outward.
if (moveData[line->moveIdx] == SPIRAL_END) if (moveData[line->moveIndex] == SPIRAL_END)
return FALSE; return FALSE;
// Presumably saving data for debug. // Presumably saving data for debug.
@@ -3319,21 +3319,21 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
// Below check is never true. // Below check is never true.
// SPIRAL_END was already checked, and position is never >= 640 // SPIRAL_END was already checked, and position is never >= 640
if (line->position >= 640 || moveData[line->moveIdx] == SPIRAL_END) if (line->position >= 640 || moveData[line->moveIndex] == SPIRAL_END)
return FALSE; return FALSE;
if (!line->outward && moveData[line->moveIdx] == SPIRAL_REBOUND) if (!line->outward && moveData[line->moveIndex] == SPIRAL_REBOUND)
{ {
// Line has reached the final point of spiraling inward. // Line has reached the final point of spiraling inward.
// Time to flip and start spiraling outward. // Time to flip and start spiraling outward.
line->outward = TRUE; line->outward = TRUE;
line->moveIdx = 1; line->moveIndex = 1;
line->position = line->reboundPosition; line->position = line->reboundPosition;
line->state = SPIRAL_OUTWARD_START; line->state = SPIRAL_OUTWARD_START;
} }
// Reached move target, advance to next movement. // Reached move target, advance to next movement.
if (line->position == moveData[line->moveIdx]) if (line->position == moveData[line->moveIndex])
{ {
line->state++; line->state++;
if (line->outward == TRUE) if (line->outward == TRUE)
@@ -3343,7 +3343,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
// Still spiraling outward, loop back to the first state // Still spiraling outward, loop back to the first state
// but use the second set of move targets. // but use the second set of move targets.
// For example, the 28 in sRectangularSpiral_Major_OutwardUp // For example, the 28 in sRectangularSpiral_Major_OutwardUp
line->moveIdx++; line->moveIndex++;
line->state = SPIRAL_OUTWARD_START; line->state = SPIRAL_OUTWARD_START;
} }
} }
@@ -3354,7 +3354,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
// Still spiraling inward, loop back to the first state // Still spiraling inward, loop back to the first state
// but use the second set of move targets. // but use the second set of move targets.
// For example, the 275 in sRectangularSpiral_Major_InwardRight // For example, the 275 in sRectangularSpiral_Major_InwardRight
line->moveIdx++; line->moveIndex++;
line->state = SPIRAL_INWARD_START; line->state = SPIRAL_INWARD_START;
} }
} }
+19 -19
View File
@@ -15,8 +15,8 @@ static bool8 IsNotSpecialBattleString(u16 stringId);
static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3); static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3);
static void TrySetBattleSeminarShow(void); static void TrySetBattleSeminarShow(void);
static void AddPointsOnFainting(bool8 targetFainted); static void AddPointsOnFainting(bool8 targetFainted);
static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot); static void AddPointsBasedOnWeather(u16 weatherFlags, u16 move, u8 moveSlot);
static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride); static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride);
#define TABLE_END ((u16)-1) #define TABLE_END ((u16)-1)
@@ -1056,7 +1056,7 @@ void TryPutLinkBattleTvShowOnAir(void)
u8 countPlayer = 0, countOpponent = 0; u8 countPlayer = 0, countOpponent = 0;
s16 sum = 0; s16 sum = 0;
u16 species = 0; u16 species = 0;
u16 moveId = 0; u16 move = MOVE_NONE;
s32 i, j; s32 i, j;
int zero = 0, one = 1; //needed for matching int zero = 0, one = 1; //needed for matching
@@ -1124,8 +1124,8 @@ void TryPutLinkBattleTvShowOnAir(void)
} }
} }
moveId = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL); move = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL);
if (playerBestSum == 0 || moveId == 0) if (playerBestSum == 0 || move == MOVE_NONE)
return; return;
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@@ -1134,12 +1134,12 @@ void TryPutLinkBattleTvShowOnAir(void)
|| (playerBestMonId >= MULTI_PARTY_SIZE && GetLinkTrainerFlankId(gBattleScripting.multiplayerId))) || (playerBestMonId >= MULTI_PARTY_SIZE && GetLinkTrainerFlankId(gBattleScripting.multiplayerId)))
{ {
j = (opponentBestMonId < MULTI_PARTY_SIZE) ? FALSE : TRUE; j = (opponentBestMonId < MULTI_PARTY_SIZE) ? FALSE : TRUE;
PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies); PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), move, playerBestSpecies, opponentBestSpecies);
} }
} }
else else
{ {
PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, moveId, playerBestSpecies, opponentBestSpecies); PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, move, playerBestSpecies, opponentBestSpecies);
} }
} }
@@ -1505,9 +1505,9 @@ static void TrySetBattleSeminarShow(void)
gCurrentMove = currMoveSaved; gCurrentMove = currMoveSaved;
} }
static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride)
{ {
if (gBattleMoves[moveId].power == 0) if (gBattleMoves[move].power == 0)
{ {
*dmg = 0; *dmg = 0;
return FALSE; return FALSE;
@@ -1517,7 +1517,7 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride)
s32 i = 0; s32 i = 0;
do do
{ {
if (moveId == sVariableDmgMoves[i]) if (move == sVariableDmgMoves[i])
break; break;
i++; i++;
} while (sVariableDmgMoves[i] != TABLE_END); } while (sVariableDmgMoves[i] != TABLE_END);
@@ -1527,13 +1527,13 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride)
*dmg = 0; *dmg = 0;
return FALSE; return FALSE;
} }
else if (moveId == MOVE_PSYWAVE) else if (move == MOVE_PSYWAVE)
{ {
*dmg = gBattleMons[gBattlerAttacker].level; *dmg = gBattleMons[gBattlerAttacker].level;
*dmg /= 2; *dmg /= 2;
return FALSE; return FALSE;
} }
else if (moveId == MOVE_MAGNITUDE) else if (move == MOVE_MAGNITUDE)
{ {
*powerOverride = 10; *powerOverride = 10;
return TRUE; return TRUE;
@@ -1568,7 +1568,7 @@ void BattleTv_ClearExplosionFaintCause(void)
} }
} }
u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) u8 GetBattlerMoveSlotId(u8 battler, u16 move)
{ {
s32 i; s32 i;
struct Pokemon *party; struct Pokemon *party;
@@ -1583,7 +1583,7 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId)
{ {
if (i >= MAX_MON_MOVES) if (i >= MAX_MON_MOVES)
break; break;
if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == moveId) if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == move)
break; break;
i++; i++;
} }
@@ -1591,14 +1591,14 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId)
return i; return i;
} }
static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot) static void AddPointsBasedOnWeather(u16 weatherFlags, u16 move, u8 moveSlot)
{ {
if (weatherFlags & B_WEATHER_RAIN) if (weatherFlags & B_WEATHER_RAIN)
AddMovePoints(PTS_RAIN, moveId, moveSlot, 0); AddMovePoints(PTS_RAIN, move, moveSlot, 0);
else if (weatherFlags & B_WEATHER_SUN) else if (weatherFlags & B_WEATHER_SUN)
AddMovePoints(PTS_SUN, moveId, moveSlot, 0); AddMovePoints(PTS_SUN, move, moveSlot, 0);
else if (weatherFlags & B_WEATHER_SANDSTORM) else if (weatherFlags & B_WEATHER_SANDSTORM)
AddMovePoints(PTS_SANDSTORM, moveId, moveSlot, 0); AddMovePoints(PTS_SANDSTORM, move, moveSlot, 0);
else if (weatherFlags & B_WEATHER_HAIL) else if (weatherFlags & B_WEATHER_HAIL)
AddMovePoints(PTS_HAIL, moveId, moveSlot, 0); AddMovePoints(PTS_HAIL, move, moveSlot, 0);
} }
+3 -3
View File
@@ -326,8 +326,8 @@ u8 ContestAI_GetActionToUse(void)
{ {
// Randomly choose a move index. If it's the move // Randomly choose a move index. If it's the move
// with the highest (or tied highest) score, return // with the highest (or tied highest) score, return
u8 moveIdx = MOD(Random(), MAX_MON_MOVES); u8 moveIndex = MOD(Random(), MAX_MON_MOVES);
u8 score = eContestAI.moveScores[moveIdx]; u8 score = eContestAI.moveScores[moveIndex];
int i; int i;
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
{ {
@@ -335,7 +335,7 @@ u8 ContestAI_GetActionToUse(void)
break; break;
} }
if (i == MAX_MON_MOVES) if (i == MAX_MON_MOVES)
return moveIdx; return moveIndex;
} }
} }
+8 -8
View File
@@ -2549,7 +2549,7 @@ static void PrepareTMHMMoveWindow(void)
static void PrintTMHMMoveData(u16 itemId) static void PrintTMHMMoveData(u16 itemId)
{ {
u8 i; u8 i;
u16 moveId; u16 move;
const u8 *text; const u8 *text;
FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0)); FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0));
@@ -2561,35 +2561,35 @@ static void PrintTMHMMoveData(u16 itemId)
} }
else else
{ {
moveId = ItemIdToBattleMoveId(itemId); move = ItemIdToBattleMoveId(itemId);
BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[moveId].type + 1, 0, 0); BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[move].type + 1, 0, 0);
// Print TMHM power // Print TMHM power
if (gBattleMoves[moveId].power <= 1) if (gBattleMoves[move].power <= 1)
{ {
text = gText_ThreeDashes; text = gText_ThreeDashes;
} }
else else
{ {
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].power, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3);
text = gStringVar1; text = gStringVar1;
} }
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// Print TMHM accuracy // Print TMHM accuracy
if (gBattleMoves[moveId].accuracy == 0) if (gBattleMoves[move].accuracy == 0)
{ {
text = gText_ThreeDashes; text = gText_ThreeDashes;
} }
else else
{ {
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3);
text = gStringVar1; text = gStringVar1;
} }
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// Print TMHM pp // Print TMHM pp
ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 3);
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX);
+6 -6
View File
@@ -705,9 +705,9 @@ static void DoMoveRelearnerMain(void)
} }
else else
{ {
u16 moveId = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot); u16 move = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot);
StringCopy(gStringVar3, gMoveNames[moveId]); StringCopy(gStringVar3, gMoveNames[move]);
RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot); RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot); SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]); StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
@@ -916,19 +916,19 @@ static void CreateLearnableMovesList(void)
sMoveRelearnerStruct->numToShowAtOnce = LoadMoveRelearnerMovesList(sMoveRelearnerStruct->menuItems, sMoveRelearnerStruct->numMenuChoices); sMoveRelearnerStruct->numToShowAtOnce = LoadMoveRelearnerMovesList(sMoveRelearnerStruct->menuItems, sMoveRelearnerStruct->numMenuChoices);
} }
void MoveRelearnerShowHideHearts(s32 moveId) void MoveRelearnerShowHideHearts(s32 move)
{ {
u16 numHearts; u16 numHearts;
u16 i; u16 i;
if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL) if (!sMoveRelearnerMenuSate.showContestInfo || move == LIST_CANCEL)
{ {
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
} }
else else
{ {
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].appeal / 10); numHearts = (u8)(gContestEffects[gContestMoves[move].effect].appeal / 10);
if (numHearts == 0xFF) if (numHearts == 0xFF)
numHearts = 0; numHearts = 0;
@@ -942,7 +942,7 @@ void MoveRelearnerShowHideHearts(s32 moveId)
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE; gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE;
} }
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].jam / 10); numHearts = (u8)(gContestEffects[gContestMoves[move].effect].jam / 10);
if (numHearts == 0xFF) if (numHearts == 0xFF)
numHearts = 0; numHearts = 0;
+14 -14
View File
@@ -5095,17 +5095,17 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// Heal PP for all moves // Heal PP for all moves
for (temp2 = 0; (signed)(temp2) < (signed)(MAX_MON_MOVES); temp2++) for (temp2 = 0; (signed)(temp2) < (signed)(MAX_MON_MOVES); temp2++)
{ {
u16 moveId; u16 move;
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + temp2, NULL); dataUnsigned = GetMonData(mon, MON_DATA_PP1 + temp2, NULL);
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL);
if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
{ {
dataUnsigned += itemEffect[itemEffectParam]; dataUnsigned += itemEffect[itemEffectParam];
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
{ {
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2); dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2);
} }
SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned); SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned);
@@ -5121,17 +5121,17 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
else else
{ {
// Heal PP for one move // Heal PP for one move
u16 moveId; u16 move;
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL); dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL);
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL);
if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
{ {
dataUnsigned += itemEffect[itemEffectParam++]; dataUnsigned += itemEffect[itemEffectParam++];
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
{ {
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
} }
SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned); SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned);
+2 -2
View File
@@ -9633,9 +9633,9 @@ u32 CountAllStorageMons(void)
return count; return count;
} }
bool32 AnyStorageMonWithMove(u16 moveId) bool32 AnyStorageMonWithMove(u16 move)
{ {
u16 moves[] = {moveId, MOVES_COUNT}; u16 moves[] = {move, MOVES_COUNT};
s32 i, j; s32 i, j;
for (i = 0; i < TOTAL_BOXES_COUNT; i++) for (i = 0; i < TOTAL_BOXES_COUNT; i++)
+4 -4
View File
@@ -1607,9 +1607,9 @@ bool8 ScrCmd_bufferdecorationname(struct ScriptContext *ctx)
bool8 ScrCmd_buffermovename(struct ScriptContext *ctx) bool8 ScrCmd_buffermovename(struct ScriptContext *ctx)
{ {
u8 stringVarIndex = ScriptReadByte(ctx); u8 stringVarIndex = ScriptReadByte(ctx);
u16 moveId = VarGet(ScriptReadHalfword(ctx)); u16 move = VarGet(ScriptReadHalfword(ctx));
StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[moveId]); StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[move]);
return FALSE; return FALSE;
} }
@@ -1712,7 +1712,7 @@ bool8 ScrCmd_setmonmove(struct ScriptContext *ctx)
bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx)
{ {
u8 i; u8 i;
u16 moveId = ScriptReadHalfword(ctx); u16 move = ScriptReadHalfword(ctx);
gSpecialVar_Result = PARTY_SIZE; gSpecialVar_Result = PARTY_SIZE;
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
@@ -1720,7 +1720,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx)
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL);
if (!species) if (!species)
break; break;
if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], moveId) == TRUE) if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], move) == TRUE)
{ {
gSpecialVar_Result = i; gSpecialVar_Result = i;
gSpecialVar_0x8004 = species; gSpecialVar_0x8004 = species;
+5 -5
View File
@@ -771,7 +771,7 @@ static u8 GetAverageEVs(struct Pokemon *pokemon)
void SetPlayerSecretBaseParty(void) void SetPlayerSecretBaseParty(void)
{ {
u16 i; u16 i;
u16 moveIdx; u16 moveIndex;
u16 partyId; u16 partyId;
struct SecretBaseParty *party; struct SecretBaseParty *party;
@@ -781,8 +781,8 @@ void SetPlayerSecretBaseParty(void)
{ {
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
party->moves[i * MAX_MON_MOVES + moveIdx] = MOVE_NONE; party->moves[i * MAX_MON_MOVES + moveIndex] = MOVE_NONE;
party->species[i] = SPECIES_NONE; party->species[i] = SPECIES_NONE;
party->heldItems[i] = ITEM_NONE; party->heldItems[i] = ITEM_NONE;
@@ -793,8 +793,8 @@ void SetPlayerSecretBaseParty(void)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
{ {
for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
party->moves[partyId * MAX_MON_MOVES + moveIdx] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIdx); party->moves[partyId * MAX_MON_MOVES + moveIndex] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIndex);
party->species[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); party->species[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES);
party->heldItems[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); party->heldItems[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
+3 -3
View File
@@ -2199,7 +2199,7 @@ void TryPutLotteryWinnerReportOnAir(void)
} }
} }
void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove) void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIndex, const u16 *movePtr, u16 betterMove)
{ {
TVShow *show; TVShow *show;
u8 i; u8 i;
@@ -2214,10 +2214,10 @@ void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16
StringCopy(show->battleSeminar.playerName, gSaveBlock2Ptr->playerName); StringCopy(show->battleSeminar.playerName, gSaveBlock2Ptr->playerName);
show->battleSeminar.foeSpecies = foeSpecies; show->battleSeminar.foeSpecies = foeSpecies;
show->battleSeminar.species = species; show->battleSeminar.species = species;
show->battleSeminar.move = movePtr[moveIdx]; show->battleSeminar.move = movePtr[moveIndex];
for (i = 0, j = 0; i < MAX_MON_MOVES; i++) for (i = 0, j = 0; i < MAX_MON_MOVES; i++)
{ {
if (i != moveIdx && movePtr[i]) if (i != moveIndex && movePtr[i])
{ {
show->battleSeminar.otherMoves[j] = movePtr[i]; show->battleSeminar.otherMoves[j] = movePtr[i];
j++; j++;