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

View File

@@ -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);
@@ -337,7 +337,7 @@ static u16 GetRandomAlternateMove(u8 monId)
u16 species;
const u16 *learnset;
bool32 needTMs = FALSE;
u16 moveId = MOVE_NONE;
u16 move = MOVE_NONE;
bool32 shouldUseMove;
u8 level;
@@ -379,7 +379,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)
@@ -390,7 +390,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] & LEVEL_UP_MOVE_ID) == moveId)
if ((learnset[j] & LEVEL_UP_MOVE_ID) == move)
{
shouldUseMove = FALSE;
break;
@@ -414,13 +414,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] & LEVEL_UP_MOVE_ID;
move = learnset[learnsetId] & LEVEL_UP_MOVE_ID;
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] & LEVEL_UP_MOVE_ID) == moveId)
if ((learnset[j] & LEVEL_UP_MOVE_ID) == move)
{
shouldUseMove = FALSE;
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;
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;
}
@@ -605,8 +605,8 @@ static void CreateApprenticeMenu(u8 menu)
case APPRENTICE_ASK_MOVES:
left = 17;
top = 8;
strings[0] = gMoveNames[gApprenticeQuestionData->moveId1];
strings[1] = gMoveNames[gApprenticeQuestionData->moveId2];
strings[0] = gMoveNames[gApprenticeQuestionData->move1];
strings[1] = gMoveNames[gApprenticeQuestionData->move2];
break;
case APPRENTICE_ASK_GIVE:
left = 18;
@@ -1006,8 +1006,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)
@@ -1062,10 +1062,10 @@ static void ApprenticeBufferString(void)
StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]);
break;
case APPRENTICE_BUFF_MOVE1:
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId1]);
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move1]);
break;
case APPRENTICE_BUFF_MOVE2:
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId2]);
StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move2]);
break;
case APPRENTICE_BUFF_ITEM:
StringCopy(stringDst, ItemId_GetName(PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data));

View File

@@ -1419,9 +1419,9 @@ static void RecordedOpponentHandleChooseMove(void)
}
else
{
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 moveIndex = 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();

View File

@@ -1445,9 +1445,9 @@ static void RecordedPlayerHandleChooseMove(void)
}
else
{
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 moveIndex = 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();

View File

@@ -2678,24 +2678,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);
}
}
@@ -2707,24 +2707,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);
}
}
@@ -5222,7 +5222,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;
@@ -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)
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 = gBattleMoves[moveIds[i * MAX_MON_MOVES + j]].power;
movePower = gBattleMoves[moves[i * MAX_MON_MOVES + j]].power;
if (movePower == 0)
movePower = 40;
else if (movePower == 1)
movePower = 60;
else if (moveIds[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT
|| moveIds[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION)
else if (moves[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT
|| moves[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION)
movePower /= 2;
for (k = 0; k < FRONTIER_PARTY_SIZE; k++)
@@ -5265,7 +5265,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
else
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)
moveScores[i * MAX_MON_MOVES + j] += movePower;
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])
{
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;
}
}
@@ -5296,7 +5296,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)
@@ -5316,7 +5316,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];
@@ -5328,7 +5328,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)

View File

@@ -545,7 +545,7 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId)
#undef tBattlerId
// 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;
}

View File

@@ -5464,8 +5464,8 @@ static void Cmd_yesnoboxlearnmove(void)
}
else
{
u16 moveId = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition);
if (IsHMMove2(moveId))
u16 move = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition);
if (IsHMMove2(move))
{
PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, gActiveBattler);
gBattleScripting.learnMoveState = 6;
@@ -5474,7 +5474,7 @@ static void Cmd_yesnoboxlearnmove(void)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId)
PREPARE_MOVE_BUFFER(gBattleTextBuff2, move)
RemoveMonPPBonus(&gPlayerParty[gBattleStruct->expGetterMonId], movePosition);
SetMonMoveSlot(&gPlayerParty[gBattleStruct->expGetterMonId], gMoveToLearn, movePosition);
@@ -9508,7 +9508,7 @@ static void Cmd_assistattackselect(void)
{
s32 chooseableMovesNo = 0;
struct Pokemon *party;
s32 monId, moveId;
s32 monId, moveIndex;
u16 *validMoves = gBattleStruct->assistPossibleMoves;
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)
continue;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++)
for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
{
s32 i = 0;
u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId);
u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveIndex);
if (IsInvalidForSleepTalkOrAssist(move))
continue;

View File

@@ -2417,7 +2417,7 @@ static void LoadMultiPartnerCandidatesData(void)
static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId)
{
u16 move = 0;
u16 move = MOVE_NONE;
u16 species = 0;
SetFacilityPtrsGetLevel();

View File

@@ -79,7 +79,7 @@ struct RectangularSpiralLine
{
u8 state;
s16 position;
u8 moveIdx;
u8 moveIndex;
s16 reboundPosition;
bool8 outward;
};
@@ -3204,28 +3204,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;
@@ -3288,7 +3288,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.
@@ -3319,21 +3319,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)
@@ -3343,7 +3343,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;
}
}
@@ -3354,7 +3354,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;
}
}

View File

@@ -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)
@@ -1056,7 +1056,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
@@ -1124,8 +1124,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)
@@ -1134,12 +1134,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);
}
}
@@ -1505,9 +1505,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 (gBattleMoves[moveId].power == 0)
if (gBattleMoves[move].power == 0)
{
*dmg = 0;
return FALSE;
@@ -1517,7 +1517,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);
@@ -1527,13 +1527,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;
@@ -1568,7 +1568,7 @@ void BattleTv_ClearExplosionFaintCause(void)
}
}
u8 GetBattlerMoveSlotId(u8 battler, u16 moveId)
u8 GetBattlerMoveSlotId(u8 battler, u16 move)
{
s32 i;
struct Pokemon *party;
@@ -1583,7 +1583,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++;
}
@@ -1591,14 +1591,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);
AddMovePoints(PTS_SANDSTORM, move, moveSlot, 0);
else if (weatherFlags & B_WEATHER_HAIL)
AddMovePoints(PTS_HAIL, moveId, moveSlot, 0);
AddMovePoints(PTS_HAIL, move, moveSlot, 0);
}

View File

@@ -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;
}
}

View File

@@ -2549,7 +2549,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));
@@ -2561,35 +2561,35 @@ static void PrintTMHMMoveData(u16 itemId)
}
else
{
moveId = ItemIdToBattleMoveId(itemId);
BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[moveId].type + 1, 0, 0);
move = ItemIdToBattleMoveId(itemId);
BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[move].type + 1, 0, 0);
// Print TMHM power
if (gBattleMoves[moveId].power <= 1)
if (gBattleMoves[move].power <= 1)
{
text = gText_ThreeDashes;
}
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;
}
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// Print TMHM accuracy
if (gBattleMoves[moveId].accuracy == 0)
if (gBattleMoves[move].accuracy == 0)
{
text = gText_ThreeDashes;
}
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;
}
BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO);
// 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);
CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX);

View File

@@ -705,9 +705,9 @@ 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);
StringCopy(gStringVar3, gMoveNames[moveId]);
StringCopy(gStringVar3, gMoveNames[move]);
RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
@@ -916,19 +916,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[gContestMoves[moveId].effect].appeal / 10);
numHearts = (u8)(gContestEffects[gContestMoves[move].effect].appeal / 10);
if (numHearts == 0xFF)
numHearts = 0;
@@ -942,7 +942,7 @@ void MoveRelearnerShowHideHearts(s32 moveId)
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)
numHearts = 0;

View File

@@ -5095,17 +5095,17 @@ 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];
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
{
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2);
move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2);
}
SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned);
@@ -5121,17 +5121,17 @@ 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++];
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
{
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
}
SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned);

View File

@@ -9633,9 +9633,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++)

View File

@@ -1607,9 +1607,9 @@ 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));
StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[moveId]);
StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[move]);
return FALSE;
}
@@ -1712,7 +1712,7 @@ bool8 ScrCmd_setmonmove(struct ScriptContext *ctx)
bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx)
{
u8 i;
u16 moveId = ScriptReadHalfword(ctx);
u16 move = ScriptReadHalfword(ctx);
gSpecialVar_Result = PARTY_SIZE;
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);
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;

View File

@@ -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);

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;
u8 i;
@@ -2214,10 +2214,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++;