summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
authorhuderlem <huderlem@gmail.com>2019-11-23 09:27:02 -0600
committerGitHub <noreply@github.com>2019-11-23 09:27:02 -0600
commitbef6150b59abb23380529099016f9deef8c558ca (patch)
tree1f89af901a1f634c7547f6f3ce0bbb8faf5bbee5 /src/pokemon.c
parente3f7f47321bbe399dfcfc422d53d9beb5caab788 (diff)
parentf039e897ca8229e6e9b104408bf48c2d4e0dcb4b (diff)
Merge pull request #909 from GriffinRichards/doc-apprentice
Document Apprentice
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 eba5a2ce2..376f400e6 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;
}
}
}