mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-07 00:25:24 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
26
engine/events/pokerus/apply_pokerus_tick.asm
Normal file
26
engine/events/pokerus/apply_pokerus_tick.asm
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
ApplyPokerusTick:
|
||||
; decreases all pokemon's pokerus counter by b. if the lower nybble reaches zero, the pokerus is cured.
|
||||
ld hl, wPartyMon1PokerusStatus ; wPartyMon1 + MON_PKRS
|
||||
ld a, [wPartyCount]
|
||||
and a
|
||||
ret z ; make sure it's not wasting time on an empty party
|
||||
ld c, a
|
||||
.loop
|
||||
ld a, [hl]
|
||||
and $f ; lower nybble is the number of days remaining
|
||||
jr z, .next ; if already 0, skip
|
||||
sub b ; subtract the number of days
|
||||
jr nc, .ok ; max(result, 0)
|
||||
xor a
|
||||
.ok
|
||||
ld d, a ; back up this value because we need to preserve the strain (upper nybble)
|
||||
ld a, [hl]
|
||||
and $f0
|
||||
add d
|
||||
ld [hl], a ; this prevents a cured pokemon from recontracting pokerus
|
||||
.next
|
||||
ld de, PARTYMON_STRUCT_LENGTH
|
||||
add hl, de
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue