2018-06-24 17:10:37 -07:00
|
|
|
TalkToTrainerScript::
|
2017-12-15 17:10:54 -08:00
|
|
|
faceplayer
|
2023-11-28 09:02:00 -08:00
|
|
|
trainerortalkerflagaction CHECK_FLAG
|
2017-12-15 17:10:54 -08:00
|
|
|
iftrue AlreadyBeatenTrainerScript
|
2019-03-10 12:31:59 -07:00
|
|
|
loadtemptrainer
|
2017-12-15 17:10:54 -08:00
|
|
|
encountermusic
|
2019-03-10 13:39:31 -07:00
|
|
|
sjump StartBattleWithMapTrainerScript
|
2017-12-15 17:10:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
SeenByTrainerScript::
|
2019-03-10 12:31:59 -07:00
|
|
|
loadtemptrainer
|
2023-11-28 00:44:10 -08:00
|
|
|
waitsfx ; wait for any pending space-related sfx
|
2017-12-15 17:10:54 -08:00
|
|
|
encountermusic
|
|
|
|
showemote EMOTE_SHOCK, LAST_TALKED, 30
|
2023-11-28 04:59:36 -08:00
|
|
|
callasm TrainerOrTalkerWalkToPlayer
|
2019-03-10 12:31:59 -07:00
|
|
|
applymovementlasttalked wMovementBuffer
|
2017-12-24 10:46:34 -08:00
|
|
|
writeobjectxy LAST_TALKED
|
|
|
|
faceobject PLAYER, LAST_TALKED
|
2019-03-10 13:39:31 -07:00
|
|
|
sjump StartBattleWithMapTrainerScript
|
2017-12-15 17:10:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
StartBattleWithMapTrainerScript:
|
2017-12-15 17:10:54 -08:00
|
|
|
opentext
|
2023-11-28 12:36:51 -08:00
|
|
|
trainerortalkertext TRAINERORTALKERTEXT_TRAINER_SEEN
|
2017-12-15 17:10:54 -08:00
|
|
|
waitbutton
|
|
|
|
closetext
|
2019-03-10 12:31:59 -07:00
|
|
|
loadtemptrainer
|
2017-12-15 17:10:54 -08:00
|
|
|
startbattle
|
|
|
|
reloadmapafterbattle
|
2023-11-28 09:02:00 -08:00
|
|
|
trainerortalkerflagaction SET_FLAG
|
2024-02-17 09:56:19 -08:00
|
|
|
scall AfterTrainerOrTalkerScript
|
2019-03-10 12:31:59 -07:00
|
|
|
loadmem wRunningTrainerBattleScript, -1
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
|
|
AlreadyBeatenTrainerScript:
|
2023-11-29 11:04:08 -08:00
|
|
|
jumptrainerafterbattlescript
|
2023-11-28 04:59:36 -08:00
|
|
|
|
|
|
|
SeenByTalkerScript::
|
|
|
|
waitsfx ; wait for any pending space-related sfx
|
2023-11-30 06:51:24 -08:00
|
|
|
playsound SFX_UNKNOWN_66
|
2023-11-28 04:59:36 -08:00
|
|
|
showemote EMOTE_TALK, LAST_TALKED, 20
|
2023-11-29 11:04:08 -08:00
|
|
|
trainerortalkerflagaction SET_FLAG
|
2023-11-28 09:02:00 -08:00
|
|
|
callasm .TalkOrSkipTalker
|
|
|
|
iffalse .skipped
|
2023-11-28 04:59:36 -08:00
|
|
|
callasm TrainerOrTalkerWalkToPlayer
|
|
|
|
applymovementlasttalked wMovementBuffer
|
|
|
|
writeobjectxy LAST_TALKED
|
|
|
|
faceobject PLAYER, LAST_TALKED
|
2023-11-28 12:36:51 -08:00
|
|
|
callasm .GetTalkerType
|
|
|
|
ifequal TALKERTYPE_TEXT, .Text
|
|
|
|
ifequal TALKERTYPE_SCRIPT, .Script
|
2023-11-28 09:02:00 -08:00
|
|
|
.skipped
|
2023-11-28 12:36:51 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
.Text
|
|
|
|
opentext
|
|
|
|
trainerortalkertext TRAINERORTALKERTEXT_TALKER
|
|
|
|
waitbutton
|
|
|
|
closetext
|
2024-02-17 09:56:19 -08:00
|
|
|
sjump AfterTrainerOrTalkerScript
|
2023-11-28 12:36:51 -08:00
|
|
|
|
|
|
|
.Script
|
2024-02-17 09:56:19 -08:00
|
|
|
talkerscript
|
|
|
|
sjump AfterTrainerOrTalkerScript
|
2023-11-28 09:02:00 -08:00
|
|
|
|
|
|
|
.TalkOrSkipTalker:
|
|
|
|
ld a, [wTempTalkerType]
|
2023-11-28 12:36:51 -08:00
|
|
|
and TALKEREVENTTYPE_MASK
|
2023-11-28 09:02:00 -08:00
|
|
|
cp TALKEREVENTTYPE_MANDATORY
|
|
|
|
jr z, .skip
|
2023-12-23 05:44:36 -08:00
|
|
|
farcall LoadTalkerEventLegendGFX
|
|
|
|
ld hl, wDisplaySecondarySprites
|
|
|
|
set SECONDARYSPRITES_TALKER_EVENT_F, [hl]
|
|
|
|
call UpdateActiveSprites
|
2023-11-28 12:36:51 -08:00
|
|
|
call JoyWaitAorB
|
2023-11-28 09:02:00 -08:00
|
|
|
call PlayClickSFX
|
|
|
|
call WaitSFX
|
2023-12-23 05:44:36 -08:00
|
|
|
ld hl, wDisplaySecondarySprites
|
|
|
|
res SECONDARYSPRITES_TALKER_EVENT_F, [hl]
|
2023-11-28 09:02:00 -08:00
|
|
|
ldh a, [hJoyPressed]
|
|
|
|
bit A_BUTTON_F, a
|
|
|
|
jr z, .skip ; jump if b was pressed
|
|
|
|
ld a, TRUE
|
|
|
|
jr .done
|
|
|
|
.skip
|
|
|
|
xor a ; FALSE
|
|
|
|
.done
|
|
|
|
ld [hScriptVar], a
|
|
|
|
ret
|
2023-11-28 12:36:51 -08:00
|
|
|
|
|
|
|
.GetTalkerType:
|
|
|
|
ld a, [wTempTalkerType]
|
|
|
|
and TALKERTYPE_MASK
|
|
|
|
ld [hScriptVar], a
|
2024-02-17 09:56:19 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
AfterTrainerOrTalkerScript:
|
|
|
|
wait 200
|
|
|
|
readmem wSpacesLeft
|
|
|
|
iftrue .not_landed
|
|
|
|
turnobject PLAYER, DOWN
|
|
|
|
wait 100
|
|
|
|
.not_landed
|
|
|
|
end
|