forked from historicalsource/arthur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rednite.zil
597 lines (579 loc) · 13.8 KB
/
rednite.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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
;"***************************************************************************"
; "game : Arthur"
; "file : REDNITE.ZIL"
; "auth : $Author: RAB $"
; "date : $Date: 15 May 1989 17:29:56 $"
; "revs : $Revision: 1.62 $"
; "vers : 1.0"
;"---------------------------------------------------------------------------"
; "Red Knight Puzzle"
; "Copyright (C) 1989 Infocom, Inc. All rights reserved."
;"***************************************************************************"
;"---------------------------------------------------------------------------"
; "RM-END-OF-CAUSEWAY"
;"---------------------------------------------------------------------------"
<ROOM RM-END-OF-CAUSEWAY
(LOC ROOMS)
(DESC "end of causeway")
(FLAGS FL-LIGHTED)
(WEST TO RM-FIELD-OF-HONOUR)
(SOUTH PER RT-RED-KNIGHT-GIFTS)
(UP PER RT-FLY-UP)
(GLOBAL LG-LAKE RM-ISLAND RM-CAUSEWAY RM-FIELD-OF-HONOUR)
(ACTION RT-RM-END-OF-CAUSEWAY)
>
<CONSTANT K-RAVEN-EGG-MSG " the egg of a giant raven">
<CONSTANT K-DRAGON-HAIR-MSG " the hair that grows between the eyes of a dragon">
<CONSTANT K-BOAR-TUSK-MSG " the tusk of the wild boar that stalks the enchanted forest">
<CONSTANT K-GOLDEN-FLEECE-MSG " the golden fleece of the evil demon Nudd">
<ROUTINE RT-RM-END-OF-CAUSEWAY ("OPT" (CONTEXT <>) "AUX" N)
<COND
(<MC-CONTEXT? ,M-F-LOOK ,M-V-LOOK ,M-LOOK>
<FSET ,CH-RED-KNIGHT ,FL-SEEN>
<FSET ,LG-LAKE ,FL-SEEN>
<FSET ,RM-ISLAND ,FL-SEEN>
<FSET ,RM-FIELD-OF-HONOUR ,FL-SEEN>
<TELL
"You are at the end of a causeway which is guarded by" a ,CH-RED-KNIGHT
". The causeway leads south across the lake to an island. The Field of Honour
lies to the west.|"
>
<RFALSE>
)
(<MC-CONTEXT? ,M-ENTER>
<SETG GL-PICTURE-NUM ,K-PIC-RED-KNIGHT>
<COND
(<EQUAL? ,GL-WINDOW-TYPE ,K-WIN-PICT>
<RT-UPDATE-PICT-WINDOW>
)
>
<RFALSE>
)
(<MC-CONTEXT? ,M-ENTERED>
<COND
(<NOT <MC-FORM? ,K-FORM-ARTHUR>>
<RFALSE>
)
(<EQUAL? ,GL-GIFT-COUNT 255>
<SETG GL-GIFT-COUNT 0>
<TELL CR The ,CH-RED-KNIGHT " stands ">
<COND
(<EQUAL? ,OHERE ,RM-FIELD-OF-HONOUR>
<TELL
"at attention before you, staring off into the distance. He acknowleges
your presence enough to say,"
>
)
(T
<TELL
"at attention with his back to you. Suddenly he looks around and says, \"How
did you get there? ... No matter.\" He eyes you warily and continues,"
>
)
>
<TELL
" \"You shall get no further unless you bring me" ,K-RAVEN-EGG-MSG ","
,K-DRAGON-HAIR-MSG "," ,K-BOAR-TUSK-MSG ", and" ,K-GOLDEN-FLEECE-MSG ".\"" CR
>
)
(<EQUAL? ,GL-GIFT-COUNT 4>
<TELL
CR The ,CH-RED-KNIGHT " acknowledges your arrival with a polite nod and
indicates that you are free to pass by." CR
>
)
(T
<TELL
"|The knight removes his stare from the horizon long enough to say, "
>
<RT-RED-GIFTS-MSG>
)
>
)
(<MC-CONTEXT? ,M-END>
<COND
(<AND <VERB? TRANSFORM>
<NOT <MC-FORM? ,GL-OLD-FORM>>
>
<TELL
CR The ,CH-RED-KNIGHT " cries, \"Sorcery! Work of the Devil!!\" He kills
you instantly." ,K-HEEDED-WARNING-MSG
>
<RT-END-OF-GAME>
)
>
)
(.CONTEXT
<RFALSE>
)
>
>
<GLOBAL GL-GIFT-COUNT 255 <> BYTE>
<ROUTINE RT-RED-GIFTS-MSG ("AUX" N)
<TELL "\"You ">
<COND
(<G? ,GL-GIFT-COUNT 0>
<TELL "have given me">
<REPEAT ((OBJ <FIRST? ,CH-RED-KNIGHT>) (1ST? T) NXT)
<COND
(<NOT .OBJ>
<RETURN>
)
(T
<SET NXT <NEXT? .OBJ>>
<COND
(.1ST?
<SET 1ST? <>>
)
(T
<TELL comma .NXT>
)
>
<TELL the .OBJ>
)
>
<SET OBJ .NXT>
>
<TELL " but you ">
)
>
<TELL "still may not pass until you have given me">
<SET N 0>
<COND
(<NOT <IN? ,TH-RAVEN-EGG ,CH-RED-KNIGHT>>
<INC N>
<TELL ,K-RAVEN-EGG-MSG>
)
>
<COND
(<NOT <IN? ,TH-DRAGON-HAIR ,CH-RED-KNIGHT>>
<INC N>
<COND
(<G? .N 1>
<TELL comma <L? <+ .N ,GL-GIFT-COUNT> 4>>
)
>
<TELL ,K-DRAGON-HAIR-MSG>
)
>
<COND
(<NOT <IN? ,TH-TUSK ,CH-RED-KNIGHT>>
<INC N>
<COND
(<G? .N 1>
<TELL comma <L? <+ .N ,GL-GIFT-COUNT> 4>>
)
>
<TELL ,K-BOAR-TUSK-MSG>
)
>
<COND
(<NOT <IN? ,TH-FLEECE ,CH-RED-KNIGHT>>
<INC N>
<COND
(<G? .N 1>
<TELL comma <L? <+ .N ,GL-GIFT-COUNT> 4>>
)
>
<TELL ,K-GOLDEN-FLEECE-MSG>
)
>
<TELL ".\"" CR>
>
;"---------------------------------------------------------------------------"
; "CH-RED-KNIGHT"
;"---------------------------------------------------------------------------"
<OBJECT CH-RED-KNIGHT
(LOC RM-END-OF-CAUSEWAY)
(DESC "red knight")
(FLAGS FL-ALIVE FL-PERSON FL-NO-DESC FL-SEARCH FL-OPEN FL-TRYTAKE)
(SYNONYM KNIGHT PERSON MAN ARMOUR ARMOR)
(ADJECTIVE RED)
(ACTION RT-CH-RED-KNIGHT)
(CONTFCN RT-CH-RED-KNIGHT)
(GENERIC RT-GN-ARMOUR)
>
<ROUTINE RT-CH-RED-KNIGHT ("OPT" (CONTEXT <>) "AUX" (NL? T))
<COND
(<MC-CONTEXT? ,M-WINNER>
<COND
(<AND <VERB? TELL-ABOUT>
<MC-PRSO? ,CH-PLAYER>
>
<RFALSE>
)
(<VERB? WHO WHAT>
<RFALSE>
)
(T
<TELL
The+verb ,CH-RED-KNIGHT "continue" " to stare straight ahead, ignoring your
presence." CR
>
)
>
)
(<MC-CONTEXT? ,M-CONT>
<COND
(<VERB? ASK-FOR>
<TELL
The+verb ,CH-RED-KNIGHT "steal" " a quick glance at you. \"It's very good of
you to ask. The answer is no.\"" CR
>
)
(<AND <VERB? ASK-ABOUT>
<NOT ,NOW-PRSI>
>
<TELL
The ,CH-RED-KNIGHT " nods imperceptibly and says out of the side of his
mouth, \"Yes, I have it. Thank you very much.\"" CR
>
)
(<VERB? TRADE-FOR>
<TELL
The ,CH-RED-KNIGHT " refuses your offer, saying, \"I'm sorry. No
substitutions.\"" CR
>
)
(<TOUCH-VERB?>
<TELL
The ,CH-RED-KNIGHT " moves" the ,PRSO " beyond your grasp and cuffs you on
the head, saying, \"It's not polite to take things without asking.\"" CR
>
)
>
)
(.CONTEXT
<RFALSE>
)
(,NOW-PRSI
<COND
(<VERB? GIVE SHOW>
<COND
(<EQUAL? ,PRSO
,TH-RAVEN-EGG
,TH-DRAGON-HAIR
,TH-TUSK
,TH-FLEECE
>
<MOVE ,PRSO ,CH-RED-KNIGHT>
<FSET ,PRSO ,FL-TRY-TAKE>
<FSET ,PRSO ,FL-NO-DESC>
<SETG GL-GIFT-COUNT <+ ,GL-GIFT-COUNT 1>>
<SETG GL-UPDATE-WINDOW <BOR ,GL-UPDATE-WINDOW ,K-UPD-INVT>>
<TELL The ,CH-RED-KNIGHT " takes" the ,PRSO>
<COND
(<EQUAL? ,GL-GIFT-COUNT 1>
<TELL
" and says, \"Now this is a very nice start. But I must have the other items
to let you by.\""
>
)
(<EQUAL? ,GL-GIFT-COUNT 2>
<TELL
", looks at you with delight and says, \"Well done. These aren't easy to come
by.\""
>
)
(<EQUAL? ,GL-GIFT-COUNT 3>
<TELL
" and says, \"You have been busy, haven't you. Still, there is that one other
item I mentioned.\""
>
)
(<EQUAL? ,GL-GIFT-COUNT 4>
<TELL
" and looks at you with new-found respect. \"Appearances deceive,\" he says.
\"The one who has done these things must be more than a mere boy.\" He steps
aside to let you pass."
>
)
>
<COND
(<G? ,P-MULT 1>
<TELL " ">
<SET NL? <>>
)
(T
<CRLF>
)
>
<RT-SCORE-MSG 0 0 0 1 .NL?>
<COND
(<G? ,P-MULT 1>
<CRLF>
)
>
)
(<EQUAL? ,PRSO ,TH-BRASS-EGG>
<TELL
The ,CH-RED-KNIGHT " refuses your offer, saying, \"This imitation might take
in a giant raven, but it would never fool me.\"" CR
>
)
(T
<TELL
The ,CH-RED-KNIGHT " refuses your offer, saying, \"I'm sorry. No substitutions.\"" CR
>
)
>
)
>
)
(<AND <VERB? TELL>
,P-CONT
>
; "Message and RFATAL if don't want knight to become winner"
<RFALSE>
)
(<VERB? ASK-ABOUT>
<COND
(<MC-PRSI? ,TH-RAVEN-EGG ,CH-RAVEN>
<TELL
"\"The giant raven nests deep within the enchanted forest. It cannot be
killed, but if I have the egg, I can lessen its evil.\"" CR
>
)
(<MC-PRSI? ,TH-DRAGON-HAIR ,CH-DRAGON>
<TELL
"\"The dragon guards the entrance to the demon's mountain.\"" CR
>
)
(<MC-PRSI? ,TH-TUSK ,TH-BOAR>
<TELL
"\"The boar roams the enchanted forest, making it unsafe for all who dwell
there.\"" CR
>
)
(<MC-PRSI? ,TH-FLEECE>
<TELL
"\"It was stolen by an evil demon who lets no one come near it.\"" CR
>
)
(<MC-PRSI? ,TH-BRASS-EGG>
<TELL
"He glances around quickly to see if anyone is looking, and then he
lowers his voice and says, \"It looks like the kind of the trash the
invisible knight deals in. Why they don't put that guy out of business
is beyond me.\"" CR
>
)
(<MC-PRSI? ,CH-RED-KNIGHT>
<TELL
"\"I stand here night and day. Anyone who would pass by me must prove his
worth by helping rid the countryside of the evils that beset it.\"" CR
>
)
(<MC-PRSI? ,CH-MERLIN>
<TELL "\"Like myself, he seeks to rid the land of evil.\"" CR>
)
(<MC-PRSI? ,CH-DEMON>
<TELL
"\"He is evil incarnate. I shall never rest until he is slain.\"" CR
>
)
(<MC-PRSI? ,CH-LOT>
<TELL
"\"Let him come here himself and he will find out soon enough what I think of
him.\"" CR
>
)
(<MC-PRSI? ,CH-PLAYER>
<TELL
"\"I know nothing about you. Yet there is something in your manner that
tells me you will succeed in your quest.\"" CR
>
)
(<MC-PRSI? ,TH-MASTER>
<TELL "\"I answer only to the gods.\"" CR>
)
(<MC-PRSI? ,TH-EXCALIBUR>
<TELL
"\"With such a sword, a brave and true knight could rid the land of all
evil.\"" CR
>
)
(T
<TELL
"\"I'm sorry. I am not at liberty to reveal anything about" him ,PRSI ".\"" CR
>
)
>
)
(<VERB? EXAMINE>
<FSET ,CH-RED-KNIGHT ,FL-SEEN>
<COND
(<NOUN-USED? ,CH-RED-KNIGHT ,W?ARMOUR ,W?ARMOR>
<TELL
"It's bright red, symbolizing the knight's magnanimity and fortitude." CR
>
)
(T
<TELL
"He stands stiffly at attention and stares straight ahead. His uniform is
bright red armour." CR
>
)
>
)
(<VERB? ASK-FOR>
<TELL
The ,CH-RED-KNIGHT " responds, \"I do not have" him ,PRSI ".\"" CR
>
)
(<VERB? ATTACK>
<COND
(<OR <NOT <MC-FORM? ,K-FORM-ARTHUR>>
<EQUAL? ,GL-GIFT-COUNT 4>
>
<TELL
The ,CH-RED-KNIGHT " sidesteps your attack and looks at you in surprise." CR
>
)
(T
<TELL
The ,CH-RED-KNIGHT " easily fends you off and says, \"No need to get
violent, young fella. Just bring me the items I have asked for and you'll
find me willing enough to let you by.\"" CR
>
)
>
)
(<VERB? POLISH>
<TELL
"You give the knight a quick spit-shine. He says, \"Thanks, kid. I'd give
you a dime, but they haven't been invented yet. Take this instead.\" He
cuffs you on the side of the head." CR
>
)
(<VERB? HELLO GOODBYE>
<TELL
The+verb ,CH-RED-KNIGHT "continue" " to stare straight ahead, ignoring your
presence." CR
>
)
(<AND <VERB? TAKE>
<NOUN-USED? ,CH-RED-KNIGHT ,W?ARMOUR ,W?ARMOR>
>
<TELL
The+verb ,CH-RED-KNIGHT "cuff" " you on the side of the head and says, \"This
is my armour. "
>
<COND
(<NOT <IN? ,TH-ARMOUR ,CH-PLAYER>>
<TELL "Go find some of your own">
)
(T
<TELL "Hands off">
)
>
<TELL ".\"" CR>
)
(<VERB? CHALLENGE>
<TELL
"\"You can challenge me all you like, lad. But you're still not getting
past until you've brought me the items I mentioned.\"" CR
>
)
>
>
;"---------------------------------------------------------------------------"
; "RT-RED-KNIGHT-GIFTS"
;"---------------------------------------------------------------------------"
<ROUTINE RT-RED-KNIGHT-GIFTS ("OPT" (QUIET <>))
<COND
(<OR .QUIET
<NOT <MC-FORM? ,K-FORM-ARTHUR>>
>
<RETURN ,RM-CAUSEWAY>
)
(<EQUAL? ,GL-GIFT-COUNT 4>
<TELL The ,CH-RED-KNIGHT " steps aside to let you pass.||">
<RETURN ,RM-CAUSEWAY>
)
(T
<TELL The ,CH-RED-KNIGHT " blocks your path and says, ">
<RT-RED-GIFTS-MSG>
<RFALSE>
)
>
>
;"---------------------------------------------------------------------------"
; "RM-CAUSEWAY"
;"---------------------------------------------------------------------------"
<ROOM RM-CAUSEWAY
(LOC ROOMS)
(DESC "causeway")
(FLAGS FL-LIGHTED)
(SYNONYM CAUSEWAY)
(EAST PER RT-YOU-WOULD-DROWN)
(WEST PER RT-YOU-WOULD-DROWN)
(NORTH TO RM-END-OF-CAUSEWAY)
(SOUTH TO RM-ISLAND)
(UP PER RT-FLY-UP)
(DOWN PER RT-YOU-WOULD-DROWN)
(GLOBAL RM-ISLAND)
(ACTION RT-RM-CAUSEWAY)
(THINGS <> (ROCK ROCKS) RT-PS-ROCKS)
>
<ROUTINE RT-RM-CAUSEWAY ("OPT" (CONTEXT <>))
<COND
(<MC-CONTEXT? ,M-F-LOOK ,M-V-LOOK ,M-LOOK>
<COND
(<MC-CONTEXT? ,M-LOOK>
<FSET ,RM-ISLAND ,FL-SEEN>
<TELL
"You are" standing " on a causeway that leads from the mainland south to the island."
>
)
(<EQUAL? ,OHERE ,RM-END-OF-CAUSEWAY>
<FSET ,RM-ISLAND ,FL-SEEN>
<TELL
"You" walk " past the knight onto the causeway that leads south to the island."
>
)
(<EQUAL? ,OHERE ,RM-ISLAND>
<TELL
"You step onto the causeway that leads north to the mainland."
>
)
(T
<TELL
"You land on the causeway that leads south to the island, and north to the
mainland."
>
)
>
<CRLF>
<RFALSE>
)
(<MC-CONTEXT? ,M-ENTER>
<SETG GL-PICTURE-NUM ,K-PIC-CAUSEWAY>
<COND
(<EQUAL? ,GL-WINDOW-TYPE ,K-WIN-PICT>
<RT-UPDATE-PICT-WINDOW>
)
>
<RFALSE>
)
(.CONTEXT
<RFALSE>
)
>
>
;"---------------------------------------------------------------------------"
; "RT-YOU-WOULD-DROWN"
;"---------------------------------------------------------------------------"
<ROUTINE RT-YOU-WOULD-DROWN ("OPT" (QUIET <>))
<COND
(<NOT .QUIET>
<TELL
"If you went that way, you would drown." CR
>
)
>
<RFALSE>
>
;"***************************************************************************"
; "end of file"
;"***************************************************************************"