-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy path2actions.zil
4039 lines (3770 loc) · 127 KB
/
2actions.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
"ACTIONS2 for
Zork II: The Wizard of Frobozz
(c) Copyright 1981, 1983 Infocom, Inc. All Rights Reserved."
<ROUTINE SWORD-FCN ()
<COND (<AND <VERB? TAKE>
<EQUAL? ,WINNER ,ADVENTURER>>
<ENABLE <QUEUE I-SWORD -1>>
<RFALSE>)>>
"SWORD demon"
<GLOBAL SWORD-GLOW 0>
<ROUTINE I-SWORD ("AUX" (DEM <INT I-SWORD>) (NG 0) G P TX L)
<SET G ,SWORD-GLOW>
<COND (<IN? ,SWORD ,ADVENTURER>
<COND (<INFESTED? ,HERE> <SET NG 2>)
(T
<SET P 0>
<REPEAT ()
<COND (<0? <SET P <NEXTP ,HERE .P>>>
<RETURN>)
(<NOT <L? .P ,LOW-DIRECTION>>
<SET TX <GETPT ,HERE .P>>
<SET L <PTSIZE .TX>>
<COND (<EQUAL? .L ,UEXIT ,CEXIT ,DEXIT>
<COND (<INFESTED? <GETB .TX 0>>
<SET NG 1>
<RETURN>)>)>)>>)>
<COND (<EQUAL? .NG .G> <RFALSE>)
(<EQUAL? .NG 2>
<TELL "Your sword has begun to glow very brightly." CR>)
(<1? .NG>
<TELL "Your sword is glowing with a faint blue glow."
CR>)
(<0? .NG>
<TELL "Your sword is no longer glowing." CR>)>
<SETG SWORD-GLOW .NG>
<RTRUE>)
(T
<PUT .DEM ,C-ENABLED? 0>
<RFALSE>)>>
<ROUTINE INFESTED? (R "AUX" (F <FIRST? .R>))
<REPEAT ()
<COND (<NOT .F> <RFALSE>)
(<AND <FSET? .F ,ACTORBIT>
<NOT <FSET? .F ,INVISIBLE>>
<NOT <EQUAL? .F ,ROBOT>>>
<RETURN .F>)
(<NOT <SET F <NEXT? .F>>> <RFALSE>)>>>
<ROUTINE CAROUSEL-ROOM-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a large circular room whose high ceiling is lost in gloom. Eight
identical passages leave the room." CR>
<COND (<NOT ,CAROUSEL-FLIP-FLAG>
<TELL
"A loud whirring sound comes from all around, and you feel
sort of disoriented in here." CR>)>
<RTRUE>)
(<AND <NOT ,CAROUSEL-FLIP-FLAG>
<EQUAL? .RARG ,M-BEG>
<VERB? WALK>>
<COND (<EQUAL? ,PRSO ,P?UP ,P?DOWN>
<RFALSE>)>
<COND (<EQUAL? ,PRSO ,P?OUT>
<TELL
"Feeling dizzy, you pick a direction at random." CR CR>
<SETG PRSO ,P?EAST>)
(T
<TELL
"You're not sure which direction is which. This
room is very disorienting." CR CR>)>
<COND (<OR <EQUAL? ,PRSO ,P?WEST> <PROB 80>>
<SETG PRSO <GET ,EIGHT-DIRECTIONS <- <RANDOM 7> 1>>>)>
<V-WALK>
<RTRUE>)>>
<ROUTINE VIOLIN-FCN ()
<COND (<AND <VERB? PLAY>
<EQUAL? ,PRSO ,VIOLIN>>
<TELL
"An amazingly offensive noise issues from the violin." CR>)>>
<GLOBAL EIGHT-DIRECTIONS
<TABLE P?NORTH P?EAST P?SOUTH P?NE P?SE P?SW P?NW>>
<GLOBAL MUNGED-ROOM <>>
<ROUTINE OPEN-CLOSE (OBJ STROPN STRCLS)
#DECL ((OBJ) OBJECT (STROPN STRCLS) STRING)
<COND (<VERB? OPEN>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL <RANDOM-ELEMENT ,DUMMY>>)
(T
<TELL .STROPN>
<FSET .OBJ ,OPENBIT>)>
<CRLF>)
(<VERB? CLOSE>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL .STRCLS>
<FCLEAR .OBJ ,OPENBIT>
T)
(T <TELL <RANDOM-ELEMENT ,DUMMY> CR>)>
<CRLF>)>>
;"SUBTITLE THE VOLCANO"
<GLOBAL BTIE-FLAG <>>
<GLOBAL BINF-FLAG <>>
<GLOBAL BLAB-FLAG <>>
<GLOBAL SAFE-FLAG <>>
<ROUTINE BALLOON-FCN ("OPTIONAL" (RARG <>) "AUX" M R RC)
#DECL ((RARG) <OR FIX FALSE> (M) <OR FALSE TABLE> (R) OBJECT)
<COND (<EQUAL? .RARG ,M-LOOK>
<COND (,BINF-FLAG
<TELL "The cloth bag is inflated and ">
<COND (<FSET? ,RECEPTACLE ,OPENBIT>
<TELL
"there is a " D ,BINF-FLAG " burning in the receptacle.">)
(T
<TELL
"some smoke is leaking out of the closed receptacle.">)>)
(T
<TELL "The cloth bag is draped over the side
of the basket. Directly in the middle of the basket is a metal receptacle
which is ">
<COND (<FSET? ,RECEPTACLE ,OPENBIT>
<TELL "open">
<SET RC <FIRST? ,RECEPTACLE>>
<COND (.RC
<TELL ". A "
D .RC
" is "
<COND (<EQUAL? ,BINF-FLAG .RC>
"burning")
(T
"nestled")>
" inside">)>)
(T <TELL "closed">)>
<TELL ".">)>
<COND (,BTIE-FLAG
<TELL
" The balloon is tied to a hook by the braided wire." CR>)
(T
<TELL
" A braided wire is dangling over the side of the basket." CR>)>
<RTRUE>)
(<EQUAL? .RARG ,M-OBJDESC>
<TELL
"There is a large and extremely heavy wicker basket here. An
enormous cloth bag ">
<COND (,BINF-FLAG
<TELL
"attached to the basket is inflated. A metal receptacle is fastened to
the center of the basket. ">
<COND (<FSET? ,RECEPTACLE ,OPENBIT>
<TELL "In it is a burning " D ,BINF-FLAG>)
(T
<TELL
"Some smoke leaks out around its closed lid">)>)
(T
<TELL
"is draped over the side and is firmly attached to the basket. A metal
receptacle is fastened to the center of the basket">)>
<COND (,BTIE-FLAG
<TELL
". A piece of wire tied to a hook holds the balloon in place." CR>)
(T
<TELL
". Dangling from the basket is a piece of braided wire." CR>)>)
(<EQUAL? .RARG ,M-BEG>
<COND (<VERB? WALK>
<COND (<SET M <GETPT ,HERE ,PRSO>>
<COND (,BTIE-FLAG
<TELL "You are tied to the ledge." CR>
<RTRUE>)
(T
<AND <EQUAL? <PTSIZE .M> 1>
<NOT <FSET? <SET R <GETB .M 0>>
,RMUNGBIT>>
<SETG BLOC .R>>
<ENABLE <QUEUE I-BALLOON 3>>
<RFALSE>)>)
(T
<TELL
"You can't control the balloon this way." CR>
<RTRUE>)>)
(<AND <VERB? OPEN>
,BINF-FLAG
<EQUAL? ,PRSO ,RECEPTACLE>
<FIRST? ,RECEPTACLE>>
<TELL "Opening it reveals a burning "
D ,BINF-FLAG "." CR>
<FSET ,RECEPTACLE ,OPENBIT>
<RTRUE>)
(<AND <VERB? TAKE>
<EQUAL? ,BINF-FLAG ,PRSO>>
<TELL "You don't really want to hold a burning "
D ,PRSO "." CR>
<RTRUE>)
(<AND <VERB? PUT>
<EQUAL? ,PRSI ,RECEPTACLE>
<FIRST? ,RECEPTACLE>>
<TELL "The receptacle is already occupied." CR>
<RTRUE>)
(<AND <VERB? PUT>
<EQUAL? ,PRSI ,RECEPTACLE>>
<FSET ,PRSO ,NDESCBIT>
<RFALSE>)
(<VERB? INFLATE>
<TELL
"It takes more than words to inflate a balloon." CR>)>)>>
<ROUTINE I-BALLOON ()
<COND (<AND <FSET? ,RECEPTACLE ,OPENBIT> ,BINF-FLAG>
<RISE-AND-SHINE>)
(<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2>
<RISE-AND-SHINE>)
(T
<DECLINE-AND-FALL>)>>
<ROUTINE BALLOON-BURN ()
<TELL "The " D ,PRSO " burns inside the receptacle." CR>
<ENABLE <QUEUE I-BURNUP <* <GETP ,PRSO ,P?SIZE> 20>>>
<FSET ,PRSO ,FLAMEBIT>
<FSET ,PRSO ,ONBIT>
<FCLEAR ,PRSO ,TAKEBIT>
<FCLEAR ,PRSO ,READBIT>
<COND (,BINF-FLAG <RTRUE>)
(T
<TELL
"The cloth bag inflates as it fills with hot air." CR>
<COND (<NOT ,BLAB-FLAG>
<TELL
"A small label drops from the bag into the basket." CR>
<MOVE ,BALLOON-LABEL ,BALLOON>)>
<SETG BLAB-FLAG T>
<SETG BINF-FLAG ,PRSO>
<ENABLE <QUEUE I-BALLOON 3>>)>>
<ROUTINE PUT-BALLOON (THERE STR)
#DECL ((THERE) OBJECT (STR) STRING)
<COND (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2 ,VOLCANO-BOTTOM>
<TELL "You watch as the balloon slowly " .STR CR>)>
<MOVE ,BALLOON .THERE>
<SETG BLOC .THERE>>
<GLOBAL BALLOON-UPS
<LTABLE VAIR-1 VAIR-2 VAIR-3 VAIR-4>>
<GLOBAL BALLOON-FLOATS
<LTABLE LEDGE-1 VAIR-2 LEDGE-2 VAIR-4>>
<GLOBAL BALLOON-DOWNS
<LTABLE VAIR-4 VAIR-3 VAIR-2 VAIR-1>>
<ROUTINE RISE-AND-SHINE ("AUX" (IN <IN? ,WINNER ,BALLOON>) R)
#DECL ((IN) <OR ATOM FALSE> (R) <OR FALSE OBJECT>)
<ENABLE <QUEUE I-BALLOON 3>>
<COND (<EQUAL? ,BLOC ,VAIR-4>
<DISABLE <INT I-BURNUP>>
<DISABLE <INT I-BALLOON>>
<REMOVE ,BALLOON>
<COND (.IN
<JIGS-UP
"The balloon floats majestically out of the volcano, revealing a
breathtaking view of a wooded river valley surrounded by impassable
mountains. In a clearing stands a white house. You drift into high winds,
which carry you towards the snow-capped peaks. Oh, no! You crash into the
jagged cliffs of the Flathead Mountains!">)
(<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2 ,VOLCANO-BOTTOM>
<TELL
"You watch the balloon drift out over the rim and away on the wind." CR>)>
<SETG BLOC ,VOLCANO-BOTTOM>)
(<SET R <LKP ,BLOC ,BALLOON-UPS>>
<COND (.IN
<TELL "The balloon ascends." CR CR>
<SETG BLOC .R>
<GOTO .R>)
(T
<PUT-BALLOON .R "ascends.">)>)
(<SET R <LKP ,BLOC ,BALLOON-FLOATS>>
<COND (.IN
<TELL "The balloon leaves the ledge." CR CR>
<SETG BLOC .R>
<GOTO .R>)
(T
<ENABLE <QUEUE I-GNOME 10>>
<PUT-BALLOON .R
"floats away. It seems to be ascending, due to its light load.">
<FSET ,RECEPTACLE ,OPENBIT>)>)
(.IN
<SETG BLOC ,VAIR-1>
<TELL "The balloon rises slowly from the ground." CR CR>
<GOTO ,VAIR-1>)
(T
<PUT-BALLOON ,VAIR-1 "lifts off.">)>>
<ROUTINE DECLINE-AND-FALL ("AUX" (IN <IN? ,WINNER ,BALLOON>) R)
#DECL ((IN) <OR ATOM FALSE> (R) <OR FALSE OBJECT>)
<ENABLE <QUEUE I-BALLOON 3>>
<COND (<EQUAL? ,BLOC ,VAIR-1>
<COND (.IN
<SETG BLOC ,VOLCANO-BOTTOM>
<COND (,BINF-FLAG
<TELL "The balloon has landed." CR CR>
<GOTO ,VOLCANO-BOTTOM>
;<QUEUE I-BALLOON 0>)
(T
<REMOVE ,BALLOON>
<MOVE ,DEAD-BALLOON ,BLOC>
<MOVE ,WINNER ,HERE>
<DISABLE <INT I-BALLOON>>
<TELL
"You have landed, but the balloon did not survive."
CR CR>
<GOTO ,VOLCANO-BOTTOM>)>)
(T <PUT-BALLOON ,VOLCANO-BOTTOM "lands.">)>)
(<SET R <LKP ,BLOC ,BALLOON-DOWNS>>
<COND (.IN
<TELL "The balloon descends." CR CR>
<SETG BLOC .R>
<GOTO .R>)
(T <PUT-BALLOON .R "descends.">)>)>>
<ROUTINE BCONTENTS ()
<COND (<VERB? TAKE>
<TELL
"The " D ,PRSO " is an integral part of the basket and cannot
be removed.">
<COND (<EQUAL? ,PRSO ,BRAIDED-WIRE>
<TELL " The wire might possibly be tied, though.">)>
<CRLF>)
(<AND <EQUAL? ,PRSO ,CLOTH-BAG>
<VERB? LOOK-INSIDE OPEN>>
<COND (<VERB? OPEN>
<TELL
"The bag is enormous. The concept of opening it here is ludicrous." CR>)
(T
<TELL
"It doesn't appear that there's anything inside." CR>)>)
(<AND <VERB? EXAMINE> <EQUAL? ,PRSO ,RECEPTACLE>>
<TELL "The receptacle is ">
<COND (<FSET? ,PRSO ,OPENBIT> <TELL "open." CR>)
(T <TELL "closed." CR>)>)
(<VERB? FIND EXAMINE>
<TELL
"The " D ,PRSO " is part of the basket. It may be manipulated
within the basket but cannot be removed." CR>)>>
<ROUTINE WIRE-FCN ()
<COND (<VERB? TAKE FIND EXAMINE>
<BCONTENTS>)
(<VERB? TIE>
<COND (<AND <EQUAL? ,PRSO ,BRAIDED-WIRE>
<EQUAL? ,PRSI ,HOOK-1 ,HOOK-2>>
<SETG BTIE-FLAG ,PRSI>
<FSET ,PRSI ,NDESCBIT>
<DISABLE <INT I-BALLOON>>
<TELL "The balloon is fastened to the hook." CR>)>)
(<AND <VERB? UNTIE>
<EQUAL? ,PRSO ,BRAIDED-WIRE>>
<COND (,BTIE-FLAG
<ENABLE <QUEUE I-BALLOON 3>>
<FCLEAR ,BTIE-FLAG ,NDESCBIT>
<SETG BTIE-FLAG <>>
<TELL "The wire falls off of the hook." CR>)
(T <TELL "The wire is not tied to anything." CR>)>)>>
<ROUTINE I-BURNUP ("AUX" (OBJ <FIRST? ,RECEPTACLE>))
#DECL ((OBJ) OBJECT)
<COND (<EQUAL? ,HERE ,BLOC>
<TELL
"The " D .OBJ " has now burned out, and the cloth bag starts to deflate." CR>)>
<REMOVE .OBJ>
<SETG BINF-FLAG <>>
T>
<ROUTINE SAFE-ROOM-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are in a dusty old room which is featureless, except
for an exit on the north side." CR>
<COND (<NOT ,SAFE-FLAG>
<TELL
"Imbedded in the far wall is a rusty box. It appears to be somewhat
damaged, since an oblong hole has been chipped out of the front of it." CR>)
(T
<TELL
"On the far wall is a rusty box, whose door has been blown off." CR>)>)>>
<ROUTINE SAFE-FCN ()
<COND (<AND <VERB? TAKE> <EQUAL? ,PRSO ,SAFE>>
<TELL "The box is imbedded in the wall." CR>)
(<VERB? OPEN>
<COND (,SAFE-FLAG <TELL "The box has no door!" CR>)
(T <TELL "The box is rusted and will not open." CR>)>)
(<VERB? CLOSE>
<COND (,SAFE-FLAG <TELL "The box has no door!" CR>)
(T <TELL "The box isn't open!" CR>)>)>>
<ROUTINE BRICK-FCN ()
<COND (<VERB? BURN>
<REMOVE ,BRICK>
<JIGS-UP ,OTHER-PROPERTIES>)>>
<GLOBAL OTHER-PROPERTIES
"Now you've done it. It seems that the brick has other properties
than weight, namely the ability to blow you to smithereens.">
<ROUTINE FUSE-FCN ()
<COND (<OR <VERB? BURN>
<AND <VERB? LAMP-ON>
<IN? ,MATCH ,WINNER>
<FSET? ,MATCH ,ONBIT>>>
<TELL "The string starts to burn." CR>
<ENABLE <QUEUE I-FUSE 2>>)>>
<ROUTINE I-FUSE ("AUX" (BRICK-ROOM <LOC ,BRICK>) F)
<COND (<IN? ,FUSE ,BRICK>
<REPEAT ()
<COND (<NOT .BRICK-ROOM> <RFALSE>)
(<IN? .BRICK-ROOM ,ROOMS>
<RETURN>)
(T
<SET BRICK-ROOM <LOC .BRICK-ROOM>>)>>
<MOVE ,EXPLOSION .BRICK-ROOM>
<FCLEAR .BRICK-ROOM ,TOUCHBIT>
<COND (<EQUAL? .BRICK-ROOM ,HERE>
<MUNG-ROOM .BRICK-ROOM
"The way is blocked by debris from an explosion.">
<JIGS-UP ,OTHER-PROPERTIES>)
(<EQUAL? .BRICK-ROOM ,SAFE-ROOM>
<ENABLE <QUEUE I-SAFE 5>>
<SETG MUNGED-ROOM ,SAFE-ROOM>
<TELL "There is an explosion nearby." CR>
<COND (<IN? ,BRICK ,SLOT>
<FSET ,SLOT ,INVISIBLE>
<FSET ,SAFE ,OPENBIT>
<FCLEAR ,SAFE-ROOM ,TOUCHBIT>
<SETG SAFE-FLAG T>)>)
(T
<TELL "There is an explosion nearby." CR>
<ENABLE <QUEUE I-SAFE 5>>
<SETG MUNGED-ROOM .BRICK-ROOM>
<COND (<SET F <FIRST? .BRICK-ROOM>>
<REPEAT ()
<COND (<FSET? .F ,TAKEBIT>
<FSET .F ,INVISIBLE>)>
<COND (<NOT <SET F <NEXT? .F>>>
<RETURN>)>>)>)>
<REMOVE ,BRICK>)
(<EQUAL? <LOC ,FUSE> ,WINNER ,HERE>
<TELL "The string rapidly burns into nothingness." CR>)>
<REMOVE ,FUSE>>
<ROUTINE I-SAFE ()
<COND (<EQUAL? ,HERE ,MUNGED-ROOM>
<JIGS-UP
"The room trembles and 5000 tons of rock fall on you, turning you
into a pancake.">)
(<NOT ,DEAD>
<TELL
"You may recall that recent explosion. Probably as a result of it, you
hear an ominous rumbling, as if a nearby room had collapsed." CR>
<COND (<EQUAL? ,MUNGED-ROOM ,SAFE-ROOM>
<ENABLE <QUEUE I-LEDGE 8>>)>)>
<MUNG-ROOM ,MUNGED-ROOM
"The way is blocked by debris from an explosion.">>
<ROUTINE I-LEDGE ("AUX" (RM ,LEDGE-2))
<COND (<EQUAL? ,HERE ,LEDGE-2>
<COND (<IN? ,WINNER ,BALLOON>
<COND (,BTIE-FLAG
<SETG BLOC ,VOLCANO-BOTTOM>
<REMOVE ,BALLOON>
<MOVE ,DEAD-BALLOON ,VOLCANO-BOTTOM>
<SETG BTIE-FLAG <>>
<SETG BINF-FLAG <>>
<DISABLE <INT I-BALLOON>>
<DISABLE <INT I-BURNUP>>
<JIGS-UP
"The ledge collapses, probably as a result of the explosion, and plummets
to the ground far below. Sadly, you were still attached to the ledge.">)
(T
<TELL
"The ledge collapses, leaving you with no place to land." CR>)>)
(T
<JIGS-UP
"The force of the recent explosion has caused the ledge to collapse.">)>)
(<NOT ,DEAD>
<TELL "The ledge collapses. (That was a narrow escape!)" CR>)>
<MUNG-ROOM .RM "The ledge has collapsed and cannot be landed on.">>
<ROUTINE LEDGE-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"You are on a wide ledge high in the volcano. The rim of the volcano is
about 200 feet above and there is a precipitous drop to the bottom.">
<COND (<FSET? ,SAFE-ROOM ,RMUNGBIT>
<TELL " The way to the south is blocked by rubble." CR>)
(T <TELL " There is a small door to the south." CR>)>)>>
;<ROUTINE BLAST () ;"APPARENTLY UNUSED?"
<COND (<EQUAL? ,HERE ,SAFE-ROOM>)
(T
<TELL "You must explain how to do that." CR>)>>
<ROUTINE I-GNOME ()
<COND (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2>
<TELL
"A volcano gnome seems to walk straight out of the wall and ">
<COND (<IN? ,WAND ,WINNER>
<TELL
"noticing the wand, straight back in." CR>)
(T
<TELL
"says
\"I have a busy appointment schedule and little time to waste on
trespassers, but for a small fee I'll show you the way out.\" You
notice the gnome nervously glancing at his watch." CR>
<MOVE ,GNOME ,HERE>)>)
(T
<ENABLE <QUEUE I-GNOME 1>>
<RFALSE>)>>
<GLOBAL GNOME-FLAG <>>
<ROUTINE GNOME-FCN ()
<COND (<VERB? TELL>
<SETG P-CONT <>>
<SETG QUOTE-FLAG <>>
<COND (<NOT ,GNOME-FLAG>
<ENABLE <QUEUE I-NERVOUS 5>>)>
<SETG GNOME-FLAG T>
<TELL
"The gnome appears increasingly nervous." CR>)
(<AND <VERB? GIVE THROW> <EQUAL? ,PRSI ,GNOME>>
<COND (<GETPT ,PRSO ,P?VALUE>
<TELL
"\"Thank you very much for the " D ,PRSO ". I don't believe
I've ever seen one as beautiful. Follow me,\" he says, and a door
appears on the west end of the ledge. Through the door, you can see
a narrow chimney sloping steeply downward. The gnome moves quickly,
and disappears from sight." CR>
<REMOVE ,PRSO>
<REMOVE ,GNOME>
<SETG GNOME-DOOR-FLAG T>)
(<BOMB? ,PRSO>
<MOVE ,BRICK ,HERE>
<REMOVE ,GNOME>
<DISABLE <INT I-GNOME>>
<DISABLE <INT I-NERVOUS>>
<TELL
"\"That certainly wasn't what I had in mind,\" he says, and disappears." CR>)
(T
<REMOVE-CAREFULLY ,PRSO>
<TELL
"\"That wasn't quite what I had in mind,\" he says, crunching the
" D ,PRSO " in his rock-hard hands." CR>)>)
(T
<TELL
"The gnome appears increasingly nervous." CR>
<COND (<NOT ,GNOME-FLAG>
<ENABLE <QUEUE I-NERVOUS 5>>)>
<SETG GNOME-FLAG T>)>>
<ROUTINE I-NERVOUS ()
<COND (<IN? ,GNOME ,HERE>
<TELL
"The gnome glances at his watch. \"Oops. I'm late for an
appointment!\" He disappears, leaving you alone on the ledge." CR>)>
<REMOVE ,GNOME>>
<ROUTINE PURPLE-BOOK-FCN ()
<COND (<AND <VERB? READ>
<IN? ,STAMP ,PURPLE-BOOK>
<NOT <FSET? ,PURPLE-BOOK ,OPENBIT>>>
<TELL <GETP ,PURPLE-BOOK ,P?TEXT> CR>
<PERFORM ,V?OPEN ,PURPLE-BOOK>
<RTRUE>)
(T <RANDOM-BOOK>)>>
<ROUTINE RANDOM-BOOK ()
<COND (<VERB? TAKE MOVE PUT>
<FSET ,WHITE-BOOK ,TOUCHBIT>
<FSET ,PURPLE-BOOK ,TOUCHBIT>
<FSET ,GREEN-BOOK ,TOUCHBIT>
<FSET ,BLUE-BOOK ,TOUCHBIT>
<RFALSE>)>>
; "SUBTITLE TOMB OF THE FLATHEADS"
<ROUTINE HEAD-FCN ()
<COND (<VERB? HELLO>
<TELL "The Flatheads are dead; therefore they do not respond." CR>)
(<VERB? KICK ATTACK RUB OPEN TAKE BURN>
<JIGS-UP
"Although the Flatheads are dead, they foresaw that some cretin
might tamper with their remains. Therefore, they took steps to
punish such actions.">)>>
<ROUTINE CRYPT-ANTEROOM-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"The anteroom is large and empty. Marble bas reliefs depict the stirring
times and afterlife of the Flatheads (the latter a bit optimistically).
The exit is to the west. A huge marble door stands to the south. ">
<TELL "The door is ">
<COND (<FSET? ,CRYPT-DOOR ,OPENBIT>
<TELL "open.">)
(T <TELL "closed.">)>
<TELL
" Above the door is the cryptic inscription: \"Feel Free\"." CR>)>>
<ROUTINE CRYPT-ROOM-FCN (RARG "AUX" CLIT?)
<COND (<EQUAL? .RARG ,M-LOOK>
<FCLEAR ,HERE ,ONBIT>
<COND (<LIT? ,HERE>
<TELL
"The room contains the earthly remains of the mighty Flatheads, twelve
somewhat flat heads mounted securely on poles. While the room might be
expected to contain funerary urns or other evidence of the ritual
practices of the ancient Zorkers, it is empty of all such objects. There
is writing carved on the crypt. The only apparent exit is to the north
through the door to the anteroom. The door is ">
<COND (<FSET? ,CRYPT-DOOR ,OPENBIT>
<TELL "open.">)
(T <TELL "closed.">)>
<CRLF>
<COND (<NOT <FSET? ,DIM-DOOR ,INVISIBLE>>
<TELL
"Looking closely at the south wall, you can see the dim outline of
a secret door labelled with the letter \"F\"." CR>)>)
(T
<DIM-DOOR-APPEARS>)>
<FSET ,HERE ,ONBIT>
<RTRUE>)
(<EQUAL? .RARG ,M-END>
<SET CLIT? ,CRYPT-LIT?>
<FCLEAR ,CRYPT-ROOM ,ONBIT>
<SETG CRYPT-LIT? <LIT? ,CRYPT-ROOM>>
<COND (<AND .CLIT?
<NOT ,CRYPT-LIT?>>
<DIM-DOOR-APPEARS>)>
<FSET ,CRYPT-ROOM ,ONBIT>)>>
<GLOBAL CRYPT-LIT? T>
<ROUTINE DIM-DOOR-APPEARS ()
<TELL
"It is dark, but on the south wall is a faint outline of a rectangle, as
though light were shining around a doorway. You can also make out a faintly
glowing letter in the center of this area. It might be an \"F\"." CR>
<FCLEAR ,DIM-DOOR ,INVISIBLE>>
<ROUTINE CRYPT-OBJECT ()
<COND (<VERB? OPEN> <TELL "The crypt is sealed for all time." CR>)
(<VERB? RUB> <TELL "The marble is cool." CR>)>>
<ROUTINE CRYPT-DOOR-FCN ()
<COND (<VERB? OPEN CLOSE>
<OPEN-CLOSE ,PRSO
"The crypt door squeaks open."
"The crypt door squeaks closed.">)>>
<ROUTINE TOMB-PSEUDO ()
<COND (<VERB? THROUGH>
<DO-WALK ,P?EAST>
T)>>
<GLOBAL DIM-DOOR-FLAG <>>
<ROUTINE DIM-DOOR-FCN ()
<COND (<VERB? KNOCK> <TELL "A hollow echo responds." CR>)
(<VERB? OPEN CLOSE>
<COND (<VERB? OPEN> <SETG DIM-DOOR-FLAG T>)
(T <SETG DIM-DOOR-FLAG <>>)>
<OPEN-CLOSE ,PRSO
"The secret door opens noiselessly."
"The secret door closes noiselessly.">)>>
<ROUTINE REPELLENT-FCN ()
<COND (<VERB? SHAKE>
<COND (,SPRAY-USED? <TELL "The can seems empty." CR>)
(T <TELL "There is a sloshing sound from inside." CR>)>)
(<AND <VERB? SPRAY PUT> <EQUAL? ,PRSO ,REPELLENT>>
<COND (,SPRAY-USED?
<TELL
"The repellent is all gone." CR>)
(<NOT ,PRSI>
<SETG SPRAY-USED? T>
<TELL
"The spray stinks amazingly for a few moments, then drifts away." CR>)
(T
<COND (<EQUAL? ,PRSI ,ME>
<ENABLE <QUEUE I-SPRAY 8>>
<SETG SPRAYED? T>)>
<SETG SPRAY-USED? T>
<TELL
"The spray smells like a mixture of old socks and burning rubber. If
I were a grue I'd sure stay clear!" CR>)>)>>
<GLOBAL SPRAY-USED? <>>
<ROUTINE I-SPRAY ()
<SETG SPRAYED? <>>
<TELL "That horrible smell is much less pungent now." CR>>
<ROUTINE ZORK3-FCN (RARG)
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"Beyond the door is a roughly hewn staircase leading down into darkness.
The landing on which you stand is covered with carefully drawn magical runes
like those sketched upon the workbench of the Wizard of Frobozz.
These have been overlaid with sweeping green lines of enormous power, which
undulate back and forth across the landing. ">
<COND (<IN? ,WAND ,WINNER>
<TELL
"The wand begins to vibrate in harmony with the motion of the lines.
You feel yourself compelled downward, and you yield, stepping onto the
staircase. As you pass the green lines, they flare and disappear with a
burst of light, and you tumble down the staircase!|
|
At the bottom, a vast red-lit hall stretches off into the distance.
Sinister statues guard the entrance to a dimly visible room far ahead.
With courage and cunning you have conquered the Wizard of Frobozz and
become the master of his domain, but the final challenge awaits!|
|
(The ultimate adventure concludes in \"Zork III: The Dungeon Master\".)|
|
" CR>
<SETG WON-FLAG T>
<FINISH>)
(T
<JIGS-UP
"The green curves begin to vibrate toward you, as if searching for
something. One by one your possessions glow bright green. Finally, you
are attacked by these magical wardens, and destroyed!">)>)>>
\
;"SUBTITLE A DROP IN THE BUCKET"
<GLOBAL BUCKET-TOP-FLAG <>>
<GLOBAL EVAPORATED <>>
<ROUTINE I-BUCKET ()
<COND (<IN? ,WATER ,BUCKET>
<SETG EVAPORATED T>
<REMOVE ,WATER>)>
<RFALSE>>
<ROUTINE WATER-FCN ("AUX" AV W PI?)
#DECL ((AV) <OR OBJECT FALSE> (W) OBJECT (PI?) <OR ATOM FALSE>)
<COND (<VERB? SGIVE> <RFALSE>)
(<VERB? THROUGH>
<PERFORM ,V?SWIM ,PRSO>
<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? <>>)
(<EQUAL? ,PRSO ,GLOBAL-WATER ,WATER>
<SET W ,PRSO>
<SET PI? <>>)
(,PRSI
<SET W ,PRSI>
<SET PI? T>)>
<COND (<EQUAL? .W ,GLOBAL-WATER>
<SET W ,WATER>
<COND (<VERB? TAKE PUT> <REMOVE .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 <EQUAL? .AV ,PRSI>>
<PUDDLE .AV>)
(<AND .AV <NOT ,PRSI> <NOT <IN? .W .AV>>>
<PUDDLE .AV>)
(<AND ,PRSI <NOT <EQUAL? ,PRSI ,TEAPOT>>>
<TELL "The water leaks out of the " D ,PRSI
" and evaporates immediately." CR>
<REMOVE .W>)
(<IN? ,TEAPOT ,WINNER>
<COND (<NOT <FIRST? ,TEAPOT>>
<COND (<EQUAL? ,HERE ,POOL-ROOM>
<MOVE ,SALTY-WATER ,TEAPOT>)
(T
<MOVE ,WATER ,TEAPOT>)>
<TELL "The teapot is now full of water." CR>)
(T
<TELL "The teapot isn't currently empty." CR>
<RTRUE>)>)
(<AND <IN? ,PRSO ,TEAPOT>
<VERB? TAKE>
<NOT ,PRSI>>
<SETG PRSO ,TEAPOT>
<ITAKE>
<SETG PRSO .W>)
(T
<TELL "The water slips through your fingers." CR>)>)
(.PI? <TELL "Nice try." CR>)
(<VERB? DROP GIVE>
<COND (<AND <EQUAL? ,PRSO ,WATER>
<NOT <HELD? ,WATER>>>
<TELL "You don't have any water." CR>
<RTRUE>)>
<REMOVE ,WATER>
<COND (.AV
<PUDDLE .AV>)
(T
<TELL
"The water spills to the floor and evaporates." CR>
<REMOVE ,WATER>)>)
(<VERB? THROW>
<TELL
"The water splashes on the walls and evaporates." CR>
<REMOVE ,WATER>)>>
<ROUTINE PUDDLE (AV)
<TELL "There is now a puddle in the bottom of the " D .AV "." CR>
<MOVE ,PRSO .AV>>
<ROUTINE BUCKET-FCN ("OPTIONAL" (RARG ,M-BEG))
<COND (<EQUAL? .RARG ,M-BEG>
<COND (<AND <VERB? BURN>
<EQUAL? ,PRSO ,BUCKET>>
<TELL
"The bucket is fireproof, and won't burn." CR>)
(<AND <VERB? DROP PUT>
<EQUAL? ,PRSO ,WATER>
<EQUAL? ,PRSI ,BUCKET>
<IN? ,BUCKET ,WELL-BOTTOM>
<NOT <IN? ,WINNER ,BUCKET>>>
<TELL "The bucket swiftly rises up, and is gone." CR>
<MOVE ,BUCKET ,WELL-TOP>
<MOVE ,WATER ,BUCKET>
<SETG BUCKET-TOP-FLAG T>
<ENABLE <QUEUE I-BUCKET 100>>
<RTRUE>)
(<VERB? KICK>
<JIGS-UP "If you insist.">)>)
(<EQUAL? .RARG ,M-END>
<COND (<AND <IN? ,WATER ,BUCKET>
<NOT ,BUCKET-TOP-FLAG>>
<TELL "The bucket rises and comes to a stop." CR CR>
<SETG BUCKET-TOP-FLAG T>
<SETG EVAPORATED <>>
<PASS-THE-BUCKET ,WELL-TOP>
<ENABLE <QUEUE I-BUCKET 100>>
<RTRUE>)
(<AND ,BUCKET-TOP-FLAG
<NOT <IN? ,WATER ,BUCKET>>>
<COND (,EVAPORATED
<TELL
"The last of the water evaporates, and the bucket descends." CR CR>)
(T
<TELL
"The bucket descends and comes to a stop." CR CR>)>
<SETG BUCKET-TOP-FLAG <>>
<PASS-THE-BUCKET ,WELL-BOTTOM>)>)
(<VERB? CLIMB-ON>
<PERFORM ,V?BOARD ,PRSO>
<RTRUE>)>>
<ROUTINE PASS-THE-BUCKET (R)
#DECL ((R) OBJECT)
<MOVE ,BUCKET .R>
<COND (<IN? ,WINNER ,BUCKET>
<GOTO .R>)>>
\
;"SUBTITLE CHOMPERS IN WONDERLAND"
<ROUTINE POSTS-ROOM-FCN (RARG)
<COND (<EQUAL? .RARG ,M-BEG>
<COND (<AND <VERB? TAKE> <FSET? ,PRSO ,NONLANDBIT>>
<TELL
"The " D ,PRSO " is now much larger than you are. You have no hope of
taking it." CR>)>)>>
<ROUTINE EATME-FCN ("AUX" F N)
<COND (<AND <VERB? EAT>
<EQUAL? ,PRSO ,EAT-ME-CAKE>
<EQUAL? ,HERE ,TEA-ROOM>>
<TELL
"Suddenly, the room appears to have become very large (although
everything you are carrying seems to be its normal size)." CR CR>
<REMOVE ,EAT-ME-CAKE>
<FSET ,ROBOT ,INVISIBLE>
<FSET ,ALICE-TABLE ,INVISIBLE>
<SET F <FIRST? ,HERE>>
<REPEAT ()
<COND (<NOT .F> <RETURN>)
(T
<SET N <NEXT? .F>>
<COND (<AND <NOT <EQUAL? .F ,ADVENTURER>>
<FSET? .F ,TAKEBIT>>
<FSET .F ,NONLANDBIT>
<FSET .F ,TRYTAKEBIT>
<MOVE .F ,POSTS-ROOM>)>)>
<SET F .N>>
<GOTO ,POSTS-ROOM>)
(T <CAKE-CRUMBLE>)>>
<ROUTINE CAKE-CRUMBLE ("AUX" CAKE)
<COND (<FSET? ,PRSO ,FOODBIT> <SET CAKE ,PRSO>)
(T <SET CAKE ,PRSI>)>
<COND (<OR <EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>
<EQUAL? ,HERE ,MACHINE-ROOM ,MAGNET-ROOM ,CAGE-ROOM>
<EQUAL? ,HERE ,WELL-TOP ,IN-CAGE>>
<RFALSE>)
(T
<REMOVE .CAKE>
<TELL
"The " D .CAKE " has crumbled to dust." CR>)>>
<ROUTINE CAKE-FCN ("AUX" F N)
<COND (<VERB? READ>
<COND (<FSET? ,PRSO ,NONLANDBIT>
<TELL
"The cake is much too tall now for you to read the lettering." CR>)
(,PRSI
<COND (<EQUAL? ,PRSI ,PALANTIR-1 ,PALANTIR-2 ,PALANTIR-3>
<PERFORM ,V?LOOK-INSIDE ,PRSI>)
(<EQUAL? ,PRSI ,FLASK>
<TELL "The letters, now visible, say \"">
<COND (<EQUAL? ,PRSO ,RED-ICING>
<TELL "Evaporate">)
(<EQUAL? ,PRSO ,ORANGE-ICING>
<TELL "Explode">)
(T <TELL "Enlarge">)>
<TELL "\"." CR>)
(T <TELL "You can't see through that!" CR>)>)
(T
<TELL
"The first letter is a capital E. The rest is too small to read." CR>)>)
(<AND <VERB? EAT>
<EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>>
<COND (<EQUAL? ,PRSO ,ORANGE-ICING>
<REMOVE ,PRSO>
<ICEBOOM>)
(<EQUAL? ,PRSO ,RED-ICING>
<REMOVE ,PRSO>
<JIGS-UP
"That was delicious, but your dying memory is of feeling horribly dehydrated
and thirsty.">)
(<EQUAL? ,PRSO ,BLUE-ICING>
<REMOVE ,PRSO>
<TELL "The room around you seems to be getting smaller."
CR CR>
<COND (<EQUAL? ,HERE ,POSTS-ROOM>
<FCLEAR ,ROBOT ,INVISIBLE>
<FCLEAR ,ALICE-TABLE ,INVISIBLE>
<FSET ,POSTS ,INVISIBLE>
<SET F <FIRST? ,HERE>>
<REPEAT ()
<COND (<NOT .F> <RETURN>)
(T
<SET N <NEXT? .F>>
<COND (<AND <NOT <EQUAL? .F ,ADVENTURER>>
<FSET? .F ,TAKEBIT>>
<FCLEAR .F ,NONLANDBIT>
<FCLEAR .F ,TRYTAKEBIT>
<MOVE .F ,TEA-ROOM>)>)>
<SET F .N>>
<GOTO ,TEA-ROOM>)
(T <JIGS-UP
"The room seems to have become too small to hold you. The walls are not as
compressible as your body, which is demolished." >)>)>)
(<AND <VERB? THROW PUT>
<EQUAL? ,PRSO ,ORANGE-ICING>
<EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>>
<REMOVE ,PRSO>
<ICEBOOM>)
(<AND <VERB? THROW PUT>
<EQUAL? ,PRSO ,RED-ICING ,BLUE-ICING ,ORANGE-ICING>
<EQUAL? ,PRSI ,POOL>>
<COND (<EQUAL? ,PRSO ,BLUE-ICING ,ORANGE-ICING>
<TELL "The cake sinks majestically into the pool." CR>
<REMOVE ,PRSO>
<RTRUE>)>
<MOVE ,PRSO ,HERE>
<REMOVE ,PRSI>
<TELL
"Most of the pool evaporates, revealing a (slightly damp but
still valuable) package of rare candies. The red cake must be
pretty strong stuff, since it remains intact!" CR>
<FCLEAR ,CANDY ,INVISIBLE>)