pokered/engine/items/tms.asm

37 lines
573 B
NASM
Raw Normal View History

2015-02-08 08:17:03 +00:00
; tests if mon [wcf91] can learn move [wMoveNum]
2016-06-12 00:24:04 +00:00
CanLearnTM:
ld a, [wcf91]
ld [wd0b5], a
2014-05-22 22:13:20 +00:00
call GetMonHeader
2015-08-31 02:38:41 +00:00
ld hl, wMonHLearnset
2014-05-22 22:13:20 +00:00
push hl
2015-02-08 08:17:03 +00:00
ld a, [wMoveNum]
2014-05-22 22:13:20 +00:00
ld b, a
ld c, $0
ld hl, TechnicalMachines
.findTMloop
ld a, [hli]
cp b
jr z, .TMfoundLoop
inc c
jr .findTMloop
.TMfoundLoop
pop hl
2015-07-20 03:45:34 +00:00
ld b, FLAG_TEST
predef_jump FlagActionPredef
2014-05-22 22:13:20 +00:00
; converts TM/HM number in wd11e into move number
2014-05-22 22:13:20 +00:00
; HMs start at 51
2016-06-12 00:24:04 +00:00
TMToMove:
ld a, [wd11e]
2014-05-22 22:13:20 +00:00
dec a
ld hl, TechnicalMachines
ld b, $0
ld c, a
add hl, bc
ld a, [hl]
ld [wd11e], a
2014-05-22 22:13:20 +00:00
ret
INCLUDE "data/moves/tmhm_moves.asm"