diff options
-rwxr-xr-x | engine/events/pokerus/check_pokerus.asm | 25 | ||||
-rw-r--r-- | main.asm | 4 |
2 files changed, 27 insertions, 2 deletions
diff --git a/engine/events/pokerus/check_pokerus.asm b/engine/events/pokerus/check_pokerus.asm new file mode 100755 index 00000000..201a3713 --- /dev/null +++ b/engine/events/pokerus/check_pokerus.asm @@ -0,0 +1,25 @@ +_CheckPokerus: +; Return carry if a monster in your party has Pokerus + +; Get number of monsters to iterate over + ld a, [wPartyCount] + and a + jr z, .NoPokerus + ld b, a +; Check each monster in the party for Pokerus + ld hl, wPartyMon1PokerusStatus + 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 @@ -373,8 +373,8 @@ INCLUDE "engine/pokemon/mail_2.asm" SECTION "bank31_2", ROMX -_CheckPokerus:: - dr $c7a40, $c7a5a +INCLUDE "engine/events/pokerus/check_pokerus.asm" + CheckForLuckyNumberWinners:: dr $c7a5a, $c7bad PrintTodaysLuckyNumber:: |