diff --git a/include/battle_tv.h b/include/battle_tv.h index b2a89451a1..5766907637 100644 --- a/include/battle_tv.h +++ b/include/battle_tv.h @@ -6,6 +6,6 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc void BattleTv_SetDataBasedOnAnimation(u8 animationId); void TryPutLinkBattleTvShowOnAir(void); void BattleTv_ClearExplosionFaintCause(void); -u8 GetBattlerMoveSlotId(u8 battler, u16 moveId); +u8 GetBattlerMoveSlotId(u8 battler, u16 move); #endif // GUARD_BATTLE_TV_H diff --git a/include/global.h b/include/global.h index a6e494f03a..95513344db 100644 --- a/include/global.h +++ b/include/global.h @@ -489,7 +489,7 @@ struct ApprenticeQuestion 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 padding; - u16 data; // used both as an itemId and a moveId + u16 data; // used both as an itemId and a move }; struct PlayersApprentice diff --git a/include/party_menu.h b/include/party_menu.h index 903c06f3ab..fe6dc93b13 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -16,7 +16,7 @@ struct PartyMenu s8 slotId2; u8 action; 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 }; diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index c2825bf779..397ec24dea 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -59,7 +59,7 @@ bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); u32 CountAllStorageMons(void); -bool32 AnyStorageMonWithMove(u16 moveId); +bool32 AnyStorageMonWithMove(u16 move); void ResetWaldaWallpaper(void); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); diff --git a/include/tv.h b/include/tv.h index 31c8fcc50f..f47aa532d7 100644 --- a/include/tv.h +++ b/include/tv.h @@ -5,7 +5,7 @@ extern u8 *const gTVStringVarPtrs[3]; void ClearTVShowData(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 DoTVShow(void); void DoTVShowInSearchOfTrainers(void); diff --git a/src/apprentice.c b/src/apprentice.c index 7dcca7b28b..3f7a9cdda5 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -70,8 +70,8 @@ struct ApprenticeQuestionData { u16 speciesId; u16 altSpeciesId; - u16 moveId1; - u16 moveId2; + u16 move1; + u16 move2; }; // IWRAM common @@ -81,7 +81,7 @@ COMMON_DATA void (*gApprenticeFunc)(void) = NULL; // This file's functions. 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 u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height); static void RemoveAndHideWindow(u8 windowId); @@ -316,7 +316,7 @@ static u16 GetRandomAlternateMove(u8 monId) u16 species; const struct LevelUpMove *learnset; bool32 needTMs = FALSE; - u16 moveId = MOVE_NONE; + u16 move = MOVE_NONE; bool32 shouldUseMove; u8 level; @@ -358,7 +358,7 @@ static u16 GetRandomAlternateMove(u8 monId) } while (!shouldUseMove); - moveId = ItemIdToBattleMoveId(ITEM_TM01 + id); + move = ItemIdToBattleMoveId(ITEM_TM01 + id); shouldUseMove = TRUE; if (numLearnsetMoves <= MAX_MON_MOVES) @@ -369,7 +369,7 @@ static u16 GetRandomAlternateMove(u8 monId) for (; j < numLearnsetMoves; j++) { // Keep looking for TMs until one not in the level up learnset is found - if ((learnset[j].move) == moveId) + if ((learnset[j].move) == move) { shouldUseMove = FALSE; break; @@ -393,13 +393,13 @@ static u16 GetRandomAlternateMove(u8 monId) { // Get a random move excluding the 4 it would know at max level u8 learnsetId = Random() % (numLearnsetMoves - MAX_MON_MOVES); - moveId = learnset[learnsetId].move; + move = learnset[learnsetId].move; shouldUseMove = TRUE; for (j = numLearnsetMoves - MAX_MON_MOVES; j < numLearnsetMoves; j++) { // Keep looking for moves until one not in the last 4 is found - if ((learnset[j].move) == moveId) + if ((learnset[j].move) == move) { shouldUseMove = FALSE; break; @@ -409,29 +409,29 @@ static u16 GetRandomAlternateMove(u8 monId) } } - if (TrySetMove(monId, moveId)) + if (TrySetMove(monId, move)) { - if (IsValidApprenticeMove(moveId)) + if (IsValidApprenticeMove(move)) break; i++; } } gApprenticePartyMovesData->moveCounter++; - return moveId; + return move; } -static bool8 TrySetMove(u8 monId, u16 moveId) +static bool8 TrySetMove(u8 monId, u16 move) { u8 i; for (i = 0; i < NUM_WHICH_MOVE_QUESTIONS; i++) { - if (gApprenticePartyMovesData->moves[monId][i] == moveId) + if (gApprenticePartyMovesData->moves[monId][i] == move) return FALSE; } - gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = moveId; + gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = move; return TRUE; } @@ -584,8 +584,8 @@ static void CreateApprenticeMenu(u8 menu) case APPRENTICE_ASK_MOVES: left = 17; top = 8; - strings[0] = GetMoveName(gApprenticeQuestionData->moveId1); - strings[1] = GetMoveName(gApprenticeQuestionData->moveId2); + strings[0] = GetMoveName(gApprenticeQuestionData->move1); + strings[1] = GetMoveName(gApprenticeQuestionData->move2); break; case APPRENTICE_ASK_GIVE: left = 18; @@ -985,8 +985,8 @@ static void InitQuestionData(void) count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; APPRENTICE_SPECIES_ID_NO_COND(id1, count); gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1]; - gApprenticeQuestionData->moveId1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); - gApprenticeQuestionData->moveId2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; + gApprenticeQuestionData->move1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); + gApprenticeQuestionData->move2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; } } else if (gSpecialVar_0x8005 == APPRENTICE_QUESTION_WHAT_ITEM) @@ -1041,10 +1041,10 @@ static void ApprenticeBufferString(void) StringCopy(stringDst, GetSpeciesName(gApprenticeQuestionData->speciesId)); break; case APPRENTICE_BUFF_MOVE1: - StringCopy(stringDst, GetMoveName(gApprenticeQuestionData->moveId1)); + StringCopy(stringDst, GetMoveName(gApprenticeQuestionData->move1)); break; case APPRENTICE_BUFF_MOVE2: - StringCopy(stringDst, GetMoveName(gApprenticeQuestionData->moveId2)); + StringCopy(stringDst, GetMoveName(gApprenticeQuestionData->move2)); break; case APPRENTICE_BUFF_ITEM: StringCopy(stringDst, ItemId_GetName(PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data)); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 521a231028..f65eb1dc73 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -456,9 +456,9 @@ static void RecordedPlayerHandleChooseMove(u32 battler) } else { - u8 moveId = RecordedBattle_GetBattlerAction(RECORDED_MOVE_SLOT, battler); + u8 moveIndex = RecordedBattle_GetBattlerAction(RECORDED_MOVE_SLOT, battler); u8 target = RecordedBattle_GetBattlerAction(RECORDED_MOVE_TARGET, battler); - BtlController_EmitTwoReturnValues(battler, B_COMM_TO_ENGINE, 10, moveId | (target << 8)); + BtlController_EmitTwoReturnValues(battler, B_COMM_TO_ENGINE, 10, moveIndex | (target << 8)); } RecordedPlayerBufferExecCompleted(battler); diff --git a/src/battle_dome.c b/src/battle_dome.c index d374843573..bb77ffc0bc 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2270,24 +2270,24 @@ int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) { - int i, moveId, playerMonId; + int i, moveIndex, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { 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++) { 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); } 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); } } @@ -2299,24 +2299,24 @@ static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) // Identical to function above, but uses EFFECTIVENESS_MODE_BAD static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom) { - int i, moveId, playerMonId; + int i, moveIndex, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { 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++) { 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); } 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); } } @@ -5091,7 +5091,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun { int i, j, k; 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 bestId = 0; int movePower = 0; @@ -5105,16 +5105,16 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun // TODO: Clean this up, looks like a different data structure (2D array) moveScores[i * MAX_MON_MOVES + j] = 0; 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 - 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 = GetMovePower(moveIds[i * MAX_MON_MOVES + j]); - if (IsBattleMoveStatus(moveIds[i * MAX_MON_MOVES + j])) + movePower = GetMovePower(moves[i * MAX_MON_MOVES + j]); + if (IsBattleMoveStatus(moves[i * MAX_MON_MOVES + j])) movePower = 40; else if (movePower == 1) movePower = 60; - else if (GetMoveEffect(moveIds[i * MAX_MON_MOVES + j]) == EFFECT_EXPLOSION) + else if (GetMoveEffect(moves[i * MAX_MON_MOVES + j]) == EFFECT_EXPLOSION) movePower /= 2; for (k = 0; k < FRONTIER_PARTY_SIZE; k++) @@ -5135,7 +5135,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun else targetAbility = gSpeciesInfo[targetSpecies].abilities[0]; - typeMultiplier = CalcPartyMonTypeEffectivenessMultiplier(moveIds[i * 4 + j], targetSpecies, targetAbility); + typeMultiplier = CalcPartyMonTypeEffectivenessMultiplier(moves[i * 4 + j], targetSpecies, targetAbility); if (typeMultiplier == UQ_4_12(0)) moveScores[i * MAX_MON_MOVES + j] += 0; else if (typeMultiplier >= UQ_4_12(2)) @@ -5153,7 +5153,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun } 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; } } @@ -5164,7 +5164,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun { 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; } if (i != roundId - 1) @@ -5184,7 +5184,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun j = 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; bestScore = moveScores[k]; @@ -5196,7 +5196,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun if (moveScores[j] == 0) j = bestId; - return moveIds[j]; + return moves[j]; } static void Task_ShowTourneyTree(u8 taskId) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b4603855ad..8355bb78bd 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8628,8 +8628,8 @@ static void Cmd_yesnoboxlearnmove(void) } else { - u16 moveId = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); - if (IsMoveHM(moveId)) + u16 move = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); + if (IsMoveHM(move)) { PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, B_POSITION_PLAYER_LEFT); gBattleScripting.learnMoveState = 6; @@ -8638,7 +8638,7 @@ static void Cmd_yesnoboxlearnmove(void) { gBattlescriptCurrInstr = cmd->forgotMovePtr; - PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId) + PREPARE_MOVE_BUFFER(gBattleTextBuff2, move) RemoveMonPPBonus(&gPlayerParty[gBattleStruct->expGetterMonId], movePosition); SetMonMoveSlot(&gPlayerParty[gBattleStruct->expGetterMonId], gMoveToLearn, movePosition); diff --git a/src/battle_tower.c b/src/battle_tower.c index 140d411843..3cd221e1c3 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2393,7 +2393,7 @@ static void LoadMultiPartnerCandidatesData(void) static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId) { - u16 move = 0; + u16 move = MOVE_NONE; u16 species = 0; SetFacilityPtrsGetLevel(); diff --git a/src/battle_transition.c b/src/battle_transition.c index b131769ba4..09dc346339 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -81,7 +81,7 @@ struct RectangularSpiralLine { u8 state; s16 position; - u8 moveIdx; + u8 moveIndex; s16 reboundPosition; bool8 outward; }; @@ -3125,28 +3125,28 @@ static bool8 RectangularSpiral_Init(struct Task *task) // Line starting in top left sRectangularSpiralLines[0].state = SPIRAL_INWARD_START; sRectangularSpiralLines[0].position = -1; - sRectangularSpiralLines[0].moveIdx = 1; + sRectangularSpiralLines[0].moveIndex = 1; sRectangularSpiralLines[0].reboundPosition = 308; sRectangularSpiralLines[0].outward = FALSE; // Line starting in bottom right sRectangularSpiralLines[1].state = SPIRAL_INWARD_START; sRectangularSpiralLines[1].position = -1; - sRectangularSpiralLines[1].moveIdx = 1; + sRectangularSpiralLines[1].moveIndex = 1; sRectangularSpiralLines[1].reboundPosition = 308; sRectangularSpiralLines[1].outward = FALSE; // Line starting in top right sRectangularSpiralLines[2].state = SPIRAL_INWARD_START; sRectangularSpiralLines[2].position = -3; - sRectangularSpiralLines[2].moveIdx = 1; + sRectangularSpiralLines[2].moveIndex = 1; sRectangularSpiralLines[2].reboundPosition = 307; sRectangularSpiralLines[2].outward = FALSE; // Line starting in bottom left sRectangularSpiralLines[3].state = SPIRAL_INWARD_START; sRectangularSpiralLines[3].position = -3; - sRectangularSpiralLines[3].moveIdx = 1; + sRectangularSpiralLines[3].moveIndex = 1; sRectangularSpiralLines[3].reboundPosition = 307; sRectangularSpiralLines[3].outward = FALSE; @@ -3209,7 +3209,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Has spiral finished? // Note that most move data arrays endsin SPIRAL_END but it is // only ever reached on the final array of spiraling outward. - if (moveData[line->moveIdx] == SPIRAL_END) + if (moveData[line->moveIndex] == SPIRAL_END) return FALSE; // Presumably saving data for debug. @@ -3240,21 +3240,21 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Below check is never true. // 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; - 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. // Time to flip and start spiraling outward. line->outward = TRUE; - line->moveIdx = 1; + line->moveIndex = 1; line->position = line->reboundPosition; line->state = SPIRAL_OUTWARD_START; } // Reached move target, advance to next movement. - if (line->position == moveData[line->moveIdx]) + if (line->position == moveData[line->moveIndex]) { line->state++; if (line->outward == TRUE) @@ -3264,7 +3264,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Still spiraling outward, loop back to the first state // but use the second set of move targets. // For example, the 28 in sRectangularSpiral_Major_OutwardUp - line->moveIdx++; + line->moveIndex++; line->state = SPIRAL_OUTWARD_START; } } @@ -3275,7 +3275,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Still spiraling inward, loop back to the first state // but use the second set of move targets. // For example, the 275 in sRectangularSpiral_Major_InwardRight - line->moveIdx++; + line->moveIndex++; line->state = SPIRAL_INWARD_START; } } diff --git a/src/battle_tv.c b/src/battle_tv.c index ac75722361..d43345fca5 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -15,8 +15,8 @@ static bool8 IsNotSpecialBattleString(u16 stringId); static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3); static void TrySetBattleSeminarShow(void); static void AddPointsOnFainting(bool8 targetFainted); -static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot); -static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride); +static void AddPointsBasedOnWeather(u16 weatherFlags, u16 move, u8 moveSlot); +static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride); #define TABLE_END ((u16)-1) @@ -829,7 +829,7 @@ void TryPutLinkBattleTvShowOnAir(void) u8 countPlayer = 0, countOpponent = 0; s16 sum = 0; u16 species = 0; - u16 moveId = 0; + u16 move = MOVE_NONE; s32 i, j; int zero = 0, one = 1; //needed for matching @@ -897,8 +897,8 @@ void TryPutLinkBattleTvShowOnAir(void) } } - moveId = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL); - if (playerBestSum == 0 || moveId == 0) + move = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL); + if (playerBestSum == 0 || move == MOVE_NONE) return; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) @@ -907,12 +907,12 @@ void TryPutLinkBattleTvShowOnAir(void) || (playerBestMonId >= MULTI_PARTY_SIZE && GetLinkTrainerFlankId(gBattleScripting.multiplayerId))) { j = (opponentBestMonId < MULTI_PARTY_SIZE) ? FALSE : TRUE; - PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies); + PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), move, playerBestSpecies, opponentBestSpecies); } } else { - PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, moveId, playerBestSpecies, opponentBestSpecies); + PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, move, playerBestSpecies, opponentBestSpecies); } } @@ -1295,9 +1295,9 @@ static void TrySetBattleSeminarShow(void) gCurrentMove = currMoveSaved; } -static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) +static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride) { - if (IsBattleMoveStatus(moveId)) + if (IsBattleMoveStatus(move)) { *dmg = 0; return FALSE; @@ -1307,7 +1307,7 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) s32 i = 0; do { - if (moveId == sVariableDmgMoves[i]) + if (move == sVariableDmgMoves[i]) break; i++; } while (sVariableDmgMoves[i] != TABLE_END); @@ -1317,13 +1317,13 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) *dmg = 0; return FALSE; } - else if (moveId == MOVE_PSYWAVE) + else if (move == MOVE_PSYWAVE) { *dmg = gBattleMons[gBattlerAttacker].level; *dmg /= 2; return FALSE; } - else if (moveId == MOVE_MAGNITUDE) + else if (move == MOVE_MAGNITUDE) { *powerOverride = 10; return TRUE; @@ -1358,7 +1358,7 @@ void BattleTv_ClearExplosionFaintCause(void) } } -u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) +u8 GetBattlerMoveSlotId(u8 battler, u16 move) { s32 i; struct Pokemon *party; @@ -1369,7 +1369,7 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) { if (i >= MAX_MON_MOVES) break; - if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == moveId) + if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == move) break; i++; } @@ -1377,14 +1377,14 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) 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) - AddMovePoints(PTS_RAIN, moveId, moveSlot, 0); + AddMovePoints(PTS_RAIN, move, moveSlot, 0); else if (weatherFlags & B_WEATHER_SUN) - AddMovePoints(PTS_SUN, moveId, moveSlot, 0); + AddMovePoints(PTS_SUN, move, moveSlot, 0); else if (weatherFlags & B_WEATHER_SANDSTORM) - AddMovePoints(PTS_SANDSTORM, moveId, moveSlot, 0); - else if (weatherFlags & (B_WEATHER_HAIL | B_WEATHER_SNOW)) - AddMovePoints(PTS_HAIL, moveId, moveSlot, 0); + AddMovePoints(PTS_SANDSTORM, move, moveSlot, 0); + else if (weatherFlags & B_WEATHER_HAIL) + AddMovePoints(PTS_HAIL, move, moveSlot, 0); } diff --git a/src/contest_ai.c b/src/contest_ai.c index 4386aeee64..77f27fcc91 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -326,8 +326,8 @@ u8 ContestAI_GetActionToUse(void) { // Randomly choose a move index. If it's the move // with the highest (or tied highest) score, return - u8 moveIdx = MOD(Random(), MAX_MON_MOVES); - u8 score = eContestAI.moveScores[moveIdx]; + u8 moveIndex = MOD(Random(), MAX_MON_MOVES); + u8 score = eContestAI.moveScores[moveIndex]; int i; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -335,7 +335,7 @@ u8 ContestAI_GetActionToUse(void) break; } if (i == MAX_MON_MOVES) - return moveIdx; + return moveIndex; } } diff --git a/src/item_menu.c b/src/item_menu.c index ff5d569f96..31b43d199d 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2591,7 +2591,7 @@ static void PrepareTMHMMoveWindow(void) static void PrintTMHMMoveData(u16 itemId) { u8 i; - u16 moveId; + u16 move; const u8 *text; FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0)); @@ -2603,11 +2603,11 @@ static void PrintTMHMMoveData(u16 itemId) } else { - moveId = ItemIdToBattleMoveId(itemId); - BlitMenuInfoIcon(WIN_TMHM_INFO, GetMoveType(moveId) + 1, 0, 0); + move = ItemIdToBattleMoveId(itemId); + BlitMenuInfoIcon(WIN_TMHM_INFO, GetMoveType(move) + 1, 0, 0); // Print TMHM power - u32 power = GetMovePower(moveId); + u32 power = GetMovePower(move); if (power <= 1) { text = gText_ThreeDashes; @@ -2619,7 +2619,7 @@ static void PrintTMHMMoveData(u16 itemId) } BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); - u32 accuracy = GetMoveAccuracy(moveId); + u32 accuracy = GetMoveAccuracy(move); // Print TMHM accuracy if (accuracy == 0) { @@ -2633,7 +2633,7 @@ static void PrintTMHMMoveData(u16 itemId) BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); // Print TMHM pp - ConvertIntToDecimalStringN(gStringVar1, GetMovePP(moveId), STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, GetMovePP(move), STR_CONV_MODE_RIGHT_ALIGN, 3); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); diff --git a/src/move_relearner.c b/src/move_relearner.c index 7d3b61213c..6acfee0cb5 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -733,10 +733,10 @@ static void DoMoveRelearnerMain(void) } else { - u16 moveId = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot); + u16 move = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot); u8 originalPP = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_PP1 + sMoveRelearnerStruct->moveSlot); - StringCopy(gStringVar3, GetMoveName(moveId)); + StringCopy(gStringVar3, GetMoveName(move)); RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot); SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot); u8 newPP = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_PP1 + sMoveRelearnerStruct->moveSlot); @@ -955,19 +955,19 @@ static void CreateLearnableMovesList(void) sMoveRelearnerStruct->numToShowAtOnce = LoadMoveRelearnerMovesList(sMoveRelearnerStruct->menuItems, sMoveRelearnerStruct->numMenuChoices); } -void MoveRelearnerShowHideHearts(s32 moveId) +void MoveRelearnerShowHideHearts(s32 move) { u16 numHearts; u16 i; - if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL) + if (!sMoveRelearnerMenuSate.showContestInfo || move == LIST_CANCEL) { for (i = 0; i < 16; i++) gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; } else { - numHearts = (u8)(gContestEffects[GetMoveContestEffect(moveId)].appeal / 10); + numHearts = (u8)(gContestEffects[GetMoveContestEffect(move)].appeal / 10); if (numHearts == 0xFF) numHearts = 0; @@ -981,7 +981,7 @@ void MoveRelearnerShowHideHearts(s32 moveId) gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE; } - numHearts = (u8)(gContestEffects[GetMoveContestEffect(moveId)].jam / 10); + numHearts = (u8)(gContestEffects[GetMoveContestEffect(move)].jam / 10); if (numHearts == 0xFF) numHearts = 0; diff --git a/src/pokemon.c b/src/pokemon.c index 0e5e81cb76..3bd0e4dd5d 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4027,14 +4027,14 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Heal PP for all moves for (temp2 = 0; (signed)(temp2) < (signed)(MAX_MON_MOVES); temp2++) { - u16 moveId; + u16 move; dataUnsigned = GetMonData(mon, MON_DATA_PP1 + temp2, NULL); - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); - if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) + move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); + if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) { dataUnsigned += itemEffect[itemEffectParam]; - if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) - dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2); + if (dataUnsigned > CalculatePPWithBonus(move, 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); retVal = FALSE; } @@ -4044,14 +4044,14 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov else { // Heal PP for one move - u16 moveId; + u16 move; dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL); - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); - if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) + move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); + if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) { dataUnsigned += itemEffect[itemEffectParam++]; - if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) - dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); + if (dataUnsigned > CalculatePPWithBonus(move, 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); retVal = FALSE; } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 9714293931..911e9025e8 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -9714,9 +9714,9 @@ u32 CountAllStorageMons(void) return count; } -bool32 AnyStorageMonWithMove(u16 moveId) +bool32 AnyStorageMonWithMove(u16 move) { - u16 moves[] = {moveId, MOVES_COUNT}; + u16 moves[] = {move, MOVES_COUNT}; s32 i, j; for (i = 0; i < TOTAL_BOXES_COUNT; i++) diff --git a/src/scrcmd.c b/src/scrcmd.c index f988bff6ea..d792a3fc35 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2138,11 +2138,11 @@ bool8 ScrCmd_bufferdecorationname(struct ScriptContext *ctx) bool8 ScrCmd_buffermovename(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); - u16 moveId = VarGet(ScriptReadHalfword(ctx)); + u16 move = VarGet(ScriptReadHalfword(ctx)); Script_RequestEffects(SCREFF_V1); - StringCopy(sScriptStringVars[stringVarIndex], GetMoveName(moveId)); + StringCopy(sScriptStringVars[stringVarIndex], GetMoveName(move)); return FALSE; } @@ -2250,7 +2250,7 @@ bool8 ScrCmd_setmonmove(struct ScriptContext *ctx) bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) { u8 i; - u16 moveId = ScriptReadHalfword(ctx); + u16 move = ScriptReadHalfword(ctx); Script_RequestEffects(SCREFF_V1); @@ -2260,7 +2260,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); if (!species) 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_0x8004 = species; diff --git a/src/secret_base.c b/src/secret_base.c index d4dc43c5bd..7ec41253c4 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -771,7 +771,7 @@ static u8 GetAverageEVs(struct Pokemon *pokemon) void SetPlayerSecretBaseParty(void) { u16 i; - u16 moveIdx; + u16 moveIndex; u16 partyId; struct SecretBaseParty *party; @@ -781,8 +781,8 @@ void SetPlayerSecretBaseParty(void) { for (i = 0; i < PARTY_SIZE; i++) { - for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) - party->moves[i * MAX_MON_MOVES + moveIdx] = MOVE_NONE; + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) + party->moves[i * MAX_MON_MOVES + moveIndex] = MOVE_NONE; party->species[i] = SPECIES_NONE; party->heldItems[i] = ITEM_NONE; @@ -793,8 +793,8 @@ void SetPlayerSecretBaseParty(void) if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) { - for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) - party->moves[partyId * MAX_MON_MOVES + moveIdx] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIdx); + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) + party->moves[partyId * MAX_MON_MOVES + moveIndex] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIndex); party->species[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); party->heldItems[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); diff --git a/src/tv.c b/src/tv.c index 8313ee9bf5..97db1c08ea 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2169,7 +2169,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; u8 i; @@ -2184,10 +2184,10 @@ void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 StringCopy(show->battleSeminar.playerName, gSaveBlock2Ptr->playerName); show->battleSeminar.foeSpecies = foeSpecies; show->battleSeminar.species = species; - show->battleSeminar.move = movePtr[moveIdx]; + show->battleSeminar.move = movePtr[moveIndex]; 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]; j++;