2018-06-24 07:09:41 -07:00
|
|
|
_CheckPokerus:
|
2017-12-24 16:35:35 -08:00
|
|
|
; Return carry if a monster in your party has Pokerus
|
|
|
|
|
|
|
|
; Get number of monsters to iterate over
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2017-12-24 16:35:35 -08:00
|
|
|
and a
|
|
|
|
jr z, .NoPokerus
|
|
|
|
ld b, a
|
|
|
|
; Check each monster in the party for Pokerus
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1PokerusStatus
|
2017-12-24 16:35:35 -08:00
|
|
|
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
|