Remove all code from main.asm (some labeled INCBINs, like out-of-context graphics, are still present)
engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content.
This commit is contained in:
25
engine/routines/checkpokerus.asm
Normal file
25
engine/routines/checkpokerus.asm
Normal file
@@ -0,0 +1,25 @@
|
||||
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, 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
|
Reference in New Issue
Block a user