-
Notifications
You must be signed in to change notification settings - Fork 10
/
script21.s
259 lines (237 loc) · 8.48 KB
/
script21.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
include macros.s
include mainsym.s
; Script 21, Bio-Dome
menuSelection = wpnBits
org scriptCodeStart
dc.w MoveSecurityChief
dc.w DestroySecurityChief
dc.w SecurityChiefSpeech
dc.w ThroneSuiteComputer
dc.w GuardHouseComputer
; Security chief move routine
;
; Parameters: X actor index
; Returns: -
; Modifies: A,Y,temp1-temp8,loader temp vars
MoveSecurityChief:
ldy #C_SECURITYCHIEF
jsr EnsureSpriteFile
lda menuMode ;Wait for dialogue
bne MSC_Wait
lda lvlObjB+$17 ;Wait if trigger not activated
bpl MSC_Wait
lda actF1,x
cmp #FR_DIE
bcs MSC_Dead
lda actHp,x ;Set health for battle
bne MSC_HasHealth
lda #HP_SECURITYCHIEF
sta actHp,x
MSC_HasHealth: cmp #HP_SECURITYCHIEF/2 ;Switch to grenade launcher at half health
bcs MSC_NoWeaponChange
lda actTime,x
bmi MSC_NoWeaponChange
lda actAttackD,x
bne MSC_NoWeaponChange
lda #ITEM_GRENADELAUNCHER
sta actWpn,x
MSC_NoWeaponChange:
lda #MUSIC_THRONE+1 ;Play the bossfight music
jsr PlaySong
ldx actIndex
MSC_Dead:
MSC_Move: jmp MoveAndAttackHuman
MSC_Wait: lda #$00
sta actHp,x ;Make a nontarget until speech over
sta actCtrl,x
sta actMoveCtrl,x
beq MSC_Move
; Security chief destroy routine
;
; Parameters: X actor index
; Returns: -
; Modifies: A,Y,temp1-temp8,loader temp vars
DestroySecurityChief:
jsr HumanDeath
stx temp6
lda #MUSIC_THRONE ;Back to regular song
jsr PlaySong
ldx temp6
lda #ITEM_MINIGUN
sta temp5
lda #-2*8 ;Drop also both weapons in addition
jsr DI_SpawnItemWithSpeed ;to the keycard
sta temp3
lda #ITEM_GRENADELAUNCHER
sta temp5
lda #2*8
jmp DI_SpawnItemWithSpeed
; Security chief speech
;
; Parameters: -
; Returns: -
; Modifies: various
SecurityChiefSpeech:
ldy #ACT_SECURITYCHIEF
gettext txtSecurityChief
jmp SpeakLine
; Throne Suite computer
;
; Parameters: -
; Returns: -
; Modifies: various
ThroneSuiteComputer:
lda #ACT_SECURITYCHIEF ;Security chief must be gone or dyin
jsr FindActor
bcc TSC_OKToUse
lda actHp,x
beq TSC_OKToUse
lda #<txtComputerLocked
ldx #>txtComputerLocked
ldy #REQUIREMENT_TEXT_DURATION
jmp PrintPanelText
TSC_OKToUse: lda #0
sta menuSelection
TSC_KeepSelection:
jsr SetupTextScreen
lda #9
sta temp1
lda #8
sta temp2
gettext txtThroneSuiteComputer
jsr PrintMultipleRows
TSC_Redraw: lda #$20
TSC_ArrowLastPos:
sta screen1+2*40
lda #9
sta temp1
lda menuSelection
clc
adc #10
sta temp2
lda #<txtArrow
ldx #>txtArrow
jsr PrintText
lda zpDestLo
sta TSC_ArrowLastPos+1
lda zpDestHi
sta TSC_ArrowLastPos+2
lda #23
sta temp1
lda #10
sta temp2
ldy lvlObjBitsStart+$0e
lda lvlStateBits,y
lsr
bcs TSC_GateOpen
TSC_GateClosed: gettext txtClosed
bne TSC_GateCommon
TSC_GateOpen: gettext txtOpen
TSC_GateCommon: jsr PrintText
TSC_ControlLoop:jsr FinishFrame
jsr GetControls
jsr GetFireClick
ldy menuSelection
bcs TSC_Action
lda prevJoy
and #JOY_UP|JOY_DOWN
bne TSC_ControlLoop
lda joystick
lsr
bcs TSC_Up
lsr
bcs TSC_Down
lda keyType
bmi TSC_ControlLoop
TSC_Exit: ldy lvlObjNum
jsr InactivateObject ;Allow immediate re-entry
jmp CenterPlayer
TSC_Action: lda #SFX_SELECT
jsr PlaySfx
cpy #2
bcs TSC_Exit
tya
bne TSC_ReadNotes
ldy lvlObjBitsStart+$0e
lda lvlStateBits,y
eor #$01
sta lvlStateBits,y
jmp TSC_Redraw
TSC_Up: dey
bpl TSC_NotOver
ldy #2
TSC_NotOver: sty menuSelection
lda #SFX_SELECT
jsr PlaySfx
jmp TSC_Redraw
TSC_Down: iny
cpy #3
bcc TSC_NotOver
ldy #0
bcs TSC_NotOver
TSC_ReadNotes: gettext txtRutgerNotes
jsr PrintCommon
lda #SFX_SELECT
jsr PlaySfx
jmp TSC_KeepSelection
; Guard house computer
;
; Parameters: -
; Returns: -
; Modifies: various
GuardHouseComputer:
gettext txtGuardHouse
jsr PrintCommon
jmp CenterPlayer
PrintCommon: jsr SetupTextScreen
ldy #0
sty temp1
sty temp2
jsr PrintMultipleRows
jmp WaitForExit
; Messages
txtSecurityChief:
dc.b 34,"YOU! THE ROGUE GUARD. UNDERSTAND THIS - THE 'CONSTRUCT' REPRESENTS NORMAN'S UNFILTERED GENIUS. "
dc.b "BUT AFTER THE UPLOAD HE BEGAN TO FALTER. I HAD TO LOCK HIM UP FOR THE RISK OF INTERFERENCE. "
dc.b "YOU GETTING HERE PAST THE BIOMETRIC LOCK MEANS YOU MUST HAVE DEFILED HIS BODY. "
dc.b "THAT'S ONE MORE REASON TO MAKE SURE YOU DON'T LEAVE THIS ROOM ALIVE.",34,0
txtComputerLocked:
dc.b "TERMINAL "
textjump txtLocked
txtThroneSuiteComputer:
dc.b "SUITE SECURITY STATION",0
dc.b " ",0
dc.b " CAVE GATES:",0
dc.b " RUTGER'S NOTES",0
dc.b " EXIT",0,0
txtRutgerNotes: ;0123456789012345678901234567890123456789
dc.b "EVENTS HAVE TAKEN UNFORTUNATE TURNS. BUT",0
dc.b "NOT BEYOND SALVAGE. ONCE THE AI IS UNDER",0
dc.b "CONTROL AND CAN BE ASSURED TO NOT BREAK",0
dc.b "ITS PARAMETERS AGAIN, I BELIEVE OUR",0
dc.b "CONTRACT CAN BE RENEGOTIATED HANDSOMELY.",0
dc.b " ",0
dc.b "I'M NOT AT ALL PLEASED THAT THERE'S A",0
dc.b "NANOBOT-ENHANCED LOW LEVEL GUARD ON THE",0
dc.b "LOOSE. THE AI IS BECOMING MORE AGITATED",0
dc.b "IN ITS EFFORTS TO STOP HER. I GAVE MY",0
dc.b "MEN ORDERS TO SHOOT ON SIGHT, BUT IT",0
dc.b "WAS OF LITTLE USE.",0
dc.b " ",0
dc.b "I SUPPOSE I SHOULD BE PLEASED THAT THE",0
dc.b "'HESSIAN' TECH PRODUCED A SEEMINGLY",0
dc.b "INVINCIBLE WARRIOR.",0,0
txtArrow: dc.b 62,0
txtClosed: dc.b "CLOSED",0
txtOpen: dc.b "OPEN ",0
txtGuardHouse: ;0123456789012345678901234567890123456789
dc.b "GUARDHOUSE AUDIO LOG",0
dc.b " ",0
dc.b "THESE WALKERS ARE HATEFUL BEASTS.",0
dc.b "GOOD THEY'RE AFRAID OF FLAMETHROWERS.",0
dc.b "SHIT, THE PILOT LIGHT WENT OUT.",0
dc.b "IT'S NOT REIGNITING.",0
dc.b "THERE'S A PACK COMING STRAIGHT AT ME!",0
dc.b "NO! SHOOT AT THEM, NOT AT THE FLIES!",0
dc.b "FUU- (UNINTELLIGIBLE NOISES)",0,0
checkscriptend