use max mon moves constant where able (#480)

* use max mon moves constant where able

* fix errors in script commands file

* fix more errors
This commit is contained in:
melthelesbian
2018-12-25 12:50:15 -05:00
committed by Marcus Huderle
parent dcbc8db6a3
commit 2dd706ca54
33 changed files with 265 additions and 260 deletions

View File

@@ -931,7 +931,7 @@ const u16 gSpeciesToNationalPokedexNum[] = // Assigns all species to the Nationa
SPECIES_TO_NATIONAL(CHIMECHO),
};
const u16 gHoennToNationalOrder[] = // Assigns Hoenn Dex Pokémon (Using National Dex Index)
const u16 gHoennToNationalOrder[] = // Assigns Hoenn Dex Pokémon (Using National Dex Index)
{
HOENN_TO_NATIONAL(TREECKO),
HOENN_TO_NATIONAL(GROVYLE),
@@ -1135,7 +1135,7 @@ const u16 gHoennToNationalOrder[] = // Assigns Hoenn Dex Pok
HOENN_TO_NATIONAL(RAYQUAZA),
HOENN_TO_NATIONAL(JIRACHI),
HOENN_TO_NATIONAL(DEOXYS),
HOENN_TO_NATIONAL(BULBASAUR), // Pokémon from here onwards are UNSEEN in the HoennDex.
HOENN_TO_NATIONAL(BULBASAUR), // Pokémon from here onwards are UNSEEN in the HoennDex.
HOENN_TO_NATIONAL(IVYSAUR),
HOENN_TO_NATIONAL(VENUSAUR),
HOENN_TO_NATIONAL(CHARMANDER),
@@ -2754,7 +2754,7 @@ void sub_806819C(struct Pokemon *mon, struct BattleTowerPokemon *src)
CreateMon(mon, src->species, src->level, 0, 1, src->personality, 1, src->otId);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->moves[i], i);
SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses);
@@ -2816,7 +2816,7 @@ void sub_8068338(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl5
CreateMon(mon, src->species, level, 0, 1, src->personality, 1, src->otId);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->moves[i], i);
SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses);
@@ -2880,7 +2880,7 @@ void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 m
otId);
SetMonData(mon, MON_DATA_HELD_ITEM, &src->party[monId].item);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->party[monId].moves[i], i);
evAmount = MAX_TOTAL_EVS / NUM_STATS;
@@ -2940,7 +2940,7 @@ void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest)
dest->heldItem = heldItem;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
dest->moves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, NULL);
dest->level = GetMonData(mon, MON_DATA_LEVEL, NULL);
@@ -3266,7 +3266,7 @@ u16 GiveMoveToMon(struct Pokemon *mon, u16 move)
u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
u16 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
if (!existingMove)
@@ -3285,7 +3285,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (!mon->moves[i])
{
@@ -3388,7 +3388,7 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
moves[3] = move;
pp[3] = gBattleMoves[move].pp;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
SetMonData(mon, MON_DATA_MOVE1 + i, &moves[i]);
SetMonData(mon, MON_DATA_PP1 + i, &pp[i]);
@@ -3415,7 +3415,7 @@ void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
moves[3] = move;
pp[3] = gBattleMoves[move].pp;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp[i]);
@@ -4849,7 +4849,7 @@ void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
for (j = 0; j < 6; j++)
SetMonData(&gEnemyParty[i], MON_DATA_HP_EV + j, &gBattleResources->secretBase->party.EVs[i]);
for (j = 0; j < 4; j++)
for (j = 0; j < MAX_MON_MOVES; j++)
{
SetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j, &gBattleResources->secretBase->party.moves[i * 4 + j]);
SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gBattleMoves[gBattleResources->secretBase->party.moves[i * 4 + j]].pp);
@@ -4938,7 +4938,7 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
gBattleMons[battlerId].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES, NULL);
gBattleMons[battlerId].item = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HELD_ITEM, NULL);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
gBattleMons[battlerId].moves[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MOVE1 + i, NULL);
gBattleMons[battlerId].pp[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PP1 + i, NULL);
@@ -6480,7 +6480,7 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
int i, j, k;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
for (i = 0; i < 20; i++)
@@ -6494,10 +6494,10 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
if (moveLevel <= (level << 9))
{
for (j = 0; j < 4 && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
;
if (j == 4)
if (j == MAX_MON_MOVES)
{
for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
;
@@ -6534,7 +6534,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
if (species == SPECIES_EGG)
return 0;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
for (i = 0; i < 20; i++)
@@ -6548,10 +6548,10 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
if (moveLevel <= (level << 9))
{
for (j = 0; j < 4 && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
;
if (j == 4)
if (j == MAX_MON_MOVES)
{
for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
;
@@ -6795,7 +6795,7 @@ void BoxMonRestorePP(struct BoxPokemon *boxMon)
{
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, 0))
{