ported Red++ levelup code

This commit is contained in:
Thorn Avery 2023-09-23 09:28:44 +10:00
parent 94dc5cbc5c
commit f95cdb0911
2 changed files with 15 additions and 0 deletions

View file

@ -174,6 +174,7 @@ GainExperience:
farcall CalcLevelFromExperience
pop hl
ld a, [hl] ; current level
ld [wTempLevel], a
cp d
jp z, .nextMon ; if level didn't change, go to next mon
ld a, [wCurEnemyLVL]
@ -269,7 +270,20 @@ GainExperience:
ld [wMonDataLocation], a
ld a, [wd0b5]
ld [wd11e], a
ld a, [wCurEnemyLVL]
ld c, a
ld a, [wTempLevel]
ld b, a
.level_loop
inc b
ld a, b
ld [wCurEnemyLVL], a
push bc
predef LearnMoveFromLevelUp
pop bc
ld a, b
cp c
jr nz, .level_loop
ld hl, wCanEvolveFlags
ld a, [wWhichPokemon]
ld c, a

View file

@ -203,6 +203,7 @@ ENDU
SECTION "Overworld Map", WRAM0
UNION
wTempLevel::
wOverworldMap:: ds 1300
wOverworldMapEnd::