You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Group Pokérus files in engine/pokerus/
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
ApplyPokerusTick: ; 13988
|
||||
; decreases all pokemon's pokerus counter by b. if the lower nybble reaches zero, the pokerus is cured.
|
||||
ld hl, PartyMon1PokerusStatus ; PartyMon1 + MON_PKRS
|
||||
ld a, [PartyCount]
|
||||
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
|
@@ -1,25 +0,0 @@
|
||||
CheckPokerus: ; 4d860
|
||||
; Return carry if a monster in your party has Pokerus
|
||||
|
||||
; Get number of monsters to iterate over
|
||||
ld a, [PartyCount]
|
||||
and a
|
||||
jr z, .NoPokerus
|
||||
ld b, a
|
||||
; Check each monster in the party for Pokerus
|
||||
ld hl, PartyMon1PokerusStatus
|
||||
ld de, PARTYMON_STRUCT_LENGTH
|
||||
.Check:
|
||||
ld a, [hl]
|
||||
and $0f ; only the bottom nybble is used
|
||||
jr nz, .HasPokerus
|
||||
; Next PartyMon
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .Check
|
||||
.NoPokerus:
|
||||
and a
|
||||
ret
|
||||
.HasPokerus:
|
||||
scf
|
||||
ret
|
Reference in New Issue
Block a user