summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Learn-moves-upon-evolution.md32
1 files changed, 31 insertions, 1 deletions
diff --git a/Learn-moves-upon-evolution.md b/Learn-moves-upon-evolution.md
index 411749c..4e16576 100644
--- a/Learn-moves-upon-evolution.md
+++ b/Learn-moves-upon-evolution.md
@@ -1,4 +1,4 @@
-Credit to Zeturic and UltimaSoul for this feature.
+Credit to Zeturic and UltimaSoul for this feature, and to ExpoSeed and Lunos for modifying it.
This tutorial will allow Pokemon to learn moves immediately after evolving, like in Gen 7. This is useful because it avoids a situation where a Pokemon (like Feebas) has no useful or damaging moves because it evolved slightly too late.
@@ -105,6 +105,36 @@ And edit `Task_TradeEvolutionScene` of [src/evolution_scene.c](../blob/master/sr
}
break;
```
+
+We also need to fix the generation of moves when a mon is initially created. Otherwise, new mons will start with their level 0 moves learned. To fix this, edit [src/pokemon.c](../blob/master/src/pokemon.c):
+
+```diff
+ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
+ {
+ u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
+ s32 level = GetLevelFromBoxMonExp(boxMon);
+ s32 i;
+
+ for (i = 0; gLevelUpLearnsets[species][i] != LEVEL_UP_END; i++)
+ {
+ u16 moveLevel;
+ u16 move;
+
+ moveLevel = (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_LV);
+
++ if (moveLevel == 0)
++ continue;
+
+ if (moveLevel > (level << 9))
+ break;
+
+ move = (gLevelUpLearnsets[species][i] & LEVEL_UP_MOVE_ID);
+
+ if (GiveMoveToBoxMon(boxMon, move) == MON_HAS_MAX_MOVES)
+ DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, move);
+ }
+ }
+```
Finally, we need to actually give our mons evolution moves. This info can be found in [src/data/pokemon/level_up_learnsets.h](../blob/master/src/data/pokemon/level_up_learnsets.h). The moves need to be at the beginning of the list and at level 0. Here is an example of what this looks like:
```c
static const u16 sMarshtompLevelUpLearnset[] = {