mirror of
https://github.com/pret/pokered.git
synced 2024-10-24 07:25:21 +00:00
26 lines
448 B
NASM
Executable file
26 lines
448 B
NASM
Executable file
; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
|
|
CheckIfMoveIsKnown:
|
|
ld a, [wWhichPokemon]
|
|
ld hl, wPartyMon1Moves
|
|
ld bc, wPartyMon2 - wPartyMon1
|
|
call AddNTimes
|
|
ld a, [wMoveNum]
|
|
ld b, a
|
|
ld c, NUM_MOVES
|
|
.loop
|
|
ld a, [hli]
|
|
cp b
|
|
jr z, .alreadyKnown ; found a match
|
|
dec c
|
|
jr nz, .loop
|
|
and a
|
|
ret
|
|
.alreadyKnown
|
|
ld hl, AlreadyKnowsText
|
|
call PrintText
|
|
scf
|
|
ret
|
|
|
|
AlreadyKnowsText:
|
|
TX_FAR _AlreadyKnowsText
|
|
db "@"
|