-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathglobal.zil
457 lines (405 loc) · 10.7 KB
/
global.zil
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
"GLOBALS for MILLIWAYS
Copyright (C) 1988 Infocom, Inc. All rights reserved."
<OBJECT GLOBAL-OBJECTS
(DESC "GO")
;(FDESC 0)
(GENERIC 0)
(GLOBAL STAIRS)
(OWNER 0)
(TEXT 0)
(FLAGS CONTBIT DEAD DOORBIT FEMALEBIT
INVISIBLE LIGHTBIT LOCKED MUNGBIT
NARTICLEBIT NDESCBIT ONBIT OPENABLE OPENBIT
;PERSONBIT PLURAL READBIT RMUNGBIT
SEARCHBIT SECRETBIT SEENBIT SURFACEBIT
TAKEBIT TOOLBIT TOUCHBIT TRANSBIT TRYTAKEBIT
VEHBIT VOWELBIT WEAPONBIT WEARBIT WORNBIT)>
<OBJECT LOCAL-GLOBALS
(LOC GLOBAL-OBJECTS)
(DESC "LG")
(SYNONYM L.G)
(FLAGS NARTICLEBIT)
(ACTION LOCAL-GLOBALS-F)>
<ROUTINE LOCAL-GLOBALS-F ()
<COND (<REMOTE-VERB?>
<RFALSE>)
(T <NOT-HERE ,LOCAL-GLOBALS>)>>
<OBJECT FRUSTATION
(LOC GLOBAL-OBJECTS)
(DESC "puzzle")
(SYNONYM FRUSTRATION PROBLEM PUZZLE)
(ACTION FRUSTRATION-F)>
<ROUTINE FRUSTRATION-F ()
<COND (<VERB? ENJOY>
<TELL ,ZEN CR>)>>
<OBJECT STAIRS
(LOC LOCAL-GLOBALS)
(DESC "stairs")
(SYNONYM STAIRS STAIRWAY STAIR)
;(GENERIC GENERIC-STAIRS)
(FLAGS SEENBIT)
;(ACTION UPSTAIRS-DOWNSTAIRS)>
<ROUTINE DO-INSTEAD-OF (OBJ1 OBJ2)
<COND (<EQUAL? ,PRSI .OBJ2> <PERFORM ,PRSA ,PRSO .OBJ1> <RTRUE>)
(<EQUAL? ,PRSO .OBJ2> <PERFORM ,PRSA .OBJ1 ,PRSI> <RTRUE>)
;(T <PERFORM ,PRSA ,PRSO ,PRSI> <RTRUE>)
(T <V-FOO>)>>
<OBJECT TURN
(LOC GLOBAL-OBJECTS)
(ADJECTIVE INT.NUM ;NUMBER FULL)
(SYNONYM TURN TURNS MINUTE MINUTES)
(DESC "turn" ;"minute")
(ACTION TURN-F)>
<ROUTINE TURN-F ()
<COND (<VERB? USE>
<PERFORM ,V?WAIT-FOR ,PRSO>
<RTRUE>)>>
<OBJECT IT
(LOC GLOBAL-OBJECTS)
(SYNONYM IT THIS FUCKER SUCKER)
(DESC "it")
(FLAGS VOWELBIT NARTICLEBIT)
(ACTION IT-F)>
<ROUTINE IT-F ()
<COND (<OR <AND <IOBJ? IT>
;<FSET? ,PRSO ,PERSONBIT>
<VERB? ASK-ABOUT ASK-FOR SEARCH-FOR TELL-ABOUT>>
<AND <DOBJ? IT>
<VERB? ASK-CONTEXT-ABOUT ASK-CONTEXT-FOR FIND ;WHAT>>>
<TELL "\"I'm not sure what you're talking about.\"" CR>)>>
<OBJECT FLOOR
(LOC GLOBAL-OBJECTS)
(DESC "floor")
;(ADJECTIVE DRAWING ;ROOM GREAT ;HALL)
(SYNONYM FLOOR ;AREA GROUND CARPET RUG)
(FLAGS SEENBIT SURFACEBIT OPENBIT)
(ACTION FLOOR-F)>
<ROUTINE FLOOR-F ("AUX" (OBJ <>) N)
<COND ;(<REMOTE-VERB?> <RFALSE>)
(<VERB? CLIMB-ON>
<ALREADY ,WINNER "on it">)
(<AND <VERB? PUT THROW-AT>
;<NOT <DOBJ? MOONMIST>>
<IOBJ? FLOOR>>
<MOVE ,PRSO ,HERE>
<TELL "Okay." CR>
<RTRUE>)
(<VERB? EXAMINE LOOK-ON SEARCH SEARCH-FOR>
<START-SEARCH .OBJ>
<RTRUE>)>>
<ROUTINE START-SEARCH ("OPTIONAL" (OBJ <>))
<TELL
"Nothing suspicious meets your eye after a moment's scrutiny. Do you want
to continue?">
<COND (<NOT <YES?>>
<OKAY>
<RTRUE>)
(T
<SETG FOUND-IT .OBJ>
<SETG FOUND-LOC ,HERE>
<QUEUE I-FOUND-IT <RANDOM 7>>
<V-WAIT 8 <> T>
<RTRUE>)>>
<GLOBAL FOUND-IT:OBJECT <>>
<GLOBAL FOUND-LOC:OBJECT <>>
<CONSTANT NOTHING-NEW "You don't find anything new there.|">
<ROUTINE I-FOUND-IT ("OPTIONAL" (GARG <>) "AUX" OBJ)
%<DEBUG-CODE <COND (<OR ,IDEBUG <==? .GARG ,G-DEBUG>>
<TELL "[I-FOUND-IT:">
<COND (<==? .GARG ,G-DEBUG> <RFALSE>)>)>>
<COND (<NOT <EQUAL? ,FOUND-LOC ,HERE>>
<RFALSE>)
(T ;<ZERO? ,FOUND-IT>
<TELL ,NOTHING-NEW>
<RFATAL>)>>
<OBJECT DANGER
(LOC GLOBAL-OBJECTS)
(DESC "danger")
(SYNONYM DANGER THREAT ATTACK)>
<OBJECT INTNUM
(LOC GLOBAL-OBJECTS)
(SYNONYM INT.NUM ;NUMBER)
(DESC "number")>
<OBJECT YOU
(LOC GLOBAL-OBJECTS)
(SYNONYM YOU YOURSELF HIMSELF HERSELF)
(DESC "self" ;"himself or herself")
(FLAGS ;NARTICLEBIT)
(ACTION YOU-F)>
<ROUTINE YOU-F ("AUX" X)
<COND (<NOT <==? ,WINNER ,PLAYER>>
<DO-INSTEAD-OF ,WINNER ,YOU>
<RTRUE>)
(<AND <VERB? ASK-ABOUT> <IOBJ? YOU>>
<PERFORM ,V?ASK-ABOUT ,PRSO ,PRSO>
<RTRUE>)
(<AND <VERB? THANK>
<SET X <QCONTEXT-GOOD?>>>
<PERFORM ,V?THANK .X>
<RTRUE>)>>
;<OBJECT HINT
(DESC "hint")
(LOC GLOBAL-OBJECTS)
(SYNONYM HINT HELP)
(ACTION HINT-F)>
;<ROUTINE HINT-F ()
<COND (<VERB? FIND>
<HELP-TEXT>)
(<VERB? ASK-FOR ASK-CONTEXT-FOR TAKE>
<MORE-SPECIFIC>)>>
<OBJECT WALL
(LOC GLOBAL-OBJECTS)
(DESC "wall")
(ADJECTIVE BRICK NORTH SOUTH)
(SYNONYM WALL WALLS BRICK BRICKS)
(FLAGS SEENBIT SURFACEBIT OPENBIT)
(ACTION WALL-F)>
<ROUTINE WALL-F ("AUX" OBJ)
<COND (<AND <VERB? OPEN CLOSE>
<T? <SET OBJ <FIND-FLAG-LG ,HERE ,DOORBIT ,SECRETBIT>>>>
<DO-INSTEAD-OF .OBJ ,WALL>
<RTRUE>)
(<VERB? KNOCK>
<COND (<OR <NOT <FSET? ,HERE ,WEARBIT> ;"WING-ROOMS">
<FIND-FLAG-LG ,HERE ,DOORBIT ,SECRETBIT>>
<TELL "You hear a hollow sound." CR>)
(T <TELL
"Knocking on the walls reveals nothing unusual." CR>)>)>>
;<ROUTINE GENERIC-ROOM (X "OPTIONAL" Y) ,GLOBAL-HERE>
<OBJECT GLOBAL-HERE
(LOC GLOBAL-OBJECTS)
(DESC "here")
(ADJECTIVE THIS)
(SYNONYM HERE AREA ROOM PLACE)
;(GENERIC GENERIC-ROOM)
(FLAGS NARTICLEBIT)
(ACTION GLOBAL-HERE-F)>
<ROUTINE GLOBAL-HERE-F ("AUX" OBJ (X <>))
<COND (<VERB? EXAMINE LIE SIT SMELL WALK-TO>
<DO-INSTEAD-OF ,HERE ,GLOBAL-HERE>
<RTRUE>)
(<VERB? PUT PUT-IN ;TIE-TO>
<MORE-SPECIFIC>)
(<VERB? SEARCH SEARCH-FOR>
<COND (<AND <T? ,PRSI>
<==? <META-LOC ,PRSI> ,HERE>>
<SET X ,PRSI>)
(T
<SET OBJ <FIRST? ,HERE>>
<REPEAT ()
<COND (<ZERO? .OBJ>
<RETURN>)
(<FSET? .OBJ ,SECRETBIT>
<SET X .OBJ>
<RETURN>)
(<AND <NOT <FSET? .OBJ ,PERSONBIT>>
<OR <FSET? .OBJ ,CONTBIT>
<FSET? .OBJ ,SURFACEBIT>>
<OR <SET X <FIND-IN .OBJ ,SECRETBIT>>
<SET X <FIND-IN .OBJ ,RMUNGBIT>>>>
<FSET .OBJ ,OPENBIT>
<RETURN>)
(T <SET OBJ <NEXT? .OBJ>>)>>)>
<START-SEARCH .X>
<RTRUE>)>>
<OBJECT CHAIR
(LOC LOCAL-GLOBALS)
(DESC "chair")
;(ADJECTIVE WING)
(SYNONYM CHAIR SEAT CHAIRS BENCH)
(FLAGS SEENBIT SURFACEBIT ;VEHBIT)
(ACTION CHAIR-F)>
<ROUTINE CHAIR-F ()
<COND (<VERB? SIT ;LOOK-UNDER CLIMB-ON ;CLIMB-DOWN BOARD>
<WONT-HELP>)
(T <RANDOM-PSEUDO>)>>
<OBJECT TABLE-RANDOM
(LOC LOCAL-GLOBALS)
(DESC "table")
;(ADJECTIVE BILLIARD CARD)
(SYNONYM TABLE DESK)
(FLAGS SEENBIT)
(ACTION RANDOM-PSEUDO)>
<OBJECT SLEEP-GLOBAL
(LOC GLOBAL-OBJECTS)
;(ADJECTIVE ;SOME MY)
(SYNONYM SLEEP)
(DESC "sleep")
(FLAGS NARTICLEBIT)
(ACTION SLEEP-GLOBAL-F)>
<ROUTINE SLEEP-GLOBAL-F ()
<COND (<VERB? WALK-TO>
<PERFORM ,V?FAINT>
<RTRUE>)>>
<ROUTINE ROB (WHAT THIEF "OPTIONAL" (TELL? <>) "AUX" N X (TOLD? <>))
<SET X <FIRST? .WHAT>>
<REPEAT ()
<COND (<NOT .X> <RETURN>)>
<SET N <NEXT? .X>>
;<COND (<NOT <FSET? .X ,TAKEBIT>>
<SET X .N>
<AGAIN>)>
<COND (<AND <NOT .N> .TOLD? .TELL?>
<TELL " and">)>
<SET TOLD? T>
<COND (.TELL?
<TELL the .X>
<COND (.N <TELL !\,>)
(T <TELL ". ">)>)>
<MOVE .X .THIEF>
;<FCLEAR .X ,TAKEBIT>
<SET X .N>>>
<OBJECT LIGHT-GLOBAL
(LOC GLOBAL-OBJECTS)
(DESC "light")
(ADJECTIVE FLOOD MOON)
(SYNONYM LIGHT LIGHTS LAMP MOONLIGHT)
(FLAGS SEENBIT TRYTAKEBIT)
(ACTION LIGHT-GLOBAL-F)>
<ROUTINE LIGHT-GLOBAL-F ("AUX" P)
<COND (<REMOTE-VERB?> <RFALSE>)
(<VERB? LAMP-ON LAMP-OFF>
<COND (<AND <OUTSIDE? ,HERE> ;<NOT <EQUAL? ,HERE ,CAR>>>
<TELL "You can't reach it from here." CR>)
(<VERB? LAMP-ON>
<COND (<FSET? ,HERE ,ONBIT>
<ALREADY ,LIGHT-GLOBAL "on">)
(T
<FSET ,HERE ,ONBIT>
<OKAY ,LIGHT-GLOBAL "on">)>)
(<VERB? LAMP-OFF>
<COND (<NOT <FSET? ,HERE ,ONBIT>>
<ALREADY ,LIGHT-GLOBAL "off">)
(<SET P <FIND-FLAG-HERE-NOT ,PERSONBIT ,MUNGBIT ,PLAYER>>
<TELL
D .P " says, \"Please don't leave us in the dark.\"" CR>)
(T
<FCLEAR ,HERE ,ONBIT>
<OKAY ,LIGHT-GLOBAL "off">)>)>)>>
<ADJ-SYNONYM MY MINE YOUR>
<OBJECT HANDS
(LOC GLOBAL-OBJECTS)
(SYNONYM HANDS HAND)
(ADJECTIVE BARE ;MY)
(OWNER BODY-PARTS-OWNERS)
(DESC ;"your " "hand")
(FLAGS NDESCBIT TOUCHBIT NARTICLEBIT)
(ACTION HANDS-F)>
<ROUTINE HANDS-F (ACTOR)
<COND ;(<VERB? WAVE>
<PERFORM ,V?WAVE-AT>
<RTRUE>)
(<VERB? SHAKE>
<COND (<SET ACTOR <FIND-IN ,HERE ,PERSONBIT>>
<PERFORM ,V?THANK .ACTOR>
<RTRUE>)
(T
<TELL "Pleased to meet you." CR>)>)>>
;<ROUTINE HANDS-F ("AUX" P A)
<COND (<NOT <SET P <FIND-BODY ,HANDS>>>
<RTRUE>)
(<REMOTE-VERB?>
<RFALSE>)>
<COND ;(<EQUAL? .P ,PLAYER>
<COND (<VERB? BRUSH>
<RFALSE>)>)
(<VERB? KISS>
<COND (<AND <FSET? .P ,FEMALEBIT>
<T? ,GENDER-KNOWN>
<NOT <FSET? ,PLAYER ,FEMALEBIT>>>
<PERFORM ,V?HELLO .P>)
(T
<PERFORM ,V?KISS .P>)>
<RTRUE>)
(<AND <VERB? SHAKE TAKE> <DOBJ? HANDS>>
<COND (<T? ,PRSI> ;<ZERO? .P>
<SET P ,PRSI>)>
;<COND (<ZERO? .P>
<COND ;(<ADJ-USED? ,W?HER>
<SET P <FIND-FLAG-HERE-BOTH ,PERSONBIT,FEMALEBIT,WINNER>>
<COND (<ZERO? .P>
<TELL "There's no woman here!" CR>
<RTRUE>)>)
;(<ADJ-USED? ,W?HIS>
<SET P <FIND-FLAG-HERE-NOT ,PERSONBIT ,FEMALEBIT,WINNER>>
<COND (<ZERO? .P>
<TELL "There's no man here!" CR>
<RTRUE>)>)
(T
<SET P <FIND-FLAG-HERE ,PERSONBIT ,WINNER>>
<COND (<ZERO? .P>
<TELL "There's no one here!" CR>
<RTRUE>)>)>)>
<PERFORM ,V?HELLO .P>
<RTRUE>)>>
<OBJECT HEAD
(LOC GLOBAL-OBJECTS)
(OWNER BODY-PARTS-OWNERS)
(DESC ;"your " "head")
(SYNONYM HEAD FACE)
(FLAGS NARTICLEBIT)
(ACTION HEAD-F)>
<ROUTINE HEAD-F ()
<COND (<VERB? NOD>
<PERFORM ,V?YES>
<RTRUE>)
(<VERB? SHAKE>
<PERFORM ,V?NO>
<RTRUE>)>>
<OBJECT EYES
(LOC GLOBAL-OBJECTS)
(OWNER BODY-PARTS-OWNERS)
(DESC ;"your " "eyes")
(SYNONYM EYE EYES)
(FLAGS NARTICLEBIT)
(ACTION EYES-F)>
<ROUTINE EYES-F ()
<COND (<VERB? OPEN>
<TELL "They are." CR>)
(<VERB? CLOSE>
<TELL "That won't help." CR>)>>
<OBJECT TEETH
(LOC GLOBAL-OBJECTS)
(DESC ;"your " "teeth")
(SYNONYM TEETH)
(FLAGS NARTICLEBIT)>
<OBJECT EARS
(LOC GLOBAL-OBJECTS)
(DESC ;"your " "ears")
(SYNONYM EAR EARS)
(FLAGS NARTICLEBIT)>
<OBJECT THIRD-PLANET
(LOC GLOBAL-OBJECTS)
(DESC "third planet")
(ADJECTIVE THIRD BLUE BLUE-GREEN GREEN SMALL)
(SYNONYM PLANET EARTH)
(FLAGS NDESCBIT)
(ACTION THIRD-PLANET-F)>
<ROUTINE THIRD-PLANET-F ()
<COND (<VERB? LEAVE DISEMBARK>
<TELL "You did!" CR>)
(<VERB? EXAMINE>
<TELL
"It is an utterly insignificant little blue-green planet, of the sort
where they probably still wear digital watches." CR>)>>
<OBJECT OBJECT-OF-GAME
(LOC GLOBAL-OBJECTS)
(DESC "object of the game")
(SYNONYM OBJECT GAME GOAL)
(FLAGS VOWELBIT)
(ACTION OBJECT-OF-GAME-F)>
<ROUTINE OBJECT-OF-GAME-F ()
<COND (<VERB? ASK-ABOUT TALK-ABOUT TELL-ABOUT>
<TELL "That's for me to know and you to find out." CR>)>>
<OBJECT SKY
(LOC GLOBAL-OBJECTS)
(DESC "sky")
(SYNONYM SKY)
(ACTION SKY-F)>
<ROUTINE SKY-F ()
<COND (<NOT <OUTSIDE? ,HERE>>
<NOT-HERE ,SKY>)
;(<AND <IN? ,FLEET ,HERE>
<VERB? EXAMINE>>
<TELL
"The sky is filled with the ships of the " D ,FLEET "." CR>)>>