mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
104 lines
1.5 KiB
NASM
104 lines
1.5 KiB
NASM
MoveTutor: ; 4925b
|
|
call FadeToMenu
|
|
call ClearBGPalettes
|
|
call ClearScreen
|
|
call DelayFrame
|
|
ld b, SCGB_PACKPALS
|
|
call GetSGBLayout
|
|
xor a
|
|
ld [wItemAttributeParamBuffer], a
|
|
call .GetMoveTutorMove
|
|
ld [wd265], a
|
|
ld [wPutativeTMHMMove], a
|
|
call GetMoveName
|
|
call CopyName1
|
|
farcall ChooseMonToLearnTMHM
|
|
jr c, .cancel
|
|
jr .enter_loop
|
|
|
|
.loop
|
|
farcall ChooseMonToLearnTMHM_NoRefresh
|
|
jr c, .cancel
|
|
.enter_loop
|
|
call CheckCanLearnMoveTutorMove
|
|
jr nc, .loop
|
|
xor a ; FALSE
|
|
ld [ScriptVar], a
|
|
jr .quit
|
|
|
|
.cancel
|
|
ld a, -1
|
|
ld [ScriptVar], a
|
|
.quit
|
|
call CloseSubmenu
|
|
ret
|
|
|
|
.GetMoveTutorMove: ; 492a5
|
|
ld a, [ScriptVar]
|
|
cp MOVETUTOR_FLAMETHROWER
|
|
jr z, .flamethrower
|
|
cp MOVETUTOR_THUNDERBOLT
|
|
jr z, .thunderbolt
|
|
; MOVETUTOR_ICE_BEAM
|
|
ld a, ICE_BEAM
|
|
ret
|
|
|
|
.flamethrower
|
|
ld a, FLAMETHROWER
|
|
ret
|
|
|
|
.thunderbolt
|
|
ld a, THUNDERBOLT
|
|
ret
|
|
|
|
CheckCanLearnMoveTutorMove: ; 492b9
|
|
ld hl, .MenuHeader
|
|
call LoadMenuHeader
|
|
|
|
predef CanLearnTMHMMove
|
|
|
|
push bc
|
|
ld a, [CurPartyMon]
|
|
ld hl, PartyMonNicknames
|
|
call GetNick
|
|
pop bc
|
|
|
|
ld a, c
|
|
and a
|
|
jr nz, .can_learn
|
|
push de
|
|
ld de, SFX_WRONG
|
|
call PlaySFX
|
|
pop de
|
|
ld a, BANK(Text_TMHMNotCompatible)
|
|
ld hl, Text_TMHMNotCompatible
|
|
call FarPrintText
|
|
jr .didnt_learn
|
|
|
|
.can_learn
|
|
callfar KnowsMove
|
|
jr c, .didnt_learn
|
|
|
|
predef LearnMove
|
|
ld a, b
|
|
and a
|
|
jr z, .didnt_learn
|
|
|
|
ld c, HAPPINESS_LEARNMOVE
|
|
callfar ChangeHappiness
|
|
jr .learned
|
|
|
|
.didnt_learn
|
|
call ExitMenu
|
|
and a
|
|
ret
|
|
|
|
.learned
|
|
call ExitMenu
|
|
scf
|
|
ret
|
|
|
|
.MenuHeader: ; 0x4930a
|
|
db MENU_BACKUP_TILES ; flags
|
|
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|