diff options
author | Daniel Harding <33dannye@gmail.com> | 2020-05-16 21:42:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 21:42:24 -0500 |
commit | 8a924f1f783572ff395f617f99546b4c949c8b04 (patch) | |
tree | 1b6c7de331cb983256651b11b8adf413a3a434f1 /engine/items/tmhm2.asm | |
parent | 88d7e9a34a8b610b358cec1ccc6660634ca9ce80 (diff) | |
parent | ed94962edf1668aba3f60938e8a5ba8040e2a59c (diff) |
Merge pull request #30 from entrpntr/spring-cleaning
Spring Cleaning
Diffstat (limited to 'engine/items/tmhm2.asm')
-rwxr-xr-x | engine/items/tmhm2.asm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/engine/items/tmhm2.asm b/engine/items/tmhm2.asm new file mode 100755 index 00000000..eb3eb58e --- /dev/null +++ b/engine/items/tmhm2.asm @@ -0,0 +1,46 @@ +CanLearnTMHMMove: + ld a, [wCurPartySpecies] + ld [wCurSpecies], a + call GetBaseData + ld hl, wBaseTMHM + push hl + + ld a, [wPutativeTMHMMove] + ld b, a + ld c, 0 + ld hl, TMHMMoves +.loop + ld a, [hli] + and a + jr z, .end + cp b + jr z, .asm_11a45 + inc c + jr .loop + +.asm_11a45 + pop hl + ld b, CHECK_FLAG + push de + ld d, 0 + predef SmallFarFlagAction + pop de + ret + +.end + pop hl + ld c, 0 + ret + +GetTMHMMove: + ld a, [wTempTMHM] + dec a + ld hl, TMHMMoves + ld b, 0 + ld c, a + add hl, bc + ld a, [hl] + ld [wTempTMHM], a + ret + +INCLUDE "data/moves/tmhm_moves.asm" |