pokered/engine/items/tmhm.asm

27 lines
448 B
NASM
Raw Normal View History

2015-02-08 08:17:03 +00:00
; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
2016-06-12 00:24:04 +00:00
CheckIfMoveIsKnown:
2014-05-22 22:13:20 +00:00
ld a, [wWhichPokemon]
ld hl, wPartyMon1Moves
2015-02-08 08:17:03 +00:00
ld bc, wPartyMon2 - wPartyMon1
2014-05-22 22:13:20 +00:00
call AddNTimes
2015-02-08 08:17:03 +00:00
ld a, [wMoveNum]
2014-05-22 22:13:20 +00:00
ld b, a
2015-02-08 08:17:03 +00:00
ld c, NUM_MOVES
2014-05-22 22:13:20 +00:00
.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
2016-06-12 00:24:04 +00:00
AlreadyKnowsText:
2014-05-22 22:13:20 +00:00
TX_FAR _AlreadyKnowsText
db "@"