Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/items/tmhm.asm
1271 views
1
; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
2
CheckIfMoveIsKnown:
3
ld a, [wWhichPokemon]
4
ld hl, wPartyMon1Moves
5
ld bc, wPartyMon2 - wPartyMon1
6
call AddNTimes
7
ld a, [wMoveNum]
8
ld b, a
9
ld c, NUM_MOVES
10
.loop
11
ld a, [hli]
12
cp b
13
jr z, .alreadyKnown ; found a match
14
dec c
15
jr nz, .loop
16
and a
17
ret
18
.alreadyKnown
19
ld hl, AlreadyKnowsText
20
call PrintText
21
scf
22
ret
23
24
AlreadyKnowsText:
25
text_far _AlreadyKnowsText
26
text_end
27
28