Advertisement
Guest User

Untitled

a guest
Sep 27th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. StepHappiness::
  2. ; Raise the party's happiness by 1 point every other step cycle.
  3.  
  4.     ld hl, wHappinessStepCount
  5.     ld a, [hl]
  6.     inc a
  7.     and 1
  8.     ld [hl], a
  9.     ret nz
  10.  
  11.     ld de, wPartyCount
  12.     ld a, [de]
  13.     and a
  14.     ret z
  15.  
  16.     ld c, a
  17.     ld hl, wPartyMon1Happiness
  18. .loop
  19.     inc de
  20.     ld a, [de]
  21.     cp EGG
  22.     jr z, .next
  23.     inc [hl] ; increase wPartyMon1Happiness
  24.     jr nz, .doIncrement
  25.     ld [hl], $ff
  26. .doIncrement
  27.     push hl
  28.     ld hl, wPartyMon1Item
  29.     ld a, [wPartyCount]
  30.     sub c
  31.     jr z, .skipIncrement
  32.     push bc
  33.     ld bc, PARTYMON_STRUCT_LENGTH
  34.     call AddNTimes
  35.     pop bc
  36. .skipIncrement
  37.     ld a, [hl]
  38.     pop hl
  39.     cp SOOTHE_BELL
  40.     jr nz, .skipSoothe
  41.     inc [hl]
  42. .skipSoothe
  43.     jr nz, .next
  44.     ld [hl], $ff
  45.  
  46. .next
  47.     push de
  48.     ld de, PARTYMON_STRUCT_LENGTH
  49.     add hl, de
  50.     pop de
  51.     dec c
  52.     jr nz, .loop
  53.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement