forked from Wavestation/oq-zik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecretroom.scc
executable file
·362 lines (323 loc) · 12.3 KB
/
secretroom.scc
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
/* ScummC
* Copyright (C) 2007 Alban Bedel, Gerrit Karius
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include <scummVars6.s>
#include "common.sch"
#include "secretroom.sch"
#include "officeroom.sch"
#include "inventoryitems.sch"
#include "actors.sch"
#include "zob_anim.sch"
#include "zif_anim.sch"
#include "cube_anim.sch"
room SecretRoom {
image = "graphics/rooms/back02_merged.bmp";
boxd = "graphics/rooms/back02.box";
zplane = {
"graphics/rooms/back02_mask1.bmp",
"graphics/rooms/back02_mask2.bmp",
"graphics/rooms/back02_mask3.bmp"
};
//trans = 0;
sound shootCageSnd = "shoot_cage.soun";
sound shootDeadSnd = "shoot_dead.soun";
sound fallDeadSnd = "fall_dead.soun";
voice mwwwahSnd = { "sounds/mwwwah_huh_huh.voc" };
bit terminalActivated;
object node;
local script entry() {
putActorAt(VAR_EGO,40,100,SecretRoom);
walkActorTo(VAR_EGO,92,100);
}
script outro() {
int i;
Actors::stopRoaming(commanderZif);
cutscene(1) {
try {
egoSay("I'm having problems hitting the target, Sir.");
waitForMessage();
actorSay(commanderZif, "You're not a soldier. Give it here.");
walkActorToObj(commanderZif,ensignZob,0);
waitForMessage();
waitForActor(commanderZif);
actorFace(commanderZif,ensignZob);
actorFace(ensignZob,commanderZif);
setObjectOwner( InventoryItems::gun, commanderZif );
animateActor(ensignZob, zob_anim_raiseArm);
delay(15);
animateActor(commanderZif, zif_anim_raiseArm);
delay(15);
animateActor(ensignZob, zob_anim_lowerArm);
delay(15);
animateActor(commanderZif, zif_anim_lowerArm);
delay(15);
actorSay(commanderZif, "Right, stand back.");
waitForMessage();
walkActorTo(ensignZob, 210, 120);
waitForActor( ensignZob );
walkActorToObj(commanderZif, node, 0);
waitForActor(commanderZif);
actorFace(ensignZob,commanderZif);
actorSay(commanderZif, "I shall disable the suspension field thusly.");
waitForMessage();
delay(100);
startSound(shootCageSnd);
animateActor(commanderZif,zif_anim_fireup);
delay(30);
setCurrentActor(bluecupActor);
for(i = 11 ; i > 0 ; i--) {
delay( 2 );
setActorElevation( i*5 );
}
delay(100);
walkActorToObj(commanderZif,bluecupActor,0);
waitForActor( commanderZif );
setCurrentActor(commanderZif);
setActorDirection(180);
delay(100);
putActorAt( bluecupActor,0,0,InventoryItems );
actorSay(commanderZif, "At last, the power of the relic is mine.");
waitForMessage();
egoSay("Expertly done, Sir.");
waitForMessage();
egoSay("Pass over the relic, and I shall place it in the containment vessel.");
waitForMessage();
walkActorTo(commanderZif, 100, 115);
waitForActor( commanderZif );
actorFace(commanderZif,ensignZob);
actorSay(commanderZif, "Never!");
waitForMessage();
actorSay(commanderZif, "The relic shall never leave my side.");
waitForMessage();
egoSay("But commander, the power is too much for one man.");
waitForMessage();
egoSay("Yield it, before it destroys you!");
waitForMessage();
actorSay(commanderZif, "Error, number one.");
waitForMessage();
actorSay(commanderZif, "Never give up the gun.");
waitForMessage();
startSound(shootDeadSnd);
animateActor(commanderZif,zif_anim_firestraight);
delay(50);
startSound(fallDeadSnd);
animateActor( ensignZob, zob_anim_die );
delay(150);
walkActorTo(commanderZif, 170, 120);
waitForActor( commanderZif );
actorSay(commanderZif, "What a shame...");
waitForMessage();
actorSay(commanderZif, "We could have ruled the cosmos together.");
waitForMessage();
setCurrentActor(commanderZif);
setActorDirection(180);
Actors::setZifOnThePhone();
animateActor( commanderZif, zif_anim_lookAround );
delay(30);
actorSay(commanderZif, "Commander's log, star date 432.2");
waitForMessage();
actorSay(commanderZif, "I have obtained the stolen artifact.");
waitForMessage();
actorSay(commanderZif, "In a slight contradiction to my orders, I have decided to enslave this planet.");
waitForMessage();
actorSay(commanderZif, "%V{mwwwahSnd}"
"Mwaaah huh huh huh huh huh huh...");
waitForMessage();
Actors::setZifOffThePhone();
}
override {
if(VAR_OVERRIDE) {
actorSay(0xFF, ""); //stopTalking();
putActorAt(ensignZob,276,110,SecretRoom);
putActorAt(commanderZif,170,120,SecretRoom);
putActorAt( bluecupActor,0,0,InventoryItems );
setCurrentActor(commanderZif);
setActorDirection(180);
Actors::setZifOffThePhone();
}
}
}
// Kill the mouseWatch
if(isScriptRunning(ResRoom::mouseWatch))
stopScript(ResRoom::mouseWatch);
VAR_VERB_SCRIPT = ResRoom::quit;
}
object blueCup {
name = "blue cup";
dir = SOUTH;
verb(int vrb, int objA, int objB) {
case LookAt:
egoSay("The holy artifact!");
return;
case PickUp:
if(cubeDisappeared)
egoSay("The artifact is still being held in place.");
else
egoSay("The artifact is protected by some kind of forcefield container.");
return;
}
}
object computerTerminal {
x = 176;
y = 56;
w = 16;
h = 24;
hs_x = 30;
hs_y = 43;
name = "computer terminal";
dir = WEST;
verb(int vrb, int objA, int objB) {
case LookAt:
egoSay("Looks pretty ordinary.");
return;
case Use:
if( terminalActivated && ! cubeDisappeared ) {
Actors::pauseRoaming(commanderZif);
cutscene(2) {
try {
animateActor(VAR_EGO, zif_anim_raiseArm);
delay(25);
animateActor(VAR_EGO, zif_anim_lowerArm);
delay(25);
animateActor(cubeActor, cube_anim_dissolve);
delay(50);
egoSay("Looks like I broke the encryption.");
waitForMessage();
putActorAt(commanderZif,40,100,SecretRoom);
walkActorTo(commanderZif,95,100);
waitForActor(commanderZif);
actorFace(commanderZif,VAR_EGO);
actorSay(commanderZif,"Well done, ensign.");
waitForMessage();
actorSay(commanderZif,"Now retrieve the relic!");
waitForMessage();
egoSay("Small problem, sir.");
waitForMessage();
actorSay(commanderZif,"What's that?");
waitForMessage();
egoSay("It is still held in place.");
waitForMessage();
actorSay(commanderZif,"Then find a way to bring it down.");
waitForMessage();
egoSay("Aye, sir!");
waitForMessage();
}
override {
if(VAR_OVERRIDE) {
actorSay(0xFF, ""); //stopTalking();
putActorAt(commanderZif,90,100,SecretRoom);
actorFace(commanderZif,VAR_EGO);
}
}
putActorAt(cubeActor,0,0,InventoryItems);
cubeDisappeared = 1;
Actors::startRoaming(commanderZif,80,220,105,130);
}
}
else if( cubeDisappeared )
egoSay("The terminal has shut down.");
else
egoSay("The terminal is offline.");
return;
}
}
object keySlot {
x = 176;
y = 80;
w = 16;
h = 16;
hs_x = 25;
hs_y = 30;
name = "key slot";
dir = WEST;
verb(int vrb, int objA, int objB) {
case LookAt:
if(terminalActivated)
egoSay("There is a keycard in this slot.");
else
egoSay("This looks like the recepticle for some kind of electronic key.");
return;
case UsedWith:
if(objB == InventoryItems::card) {
cutscene(0) {
egoSay("I think this should activate the terminal.");
waitForMessage();
animateActor(VAR_EGO, zob_anim_raiseArm);
delay(25);
animateActor(VAR_EGO, zob_anim_lowerArm);
terminalActivated = 1;
setObjectOwner( InventoryItems::card, 0 );
}
}
return;
}
}
object node {
x = 152;
y = 16;
w = 16;
h = 8;
hs_x = -50;
hs_y = 75;
name = "node";
dir = EAST;
verb(int vrb, int objA, int objB) {
case LookAt:
egoSay("It appears to assist in suspending the artifact.");
return;
case UsedWith:
if(objB == InventoryItems::gun) {
if( getObjectState( InventoryItems::gun ) != 2 ) {
egoSay("The weapon is not loaded.");
return;
}
if( cubeDisappeared != 1 ) {
egoSay("The suspension cage prevents a clear shot at the node.");
return;
}
cutscene(2) {
hasShotAtNode = 1;
animateActor(VAR_EGO,zob_anim_fireup);
startSound(shootCageSnd);
delay(120);
egoSay("Missed!");
waitForMessage();
}
egoSay("I am not familiar with the aiming reticule.");
return;
}
return;
}
}
object exitToOfficeRoom {
x = 48;
y = 32;
w = 32;
h = 72;
hs_x = 42;
hs_y = 68;
name = "room";
dir = WEST;
verb(int vrb, int objA, int objB) {
case WalkTo:
walkActorTo(VAR_EGO,50,100);
waitForActor(VAR_EGO);
screenEffect(0x0082);
startRoom(OfficeRoom);
return;
}
}
}