summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pokemon.c')
-rw-r--r--src/pokemon.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index a30e20ea2..4d14e61c2 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -2943,12 +2943,12 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
u16 moveLevel;
u16 move;
- moveLevel = (gLevelUpLearnsets[species][i] & 0xFE00);
+ moveLevel = (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV);
if (moveLevel > (level << 9))
break;
- move = (gLevelUpLearnsets[species][i] & 0x1FF);
+ move = (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID);
if (GiveMoveToBoxMon(boxMon, move) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, move);
@@ -2969,7 +2969,7 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
{
sLearningMoveTableID = 0;
- while ((gLevelUpLearnsets[species][sLearningMoveTableID] & 0xFE00) != (level << 9))
+ while ((gLevelUpLearnsets[species][sLearningMoveTableID] & LEVEL_UP_MOVE_LV) != (level << 9))
{
sLearningMoveTableID++;
if (gLevelUpLearnsets[species][sLearningMoveTableID] == LEVEL_UP_END)
@@ -2977,9 +2977,9 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
}
}
- if ((gLevelUpLearnsets[species][sLearningMoveTableID] & 0xFE00) == (level << 9))
+ if ((gLevelUpLearnsets[species][sLearningMoveTableID] & LEVEL_UP_MOVE_LV) == (level << 9))
{
- gMoveToLearn = (gLevelUpLearnsets[species][sLearningMoveTableID] & 0x1FF);
+ gMoveToLearn = (gLevelUpLearnsets[species][sLearningMoveTableID] & LEVEL_UP_MOVE_ID);
sLearningMoveTableID++;
retVal = GiveMoveToMon(mon, gMoveToLearn);
}
@@ -6112,23 +6112,23 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
u16 moveLevel;
- if (gLevelUpLearnsets[species][i] == 0xFFFF)
+ if (gLevelUpLearnsets[species][i] == LEVEL_UP_END)
break;
- moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
+ moveLevel = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV;
if (moveLevel <= (level << 9))
{
- for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
+ for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID); j++)
;
if (j == MAX_MON_MOVES)
{
- for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
+ for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID); k++)
;
if (k == numMoves)
- moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID;
}
}
}
@@ -6141,8 +6141,8 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
u8 numMoves = 0;
int i;
- for (i = 0; i < 20 && gLevelUpLearnsets[species][i] != 0xFFFF; i++)
- moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+ for (i = 0; i < 20 && gLevelUpLearnsets[species][i] != LEVEL_UP_END; i++)
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID;
return numMoves;
}
@@ -6166,23 +6166,23 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
u16 moveLevel;
- if (gLevelUpLearnsets[species][i] == 0xFFFF)
+ if (gLevelUpLearnsets[species][i] == LEVEL_UP_END)
break;
- moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
+ moveLevel = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV;
if (moveLevel <= (level << 9))
{
- for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
+ for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID); j++)
;
if (j == MAX_MON_MOVES)
{
- for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
+ for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID); k++)
;
if (k == numMoves)
- moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID;
}
}
}