diff options
| author | libjet <libj3t@gmail.com> | 2020-05-29 16:38:56 +0100 |
|---|---|---|
| committer | libjet <libj3t@gmail.com> | 2020-05-29 16:38:56 +0100 |
| commit | f0212e7fb938415fa20014b1ed013795b537a489 (patch) | |
| tree | 532650c25a60455ce74325c3e4111252345e11a0 /engine | |
| parent | 3a9930b9d4348cf0a67861438d7af32fbb60d812 (diff) | |
Add engine/events/pokerus/check_pokerus.asm
Diffstat (limited to 'engine')
| -rwxr-xr-x | engine/events/pokerus/check_pokerus.asm | 25 |
1 files changed, 25 insertions, 0 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 |
