pokecrystal/engine/routines/leveluphappinessmod.asm

21 lines
333 B
NASM
Raw Normal View History

LevelUpHappinessMod: ; 2709e
2018-01-23 22:39:09 +00:00
ld a, [wCurPartyMon]
ld hl, wPartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and $7f
ld d, a
2018-01-23 22:39:09 +00:00
ld a, [wMapGroup]
ld b, a
2018-01-23 22:39:09 +00:00
ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp d
ld c, HAPPINESS_GAINLEVEL
jr nz, .ok
ld c, HAPPINESS_GAINLEVELATHOME
.ok
callfar ChangeHappiness
ret