-
Notifications
You must be signed in to change notification settings - Fork 15
/
chestnut.zil
472 lines (451 loc) · 9.89 KB
/
chestnut.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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
;"***************************************************************************"
; "game : Arthur"
; "file : CHESTNUT.ZIL"
; "auth : $Author: DEB $"
; "date : $Date: 11 May 1989 23:51:28 $"
; "revs : $Revision: 1.43 $"
; "vers : 1.0"
;"---------------------------------------------------------------------------"
; "Horse Chestnuts"
; "Copyright (C) 1989 Infocom, Inc. All rights reserved."
;"***************************************************************************"
;"---------------------------------------------------------------------------"
; "RM-CHESTNUT-PATH"
;"---------------------------------------------------------------------------"
<ROOM RM-CHESTNUT-PATH
(LOC ROOMS)
(DESC "track")
(FLAGS FL-LIGHTED)
(SYNONYM PATH TRACK)
(ADJECTIVE FOREST)
(NORTH PER RT-SURVIVE-CONKERS)
(SE TO RM-LEP-PATH)
(UP PER RT-FLY-UP)
(GLOBAL LG-CHESTNUT-TREES LG-FOREST RM-GLADE)
(ACTION RT-RM-CHESTNUT-PATH)
>
<ROUTINE RT-RM-CHESTNUT-PATH ("OPT" (CONTEXT <>) "AUX" OBJ)
<COND
(<MC-CONTEXT? ,M-F-LOOK ,M-V-LOOK ,M-LOOK>
<FSET ,LG-CHESTNUT-TREES ,FL-SEEN>
<TELL
"You are" standing " on a track next to a stand of horse chestnut trees. The
track continues to the north and the southeast.|"
>
<RFALSE>
)
(<MC-CONTEXT? ,M-BEG>
<COND
(,GL-CONKERS-RUNNING
<COND
(<VERB? RAISE HIDE-BEHIND>
<COND
(<HELD? ,PRSO>
<TELL
"You hold up" the ,PRSO ", but" he+verb ,PRSO "are" " not large enough to
stop all the conkers from getting through." CR
>
)
>
)
(<VERB? SHIELD>
<COND
(<MC-PRSI? <> ,ROOMS>
<COND
(<IN? ,TH-SHIELD ,WINNER>
<SET OBJ ,TH-SHIELD>
)
(T
<SET OBJ ,TH-HANDS>
)
>
)
(T
<SET OBJ ,PRSI>
)
>
<COND
(<HELD? .OBJ>
<COND
(<EQUAL? .OBJ ,TH-SHIELD>
<COND
(<MC-PRSO? ,TH-HEAD>
<SETG GL-SHIELD-CONKERS 1>
)
(<MC-PRSO? ,TH-LEGS>
<SETG GL-SHIELD-CONKERS 2>
)
(T
<SETG GL-SHIELD-CONKERS 0>
)
>
)
>
<TELL
The+verb ,WINNER "hold" " up" the .OBJ ", but" he+verb .OBJ "are" " not large
enough to stop all the conkers from getting through." CR
>
)
>
)
(<VERB? SHIELD-FROM>
<COND
(<MC-PRSO? ,CH-PLAYER ,TH-HEAD ,TH-LEGS>
<COND
(<MC-PRSI? ,PSEUDO-OBJECT>
<COND
(<IN? ,TH-SHIELD ,WINNER>
<COND
(<MC-PRSO? ,TH-HEAD>
<SETG GL-SHIELD-CONKERS 1>
)
(<MC-PRSO? ,TH-LEGS>
<SETG GL-SHIELD-CONKERS 2>
)
(T
<SETG GL-SHIELD-CONKERS 0>
)
>
<TELL
The+verb ,WINNER "hold" " up" the ,TH-SHIELD ", but it is not large enough to
stop all the conkers from getting through." CR
>
)
>
)
>
)
>
)
>
)
>
)
(<MC-CONTEXT? ,M-ENTER>
<SETG GL-CONKERS-RUNNING <>>
<SETG GL-PICTURE-NUM ,K-PIC-FOREST-PATH>
<COND
(<EQUAL? ,GL-WINDOW-TYPE ,K-WIN-PICT>
<RT-UPDATE-PICT-WINDOW>
)
>
<RFALSE>
)
(.CONTEXT
<RFALSE>
)
>
>
<ROUTINE RT-SURVIVE-CONKERS ("OPT" (QUIET <>))
<COND
(<OR .QUIET
,GL-CONKERS-DONE
<AND
<NOT <MC-FORM? ,K-FORM-ARTHUR>>
<NOT ,GL-CONKERS-RUNNING>
>
>
<RETURN ,RM-GLADE>
)
(,GL-CONKERS-RUNNING
<TELL ,K-BARRAGE-MSG CR>
<RFALSE>
)
(T
<RT-QUEUE ,RT-I-CONKERS-1 <+ ,GL-MOVES 1>>
<SETG GL-CONKERS-RUNNING T>
<TELL
"When you try to pass, the horse chestnut trees suddenly start to pluck
conkers from their branches and pelt you with them. " ,K-BARRAGE-MSG " The
enchanted conkers hit you with amazing force, then fall to the ground
and disappear.|"
>
<RFALSE>
)
>
>
;"---------------------------------------------------------------------------"
; "TH-CONKERS"
;"---------------------------------------------------------------------------"
<OBJECT TH-CONKERS
(LOC RM-CHESTNUT-PATH)
(DESC "conkers")
(FLAGS FL-PLURAL FL-TRY-TAKE)
(SYNONYM CONKER CONKERS)
(ACTION RT-TH-CONKERS)
>
<ROUTINE RT-TH-CONKERS ("OPT" (CONTEXT <>))
<COND
(.CONTEXT
<RFALSE>
)
(<VERB? EXAMINE>
<COND
(,GL-CONKERS-RUNNING
<THIS-IS-IT ,PSEUDO-OBJECT>
<TELL "They come at you in a blur." CR>
)
(T
<THIS-IS-IT ,PSEUDO-OBJECT>
<TELL
"The conkers are hard brown nuts surrounded by spiky green shells." CR
>
)
>
)
(<TOUCH-VERB?>
<COND
(,GL-CONKERS-RUNNING
<THIS-IS-IT ,PSEUDO-OBJECT>
<TELL
"You can't catch any before they hit you, and after they hit you they
disappear." CR
>
)
(T
<THIS-IS-IT ,PSEUDO-OBJECT>
<TELL "They're all out of reach." CR>
)
>
)
>
>
;"---------------------------------------------------------------------------"
; "LG-CHESTNUT-TREES"
;"---------------------------------------------------------------------------"
<OBJECT LG-CHESTNUT-TREES
(LOC LOCAL-GLOBALS)
(DESC "chestnut trees")
(FLAGS FL-PLURAL)
(SYNONYM TREE TREES BRANCH BRANCHES)
(ADJECTIVE HORSE CHESTNUT)
(ACTION RT-LG-CHESTNUT-TREES)
>
<ROUTINE RT-LG-CHESTNUT-TREES ("OPT" (CONTEXT <>))
<COND
(<VERB? EXAMINE>
<FSET ,LG-CHESTNUT-TREES ,FL-SEEN>
<COND
(,GL-CONKERS-RUNNING
<TELL
The+verb ,LG-CHESTNUT-TREES "are" " plucking conkers from their own branches
and pelting you with them." CR
>
)
(<MC-HERE? ,RM-CHESTNUT-PATH>
<TELL
The+verb ,LG-CHESTNUT-TREES "are" " loaded with conkers." CR
>
)
(T
<THIS-IS-IT ,LG-CHESTNUT-TREES>
<TELL
"The stand of horse chestnut trees lies to the northwest." CR
>
)
>
)
(<VERB? ATTACK CUT>
<TELL "The sturdy bark is impervious to your assault." CR>
)
(<VERB? CLIMB-UP CLIMB-ON>
<TELL ,K-CLIMB-TREE-MSG>
)
(<TOUCH-VERB?>
<COND
(<NOT <MC-HERE? ,RM-CHESTNUT-PATH>>
<TELL The+verb ,LG-CHESTNUT-TREES "are" " too far away." CR>
)
>
)
>
>
<GLOBAL GL-CONKERS-DONE:FLAG <> <> BYTE>
<GLOBAL GL-CONKERS-RUNNING:FLAG <> <> BYTE>
<GLOBAL GL-SHIELD-CONKERS 0 <> BYTE>
<CONSTANT K-BARRAGE-MSG
"You try to move forward into the barrage, but get nowhere.">
<CONSTANT K-TREES-ATTACK-MSG "The horse chestnut trees continue to attack">
<CONSTANT K-PAIN-TOO-MUCH-MSG " The force of the repeated blows finally
overwhelms you. You fall to the ground and die.|">
<CONSTANT K-CONKER-HARMLESS-MSG "The conkers bounce harmlessly off your shell.|">
<ROUTINE RT-I-CONKERS-1 ()
<COND
(<MC-HERE? ,RM-CHESTNUT-PATH>
<RT-QUEUE ,RT-I-CONKERS-2 <+ ,GL-MOVES 1>>
<TELL
"|The horse chestnut trees are still bombarding you with conkers. "
>
<COND
(<OR <MC-FORM? ,K-FORM-TURTLE>
<EQUAL? ,GL-SHIELD-CONKERS 1 2>
<AND
<FSET? ,TH-ARMOUR ,FL-WORN>
<IN? ,TH-ARMOUR ,CH-PLAYER>
>
>
<TELL "Some bounce off your ">
<COND
(<MC-FORM? ,K-FORM-TURTLE>
<TELL "shell">
)
(<EQUAL? ,GL-SHIELD-CONKERS 1 2>
<TELL "shield">
)
(T
<TELL "armour">
)
>
<TELL " but others">
)
(T
<TELL "They">
)
>
<TELL " hit you on the ">
<COND
(<EQUAL? ,GL-SHIELD-CONKERS 0>
<TELL "head and legs">
)
(<EQUAL? ,GL-SHIELD-CONKERS 1> ; "shielded head"
<TELL "legs">
)
(<EQUAL? ,GL-SHIELD-CONKERS 2> ; "shielded legs"
<TELL "head">
)
>
<TELL
", causing intense pain. You won't be able to stand much more of this." CR
>
)
>
>
<ROUTINE RT-I-CONKERS-2 ()
<COND
(<MC-HERE? ,RM-CHESTNUT-PATH>
<RT-QUEUE ,RT-I-CONKERS-3 <+ ,GL-MOVES 1>>
<CRLF>
<COND
(<NOT <MC-FORM? ,K-FORM-TURTLE>>
<TELL
,K-TREES-ATTACK-MSG " you with conkers." ,K-PAIN-TOO-MUCH-MSG
>
<RT-END-OF-GAME>
)
(<OR <NOT <FSET? ,TH-HEAD ,FL-LOCKED>>
<NOT <FSET? ,TH-LEGS ,FL-LOCKED>>
>
<TELL "The conkers are still pelting against">
<COND
(<NOT <FSET? ,TH-HEAD ,FL-LOCKED>>
<TELL the ,TH-HEAD>
)
>
<COND
(<NOT <FSET? ,TH-LEGS ,FL-LOCKED>>
<COND
(<NOT <FSET? ,TH-HEAD ,FL-LOCKED>>
<TELL " and">
)
>
<TELL the ,TH-LEGS>
)
>
<TELL "." CR>
)
(T
<TELL ,K-CONKER-HARMLESS-MSG>
)
>
)
>
>
<ROUTINE RT-I-CONKERS-3 ()
<COND
(<MC-HERE? ,RM-CHESTNUT-PATH>
<CRLF>
<COND
(<RT-TREES-ATTACK?>
<RT-END-OF-GAME>
)
(T
<RT-QUEUE ,RT-I-CONKERS-4 <+ ,GL-MOVES 1>>
<TELL ,K-CONKER-HARMLESS-MSG>
)
>
)
>
>
<ROUTINE RT-I-CONKERS-4 ()
<COND
(<MC-HERE? ,RM-CHESTNUT-PATH>
<CRLF>
<COND
(<RT-TREES-ATTACK?>
<RT-END-OF-GAME>
)
(T
<RT-QUEUE ,RT-I-CONKERS-5 <+ ,GL-MOVES 1>>
<TELL
"The conkers continue to rain off your shell, but the barrage seems to be
lessening." CR
>
)
>
)
>
>
<ROUTINE RT-I-CONKERS-5 ()
<COND
(<MC-HERE? ,RM-CHESTNUT-PATH>
<CRLF>
<COND
(<RT-TREES-ATTACK?>
<RT-END-OF-GAME>
)
(T
<SETG GL-CONKERS-RUNNING <>>
<SETG GL-CONKERS-DONE T>
<TELL "The hailstorm of conkers ceases." CR>
<RT-SCORE-MSG 0 3 7 3>
)
>
)
>
>
<ROUTINE RT-TREES-ATTACK? ("AUX" T H L)
<COND
(<OR <SET T <NOT <MC-FORM? ,K-FORM-TURTLE>>>
<SET H <NOT <FSET? ,TH-HEAD ,FL-LOCKED>>>
<SET L <NOT <FSET? ,TH-LEGS ,FL-LOCKED>>>
>
<TELL ,K-TREES-ATTACK-MSG>
<COND
(.T
<TELL the ,CH-PLAYER>
)
(T
<COND
(.H
<TELL the ,TH-HEAD>
)
>
<COND
(.L
<COND
(.H
<TELL " and">
)
>
<TELL the ,TH-LEGS>
)
>
)
>
<TELL " with conkers." ,K-PAIN-TOO-MUCH-MSG>
)
>
>
;"***************************************************************************"
; "end of file"
;"***************************************************************************"