Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StepHappiness::
- ; Raise the party's happiness by 1 point every 512 steps.
- ld hl, wHappinessStepCount
- inc [hl]
- ld a, [hl]
- and 1
- ret nz
- ld de, wPartyCount
- ld a, [de]
- and a
- ret z
- ld c, a
- ld hl, wPartyMon1Happiness
- .loop
- inc de
- ld a, [de]
- cp EGG
- jr z, .next
- inc [hl] ; increase happiness
- jr nz, .doIncrement
- dec [hl]
- jr .next
- .doIncrement
- push hl
- push bc
- ld bc, MON_ITEM - MON_HAPPINESS
- add hl, bc
- pop bc
- ld a, [hl]
- pop hl
- cp SOOTHE_BELL
- jr nz, .next
- inc [hl]
- jr nz, .next
- dec [hl]
- .next
- push de
- ld de, PARTYMON_STRUCT_LENGTH
- add hl, de
- pop de
- dec c
- jr nz, .loop
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement