1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
Gen 7 introduced *evolution moves*: moves that a Pokémon learns when it evolves, regardless of its level. This is fairly simple to implement in pokecrystal.
## Contents
1. [Define a table of evolution moves](#1-define-a-table-of-evolution-moves)
2. [Revise level-up movesets to match evolution moves](#2-revise-level-up-movesets-to-match-evolution-moves)
3. [Actually learn evolution moves](#3-actually-learn-evolution-moves)
## 1. Define a table of evolution moves
Create **data/pokemon/evolution_moves.asm**:
```diff
+EvolutionMoves::
+ table_width 1, EvolutionMoves
+ db NO_MOVE ; BULBASAUR
+ db NO_MOVE ; IVYSAUR
+ db PETAL_DANCE ; VENUSAUR
+ db NO_MOVE ; CHARMANDER
+ db NO_MOVE ; CHARMELEON
+ db WING_ATTACK ; CHARIZARD
+ db NO_MOVE ; SQUIRTLE
+ db NO_MOVE ; WARTORTLE
+ db NO_MOVE ; BLASTOISE
+ ...
+ db NO_MOVE ; CATERPIE
+ db HARDEN ; METAPOD
+ db CONFUSION ; BUTTERFREE
+ db NO_MOVE ; WEEDLE
+ db HARDEN ; KAKUNA
+ db FURY_ATTACK ; BEEDRILL
+ ...
+ db SCARY_FACE ; RATICATE
+ ...
+ db CRUNCH ; ARBOK
+ ...
+ db THUNDERBOLT ; RAICHU
+ ...
+ db GUST ; VENOMOTH
+ ...
+ db TRI_ATTACK ; DUGTRIO
+ ...
+ db SWIFT ; PERSIAN
+ ...
+ db RAGE ; PRIMEAPE
+ ...
+ db SUBMISSION ; POLIWRATH
+ ...
+ db KINESIS ; KADABRA
+ db KINESIS ; ALAKAZAM
+ ...
+ db STRENGTH ; MACHAMP
+ ...
+ db WRAP ; TENTACRUEL
+ ...
+ db FURY_ATTACK ; RAPIDASH
+ ...
+ db WITHDRAW ; SLOWBRO
+ ...
+ db TRI_ATTACK ; MAGNETON
+ ...
+ db TRI_ATTACK ; DODRIO
+ ...
+ db STOMP ; EXEGGUTOR
+ ...
+ db DOUBLE_KICK ; HITMONLEE
+ db COMET_PUNCH ; HITMONCHAN
+ ...
+ db BITE ; GYARADOS
+ ...
+ db WATER_GUN ; VAPOREON
+ db THUNDERSHOCK ; JOLTEON
+ db EMBER ; FLAREON
+ ...
+ db SPIKE_CANNON ; OMASTAR
+ ...
+ db SLASH ; KABUTOPS
+ ...
+ db WING_ATTACK ; DRAGONITE
+ ...
+ db PETAL_DANCE ; MEGANIUM
+ ...
+ db AGILITY ; FURRET
+ ...
+ db SWORDS_DANCE ; ARIADOS
+ ...
+ db THUNDERPUNCH ; AMPHAROS
+ ...
+ db PERISH_SONG ; POLITOED
+ ...
+ db CONFUSION ; ESPEON
+ db PURSUIT ; UMBREON
+ ...
+ db IRON_TAIL ; STEELIX
+ ...
+ db METAL_CLAW ; SCIZOR
+ ...
+ db FURY_ATTACK ; PILOSWINE
+ ...
+ db OCTAZOOKA ; OCTILLERY
+ ...
+ db FURY_ATTACK ; DONPHAN
+ ...
+ db ROLLING_KICK ; HITMONTOP
+ ...
+ db NO_MOVE ; CELEBI
+ assert_table_length NUM_POKEMON
```
This is simply a table of 251 evolution moves, one for each Pokémon. I've left out the many `NO_MOVE`s, so make sure to complete the table correctly.
Some of the moves here are taken from [the S/M data](https://www.serebii.net/sunmoon/evolutionmoves.shtml) (like Petal Dance for Venusaur); others are moves that G/S/C Pokémon learned at the same level they evolved (like Thunderpunch for Ampharos); and a few are invented to make up for Gen 7 evolution moves that don't exist in Gen 2 (like Iron Tail for Steelix). Of course, feel free to design your own set.
## 2. Revise level-up movesets to match evolution moves
Edit [data/pokemon/evos_attacks.asm](../blob/master/data/pokemon/evos_attacks.asm):
```diff
+INCLUDE "data/pokemon/evolution_moves.asm"
INCLUDE "data/pokemon/evos_attacks_pointers.asm"
...
MetapodEvosAttacks:
...
db 1, HARDEN
- db 7, HARDEN
...
ButterfreeEvosAttacks:
...
db 1, CONFUSION
- db 10, CONFUSION
...
KakunaEvosAttacks:
...
db 1, HARDEN
- db 7, HARDEN
...
BeedrillEvosAttacks:
...
db 1, FURY_ATTACK
- db 10, FURY_ATTACK
...
RaticateEvosAttacks:
...
- db 20, SCARY_FACE
+ db 19, SCARY_FACE
...
VenomothEvosAttacks:
...
- db 31, GUST
+ db 30, GUST
...
PersianEvosAttacks:
...
+ db 1, SWIFT
...
PrimeapeEvosAttacks:
...
- db 28, RAGE
+ db 27, RAGE
...
PoliwrathEvosAttacks:
...
db 1, SUBMISSION
- db 35, SUBMISSION
...
MachampEvosAttacks:
...
+ db 27, STRENGTH
...
TentacruelEvosAttacks:
...
- db 30, WRAP
+ db 29, WRAP
...
RapidashEvosAttacks:
...
- db 40, FURY_ATTACK
+ db 39, FURY_ATTACK
...
SlowbroEvosAttacks:
...
- db 37, WITHDRAW
+ db 36, WITHDRAW
...
MagnetonEvosAttacks:
...
- db 35, TRI_ATTACK
+ db 29, TRI_ATTACK
+ db 35, SWIFT ; from G/S
...
DoduoEvosAttacks:
...
- db 21, TRI_ATTACK
+ db 21, QUICK_ATTACK
...
DodrioEvosAttacks:
...
- db 21, TRI_ATTACK
+ db 21, QUICK_ATTACK
db 25, RAGE
+ db 30, TRI_ATTACK
...
ExeggutorEvosAttacks:
...
- db 19, STOMP
+ db 1, STOMP
...
GyaradosEvosAttacks:
...
- db 20, BITE
+ db 1, BITE
...
OmastarEvosAttacks:
...
- db 40, SPIKE_CANNON
+ db 39, SPIKE_CANNON
...
KabutopsEvosAttacks:
...
- db 40, SLASH
+ db 39, SLASH
...
DragoniteEvosAttacks:
...
- db 55, WING_ATTACK
+ db 54, WING_ATTACK
...
FurretEvosAttacks:
...
+ db 14, AGILITY
...
AriadosEvosAttacks:
...
+ db 21, SWORDS_DANCE
...
AmpharosEvosAttacks:
...
- db 30, THUNDERPUNCH
+ db 29, THUNDERPUNCH
...
PolitoedEvosAttacks:
...
- db 35, PERISH_SONG
+ db 1, PERISH_SONG
...
PiloswineEvosAttacks:
...
- db 33, FURY_ATTACK
+ db 32, FURY_ATTACK
...
OctilleryEvosAttacks:
...
- db 25, OCTAZOOKA
+ db 24, OCTAZOOKA
...
DonphanEvosAttacks:
...
- db 25, FURY_ATTACK
+ db 24, FURY_ATTACK
...
```
Here we `INCLUDE` data/pokemon/evolution_moves.asm in the same bank as the level-up movesets.
We've also revised the learnsets somewhat, in order to guarantee two properties:
- One, evolution moves should not also be learned at level-up. Otherwise, you could be prompted to learn the move twice if you stop learning it the first time. (We do need to allow learning evolution moves and level-up moves separately, since, for example, Abra can evolve into Kadabra at level 16, learn Kinesis by evolution, and learn Confusion by level-up.)
- Two, evolution moves should still appear in learnsets, in roughly the same order as before. This is so that wild Pokémon and enemy trainers' Pokémon with default movesets will still know those moves.
My solution here is usually to learn moves one level earlier. For example, if Rattata evolves into Raticate at level 20 and Raticate's evolution move is Scary Face, Raticate should learn Scary Face at level 19 instead of level 20.
## 3. Actually learn evolution moves
Edit [engine/pokemon/evolve.asm](../blob/master/engine/pokemon/evolve.asm):
```diff
EvolvePokemon:
...
ld a, [wCurSpecies]
ld [wTempSpecies], a
xor a
ld [wMonType], a
+ call LearnEvolutionMove
call LearnLevelMoves
ld a, [wTempSpecies]
dec a
call SetSeenAndCaughtMon
...
.ReturnToMap:
...
ret
+
+LearnEvolutionMove:
+ ld a, [wTempSpecies]
+ ld [wCurPartySpecies], a
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, EvolutionMoves
+ add hl, bc
+ ld a, [hl]
+ and a
+ ret z
+
+ push hl
+ ld d, a
+ ld hl, wPartyMon1Moves
+ ld a, [wCurPartyMon]
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+
+ ld b, NUM_MOVES
+.check_move
+ ld a, [hli]
+ cp d
+ jr z, .has_move
+ dec b
+ jr nz, .check_move
+
+ ld a, d
+ ld [wPutativeTMHMMove], a
+ ld [wNamedObjectIndex], a
+ call GetMoveName
+ call CopyName1
+ predef LearnMove
+ ld a, [wCurPartySpecies]
+ ld [wTempSpecies], a
+
+.has_move
+ pop hl
+ ret
```
That's it; now Pokémon will try to learn their evolution move, if they have one, before their level-up moves.

|