WIP Document apprentice

This commit is contained in:
GriffinR
2019-11-14 18:56:18 -05:00
parent ef8370566f
commit fc3783b739
15 changed files with 3284 additions and 3228 deletions
+578 -563
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1,5 +1,4 @@
#define LEVEL_UP_MOVE(lvl, move) ((lvl << 9) | move)
#define LEVEL_UP_END 0xffff
static const u16 sBulbasaurLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
+17 -17
View File
@@ -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;
}
}
}
+4 -4
View File
@@ -1113,14 +1113,14 @@ void GetPlayerHallRecords(struct PlayerHallRecords *dst)
}
}
static bool32 sub_80E841C(struct Apprentice *arg0, struct Apprentice *arg1)
static bool32 sub_80E841C(struct Apprentice *mixApprentice, struct Apprentice *apprentices)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < APPRENTICE_COUNT; i++)
{
if (GetTrainerId(arg0->playerId) == GetTrainerId(arg1[i].playerId)
&& arg0->number == arg1[i].number)
if (GetTrainerId(mixApprentice->playerId) == GetTrainerId(apprentices[i].playerId)
&& mixApprentice->number == apprentices[i].number)
{
return TRUE;
}