shithub: pokecrystal

ref: 6e62eabb42cb8c933e77d84768353c5fec47cf3a
dir: /engine/routines/leveluphappinessmod.asm/

View raw version
LevelUpHappinessMod: ; 2709e
	ld a, [wCurPartyMon]
	ld hl, wPartyMon1CaughtLocation
	call GetPartyLocation
	ld a, [hl]
	and $7f
	ld d, a
	ld a, [wMapGroup]
	ld b, a
	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