summaryrefslogtreecommitdiff
path: root/engine/items/tmhm.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/items/tmhm.asm')
-rwxr-xr-xengine/items/tmhm.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm
new file mode 100755
index 00000000..5b7b4e8e
--- /dev/null
+++ b/engine/items/tmhm.asm
@@ -0,0 +1,26 @@
+; checks if the mon in wWhichPokemon already knows the move in $d0e0
+CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
+ ld a, [wWhichPokemon]
+ ld hl, W_PARTYMON1_MOVE1
+ ld bc, $2c
+ call AddNTimes
+ ld a, [$d0e0]
+ ld b, a
+ ld c, $4 ; nubmer of 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: ; 2fe3b (b:7e3b)
+ TX_FAR _AlreadyKnowsText
+ db "@"