-
Notifications
You must be signed in to change notification settings - Fork 1
/
GORREVEN.TYP
460 lines (359 loc) · 12.5 KB
/
GORREVEN.TYP
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# GORREVEN.TYP
#
# Type definitions for "The Gorreven Papers".
include "utility"
type sit_furniture based on furniture
proximity : "on"
methods
'look' : >>It looks like I could sit on it.
'sit' : 'enter'
'sit on' : 'sit'
'sit down on' : 'sit'
end
type sitat_furniture based on sit_furniture
proximity : "at"
methods
'look' : >>Looks like I could sit at it.
'sit at' : 'sit'
end
type wearable based on object
wearing : FALSE
methods
'INVENTORY NAME' :
if visible then {
if wearing = TRUE then
('INDEF' -> self) & " (which I'm wearing)"
else if wearing.IsAobject then
('INDEF' -> self) & " (which " & ('INDEF' -> wearing) & " is wearing)"
else
'INDEF' -> self
}
'put_on' : 'wear'
'wear' :
if wearing = TRUE then
write "I'm already wearing ", 'DEF' -> self, "."
else if location ~= player then
write "I don't have ", 'DEF' -> self, "."
else {
write "I put on ", 'DEF' -> self, "."
wearing := TRUE
}
'take_off' : 'remove'
'remove' :
if wearing = TRUE then {
write "I take off ", 'DEF' -> self, "."
wearing := FALSE
}
else
write "I'm not wearing ", 'DEF' -> self, "."
# And remember to change how drop works.
'drop' : {
if wearing then 'remove'
'drop' --> object
}
end
type guard_type based on object
IsAguard_type : TRUE
alive : TRUE
desc : 'Desc' -> self
suspicious : 0
see_naked : 0
panic : 0
pronoun : "him"
methods
'Desc' :
if alive then
"guard"
else
"dead guard"
'INITIAL' : 'REGISTER' -> after
'AFTER' :
if alive and 'ACCESS' -> self then 'Encounter'
'get' :
if alive then
write "Oh sure."
else
write "I don't want to burden myself with that."
'kill' :
if not alive then
write "He's already plenty dead."
else if gun.location = player and gun.bullets > 0 then
{ writes "I use my gun. "; 'Kill With Gun' }
else if cot_fragment.location = player then
{ writes "I use the piece of metal that worked so well before..."
'Kill With Knife' }
else {
writes "I attack with my bare hands grasping for his throat. "
writes "But this turns into a monumental failure as he triumphantly "
stop "drills me through the skull with his sidearm."
}
'kill...with' :
if not alive then
write "He's already dead."
else
case main.dobj of {
cot_fragment : 'Kill With Knife'
gun : if gun.bullets > 0 then
'Kill With Gun'
else
write "The gun's out of bullets!"
cattle_prod : 'Kill With Prod'
bear_trap : stop "Not knowing quite how I plan to kill him with ",
"a bear trap, of all things, I sort of open its ",
"jaws and lunge at him. Unfortunately he is ",
"already prepared with his gun and a gun beats ",
"a bear trap anytime."
default : >>That won't make much of a weapon!
}
'Kill With Knife' : {
writes "Sadly, between a sharp piece of metal and a .38 caliber pistol, "
writes "the firearm comes out on top. He has perforated me soundly "
stop "long before I am within striking distance."
}
'Kill With Gun' : {
gun.bullets -:= 1
writes "I fire, point blank; he was not ready and I was. He is thrown "
writes "against the far wall by the impact and slumps to the ground, "
writes "painting a bloody stripe down the wall behind him, his face "
write "frozen in a death mask of bewilderment."
alive := FALSE
}
'Kill With Prod' :
stop "I shove the cattle prod into him, but the charge in the prod ",
"isn't sufficient to kill anyone... he yelps in pain, then, in ",
"a paroxysm of rage, pulls his gun and shoots me."
'pull' : 'push'
'push' : {
writes "I ", main.verb, " ", 'DEF' -> self, ". "
if not alive then
write "Nothing happens."
else {
writes "He seems surprised at the sudden physical contact. Annoyed, ",
"he turns and looks me right in the eye. "
'Found Out'
}
}
'Encounter' :
if power.off then {
case panic +:= 1 of {
1 : write "The guard is on edge in the wake of the power outage ",
"I caused. He is nervous and trigger happy and staring ",
"wide-eyed into the dark. Fortunately he can't see my ",
"face yet and he simply acknowledges me with a nod."
3 : { writes "The guard's eyes seem to have adjusted a little to the ",
"dark. He sees my face, and his eyes grow wider still. "
'Found Out'
}
}
}
else { if uniform.wearing = TRUE then
case suspicious +:= 1 of {
1 : {
write "Looks like ", 'DEF' -> self, " isn't paying very close ",
"attention to my face."; 'MENTION SELF' }
2 : {
write "The disguise seems to be holding; ", 'DEF' -> self,
" doesn't seem suspicious yet."; 'MENTION SELF' }
4 : {
write "Now ", 'DEF' -> self, " seems to be a little disturbed, ",
"trying to get a good look at my face." 'MENTION SELF' }
5 : {
>>The guard suddenly draws his weapon. "You're not Krugnik! Who are you?
>>And what have you done with him?" Startled, I make the fatal mistake of
writes "glancing up and making eye contact. "
'Found Out'
}
} # case
else { # not wearing prison uniform
writes "A look of shock comes over ", 'DEF' -> self, "'s face "
writes "as he sees me standing there in "
if prison_coveralls.wearing then {
writes "my gloriously conspicuous prison coveralls, the bright orange "
writes "triangle glowing like a beacon. Making a wonderful target. "
'Found Out'
}
else {
writes "my stunning nakedness. "
case see_naked +:= 1 of {
1 : { write "He seems unsure how to react."; 'MENTION SELF' }
default : 'Found Out'
} # case
} # else wearing nothing
} # else not wearing prison uniform
} # kluge - should be able to do that 'else if'
'Found Out' : {
writes "\"The SPY!\" he shrieks, and before I can react further, "
stop "he has shot me conclusively through the heart."
}
end
# scenery: these are objects which are really part of the surroundings,
# but will yield more information on a closer look.
type scenery based on object
first_seen : TRUE
methods
'get' : >>I can't do that.
'look' : {
'Desc'
first_seen := FALSE
}
end
type openable based on object
open : FALSE
methods
'look' : {
writes "It is "
if open then writes "open " else writes "closed "
write "at the moment."
}
'open' :
if open then
write "It's already open."
else {
open := TRUE
write "I opened ", 'DEF' -> self, "."
}
'close' :
if open then {
open := FALSE
write "I closed ", 'DEF' -> self, "."
}
else
write "It's already closed."
end
type elev_button based on object
location : elevator
visible : FALSE
desc : "button " & ('Name' -> self)
syn : level
level : 0
methods
'look' : {
writes "It's just a small square button with the number \"", level,
"\" painted on it. "
if elevator.level = level then writes "It is currently lit."
write
}
'get' : write "I can't remove ", desc, " from the wall."
'Name' :
case level of {
1 : "one"
2 : "two"
3 : "three"
4 : "four"
}
'push' :
if elevator.level = level then
write "That's the button that's lit. Nothing happens."
else {
writes "There is the sound of a mighty motor and "
if level < elevator.level then
writes "the floor briefly drops out from under me. "
else
writes "my knees buckle with the force of the lift. "
elevator.level := level
if elevator.never_rode then {
elevator.never_rode := FALSE
writes "To my shock, there is no inner door to this elevator. The "
writes "concrete bricks of the elevator shaft go hurtling by in a "
writes "blur. I don't like to think about what might have happened "
writes "if I had chosen to lean against that wall. "
}
if level = 4 then
writes "The ride seems to be taking quite some time. "
writes "Finally, with a bone-jarring, sudden stop, the ride comes "
write "to an end."
}
end
type elev_call_button based on elev_button
visible : TRUE
desc : "elevator call button"
waiting : FALSE
methods
'look' : {
if elevator.level = level then waiting = FALSE
writes "The button is "
if not waiting then writes "not "
write "lit."
}
'push' :
if elevator.level = level then {
writes "The button lights briefly and there is the sound of a bell; "
write "this is because the elevator is already here."
}
else {
write "I push the button and it becomes lit."
'Calling Elevator' -> elevator
waiting := TRUE
}
end
# Thin-handled implement. Basically the mop and the broom. These objects
# can get a dustpan stuck on the end of them.
type thin_handled based on object
is_shovel : dustpan.location = self
methods
'look' : if is_shovel then
write "There's ", 'INDEF' -> dustpan,
" stuck on the end."
else
message --> object
'TRANSPARENT' : TRUE
'INVENTORY NAME' :
if dustpan.location = self then
('INDEF' -> self) & " with a dustpan stuck on the end"
else
'INDEF' -> self
end
type elevator_hall based on room
desc : "hallway near the elevator"
level : 0
IsAelevator_hall : TRUE
methods
'south' : if elevator.level = level then elevator
'Elevator Desc' :
if elevator.level = level then
writes "The elevator is waiting directly to the south. "
else {
writes "There is a huge square gaping hole directly to the south. "
writes "It's not much of an exit; the rear of the elevator shaft is "
writes "visible a few feet beyond. "
}
end
type fence based on object
desc : "chain-link fence"
syn : "chainlink fence"
otherside : UNDEFINED
never_seen : TRUE
methods
'get' : >>Yeah right.
'look' : {
writes "It's about twelve feet high, made of a chain-link construction ",
"that is somewhat thicker than what I'm used to. It seems to be buried ",
"securely underground; probably not easy to tear up. Oh, and there's a ",
"sign on it saying \"HIGH VOLTAGE - KEEP OFF\". Important detail. "
if never_seen then { never_seen := FALSE; hinter.hint := power_off }
if power.off then
writes "Hopefully, though, turning off the main power grid took care ",
"of that. Just one way to find out."
write
}
'climb' :
if power.off then {
writes "I climb up the fence. Nothing happens; the power is still off. "
if searchlight.broken then {
player.location := otherside; 'MOVE' -> player
}
else
stop "But halfway up the fence the burning light of a searchlight ",
"from the central guard tower stabs down upon me. ",
"It must have been independently powered! Like a ",
"cockroach caught in the middle of a bathroom floor I leap away, ",
"lunging toward the darkness. But the searchlight follows me, ",
"and I hear the popping sounds of gunfire. An instant later my ",
"body is torn by bullets; like an actor on a stage, I perform ",
"my death scene beneath the spotlight."
}
else
stop "I grab hold of the fence. A horrible vibrating burning sensation ",
"leaps through me. The fence is electrified! I try to let go but my ",
"muscles are paralyzed! I... I... AIIIIIIIEEEEEEEE..."
end