ref: 80e760544d7504131227a9916618a7229bb1a860
parent: 9fbe7ea42390e7a0d6a1288f076d7951ce66b5eb
author: yenatch <yenatch@gmail.com>
date: Sun Jan 13 20:03:14 EST 2013
add pokerus check
--- a/main.asm
+++ b/main.asm
@@ -18653,7 +18653,36 @@
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]
--
⑨