mirror of
https://github.com/pret/pokered.git
synced 2024-10-24 07:25:21 +00:00
36 lines
560 B
NASM
Executable file
36 lines
560 B
NASM
Executable file
; tests if mon [wcf91] can learn move [wMoveNum]
|
|
CanLearnTM:
|
|
ld a, [wcf91]
|
|
ld [wd0b5], a
|
|
call GetMonHeader
|
|
ld hl, wMonHLearnset
|
|
push hl
|
|
ld a, [wMoveNum]
|
|
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
|
|
ld b, FLAG_TEST
|
|
predef_jump FlagActionPredef
|
|
|
|
; converts TM/HM number in wd11e into move number
|
|
; HMs start at 51
|
|
TMToMove:
|
|
ld a, [wd11e]
|
|
dec a
|
|
ld hl, TechnicalMachines
|
|
ld b, $0
|
|
ld c, a
|
|
add hl, bc
|
|
ld a, [hl]
|
|
ld [wd11e], a
|
|
ret
|
|
|
|
INCLUDE "data/tms.asm"
|