pokecrystal-board/engine/events/move_tutor.asm
Remy Oukaour 14c8cf5b48 Merge branch 'master' of https://github.com/mid-kid/pokecrystal (resolve PR #452)
# Conflicts:
#	data/player_names.asm
#	engine/battle/menu.asm
#	engine/billspc.asm
#	engine/billspctop.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/delete_save_change_clock.asm
#	engine/events/buena.asm
#	engine/events/elevator.asm
#	engine/events/kurt.asm
#	engine/events/mom.asm
#	engine/events/move_tutor.asm
#	engine/events/pokecenter_pc.asm
#	engine/events/pokepic.asm
#	engine/events/std_scripts.asm
#	engine/events/unown_walls.asm
#	engine/init_gender.asm
#	engine/intro_menu.asm
#	engine/mail.asm
#	engine/main_menu.asm
#	engine/mart.asm
#	engine/menu_2.asm
#	engine/mon_menu.asm
#	engine/pack.asm
#	engine/slot_machine.asm
#	engine/start_menu.asm
#	home/menu.asm
#	maps/CeladonDeptStore6F.asm
#	maps/CeladonGameCornerPrizeRoom.asm
#	maps/DragonShrine.asm
#	maps/EarlsPokemonAcademy.asm
#	maps/GoldenrodCity.asm
#	maps/GoldenrodDeptStore6F.asm
#	maps/GoldenrodGameCorner.asm
#	maps/GoldenrodPokeComCenter2FMobile.asm
#	mobile/mobile_12.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_22.asm
#	mobile/mobile_22_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_45.asm
#	mobile/mobile_45_sprite_engine.asm
#	mobile/mobile_46.asm
#	mobile/mobile_5c.asm
#	mobile/mobile_5f.asm
#	mobile/mobile_menu.asm
2018-01-14 23:43:51 -05:00

104 lines
1.6 KiB
NASM

Special_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, .MenuDataHeader
call LoadMenuDataHeader
predef 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 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
.MenuDataHeader: ; 0x4930a
db MENU_BACKUP_TILES ; flags
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1