2018-06-24 14:09:41 +00:00
|
|
|
MoveTutor:
|
2017-12-16 01:10:54 +00:00
|
|
|
call FadeToMenu
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearScreen
|
|
|
|
call DelayFrame
|
|
|
|
ld b, SCGB_PACKPALS
|
|
|
|
call GetSGBLayout
|
|
|
|
xor a
|
|
|
|
ld [wItemAttributeParamBuffer], a
|
|
|
|
call .GetMoveTutorMove
|
2018-07-28 23:27:34 +00:00
|
|
|
ld [wNamedObjectIndexBuffer], a
|
2017-12-16 01:10:54 +00:00
|
|
|
ld [wPutativeTMHMMove], a
|
|
|
|
call GetMoveName
|
|
|
|
call CopyName1
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ChooseMonToLearnTMHM
|
2017-12-16 01:10:54 +00:00
|
|
|
jr c, .cancel
|
|
|
|
jr .enter_loop
|
|
|
|
|
|
|
|
.loop
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ChooseMonToLearnTMHM_NoRefresh
|
2017-12-16 01:10:54 +00:00
|
|
|
jr c, .cancel
|
|
|
|
.enter_loop
|
|
|
|
call CheckCanLearnMoveTutorMove
|
|
|
|
jr nc, .loop
|
2018-01-12 06:40:20 +00:00
|
|
|
xor a ; FALSE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr .quit
|
|
|
|
|
|
|
|
.cancel
|
|
|
|
ld a, -1
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2017-12-16 01:10:54 +00:00
|
|
|
.quit
|
|
|
|
call CloseSubmenu
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.GetMoveTutorMove:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2018-01-12 06:40:20 +00:00
|
|
|
cp MOVETUTOR_FLAMETHROWER
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .flamethrower
|
2018-01-12 06:40:20 +00:00
|
|
|
cp MOVETUTOR_THUNDERBOLT
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .thunderbolt
|
2018-01-12 06:40:20 +00:00
|
|
|
; MOVETUTOR_ICE_BEAM
|
2017-12-16 01:10:54 +00:00
|
|
|
ld a, ICE_BEAM
|
|
|
|
ret
|
|
|
|
|
|
|
|
.flamethrower
|
|
|
|
ld a, FLAMETHROWER
|
|
|
|
ret
|
|
|
|
|
|
|
|
.thunderbolt
|
|
|
|
ld a, THUNDERBOLT
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
CheckCanLearnMoveTutorMove:
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, .MenuHeader
|
|
|
|
call LoadMenuHeader
|
2017-12-16 01:10:54 +00:00
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
predef CanLearnTMHMMove
|
2017-12-16 01:10:54 +00:00
|
|
|
|
|
|
|
push bc
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
|
|
|
ld hl, wPartyMonNicknames
|
2017-12-16 01:10:54 +00:00
|
|
|
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
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar KnowsMove
|
2017-12-16 01:10:54 +00:00
|
|
|
jr c, .didnt_learn
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
predef LearnMove
|
2017-12-16 01:10:54 +00:00
|
|
|
ld a, b
|
|
|
|
and a
|
|
|
|
jr z, .didnt_learn
|
|
|
|
|
|
|
|
ld c, HAPPINESS_LEARNMOVE
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar ChangeHappiness
|
2017-12-16 01:10:54 +00:00
|
|
|
jr .learned
|
|
|
|
|
|
|
|
.didnt_learn
|
|
|
|
call ExitMenu
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.learned
|
|
|
|
call ExitMenu
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
.MenuHeader:
|
2018-01-14 10:59:56 +00:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|