You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Implement talker events [commit 3] (#30)
This commit is contained in:
@@ -28,8 +28,8 @@ BoardMenuScript::
|
||||
ld hl, wCurTurn
|
||||
inc [hl]
|
||||
; reset turn-scoped event flags
|
||||
ld hl, wEventFlags + EVENT_LEVEL_SCOPED_FLAGS_START / 8
|
||||
ld c, (EVENT_LEVEL_SCOPED_FLAGS_END / 8) - (EVENT_LEVEL_SCOPED_FLAGS_START / 8)
|
||||
ld hl, wEventFlags + EVENT_TURN_SCOPED_FLAGS_START / 8
|
||||
ld c, (EVENT_TURN_SCOPED_FLAGS_END / 8) - (EVENT_TURN_SCOPED_FLAGS_START / 8)
|
||||
xor a
|
||||
.loop
|
||||
ld [hli], a
|
||||
|
||||
@@ -19,7 +19,7 @@ SeenByTrainerScript::
|
||||
|
||||
StartBattleWithMapTrainerScript:
|
||||
opentext
|
||||
trainertext TRAINERTEXT_SEEN
|
||||
trainerortalkertext TRAINERORTALKERTEXT_TRAINER_SEEN
|
||||
waitbutton
|
||||
closetext
|
||||
loadtemptrainer
|
||||
@@ -33,6 +33,7 @@ AlreadyBeatenTrainerScript:
|
||||
|
||||
SeenByTalkerScript::
|
||||
waitsfx ; wait for any pending space-related sfx
|
||||
; playsound SFX_
|
||||
showemote EMOTE_TALK, LAST_TALKED, 20
|
||||
callasm .TalkOrSkipTalker
|
||||
iffalse .skipped
|
||||
@@ -40,15 +41,31 @@ SeenByTalkerScript::
|
||||
applymovementlasttalked wMovementBuffer
|
||||
writeobjectxy LAST_TALKED
|
||||
faceobject PLAYER, LAST_TALKED
|
||||
callasm .GetTalkerType
|
||||
ifequal TALKERTYPE_TEXT, .Text
|
||||
ifequal TALKERTYPE_SCRIPT, .Script
|
||||
.skipped
|
||||
trainerortalkerflagaction SET_FLAG
|
||||
end
|
||||
|
||||
.Text
|
||||
opentext
|
||||
trainerortalkertext TRAINERORTALKERTEXT_TALKER
|
||||
waitbutton
|
||||
closetext
|
||||
trainerortalkerflagaction SET_FLAG
|
||||
end
|
||||
|
||||
.Script
|
||||
trainerortalkerflagaction SET_FLAG
|
||||
end
|
||||
|
||||
.TalkOrSkipTalker:
|
||||
ld a, [wTempTalkerType]
|
||||
and %1
|
||||
and TALKEREVENTTYPE_MASK
|
||||
cp TALKEREVENTTYPE_MANDATORY
|
||||
jr z, .skip
|
||||
call WaitButton
|
||||
call JoyWaitAorB
|
||||
call PlayClickSFX
|
||||
call WaitSFX
|
||||
ldh a, [hJoyPressed]
|
||||
@@ -61,3 +78,9 @@ SeenByTalkerScript::
|
||||
.done
|
||||
ld [hScriptVar], a
|
||||
ret
|
||||
|
||||
.GetTalkerType:
|
||||
ld a, [wTempTalkerType]
|
||||
and TALKERTYPE_MASK
|
||||
ld [hScriptVar], a
|
||||
ret
|
||||
@@ -162,7 +162,7 @@ ScriptCommandTable:
|
||||
dw Script_startbattle ; 5f
|
||||
dw Script_reloadmapafterbattle ; 60
|
||||
dw Script_catchtutorial ; 61
|
||||
dw Script_trainertext ; 62
|
||||
dw Script_trainerortalkertext ; 62
|
||||
dw Script_trainerortalkerflagaction ; 63
|
||||
dw Script_winlosstext ; 64
|
||||
dw Script_scripttalkafter ; 65
|
||||
@@ -661,13 +661,17 @@ Script_swarm:
|
||||
farcall StoreSwarmMapIndices
|
||||
ret
|
||||
|
||||
Script_trainertext:
|
||||
Script_trainerortalkertext:
|
||||
call GetScriptByte
|
||||
cp TRAINERORTALKERTEXT_TALKER
|
||||
ld hl, wTempTalkerTextOrScriptPointer
|
||||
jr z, .next
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, wSeenTextPointer
|
||||
add hl, bc
|
||||
add hl, bc
|
||||
.next
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
||||
Reference in New Issue
Block a user