-
Notifications
You must be signed in to change notification settings - Fork 10
/
script13.s
164 lines (144 loc) · 5.64 KB
/
script13.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
include macros.s
include mainsym.s
; Script 13, escort scientists begin & end
org scriptCodeStart
dc.w EscortScientistsStart
dc.w EscortScientistsFinish
dc.w RadioFindFilter
; Start escort scientists sequence
;
; Parameters: -
; Returns: -
; Modifies: various
EscortScientistsStart:
ldy #C_SCIENTIST ;Ensure sprite file on the same frame as first script exec
jsr EnsureSpriteFile
ldx actIndex
lda actXH,x
sec
sbc actXH+ACTI_PLAYER
cmp #$03
bcs ESS_WaitUntilClose
lda scriptVariable
asl
tay
lda ESS_JumpTbl,y
sta ESS_Jump+1
lda ESS_JumpTbl+1,y
sta ESS_Jump+2
ESS_Jump: jmp $1000
ESS_JumpTbl: dc.w ESS_1
dc.w ESS_2
dc.w ESS_3
ESS_1: inc scriptVariable
jsr AddQuestScore
ldy #ACT_SCIENTIST2
gettext txtEscortStart1
jmp SpeakLine
ESS_2: inc scriptVariable
ldy #ACT_SCIENTIST3
gettext txtEscortStart2
jmp SpeakLine
ESS_3: inc scriptVariable
ldy #ACT_SCIENTIST2
gettext txtEscortStart3
jsr SpeakLine
lda #<EP_ESCORTSCIENTISTSREFRESH
ldx #>EP_ESCORTSCIENTISTSREFRESH
sta actScriptEP
stx actScriptF
sta actScriptEP+1
stx actScriptF+1
ESS_WaitUntilClose:
rts
; Escort scientists sequence finish
;
; Parameters: -
; Returns: -
; Modifies: various
EscortScientistsFinish:
ldx actIndex
lda actT,x
cmp #ACT_SCIENTIST3
beq ESF_Follow
lda actXH,x
cmp #$4d
bcc ESF_Stop
lda #JOY_LEFT
sta actMoveCtrl,x
lda #AIMODE_IDLE
beq ESF_StoreMode
ESF_Stop: lda actSX,x
bne ESF_NoDialogueYet
lda #$00 ;Stop actor script exec for now
sta actScriptF
sta actScriptF+1
ldy #ACT_SCIENTIST2
gettext txtEscortFinish
jmp SpeakLine
ESF_NoDialogueYet:
lda #AIMODE_TURNTO
ESF_StoreMode: sta actAIMode,x
rts
ESF_Follow: lda actXH,x
cmp #$4e
bcc ESF_NoDialogueYet
lda #ACT_SCIENTIST2
jsr FindActor
txa
ldx actIndex
sta actAITarget,x
lda #AIMODE_FOLLOW
bne ESF_StoreMode
; Find filter script. Also move scientists to final positions before surgery
;
; Parameters: -
; Returns: -
; Modifies: various
RadioFindFilter:jsr StopZoneScript
lda #ACT_SCIENTIST3
jsr FindLevelActor
lda #$3f
ldx #$30+AIMODE_TURNTO
jsr MoveScientistSub2
lda #ACT_SCIENTIST2
jsr FindLevelActor
lda #$42
ldx #$00+AIMODE_TURNTO
jsr MoveScientistSub2
lda #<EP_BEGINSURGERY
ldx #>EP_BEGINSURGERY
sta actScriptEP
stx actScriptF
lda #$00
sta actScriptF+1 ;Reset both actor scripts in case player exited early
gettext txtRadioFindFilter
RadioMsg: ldy #ACT_PLAYER
jsr SpeakLine
lda #SFX_RADIO
jmp PlaySfx
MoveScientistSub2:
sta lvlActX,y ;Set also Y & level so that this can be used as shortcut in testing
lda #$56
sta lvlActY,y
txa
sta lvlActF,y
lda #$08+ORG_GLOBAL
sta lvlActOrg,y
BA_Skip: rts
; Messages
; Reordered to compress better
txtEscortStart2:dc.b 34,"NO-ONE TOOK NOTICE WHILE THE AI ORDERED HUGE SHIPMENTS TO BUILD THIS THING UNDERGROUND. "
dc.b "I BELIEVE IT'S RE-ENACTING THE RAGNAROK MYTH - JORMUNGANDR POISONING THE SKY. "
dc.b "HOW EXACTLY, I'M NOT SURE. BUT A MACHINE THAT LARGE IS CERTAINLY DANGEROUS. "
dc.b "IT'S A LOT TO ASK, BUT OUR BELIEF IS THAT YOU MUST VENTURE BELOW AND DISABLE JORMUNGANDR. THERE'S "
dc.b "NO KNOWING IF IT'S ALREADY READY TO ACT, SO WAITING FOR THE CAVALRY COULD BE TOO LATE.",34,0
txtEscortStart3:dc.b 34,"YOU'LL NEED A LUNG FILTER TO SURVIVE THE TUNNELS. THAT MEANS A SECOND SURGERY. THIS REQUIRES THE OPERATING ROOM ON THE LOWER LABS' "
dc.b "RIGHT SIDE, AT THE VERY BOTTOM. PLEASE LEAD THE WAY.",34,0
txtEscortStart1:dc.b 34,"THERE YOU ARE. I'LL LET LINDA EXPLAIN.",34,0
txtRadioFindFilter:
dc.b 34,"LINDA HERE. WE GOT AHEAD OF OURSELVES - THERE'S NO LUNG FILTERS STORED IN HERE. AMOS IS QUITE ANGRY WITH HIMSELF. "
dc.b "SINCE YOU'RE MUCH BETTER SUITED TO EXPLORING, "
dc.b "WE'LL HAVE TO ASK YOU TO FIND ONE. THERE SHOULD BE AT LEAST ONE PACKAGE IN THE LOWER LABS SOMEWHERE.",34,0
txtEscortFinish:dc.b 34,"WE'D NEVER HAVE MADE IT ALONE. NOW WE NEED TIME TO SET UP. WE'LL GIVE YOU A CALL WHEN READY.",34,0
checkscriptend