summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-01-14 01:03:14 -0500
committeryenatch <yenatch@gmail.com>2013-01-14 01:03:14 -0500
commit80e760544d7504131227a9916618a7229bb1a860 (patch)
treefd0125af58868f3bba7a76fdf65afcbfbae808bf
parent9fbe7ea42390e7a0d6a1288f076d7951ce66b5eb (diff)
add pokerus check
-rw-r--r--main.asm31
1 files changed, 30 insertions, 1 deletions
diff --git a/main.asm b/main.asm
index dfa6cf80c..2c1cdd3ab 100644
--- a/main.asm
+++ b/main.asm
@@ -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]