diff options
author | ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> | 2020-07-27 18:49:19 -0500 |
---|---|---|
committer | ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> | 2020-07-27 18:49:19 -0500 |
commit | 83c6956ed230a68a37201ec39f34e0fdf754675d (patch) | |
tree | 5a995f57bcb742c31f69d50586db41ff0d8928f8 | |
parent | 9f951e087facd6f0301dcdec36ccfb2cfadbb842 (diff) |
Updated Learn moves upon evolution (markdown)
-rw-r--r-- | Learn-moves-upon-evolution.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Learn-moves-upon-evolution.md b/Learn-moves-upon-evolution.md index 4e16576..60e0eeb 100644 --- a/Learn-moves-upon-evolution.md +++ b/Learn-moves-upon-evolution.md @@ -13,7 +13,7 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL); - + s32 i; // since you can learn more than one move per level // the game needs to know whether you decided to // learn it or keep the old set to avoid asking @@ -22,11 +22,12 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) { sLearningMoveTableID = 0; } - while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_END) + for (i = 0; gLevelUpLearnsets[species][i] != LEVEL_UP_END; i++) { - while (!gLevelUpLearnsets[species][sLearningMoveTableID].level || gLevelUpLearnsets[species][sLearningMoveTableID].level == level) + moveLevel = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV; + while (moveLevel == 0 || moveLevel == (level << 9)) { - gMoveToLearn = gLevelUpLearnsets[species][sLearningMoveTableID].move; + gMoveToLearn = gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID; sLearningMoveTableID++; return GiveMoveToMon(mon, gMoveToLearn); } |