add pokerus check

This commit is contained in:
yenatch 2013-01-14 01:03:14 -05:00
parent 9fbe7ea423
commit 80e760544d

View File

@ -18653,7 +18653,36 @@ TileTypeTable: ; 4ce1f
db $00, $00, $00, $00, $00, $00, $00, $0f
; 4cf1f
INCBIN "baserom.gbc",$4cf1f,$50000 - $4cf1f
INCBIN "baserom.gbc",$4cf1f,$4d860 - $4cf1f
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, PartyMon2 - PartyMon1
.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
; 4d87a
INCBIN "baserom.gbc",$4d87a,$50000 - $4d87a
SECTION "bank14",DATA,BANK[$14]