forked from historicalsource/zork1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1actions.zil
4178 lines (3852 loc) · 128 KB
/
1actions.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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"1ACTIONS for
Zork I: The Great Underground Empire
(c) Copyright 1983 Infocom, Inc. All Rights Reserved."
"SUBTITLE THE WHITE HOUSE"
<ROUTINE WEST-HOUSE (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are standing in an open field west of a white house, with a boarded
front door.">
<COND (,WON-FLAG
<TELL
" A secret path leads southwest into the forest.">)>
<CRLF>)>>
<ROUTINE EAST-HOUSE (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are behind the white house. A path leads into the forest
to the east. In one corner of the house there is a small window
which is ">
<COND (<FSET? ,KITCHEN-WINDOW ,OPENBIT>
<TELL "open.">)
(T <TELL "slightly ajar.">)>
<CRLF>)>>
<ROUTINE OPEN-CLOSE (OBJ STROPN STRCLS)
<COND (<VERB? OPEN>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL <PICK-ONE ,DUMMY>>)
(T
<TELL .STROPN>
<FSET .OBJ ,OPENBIT>)>
<CRLF>)
(<VERB? CLOSE>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL .STRCLS>
<FCLEAR .OBJ ,OPENBIT>
T)
(T <TELL <PICK-ONE ,DUMMY>>)>
<CRLF>)>>
<ROUTINE BOARD-F ()
<COND (<VERB? TAKE EXAMINE>
<TELL "The boards are securely fastened." CR>)>>
<ROUTINE TEETH-F ()
<COND (<AND <VERB? BRUSH>
<EQUAL? ,PRSO ,TEETH>>
<COND (<AND <EQUAL? ,PRSI ,PUTTY>
<IN? ,PRSI ,WINNER>>
<JIGS-UP
"Well, you seem to have been brushing your teeth with some sort of
glue. As a result, your mouth gets glued together (with your nose)
and you die of respiratory failure.">)
(<NOT ,PRSI>
<TELL
"Dental hygiene is highly recommended, but I'm not sure what you want
to brush them with." CR>)
(T
<TELL "A nice idea, but with a " D ,PRSI "?" CR>)>)>>
<ROUTINE GRANITE-WALL-F ()
<COND (<EQUAL? ,HERE ,NORTH-TEMPLE>
<COND (<VERB? FIND>
<TELL "The west wall is solid granite here." CR>)
(<VERB? TAKE RAISE LOWER>
<TELL "It's solid granite." CR>)>)
(<EQUAL? ,HERE ,TREASURE-ROOM>
<COND (<VERB? FIND>
<TELL "The east wall is solid granite here." CR>)
(<VERB? TAKE RAISE LOWER>
<TELL "It's solid granite." CR>)>)
(<EQUAL? ,HERE ,SLIDE-ROOM>
<COND (<VERB? FIND READ>
<TELL "It only SAYS \"Granite Wall\"." CR>)
(T <TELL "The wall isn't granite." CR>)>)
(T
<TELL "There is no granite wall here." CR>)>>
<ROUTINE SONGBIRD-F ()
<COND (<VERB? FIND TAKE>
<TELL "The songbird is not here but is probably nearby." CR>)
(<VERB? LISTEN>
<TELL "You can't hear the songbird now." CR>)
(<VERB? FOLLOW>
<TELL "It can't be followed." CR>)
(T
<TELL "You can't see any songbird here." CR>)>>
<ROUTINE WHITE-HOUSE-F ()
<COND (<EQUAL? ,HERE ,KITCHEN ,LIVING-ROOM ,ATTIC>
<COND (<VERB? FIND>
<TELL "Why not find your brains?" CR>)
(<VERB? WALK-AROUND>
<GO-NEXT ,IN-HOUSE-AROUND>
T)>)
(<NOT <OR <EQUAL? ,HERE ,EAST-OF-HOUSE ,WEST-OF-HOUSE>
<EQUAL? ,HERE ,NORTH-OF-HOUSE ,SOUTH-OF-HOUSE>>>
<COND (<VERB? FIND>
<COND (<EQUAL? ,HERE ,CLEARING>
<TELL "It seems to be to the west." CR>)
(T
<TELL "It was here just a minute ago...." CR>)>)
(T <TELL "You're not at the house." CR>)>)
(<VERB? FIND>
<TELL
"It's right here! Are you blind or something?" CR>)
(<VERB? WALK-AROUND>
<GO-NEXT ,HOUSE-AROUND>
T)
(<VERB? EXAMINE>
<TELL
"The house is a beautiful colonial house which is painted white.
It is clear that the owners must have been extremely wealthy." CR>)
(<VERB? THROUGH OPEN>
<COND (<EQUAL? ,HERE ,EAST-OF-HOUSE>
<COND (<FSET? ,KITCHEN-WINDOW ,OPENBIT>
<GOTO ,KITCHEN>)
(T
<TELL "The window is closed." CR>
<THIS-IS-IT ,KITCHEN-WINDOW>)>)
(T
<TELL "I can't see how to get in from here." CR>)>)
(<VERB? BURN>
<TELL "You must be joking." CR>)>>
;"0 -> no next, 1 -> success, 2 -> failed move"
<ROUTINE GO-NEXT (TBL "AUX" VAL)
<COND (<SET VAL <LKP ,HERE .TBL>>
<COND (<NOT <GOTO .VAL>> 2)
(T 1)>)>>
<ROUTINE FOREST-F ()
<COND (<VERB? WALK-AROUND>
<COND (<OR <EQUAL? ,HERE
,WEST-OF-HOUSE ,NORTH-OF-HOUSE
,SOUTH-OF-HOUSE>
<EQUAL? ,HERE ,EAST-OF-HOUSE>>
<TELL "You aren't even in the forest." CR>)>
<GO-NEXT ,FOREST-AROUND>)
(<VERB? DISEMBARK>
<TELL "You will have to specify a direction." CR>)
(<VERB? FIND>
<TELL "You cannot see the forest for the trees." CR>)
(<VERB? LISTEN>
<TELL "The pines and the hemlocks seem to be murmuring."
CR>)>>
<ROUTINE MOUNTAIN-RANGE-F ()
<COND (<VERB? CLIMB-UP CLIMB-DOWN CLIMB-FOO>
<TELL "Don't you believe me? The mountains are impassable!"
CR>)>>
<ROUTINE WATER-F ("AUX" AV W PI?)
<COND (<VERB? SGIVE> <RFALSE>)
(<VERB? THROUGH BOARD>
<TELL <PICK-ONE ,SWIMYUKS> CR>
<RTRUE>)
(<VERB? FILL> ;"fill bottle with water =>"
<SET W ,PRSI> ;"put water in bottle"
<SETG PRSA ,V?PUT>
<SETG PRSI ,PRSO>
<SETG PRSO .W>
<SET PI? <>>)
(<OR <EQUAL? ,PRSO ,GLOBAL-WATER>
<EQUAL? ,PRSO ,WATER>>
<SET W ,PRSO>
<SET PI? <>>)
(ELSE
<SET W ,PRSI>
<COND (.W <SET PI? T>)>)>
<COND (<EQUAL? .W ,GLOBAL-WATER>
<SET W ,WATER>
<COND (<VERB? TAKE PUT> <REMOVE-CAREFULLY .W>)>)>
<COND (.PI? <SETG PRSI .W>)
(T <SETG PRSO .W>)>
<SET AV <LOC ,WINNER>>
<COND (<NOT <FSET? .AV ,VEHBIT>> <SET AV <>>)>
<COND (<AND <VERB? TAKE PUT> <NOT .PI?>>
<COND (<AND .AV
<OR <EQUAL? .AV ,PRSI>
<AND <NOT ,PRSI>
<NOT <IN? .W .AV>>>>>
<TELL "There is now a puddle in the bottom of the "
D .AV "." CR>
<REMOVE-CAREFULLY ,PRSO>
<MOVE ,PRSO .AV>)
(<AND ,PRSI <NOT <EQUAL? ,PRSI ,BOTTLE>>>
<TELL "The water leaks out of the " D ,PRSI
" and evaporates immediately." CR>
<REMOVE-CAREFULLY .W>)
(<IN? ,BOTTLE ,WINNER>
<COND (<NOT <FSET? ,BOTTLE ,OPENBIT>>
<TELL "The bottle is closed." CR>
<THIS-IS-IT ,BOTTLE>)
(<NOT <FIRST? ,BOTTLE>>
<MOVE ,WATER ,BOTTLE>
<TELL "The bottle is now full of water." CR>)
(T
<TELL "The water slips through your fingers." CR>
<RTRUE>)>)
(<AND <IN? ,PRSO ,BOTTLE>
<VERB? TAKE>
<NOT ,PRSI>>
<TELL
"It's in the bottle. Perhaps you should take that instead." CR>)
(T
<TELL "The water slips through your fingers." CR>)>)
(.PI?
<COND (<AND <VERB? PUT>
<GLOBAL-IN? ,RIVER ,HERE>>
<PERFORM ,V?PUT ,PRSO ,RIVER>)
(ELSE
<TELL "Nice try." CR>)>
<RTRUE>)
(<VERB? DROP GIVE>
<COND (<AND <VERB? DROP>
<IN? ,WATER ,BOTTLE>
<NOT <FSET? ,BOTTLE ,OPENBIT>>>
<TELL "The bottle is closed." CR>
<RTRUE>)>
<REMOVE-CAREFULLY ,WATER>
<COND (.AV
<TELL "There is now a puddle in the bottom of the "
D .AV "." CR>
<MOVE ,WATER .AV>)
(T
<TELL
"The water spills to the floor and evaporates immediately." CR>
<REMOVE-CAREFULLY ,WATER>)>)
(<VERB? THROW>
<TELL
"The water splashes on the walls and evaporates immediately." CR>
<REMOVE-CAREFULLY ,WATER>)>>
<GLOBAL KITCHEN-WINDOW-FLAG <>>
<ROUTINE KITCHEN-WINDOW-F ()
<COND (<VERB? OPEN CLOSE>
<SETG KITCHEN-WINDOW-FLAG T>
<OPEN-CLOSE ,KITCHEN-WINDOW
"With great effort, you open the window far enough to allow entry."
"The window closes (more easily than it opened).">)
(<AND <VERB? EXAMINE>
<NOT ,KITCHEN-WINDOW-FLAG>>
<TELL
"The window is slightly ajar, but not enough to allow entry." CR>)
(<VERB? WALK BOARD THROUGH>
<COND (<EQUAL? ,HERE ,KITCHEN>
<DO-WALK ,P?EAST>)
(T
<DO-WALK ,P?WEST>)>
<RTRUE>)
(<VERB? LOOK-INSIDE>
<TELL "You can see ">
<COND (<EQUAL? ,HERE ,KITCHEN>
<TELL "a clear area leading towards a forest." CR>)
(T
<TELL "what appears to be a kitchen." CR>)>)>>
<ROUTINE GHOSTS-F ()
<COND (<VERB? TELL>
<TELL "The spirits jeer loudly and ignore you." CR>
<SETG P-CONT <>>)
(<VERB? EXORCISE>
<TELL "Only the ceremony itself has any effect." CR>)
(<AND <VERB? ATTACK MUNG> <EQUAL? ,PRSO ,GHOSTS>>
<TELL "How can you attack a spirit with material objects?" CR>)
(T
<TELL "You seem unable to interact with these spirits." CR>)>>
<GLOBAL CAGE-TOP T>
<ROUTINE BASKET-F ()
<COND (<VERB? RAISE>
<COND (,CAGE-TOP
<TELL <PICK-ONE ,DUMMY> CR>)
(T
<MOVE ,RAISED-BASKET ,SHAFT-ROOM>
<MOVE ,LOWERED-BASKET ,LOWER-SHAFT>
<SETG CAGE-TOP T>
<THIS-IS-IT ,RAISED-BASKET>
<TELL
"The basket is raised to the top of the shaft." CR>)>)
(<VERB? LOWER>
<COND (<NOT ,CAGE-TOP>
<TELL <PICK-ONE ,DUMMY> CR>)
(T
<MOVE ,RAISED-BASKET ,LOWER-SHAFT>
<MOVE ,LOWERED-BASKET ,SHAFT-ROOM>
<THIS-IS-IT ,LOWERED-BASKET>
<TELL
"The basket is lowered to the bottom of the shaft." CR>
<SETG CAGE-TOP <>>
<COND (<AND ,LIT <NOT <SETG LIT <LIT? ,HERE>>>>
<TELL "It is now pitch black." CR>)>
T)>)
(<OR <EQUAL? ,PRSO ,LOWERED-BASKET>
<EQUAL? ,PRSI ,LOWERED-BASKET>>
<TELL "The basket is at the other end of the chain." CR>)
(<AND <VERB? TAKE>
<EQUAL? ,PRSO ,RAISED-BASKET ,LOWERED-BASKET>>
<TELL "The cage is securely fastened to the iron chain." CR>)>>
<ROUTINE BAT-F ()
<COND (<VERB? TELL>
<FWEEP 6>
<SETG P-CONT <>>)
(<VERB? TAKE ATTACK MUNG>
<COND (<EQUAL? <LOC ,GARLIC> ,WINNER ,HERE>
<TELL "You can't reach him; he's on the ceiling." CR>)
(T <FLY-ME>)>)>>
<ROUTINE FLY-ME ()
<FWEEP 4>
<TELL
"The bat grabs you by the scruff of your neck and lifts you away...." CR CR>
<GOTO <PICK-ONE ,BAT-DROPS> <>>
<COND (<NOT <EQUAL? ,HERE ,ENTRANCE-TO-HADES>>
<V-FIRST-LOOK>)>
T>
<ROUTINE FWEEP (N)
<REPEAT ()
<COND (<L? <SET N <- .N 1>> 1> <RETURN>)
(T <TELL " Fweep!" CR>)>>
<CRLF>>
<GLOBAL BAT-DROPS
<LTABLE 0
MINE-1
MINE-2
MINE-3
MINE-4
LADDER-TOP
LADDER-BOTTOM
SQUEEKY-ROOM
MINE-ENTRANCE>>
<ROUTINE BELL-F ()
<COND (<VERB? RING>
<COND (<AND <EQUAL? ,HERE ,LLD-ROOM>
<NOT ,LLD-FLAG>>
<RFALSE>)
(T
<TELL "Ding, dong." CR>)>)>>
<ROUTINE HOT-BELL-F ()
<COND (<VERB? TAKE>
<TELL "The bell is very hot and cannot be taken." CR>)
(<OR <VERB? RUB> <AND <VERB? RING> ,PRSI>>
<COND (<FSET? ,PRSI ,BURNBIT>
<TELL "The " D ,PRSI " burns and is consumed." CR>
<REMOVE-CAREFULLY ,PRSI>)
(<EQUAL? ,PRSI ,HANDS>
<TELL "The bell is too hot to touch." CR>)
(T
<TELL "The heat from the bell is too intense." CR>)>)
(<VERB? POUR-ON>
<REMOVE-CAREFULLY ,PRSO>
<TELL "The water cools the bell and is evaporated." CR>
<QUEUE I-XBH 0>
<I-XBH>)
(<VERB? RING>
<TELL "The bell is too hot to reach." CR>)>>
<ROUTINE BOARDED-WINDOW-FCN ()
<COND (<VERB? OPEN>
<TELL "The windows are boarded and can't be opened." CR>)
(<VERB? MUNG>
<TELL "You can't break the windows open." CR>)>>
<ROUTINE NAILS-PSEUDO ()
<COND (<VERB? TAKE>
<TELL
"The nails, deeply imbedded in the door, cannot be removed." CR>)>>
<ROUTINE CRACK-FCN ()
<COND (<VERB? THROUGH>
<TELL "You can't fit through the crack." CR>)>>
<ROUTINE KITCHEN-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in the kitchen of the white house. A table seems to
have been used recently for the preparation of food. A passage
leads to the west and a dark staircase can be seen leading
upward. A dark chimney leads down and to the east is a small
window which is ">
<COND (<FSET? ,KITCHEN-WINDOW ,OPENBIT>
<TELL "open." CR>)
(T
<TELL "slightly ajar." CR>)>)
(<==? .RARG ,M-BEG>
<COND (<AND <VERB? CLIMB-UP> <EQUAL? ,PRSO ,STAIRS>>
<DO-WALK ,P?UP>)
(<AND <VERB? CLIMB-UP> <EQUAL? ,PRSO ,STAIRS>>
<TELL "There are no stairs leading down." CR>)>)>>
<ROUTINE STONE-BARROW-FCN (RARG)
<COND (<AND <EQUAL? .RARG ,M-BEG>
<OR <VERB? ENTER>
<AND <VERB? WALK>
<EQUAL? ,PRSO ,P?WEST ,P?IN>>
<AND <VERB? THROUGH>
<EQUAL? ,PRSO ,BARROW>>>>
<TELL
"Inside the Barrow|
As you enter the barrow, the door closes inexorably behind you. Around
you it is dark, but ahead is an enormous cavern, brightly lit. Through
its center runs a wide stream. Spanning the stream is a small wooden
footbridge, and beyond a path leads into a dark tunnel. Above the
bridge, floating in the air, is a large sign. It reads: All ye who
stand before this bridge have completed a great and perilous adventure
which has tested your wit and courage. You have mastered">
<COND (<EQUAL? <BAND <GETB 0 1> 8> 0>
<TELL "
the first part of the ZORK trilogy. Those who pass over this bridge must be
prepared to undertake an even greater adventure that will severely test your
skill and bravery!|
|
The ZORK trilogy continues with \"ZORK II: The Wizard of Frobozz\" and
is completed in \"ZORK III: The Dungeon Master.\"" CR>)
(T
<TELL "
ZORK: The Great Underground Empire.|" CR>)>
<FINISH>)>>
<ROUTINE BARROW-DOOR-FCN ()
<COND (<VERB? OPEN CLOSE>
<TELL "The door is too heavy." CR>)>>
<ROUTINE BARROW-FCN ()
<COND (<VERB? THROUGH>
<DO-WALK ,P?WEST>)>>
\
<ROUTINE TROPHY-CASE-FCN ()
<COND (<AND <VERB? TAKE> <EQUAL? ,PRSO ,TROPHY-CASE>>
<TELL
"The trophy case is securely fastened to the wall." CR>)>>
<GLOBAL RUG-MOVED <>>
<ROUTINE LIVING-ROOM-FCN (RARG "AUX" RUG? TC)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in the living room. There is a doorway to the east">
<COND (,MAGIC-FLAG
<TELL
". To the
west is a cyclops-shaped opening in an old wooden door, above which is
some strange gothic lettering, ">)
(T
<TELL
", a wooden
door with strange gothic lettering to the west, which appears to be
nailed shut, ">)>
<TELL "a trophy case, ">
<SET RUG? ,RUG-MOVED>
<COND (<AND .RUG? <FSET? ,TRAP-DOOR ,OPENBIT>>
<TELL
"and a rug lying beside an open trap door.">)
(.RUG?
<TELL "and a closed trap door at your feet.">)
(<FSET? ,TRAP-DOOR ,OPENBIT>
<TELL "and an open trap door at your feet.">)
(T
<TELL
"and a large oriental rug in the center of the room.">)>
<CRLF>
T)
(<EQUAL? .RARG ,M-END>
<COND (<OR <VERB? TAKE>
<AND <VERB? PUT>
<EQUAL? ,PRSI ,TROPHY-CASE>>>
<COND (<IN? ,PRSO ,TROPHY-CASE>
<TOUCH-ALL ,PRSO>)>
<SETG SCORE <+ ,BASE-SCORE <OTVAL-FROB>>>
<SCORE-UPD 0>
<RFALSE>)>)>>
<ROUTINE TOUCH-ALL (OBJ "AUX" F)
<SET F <FIRST? .OBJ>>
<REPEAT ()
<COND (<NOT .F> <RETURN>)
(T
<FSET .F ,TOUCHBIT>
<COND (<FIRST? .F> <TOUCH-ALL .F>)>)>
<SET F <NEXT? .F>>>>
<ROUTINE OTVAL-FROB ("OPTIONAL" (O ,TROPHY-CASE) "AUX" F (SCORE 0))
<SET F <FIRST? .O>>
<REPEAT ()
<COND (<NOT .F> <RETURN .SCORE>)>
<SET SCORE <+ .SCORE <GETP .F ,P?TVALUE>>>
<COND (<FIRST? .F> <OTVAL-FROB .F>)>
<SET F <NEXT? .F>>>>
<ROUTINE TRAP-DOOR-FCN ()
<COND (<VERB? RAISE>
<PERFORM ,V?OPEN ,TRAP-DOOR>
<RTRUE>)
(<AND <VERB? OPEN CLOSE>
<EQUAL? ,HERE ,LIVING-ROOM>>
<OPEN-CLOSE ,PRSO
"The door reluctantly opens to reveal a rickety staircase descending into
darkness."
"The door swings shut and closes.">)
(<AND <VERB? LOOK-UNDER> <EQUAL? ,HERE LIVING-ROOM>>
<COND (<FSET? ,TRAP-DOOR ,OPENBIT>
<TELL
"You see a rickety staircase descending into darkness." CR>)
(T <TELL "It's closed." CR>)>)
(<EQUAL? ,HERE ,CELLAR>
<COND (<AND <VERB? OPEN UNLOCK>
<NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
<TELL
"The door is locked from above." CR>)
(<AND <VERB? CLOSE> <NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
<FCLEAR ,TRAP-DOOR ,TOUCHBIT>
<FCLEAR ,TRAP-DOOR ,OPENBIT>
<TELL "The door closes and locks." CR>)
(<VERB? OPEN CLOSE>
<TELL <PICK-ONE ,DUMMY> CR>)>)>>
<ROUTINE CELLAR-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a dark and damp cellar with a narrow passageway leading
north, and a crawlway to the south. On the west is the bottom of a
steep metal ramp which is unclimbable." CR>)
(<EQUAL? .RARG ,M-ENTER>
<COND (<AND <FSET? ,TRAP-DOOR ,OPENBIT>
<NOT <FSET? ,TRAP-DOOR ,TOUCHBIT>>>
<FCLEAR ,TRAP-DOOR ,OPENBIT>
<FSET ,TRAP-DOOR ,TOUCHBIT>
<TELL
"The trap door crashes shut, and you hear someone barring it." CR CR>)>)>>
<ROUTINE CHIMNEY-F ()
<COND (<VERB? EXAMINE>
<TELL "The chimney leads ">
<COND (<==? ,HERE ,KITCHEN>
<TELL "down">)
(T <TELL "up">)>
<TELL "ward, and looks climbable." CR>)>>
<ROUTINE UP-CHIMNEY-FUNCTION ("AUX" F)
<COND (<NOT <SET F <FIRST? ,WINNER>>>
<TELL "Going up empty-handed is a bad idea." CR>
<RFALSE>)
(<AND <OR <NOT <SET F <NEXT? .F>>>
<NOT <NEXT? .F>>>
<IN? ,LAMP ,WINNER>>
<COND (<NOT <FSET? ,TRAP-DOOR ,OPENBIT>>
<FCLEAR ,TRAP-DOOR ,TOUCHBIT>)>
<RETURN ,KITCHEN>)
(T
<TELL "You can't get up there with what you're carrying." CR>
<RFALSE>)>>
<ROUTINE TRAP-DOOR-EXIT ()
<COND (,RUG-MOVED
<COND (<FSET? ,TRAP-DOOR ,OPENBIT>
<RETURN ,CELLAR>)
(T
<TELL "The trap door is closed." CR>
<THIS-IS-IT ,TRAP-DOOR>
<RFALSE>)>)
(T
<TELL "You can't go that way." CR>
<RFALSE>)>>
<ROUTINE RUG-FCN ()
<COND (<VERB? RAISE>
<TELL "The rug is too heavy to lift">
<COND (,RUG-MOVED
<TELL "." CR>)
(T
<TELL
", but in trying to take it you have
noticed an irregularity beneath it." CR>)>)
(<VERB? MOVE PUSH>
<COND (,RUG-MOVED
<TELL
"Having moved the carpet previously, you find it impossible to move
it again." CR>)
(T
<TELL
"With a great effort, the rug is moved to one side of the room, revealing
the dusty cover of a closed trap door." CR>
<FCLEAR ,TRAP-DOOR ,INVISIBLE>
<THIS-IS-IT ,TRAP-DOOR>
<SETG RUG-MOVED T>)>)
(<VERB? TAKE>
<TELL
"The rug is extremely heavy and cannot be carried." CR>)
(<AND <VERB? LOOK-UNDER>
<NOT ,RUG-MOVED>
<NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
<TELL
"Underneath the rug is a closed trap door. As you drop the corner of the
rug, the trap door is once again concealed from view." CR>)
(<VERB? CLIMB-ON>
<COND (<AND <NOT ,RUG-MOVED>
<NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
<TELL
"As you sit, you notice an irregularity underneath it. Rather than be
uncomfortable, you stand up again." CR>)
(ELSE
<TELL "I suppose you think it's a magic carpet?" CR>)>)>>
\
"SUBTITLE TROLL"
<ROUTINE AXE-F ()
<COND (,TROLL-FLAG <>)
(T <WEAPON-FUNCTION ,AXE ,TROLL>)>>
<ROUTINE STILETTO-FUNCTION ()
<WEAPON-FUNCTION ,STILETTO ,THIEF>>
<ROUTINE WEAPON-FUNCTION (W V)
<COND (<NOT <IN? .V ,HERE>> <RFALSE>)
(<VERB? TAKE>
<COND (<IN? .W .V>
<TELL
"The " D .V " swings it out of your reach." CR>)
(T
<TELL
"The " D .W " seems white-hot. You can't hold on to it." CR>)>
T)>>
<ROUTINE TROLL-FCN ("OPTIONAL" (MODE <>))
<COND (<VERB? TELL>
<SETG P-CONT <>>
<TELL "The troll isn't much of a conversationalist." CR>)
(<EQUAL? .MODE ,F-BUSY?>
<COND (<IN? ,AXE ,TROLL> <>)
(<AND <IN? ,AXE ,HERE> <PROB 75 90>>
<FSET ,AXE ,NDESCBIT>
<FCLEAR ,AXE ,WEAPONBIT>
<MOVE ,AXE ,TROLL>
<PUTP ,TROLL ,P?LDESC
"A nasty-looking troll, brandishing a bloody axe, blocks all passages out
of the room.">
<AND <IN? ,TROLL ,HERE>
<TELL
"The troll, angered and humiliated, recovers his weapon. He appears to have
an axe to grind with you." CR>>
T)
(<IN? ,TROLL ,HERE>
<PUTP ,TROLL ,P?LDESC
"A pathetically babbling troll is here.">
<TELL
"The troll, disarmed, cowers in terror, pleading for his life in
the guttural tongue of the trolls." CR>
T)>)
(<EQUAL? .MODE ,F-DEAD>
<COND (<IN? ,AXE ,TROLL>
<MOVE ,AXE ,HERE>
<FCLEAR ,AXE ,NDESCBIT>
<FSET ,AXE ,WEAPONBIT>)>
<SETG TROLL-FLAG T>)
(<EQUAL? .MODE ,F-UNCONSCIOUS>
<FCLEAR ,TROLL ,FIGHTBIT>
<COND (<IN? ,AXE ,TROLL>
<MOVE ,AXE ,HERE>
<FCLEAR ,AXE ,NDESCBIT>
<FSET ,AXE ,WEAPONBIT>)>
<PUTP ,TROLL ,P?LDESC
"An unconscious troll is sprawled on the floor. All passages
out of the room are open.">
<SETG TROLL-FLAG T>)
(<EQUAL? .MODE ,F-CONSCIOUS>
<COND (<IN? ,TROLL ,HERE>
<FSET ,TROLL ,FIGHTBIT>
<TELL
"The troll stirs, quickly resuming a fighting stance." CR>)>
<COND (<IN? ,AXE ,TROLL>
<PUTP ,TROLL ,P?LDESC
"A nasty-looking troll, brandishing a bloody axe, blocks
all passages out of the room.">)
(<IN? ,AXE ,TROLL-ROOM>
<FSET ,AXE ,NDESCBIT>
<FCLEAR ,AXE ,WEAPONBIT>
<MOVE ,AXE ,TROLL>
<PUTP ,TROLL ,P?LDESC
"A nasty-looking troll, brandishing a bloody axe, blocks
all passages out of the room.">)
(T
<PUTP ,TROLL ,P?LDESC
"A troll is here.">)>
<SETG TROLL-FLAG <>>)
(<EQUAL? .MODE ,F-FIRST?>
<COND (<PROB 33>
<FSET ,TROLL ,FIGHTBIT>
<SETG P-CONT <>>
T)>)
(<NOT .MODE>
<COND (<VERB? EXAMINE>
<TELL <GETP ,TROLL ,P?LDESC> CR>)
(<OR <AND <VERB? THROW GIVE>
,PRSO
<EQUAL? ,PRSI ,TROLL>>
<VERB? TAKE MOVE MUNG>>
<AWAKEN ,TROLL>
<COND (<VERB? THROW GIVE>
<COND (<AND <EQUAL? ,PRSO ,AXE>
<IN? ,AXE ,WINNER>>
<TELL
"The troll scratches his head in confusion, then takes the axe." CR>
<FSET ,TROLL ,FIGHTBIT>
<MOVE ,AXE ,TROLL>
<RTRUE>)
(<EQUAL? ,PRSO ,TROLL ,AXE>
<TELL
"You would have to get the " D ,PRSO " first, and that seems unlikely." CR>
<RTRUE>)>
<COND (<VERB? THROW>
<TELL
"The troll, who is remarkably coordinated, catches the " D ,PRSO>)
(T
<TELL
"The troll, who is not overly proud, graciously accepts the gift">)>
<COND (<AND <PROB 20>
<EQUAL? ,PRSO ,KNIFE ,SWORD ,AXE>>
<REMOVE-CAREFULLY ,PRSO>
<TELL
" and eats it hungrily. Poor troll, he dies from an internal hemorrhage
and his carcass disappears in a sinister black fog." CR>
<REMOVE-CAREFULLY ,TROLL>
<APPLY <GETP ,TROLL ,P?ACTION> ,F-DEAD>
<SETG TROLL-FLAG T>)
(<EQUAL? ,PRSO ,KNIFE ,SWORD ,AXE>
<MOVE ,PRSO ,HERE>
<TELL
" and, being for the moment sated, throws it back. Fortunately, the
troll has poor control, and the " D ,PRSO " falls to the floor. He does
not look pleased." CR>
<FSET ,TROLL ,FIGHTBIT>)
(T
<TELL
" and not having the most discriminating tastes, gleefully eats it." CR>
<REMOVE-CAREFULLY ,PRSO>)>)
(<VERB? TAKE MOVE>
<TELL
"The troll spits in your face, grunting \"Better luck next time\" in a
rather barbarous accent." CR>)
(<VERB? MUNG>
<TELL
"The troll laughs at your puny gesture." CR>)>)
(<VERB? LISTEN>
<TELL
"Every so often the troll says something, probably uncomplimentary, in
his guttural tongue." CR>)
(<AND ,TROLL-FLAG <VERB? HELLO>>
<TELL "Unfortunately, the troll can't hear you." CR>)>)>>
\
"SUBTITLE GRATING/MAZE"
;<GLOBAL LEAVES-GONE <>> ;"no longer used?"
<GLOBAL GRATE-REVEALED <>>
<GLOBAL GRUNLOCK <>>
<ROUTINE LEAVES-APPEAR ()
<COND (<AND <NOT <FSET? ,GRATE ,OPENBIT>>
<NOT ,GRATE-REVEALED>>
<COND (<VERB? MOVE TAKE>
<TELL
"In disturbing the pile of leaves, a grating is revealed." CR>)
(T <TELL
"With the leaves moved, a grating is revealed." CR>)>
<FCLEAR ,GRATE ,INVISIBLE>
<SETG GRATE-REVEALED T>)>
<>>
<ROUTINE LEAF-PILE ()
<COND (<VERB? COUNT>
<TELL "There are 69,105 leaves here." CR>)
(<VERB? BURN>
<LEAVES-APPEAR>
<REMOVE-CAREFULLY ,PRSO>
<COND (<IN? ,PRSO ,HERE>
<TELL
"The leaves burn." CR>)
(T
<JIGS-UP
"The leaves burn, and so do you.">)>)
(<VERB? CUT>
<TELL "You rustle the leaves around, making quite a mess." CR>
<LEAVES-APPEAR>
<RTRUE>)
(<VERB? MOVE TAKE>
<COND (<VERB? MOVE>
<TELL "Done." CR>)>
<COND (,GRATE-REVEALED <RFALSE>)>
<LEAVES-APPEAR>
<COND (<VERB? TAKE> <RFALSE>)
(T <RTRUE>)>)
(<AND <VERB? LOOK-UNDER>
<NOT ,GRATE-REVEALED>>
<TELL
"Underneath the pile of leaves is a grating. As you release the leaves,
the grating is once again concealed from view." CR>)>>
<ROUTINE CLEARING-FCN (RARG)
<COND (<EQUAL? .RARG ,M-ENTER>
<COND (<NOT ,GRATE-REVEALED>
<FSET ,GRATE ,INVISIBLE>)>)
(<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a clearing, with a forest surrounding you on all sides. A
path leads south.">
<COND (<FSET? ,GRATE ,OPENBIT>
<CRLF>
<TELL
"There is an open grating, descending into darkness.">)
(,GRATE-REVEALED
<CRLF>
<TELL
"There is a grating securely fastened into the ground.">)>
<CRLF>)>>
<ROUTINE MAZE-11-FCN (RARG)
<COND (<EQUAL? .RARG ,M-ENTER>
<FCLEAR ,GRATE ,INVISIBLE>)
(<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a small room near the maze. There are twisty passages
in the immediate vicinity." CR>
<COND (<FSET? ,GRATE ,OPENBIT>
<TELL
"Above you is an open grating with sunlight pouring in.">)
(,GRUNLOCK
<TELL "Above you is a grating.">)
(T
<TELL
"Above you is a grating locked with a skull-and-crossbones lock.">)>
<CRLF>)>>
<ROUTINE GRATE-FUNCTION ()
<COND (<AND <VERB? OPEN> <EQUAL? ,PRSI ,KEYS>>
<PERFORM ,V?UNLOCK ,GRATE ,KEYS>
<RTRUE>)
(<VERB? LOCK>
<COND (<EQUAL? ,HERE ,GRATING-ROOM>
<SETG GRUNLOCK <>>
<TELL "The grate is locked." CR>)
(<EQUAL? ,HERE ,GRATING-CLEARING>
<TELL "You can't lock it from this side." CR>)>)
(<AND <VERB? UNLOCK> <EQUAL? ,PRSO ,GRATE>>
<COND (<AND <EQUAL? ,HERE ,GRATING-ROOM> <EQUAL? ,PRSI ,KEYS>>
<SETG GRUNLOCK T>
<TELL "The grate is unlocked." CR>)
(<AND <EQUAL? ,HERE ,GRATING-CLEARING>
<EQUAL? ,PRSI ,KEYS>>
<TELL "You can't reach the lock from here." CR>)
(T
<TELL
"Can you unlock a grating with a " D ,PRSI "?" CR>)>)
(<VERB? PICK>
<TELL "You can't pick the lock." CR>)
(<VERB? OPEN CLOSE>
<COND (,GRUNLOCK
<OPEN-CLOSE ,GRATE
<COND (<EQUAL? ,HERE ,CLEARING>
"The grating opens.")
(T
"The grating opens to reveal trees above you.")>
"The grating is closed.">
<COND (<FSET? ,GRATE ,OPENBIT>
<COND (<AND <NOT <EQUAL? ,HERE ,CLEARING>>
<NOT ,GRATE-REVEALED>>
<TELL
"A pile of leaves falls onto your head and to the ground." CR>
<SETG GRATE-REVEALED T>
<MOVE ,LEAVES ,HERE>)>
<FSET ,GRATING-ROOM ,ONBIT>)
(T <FCLEAR ,GRATING-ROOM ,ONBIT>)>)
(T <TELL "The grating is locked." CR>)>)
(<AND <VERB? PUT> <EQUAL? ,PRSI ,GRATE>>
<COND (<G? <GETP ,PRSO ,P?SIZE> 20>
<TELL "It won't fit through the grating." CR>)
(T
<MOVE ,PRSO ,GRATING-ROOM>
<TELL
"The " D ,PRSO " goes through the grating into the darkness below." CR>)>)>>
<ROUTINE MAZE-DIODES ()
<TELL
"You won't be able to get back up to the tunnel you are going through
when it gets to the next room." CR CR>
<COND (<EQUAL? ,HERE ,MAZE-2> ,MAZE-4)
(<EQUAL? ,HERE ,MAZE-7> ,DEAD-END-1)
(<EQUAL? ,HERE ,MAZE-9> ,MAZE-11)
(<EQUAL? ,HERE ,MAZE-12> ,MAZE-5)>>
<ROUTINE RUSTY-KNIFE-FCN ()
<COND (<VERB? TAKE>
<AND <IN? ,SWORD ,WINNER>
<TELL
"As you touch the rusty knife, your sword gives a single pulse of blinding
blue light." CR>>
<>)
(<OR <AND <EQUAL? ,PRSI ,RUSTY-KNIFE>
<VERB? ATTACK>>
<AND <VERB? SWING>
<EQUAL? ,PRSO ,RUSTY-KNIFE>
,PRSI>>
<REMOVE-CAREFULLY ,RUSTY-KNIFE>
<JIGS-UP
"As the knife approaches its victim, your mind is submerged by an
overmastering will. Slowly, your hand turns, until the rusty blade
is an inch from your neck. The knife seems to sing as it savagely
slits your throat.">)>>
<ROUTINE KNIFE-F ()
<COND (<VERB? TAKE>
<FCLEAR ,ATTIC-TABLE ,NDESCBIT>
<RFALSE>)>>
<ROUTINE SKELETON ()
<COND (<VERB? TAKE RUB MOVE PUSH RAISE LOWER ATTACK KICK KISS>
<TELL
"A ghost appears in the room and is appalled at your desecration of
the remains of a fellow adventurer. He casts a curse on your valuables
and banishes them to the Land of the Living Dead. The ghost leaves,
muttering obscenities." CR>
<ROB ,HERE ,LAND-OF-LIVING-DEAD 100>
<ROB ,ADVENTURER ,LAND-OF-LIVING-DEAD>
T)>>
\
<ROUTINE TORCH-OBJECT ()
<COND (<VERB? EXAMINE>
<TELL "The torch is burning." CR>)
(<AND <VERB? POUR-ON>
<EQUAL? ,PRSI ,TORCH>>
<TELL "The water evaporates before it gets close." CR>)
(<AND <VERB? LAMP-OFF> <FSET? ,PRSO ,ONBIT>>
<TELL
"You nearly burn your hand trying to extinguish the flame." CR>)>>
\
"SUBTITLE MIRROR, MIRROR, ON THE WALL"
<ROUTINE MIRROR-ROOM (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a large square room with tall ceilings. On the south wall
is an enormous mirror which fills the entire wall. There are exits
on the other three sides of the room." CR>
<COND (,MIRROR-MUNG
<TELL
"Unfortunately, the mirror has been destroyed by your recklessness." CR>)>)>>
<GLOBAL MIRROR-MUNG <>>
<GLOBAL LUCKY T>
<ROUTINE MIRROR-MIRROR ("AUX" (RM2 ,MIRROR-ROOM-2) L1 L2 N)
<COND (<AND <NOT ,MIRROR-MUNG> <VERB? RUB>>
<COND (<AND ,PRSI <NOT <EQUAL? ,PRSI ,HANDS>>>
<TELL
"You feel a faint tingling transmitted through the " D ,PRSI "." CR>
<RTRUE>)>
<COND (<EQUAL? ,HERE .RM2>
<SET RM2 ,MIRROR-ROOM-1>)>
<SET L1 <FIRST? ,HERE>>
<SET L2 <FIRST? .RM2>>
<REPEAT ()
<COND (<NOT .L1> <RETURN>)>
<SET N <NEXT? .L1>>
<MOVE .L1 .RM2>
<SET L1 .N>>
<REPEAT ()
<COND (<NOT .L2> <RETURN>)>
<SET N <NEXT? .L2>>
<MOVE .L2 ,HERE>
<SET L2 .N>>
<GOTO .RM2 <>>
<TELL
"There is a rumble from deep within the earth and the room shakes." CR>)
(<VERB? LOOK-INSIDE EXAMINE>
<COND (,MIRROR-MUNG
<TELL "The mirror is broken into many pieces.">)
(T
<TELL "There is an ugly person staring back at you.">)>
<CRLF>)
(<VERB? TAKE>