2018-06-24 07:09:41 -07:00
|
|
|
MoveTutor:
|
2017-12-15 17:10:54 -08:00
|
|
|
call FadeToMenu
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearScreen
|
|
|
|
call DelayFrame
|
2023-07-26 08:01:20 -07:00
|
|
|
ld b, CGB_PACKPALS
|
|
|
|
call GetCGBLayout
|
2017-12-15 17:10:54 -08:00
|
|
|
xor a
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wItemAttributeValue], a
|
2017-12-15 17:10:54 -08:00
|
|
|
call .GetMoveTutorMove
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [wPutativeTMHMMove], a
|
|
|
|
call GetMoveName
|
|
|
|
call CopyName1
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ChooseMonToLearnTMHM
|
2017-12-15 17:10:54 -08:00
|
|
|
jr c, .cancel
|
|
|
|
jr .enter_loop
|
|
|
|
|
|
|
|
.loop
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ChooseMonToLearnTMHM_NoRefresh
|
2017-12-15 17:10:54 -08:00
|
|
|
jr c, .cancel
|
|
|
|
.enter_loop
|
|
|
|
call CheckCanLearnMoveTutorMove
|
|
|
|
jr nc, .loop
|
2018-01-11 22:40:20 -08:00
|
|
|
xor a ; FALSE
|
2023-09-30 10:12:57 -07:00
|
|
|
ldh [hScriptVar], a
|
2017-12-15 17:10:54 -08:00
|
|
|
jr .quit
|
|
|
|
|
|
|
|
.cancel
|
|
|
|
ld a, -1
|
2023-09-30 10:12:57 -07:00
|
|
|
ldh [hScriptVar], a
|
2017-12-15 17:10:54 -08:00
|
|
|
.quit
|
|
|
|
call CloseSubmenu
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetMoveTutorMove:
|
2023-09-30 10:12:57 -07:00
|
|
|
ldh a, [hScriptVar]
|
2018-01-11 22:40:20 -08:00
|
|
|
cp MOVETUTOR_FLAMETHROWER
|
2017-12-15 17:10:54 -08:00
|
|
|
jr z, .flamethrower
|
2018-01-11 22:40:20 -08:00
|
|
|
cp MOVETUTOR_THUNDERBOLT
|
2017-12-15 17:10:54 -08:00
|
|
|
jr z, .thunderbolt
|
2018-01-11 22:40:20 -08:00
|
|
|
; MOVETUTOR_ICE_BEAM
|
2020-07-06 13:53:05 -07:00
|
|
|
ld a, MT03_MOVE ; ICE_BEAM
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.flamethrower
|
2020-07-06 13:53:05 -07:00
|
|
|
ld a, MT01_MOVE ; FLAMETHROWER
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.thunderbolt
|
2020-07-06 13:53:05 -07:00
|
|
|
ld a, MT02_MOVE ; THUNDERBOLT
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
CheckCanLearnMoveTutorMove:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, .MenuHeader
|
|
|
|
call LoadMenuHeader
|
2017-12-15 17:10:54 -08:00
|
|
|
|
2018-01-16 11:30:10 -08:00
|
|
|
predef CanLearnTMHMMove
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
|
|
push bc
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
|
|
|
ld hl, wPartyMonNicknames
|
2021-03-17 13:16:02 -07:00
|
|
|
call GetNickname
|
2017-12-15 17:10:54 -08:00
|
|
|
pop bc
|
|
|
|
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr nz, .can_learn
|
|
|
|
push de
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call PlaySFX
|
|
|
|
pop de
|
2019-10-20 15:24:17 -07:00
|
|
|
ld a, BANK(TMHMNotCompatibleText)
|
|
|
|
ld hl, TMHMNotCompatibleText
|
2023-08-11 03:28:14 -07:00
|
|
|
call FarPrintText1bpp
|
2017-12-15 17:10:54 -08:00
|
|
|
jr .didnt_learn
|
|
|
|
|
|
|
|
.can_learn
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar KnowsMove
|
2017-12-15 17:10:54 -08:00
|
|
|
jr c, .didnt_learn
|
|
|
|
|
2018-01-16 11:30:10 -08:00
|
|
|
predef LearnMove
|
2017-12-15 17:10:54 -08:00
|
|
|
ld a, b
|
|
|
|
and a
|
|
|
|
jr z, .didnt_learn
|
|
|
|
|
|
|
|
ld c, HAPPINESS_LEARNMOVE
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar ChangeHappiness
|
2017-12-15 17:10:54 -08:00
|
|
|
jr .learned
|
|
|
|
|
|
|
|
.didnt_learn
|
|
|
|
call ExitMenu
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.learned
|
|
|
|
call ExitMenu
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
.MenuHeader:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|