pokeyellow/engine/items/tmhm.asm
luckytyphlosion 6dc1f939e1 bankB misc functions
ScaleSpriteByTwo, DisplayEffectiveness and CheckIfMoveIsKnown
2015-11-29 15:09:32 -05:00

27 lines
482 B
NASM
Executable File

; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
CheckIfMoveIsKnown: ; 2fd42 (b:7d42)
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: ; 2fd65 (b:7d65)
TX_FAR _AlreadyKnowsText
db "@"