summaryrefslogtreecommitdiff
path: root/engine/pokemon/leveluphappinessmod.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/pokemon/leveluphappinessmod.asm')
-rw-r--r--engine/pokemon/leveluphappinessmod.asm20
1 files changed, 20 insertions, 0 deletions
diff --git a/engine/pokemon/leveluphappinessmod.asm b/engine/pokemon/leveluphappinessmod.asm
new file mode 100644
index 000000000..8c6dd92fe
--- /dev/null
+++ b/engine/pokemon/leveluphappinessmod.asm
@@ -0,0 +1,20 @@
+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