mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-04-24 14:59:33 -05:00
Some checks failed
CI / build (push) Has been cancelled
* Fully labelled bank09.asm, started bank03.asm * Finished labelling bank03.asm and bank0b.asm * Tying up loose ends, splitting most of the completely labelled bank dumps * Moved pokedex letter graphics out of charmap
51 lines
848 B
NASM
51 lines
848 B
NASM
INCLUDE "constants.asm"
|
|
|
|
SECTION "engine/items/tmhm.asm", ROMX
|
|
|
|
CanLearnTMHMMove:
|
|
; Gets the index of TM or HM with move ID wPutativeTMHMMove,
|
|
; then checks the corresponding flag in wCurPartySpecies's learnset.
|
|
; Sets register c to 1 if TM/HM is in learnset OR if debug is enabled.
|
|
ld a, [wDebugFlags]
|
|
ld c, 01
|
|
bit DEBUG_FIELD_F, a
|
|
ret nz
|
|
|
|
ld a, [wCurPartySpecies]
|
|
ld [wCurSpecies], a
|
|
call GetBaseData
|
|
ld hl, wMonHLearnset
|
|
push hl
|
|
|
|
ld a, [wPutativeTMHMMove]
|
|
ld b, a
|
|
ld c, 0
|
|
ld hl, TMHMMoves
|
|
.loop
|
|
ld a, [hli]
|
|
cp b
|
|
jr z, .jump
|
|
inc c
|
|
jr .loop
|
|
|
|
.jump
|
|
pop hl
|
|
ld b, CHECK_FLAG
|
|
push de
|
|
ld d, 0
|
|
predef SmallFarFlagAction
|
|
pop de
|
|
ret
|
|
|
|
GetTMHMMove:
|
|
; converts TM/HM list index to TM/HM move ID
|
|
ld a, [wNamedObjectIndexBuffer]
|
|
dec a
|
|
ld hl, TMHMMoves
|
|
ld b, 0
|
|
ld c, a
|
|
add hl, bc
|
|
ld a, [hl]
|
|
ld [wNamedObjectIndexBuffer], a
|
|
ret
|