Evolution moves - pret/pokecrystal GitHub Wiki
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
- Define a table of evolution moves
- Revise level-up movesets to match evolution moves
- Actually learn evolution moves
1. Define a table of evolution moves
Create data/pokemon/evolution_moves.asm:
+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 (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:
+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:
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.