SHOW:
|
|
- or go back to the newest paste.
| 1 | StepHappiness:: | |
| 2 | - | ; Raise the party's happiness by 1 point every other step cycle. |
| 2 | + | ; Raise the party's happiness by 1 point every 512 steps. |
| 3 | ||
| 4 | ld hl, wHappinessStepCount | |
| 5 | inc [hl] | |
| 6 | - | inc a |
| 6 | + | |
| 7 | and 1 | |
| 8 | - | ld [hl], a |
| 8 | + | |
| 9 | ||
| 10 | ld de, wPartyCount | |
| 11 | ld a, [de] | |
| 12 | and a | |
| 13 | ret z | |
| 14 | ||
| 15 | ld c, a | |
| 16 | ld hl, wPartyMon1Happiness | |
| 17 | .loop | |
| 18 | inc de | |
| 19 | ld a, [de] | |
| 20 | cp EGG | |
| 21 | jr z, .next | |
| 22 | inc [hl] ; increase happiness | |
| 23 | - | inc [hl] ; increase wPartyMon1Happiness |
| 23 | + | |
| 24 | dec [hl] | |
| 25 | - | ld [hl], $ff |
| 25 | + | jr .next |
| 26 | ||
| 27 | .doIncrement | |
| 28 | - | ld hl, wPartyMon1Item |
| 28 | + | |
| 29 | - | ld a, [wPartyCount] |
| 29 | + | |
| 30 | - | sub c |
| 30 | + | ld bc, MON_ITEM - MON_HAPPINESS |
| 31 | - | jr z, .skipIncrement |
| 31 | + | add hl, bc |
| 32 | pop bc | |
| 33 | - | ld bc, PARTYMON_STRUCT_LENGTH |
| 33 | + | |
| 34 | - | call AddNTimes |
| 34 | + | |
| 35 | cp SOOTHE_BELL | |
| 36 | - | .skipIncrement |
| 36 | + | jr nz, .next |
| 37 | ||
| 38 | inc [hl] | |
| 39 | jr nz, .next | |
| 40 | - | jr nz, .skipSoothe |
| 40 | + | dec [hl] |
| 41 | .next | |
| 42 | - | .skipSoothe |
| 42 | + | |
| 43 | ld de, PARTYMON_STRUCT_LENGTH | |
| 44 | - | ld [hl], $ff |
| 44 | + | |
| 45 | pop de | |
| 46 | dec c | |
| 47 | jr nz, .loop | |
| 48 | ret |