forked from historicalsource/zork2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2actions.zap
3957 lines (3593 loc) · 111 KB
/
2actions.zap
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
.FUNCT SWORD-FCN
EQUAL? PRSA,V?TAKE \FALSE
EQUAL? WINNER,ADVENTURER \FALSE
CALL QUEUE,I-SWORD,-1
PUT STACK,0,1
RFALSE
.FUNCT I-SWORD,DEM,NG=0,G,P,TX,L
CALL INT,I-SWORD >DEM
SET 'G,SWORD-GLOW
IN? SWORD,ADVENTURER \?ELS5
CALL INFESTED?,HERE
ZERO? STACK /?ELS8
SET 'NG,2
JUMP ?CND6
?ELS8: SET 'P,0
?PRG11: NEXTP HERE,P >P
ZERO? P \?ELS15
JUMP ?CND6
?ELS15: LESS? P,LOW-DIRECTION /?PRG11
GETPT HERE,P >TX
PTSIZE TX >L
EQUAL? L,UEXIT,CEXIT,DEXIT \?PRG11
GETB TX,0
CALL INFESTED?,STACK
ZERO? STACK /?PRG11
SET 'NG,1
?CND6: EQUAL? NG,G /FALSE
EQUAL? NG,2 \?ELS28
PRINTI "Your sword has begun to glow very brightly."
CRLF
JUMP ?CND24
?ELS28: EQUAL? NG,1 \?ELS32
PRINTI "Your sword is glowing with a faint blue glow."
CRLF
JUMP ?CND24
?ELS32: ZERO? NG \?CND24
PRINTI "Your sword is no longer glowing."
CRLF
?CND24: SET 'SWORD-GLOW,NG
RTRUE
?ELS5: PUT DEM,C-ENABLED?,0
RFALSE
.FUNCT INFESTED?,R,F
FIRST? R >F /?KLU12
?KLU12:
?PRG1: ZERO? F /FALSE
FSET? F,ACTORBIT \?ELS7
FSET? F,INVISIBLE /?ELS7
EQUAL? F,ROBOT /?ELS7
RETURN F
?ELS7: NEXT? F >F /?PRG1
RFALSE
.FUNCT CAROUSEL-ROOM-FCN,RARG
EQUAL? RARG,M-LOOK \?ELS5
PRINTI "You are in a large circular room whose high ceiling is lost in gloom. Eight identical passages leave the room."
CRLF
ZERO? CAROUSEL-FLIP-FLAG \TRUE
PRINTR "A loud whirring sound comes from all around, and you feel sort of disoriented in here."
?ELS5: ZERO? CAROUSEL-FLIP-FLAG \FALSE
EQUAL? RARG,M-BEG \FALSE
EQUAL? PRSA,V?WALK \FALSE
EQUAL? PRSO,P?UP,P?DOWN /FALSE
EQUAL? PRSO,P?OUT \?ELS22
PRINTI "Feeling dizzy, you pick a direction at random."
CRLF
CRLF
SET 'PRSO,P?EAST
JUMP ?CND20
?ELS22: PRINTI "You're not sure which direction is which. This room is very disorienting."
CRLF
CRLF
?CND20: EQUAL? PRSO,P?WEST /?THN32
RANDOM 100
GRTR? 80,STACK \?CND29
?THN32: RANDOM 7
SUB STACK,1
GET EIGHT-DIRECTIONS,STACK >PRSO
?CND29: CALL V-WALK
RTRUE
.FUNCT VIOLIN-FCN
EQUAL? PRSA,V?PLAY \FALSE
EQUAL? PRSO,VIOLIN \FALSE
PRINTR "An amazingly offensive noise issues from the violin."
.FUNCT OPEN-CLOSE,OBJ,STROPN,STRCLS
EQUAL? PRSA,V?OPEN \?ELS5
FSET? OBJ,OPENBIT \?ELS8
CALL RANDOM-ELEMENT,DUMMY
PRINT STACK
JUMP ?CND6
?ELS8: PRINT STROPN
FSET OBJ,OPENBIT
?CND6: CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?CLOSE \FALSE
FSET? OBJ,OPENBIT \?ELS19
PRINT STRCLS
FCLEAR OBJ,OPENBIT
JUMP ?CND17
?ELS19: CALL RANDOM-ELEMENT,DUMMY
PRINT STACK
CRLF
?CND17: CRLF
RTRUE
.FUNCT BALLOON-FCN,RARG=0,M,R,RC
EQUAL? RARG,M-LOOK \?ELS5
ZERO? BINF-FLAG /?ELS8
PRINTI "The cloth bag is inflated and "
FSET? RECEPTACLE,OPENBIT \?ELS14
PRINTI "there is a "
PRINTD BINF-FLAG
PRINTI " burning in the receptacle."
JUMP ?CND6
?ELS14: PRINTI "some smoke is leaking out of the closed receptacle."
JUMP ?CND6
?ELS8: PRINTI "The cloth bag is draped over the side of the basket. Directly in the middle of the basket is a metal receptacle which is "
FSET? RECEPTACLE,OPENBIT \?ELS27
PRINTI "open"
FIRST? RECEPTACLE >RC /?KLU148
?KLU148: ZERO? RC /?CND25
PRINTI ". A "
PRINTD RC
PRINTI " is "
EQUAL? BINF-FLAG,RC \?ELS40
PUSH STR?204
JUMP ?CND36
?ELS40: PUSH STR?205
?CND36: PRINT STACK
PRINTI " inside"
JUMP ?CND25
?ELS27: PRINTI "closed"
?CND25: PRINTI "."
?CND6: ZERO? BTIE-FLAG /?ELS51
PRINTR " The balloon is tied to a hook by the braided wire."
?ELS51: PRINTR " A braided wire is dangling over the side of the basket."
?ELS5: EQUAL? RARG,M-OBJDESC \?ELS60
PRINTI "There is a large and extremely heavy wicker basket here. An enormous cloth bag "
ZERO? BINF-FLAG /?ELS65
PRINTI "attached to the basket is inflated. A metal receptacle is fastened to the center of the basket. "
FSET? RECEPTACLE,OPENBIT \?ELS71
PRINTI "In it is a burning "
PRINTD BINF-FLAG
JUMP ?CND63
?ELS71: PRINTI "Some smoke leaks out around its closed lid"
JUMP ?CND63
?ELS65: PRINTI "is draped over the side and is firmly attached to the basket. A metal receptacle is fastened to the center of the basket"
?CND63: ZERO? BTIE-FLAG /?ELS86
PRINTR ". A piece of wire tied to a hook holds the balloon in place."
?ELS86: PRINTR ". Dangling from the basket is a piece of braided wire."
?ELS60: EQUAL? RARG,M-BEG \FALSE
EQUAL? PRSA,V?WALK \?ELS100
GETPT HERE,PRSO >M
ZERO? M /?ELS105
ZERO? BTIE-FLAG /?ELS110
PRINTR "You are tied to the ledge."
?ELS110: PTSIZE M
EQUAL? STACK,1 \?ELS117
GETB M,0 >R
FSET? R,RMUNGBIT /?ELS117
SET 'BLOC,R
?ELS117: CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
RFALSE
?ELS105: PRINTR "You can't control the balloon this way."
?ELS100: EQUAL? PRSA,V?OPEN \?ELS123
ZERO? BINF-FLAG /?ELS123
EQUAL? PRSO,RECEPTACLE \?ELS123
FIRST? RECEPTACLE \?ELS123
PRINTI "Opening it reveals a burning "
PRINTD BINF-FLAG
PRINTI "."
CRLF
FSET RECEPTACLE,OPENBIT
RTRUE
?ELS123: EQUAL? PRSA,V?TAKE \?ELS129
EQUAL? BINF-FLAG,PRSO \?ELS129
PRINTI "You don't really want to hold a burning "
PRINTD PRSO
PRINTR "."
?ELS129: EQUAL? PRSA,V?PUT \?ELS135
EQUAL? PRSI,RECEPTACLE \?ELS135
FIRST? RECEPTACLE \?ELS135
PRINTR "The receptacle is already occupied."
?ELS135: EQUAL? PRSA,V?PUT \?ELS141
EQUAL? PRSI,RECEPTACLE \?ELS141
FSET PRSO,NDESCBIT
RFALSE
?ELS141: EQUAL? PRSA,V?INFLATE \FALSE
PRINTR "It takes more than words to inflate a balloon."
.FUNCT I-BALLOON
FSET? RECEPTACLE,OPENBIT \?ELS5
ZERO? BINF-FLAG /?ELS5
CALL RISE-AND-SHINE
RSTACK
?ELS5: EQUAL? HERE,LEDGE-1,LEDGE-2 \?ELS9
CALL RISE-AND-SHINE
RSTACK
?ELS9: CALL DECLINE-AND-FALL
RSTACK
.FUNCT BALLOON-BURN
PRINTI "The "
PRINTD PRSO
PRINTI " burns inside the receptacle."
CRLF
GETP PRSO,P?SIZE
MUL STACK,20
CALL QUEUE,I-BURNUP,STACK
PUT STACK,0,1
FSET PRSO,FLAMEBIT
FSET PRSO,ONBIT
FCLEAR PRSO,TAKEBIT
FCLEAR PRSO,READBIT
ZERO? BINF-FLAG \TRUE
PRINTI "The cloth bag inflates as it fills with hot air."
CRLF
ZERO? BLAB-FLAG \?CND13
PRINTI "A small label drops from the bag into the basket."
CRLF
MOVE BALLOON-LABEL,BALLOON
?CND13: SET 'BLAB-FLAG,TRUE-VALUE
SET 'BINF-FLAG,PRSO
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
RTRUE
.FUNCT PUT-BALLOON,THERE,STR
EQUAL? HERE,LEDGE-1,LEDGE-2,VOLCANO-BOTTOM \?CND1
PRINTI "You watch as the balloon slowly "
PRINT STR
CRLF
?CND1: MOVE BALLOON,THERE
SET 'BLOC,THERE
RETURN BLOC
.FUNCT RISE-AND-SHINE,IN,R
IN? WINNER,BALLOON /?PRD1
PUSH 0
JUMP ?PRD2
?PRD1: PUSH 1
?PRD2: SET 'IN,STACK
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
EQUAL? BLOC,VAIR-4 \?ELS7
CALL INT,I-BURNUP
PUT STACK,0,0
CALL INT,I-BALLOON
PUT STACK,0,0
REMOVE BALLOON
ZERO? IN /?ELS10
CALL JIGS-UP,STR?206
JUMP ?CND8
?ELS10: EQUAL? HERE,LEDGE-1,LEDGE-2,VOLCANO-BOTTOM \?CND8
PRINTI "You watch the balloon drift out over the rim and away on the wind."
CRLF
?CND8: SET 'BLOC,VOLCANO-BOTTOM
RETURN BLOC
?ELS7: CALL LKP,BLOC,BALLOON-UPS >R
ZERO? R /?ELS17
ZERO? IN /?ELS22
PRINTI "The balloon ascends."
CRLF
CRLF
SET 'BLOC,R
CALL GOTO,R
RSTACK
?ELS22: CALL PUT-BALLOON,R,STR?207
RSTACK
?ELS17: CALL LKP,BLOC,BALLOON-FLOATS >R
ZERO? R /?ELS29
ZERO? IN /?ELS34
PRINTI "The balloon leaves the ledge."
CRLF
CRLF
SET 'BLOC,R
CALL GOTO,R
RSTACK
?ELS34: CALL QUEUE,I-GNOME,10
PUT STACK,0,1
CALL PUT-BALLOON,R,STR?208
FSET RECEPTACLE,OPENBIT
RTRUE
?ELS29: ZERO? IN /?ELS41
SET 'BLOC,VAIR-1
PRINTI "The balloon rises slowly from the ground."
CRLF
CRLF
CALL GOTO,VAIR-1
RSTACK
?ELS41: CALL PUT-BALLOON,VAIR-1,STR?209
RSTACK
.FUNCT DECLINE-AND-FALL,IN,R
IN? WINNER,BALLOON /?PRD1
PUSH 0
JUMP ?PRD2
?PRD1: PUSH 1
?PRD2: SET 'IN,STACK
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
EQUAL? BLOC,VAIR-1 \?ELS7
ZERO? IN /?ELS12
SET 'BLOC,VOLCANO-BOTTOM
ZERO? BINF-FLAG /?ELS18
PRINTI "The balloon has landed."
CRLF
CRLF
CALL GOTO,VOLCANO-BOTTOM
RSTACK
?ELS18: REMOVE BALLOON
MOVE DEAD-BALLOON,BLOC
MOVE WINNER,HERE
CALL INT,I-BALLOON
PUT STACK,0,0
PRINTI "You have landed, but the balloon did not survive."
CRLF
CRLF
CALL GOTO,VOLCANO-BOTTOM
RSTACK
?ELS12: CALL PUT-BALLOON,VOLCANO-BOTTOM,STR?210
RSTACK
?ELS7: CALL LKP,BLOC,BALLOON-DOWNS >R
ZERO? R /FALSE
ZERO? IN /?ELS34
PRINTI "The balloon descends."
CRLF
CRLF
SET 'BLOC,R
CALL GOTO,R
RSTACK
?ELS34: CALL PUT-BALLOON,R,STR?211
RSTACK
.FUNCT BCONTENTS
EQUAL? PRSA,V?TAKE \?ELS5
PRINTI "The "
PRINTD PRSO
PRINTI " is an integral part of the basket and cannot be removed."
EQUAL? PRSO,BRAIDED-WIRE \?CND8
PRINTI " The wire might possibly be tied, though."
?CND8: CRLF
RTRUE
?ELS5: EQUAL? PRSO,CLOTH-BAG \?ELS14
EQUAL? PRSA,V?OPEN,V?LOOK-INSIDE \?ELS14
EQUAL? PRSA,V?OPEN \?ELS21
PRINTR "The bag is enormous. The concept of opening it here is ludicrous."
?ELS21: PRINTR "It doesn't appear that there's anything inside."
?ELS14: EQUAL? PRSA,V?EXAMINE \?ELS29
EQUAL? PRSO,RECEPTACLE \?ELS29
PRINTI "The receptacle is "
FSET? PRSO,OPENBIT \?ELS38
PRINTR "open."
?ELS38: PRINTR "closed."
?ELS29: EQUAL? PRSA,V?EXAMINE,V?FIND \FALSE
PRINTI "The "
PRINTD PRSO
PRINTR " is part of the basket. It may be manipulated within the basket but cannot be removed."
.FUNCT WIRE-FCN
EQUAL? PRSA,V?EXAMINE,V?FIND,V?TAKE \?ELS5
CALL BCONTENTS
RSTACK
?ELS5: EQUAL? PRSA,V?TIE \?ELS7
EQUAL? PRSO,BRAIDED-WIRE \FALSE
EQUAL? PRSI,HOOK-1,HOOK-2 \FALSE
SET 'BTIE-FLAG,PRSI
FSET PRSI,NDESCBIT
CALL INT,I-BALLOON
PUT STACK,0,0
PRINTR "The balloon is fastened to the hook."
?ELS7: EQUAL? PRSA,V?UNTIE \FALSE
EQUAL? PRSO,BRAIDED-WIRE \FALSE
ZERO? BTIE-FLAG /?ELS25
CALL QUEUE,I-BALLOON,3
PUT STACK,0,1
FCLEAR BTIE-FLAG,NDESCBIT
SET 'BTIE-FLAG,FALSE-VALUE
PRINTR "The wire falls off of the hook."
?ELS25: PRINTR "The wire is not tied to anything."
.FUNCT I-BURNUP,OBJ
FIRST? RECEPTACLE >OBJ /?KLU6
?KLU6: EQUAL? HERE,BLOC \?CND1
PRINTI "The "
PRINTD OBJ
PRINTI " has now burned out, and the cloth bag starts to deflate."
CRLF
?CND1: REMOVE OBJ
SET 'BINF-FLAG,FALSE-VALUE
RTRUE
.FUNCT SAFE-ROOM-FCN,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are in a dusty old room which is featureless, except for an exit on the north side."
CRLF
ZERO? SAFE-FLAG \?ELS12
PRINTR "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."
?ELS12: PRINTR "On the far wall is a rusty box, whose door has been blown off."
.FUNCT SAFE-FCN
EQUAL? PRSA,V?TAKE \?ELS5
EQUAL? PRSO,SAFE \?ELS5
PRINTR "The box is imbedded in the wall."
?ELS5: EQUAL? PRSA,V?OPEN \?ELS11
ZERO? SAFE-FLAG /?ELS16
PRINTR "The box has no door!"
?ELS16: PRINTR "The box is rusted and will not open."
?ELS11: EQUAL? PRSA,V?CLOSE \FALSE
ZERO? SAFE-FLAG /?ELS30
PRINTR "The box has no door!"
?ELS30: PRINTR "The box isn't open!"
.FUNCT BRICK-FCN
EQUAL? PRSA,V?BURN \FALSE
REMOVE BRICK
CALL JIGS-UP,OTHER-PROPERTIES
RSTACK
.FUNCT FUSE-FCN
EQUAL? PRSA,V?BURN /?THN6
EQUAL? PRSA,V?LAMP-ON \FALSE
IN? MATCH,WINNER \FALSE
FSET? MATCH,ONBIT \FALSE
?THN6: PRINTI "The string starts to burn."
CRLF
CALL QUEUE,I-FUSE,2
PUT STACK,0,1
RTRUE
.FUNCT I-FUSE,BRICK-ROOM,F
LOC BRICK >BRICK-ROOM
IN? FUSE,BRICK \?ELS3
?PRG4: ZERO? BRICK-ROOM /FALSE
IN? BRICK-ROOM,ROOMS \?ELS10
JUMP ?REP5
?ELS10: LOC BRICK-ROOM >BRICK-ROOM
JUMP ?PRG4
?REP5: MOVE EXPLOSION,BRICK-ROOM
FCLEAR BRICK-ROOM,TOUCHBIT
EQUAL? BRICK-ROOM,HERE \?ELS15
CALL MUNG-ROOM,BRICK-ROOM,STR?213
CALL JIGS-UP,OTHER-PROPERTIES
JUMP ?CND13
?ELS15: EQUAL? BRICK-ROOM,SAFE-ROOM \?ELS17
CALL QUEUE,I-SAFE,5
PUT STACK,0,1
SET 'MUNGED-ROOM,SAFE-ROOM
PRINTI "There is an explosion nearby."
CRLF
IN? BRICK,SLOT \?CND13
FSET SLOT,INVISIBLE
FSET SAFE,OPENBIT
FCLEAR SAFE-ROOM,TOUCHBIT
SET 'SAFE-FLAG,TRUE-VALUE
JUMP ?CND13
?ELS17: PRINTI "There is an explosion nearby."
CRLF
CALL QUEUE,I-SAFE,5
PUT STACK,0,1
SET 'MUNGED-ROOM,BRICK-ROOM
FIRST? BRICK-ROOM >F \?CND13
?PRG30: FSET? F,TAKEBIT \?CND32
FSET F,INVISIBLE
?CND32: NEXT? F >F /?PRG30
?CND13: REMOVE BRICK
JUMP ?CND1
?ELS3: LOC FUSE
EQUAL? STACK,WINNER,HERE \?CND1
PRINTI "The string rapidly burns into nothingness."
CRLF
?CND1: REMOVE FUSE
RTRUE
.FUNCT I-SAFE
EQUAL? HERE,MUNGED-ROOM \?ELS3
CALL JIGS-UP,STR?214
JUMP ?CND1
?ELS3: ZERO? DEAD \?CND1
PRINTI "You may recall that recent explosion. Probably as a result of it, you hear an ominous rumbling, as if a nearby room had collapsed."
CRLF
EQUAL? MUNGED-ROOM,SAFE-ROOM \?CND1
CALL QUEUE,I-LEDGE,8
PUT STACK,0,1
?CND1: CALL MUNG-ROOM,MUNGED-ROOM,STR?213
RSTACK
.FUNCT I-LEDGE,RM=LEDGE-2
EQUAL? HERE,LEDGE-2 \?ELS3
IN? WINNER,BALLOON \?ELS6
ZERO? BTIE-FLAG /?ELS9
SET 'BLOC,VOLCANO-BOTTOM
REMOVE BALLOON
MOVE DEAD-BALLOON,VOLCANO-BOTTOM
SET 'BTIE-FLAG,FALSE-VALUE
SET 'BINF-FLAG,FALSE-VALUE
CALL INT,I-BALLOON
PUT STACK,0,0
CALL INT,I-BURNUP
PUT STACK,0,0
CALL JIGS-UP,STR?215
JUMP ?CND1
?ELS9: PRINTI "The ledge collapses, leaving you with no place to land."
CRLF
JUMP ?CND1
?ELS6: CALL JIGS-UP,STR?216
JUMP ?CND1
?ELS3: ZERO? DEAD \?CND1
PRINTI "The ledge collapses. (That was a narrow escape!)"
CRLF
?CND1: CALL MUNG-ROOM,RM,STR?217
RSTACK
.FUNCT LEDGE-FCN,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "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."
FSET? SAFE-ROOM,RMUNGBIT \?ELS12
PRINTR " The way to the south is blocked by rubble."
?ELS12: PRINTR " There is a small door to the south."
.FUNCT I-GNOME
EQUAL? HERE,LEDGE-1,LEDGE-2 \?ELS5
PRINTI "A volcano gnome seems to walk straight out of the wall and "
IN? WAND,WINNER \?ELS12
PRINTR "noticing the wand, straight back in."
?ELS12: PRINTI "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."
CRLF
MOVE GNOME,HERE
RTRUE
?ELS5: CALL QUEUE,I-GNOME,1
PUT STACK,0,1
RFALSE
.FUNCT GNOME-FCN
EQUAL? PRSA,V?TELL \?ELS5
SET 'P-CONT,FALSE-VALUE
SET 'QUOTE-FLAG,FALSE-VALUE
ZERO? GNOME-FLAG \?CND6
CALL QUEUE,I-NERVOUS,5
PUT STACK,0,1
?CND6: SET 'GNOME-FLAG,TRUE-VALUE
PRINTR "The gnome appears increasingly nervous."
?ELS5: EQUAL? PRSA,V?THROW,V?GIVE \?ELS12
EQUAL? PRSI,GNOME \?ELS12
GETPT PRSO,P?VALUE
ZERO? STACK /?ELS19
PRINTI """Thank you very much for the "
PRINTD PRSO
PRINTI ". 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."
CRLF
REMOVE PRSO
REMOVE GNOME
SET 'GNOME-DOOR-FLAG,TRUE-VALUE
RETURN GNOME-DOOR-FLAG
?ELS19: CALL BOMB?,PRSO
ZERO? STACK /?ELS23
MOVE BRICK,HERE
REMOVE GNOME
CALL INT,I-GNOME
PUT STACK,0,0
CALL INT,I-NERVOUS
PUT STACK,0,0
PRINTR """That certainly wasn't what I had in mind,"" he says, and disappears."
?ELS23: CALL REMOVE-CAREFULLY,PRSO
PRINTI """That wasn't quite what I had in mind,"" he says, crunching the "
PRINTD PRSO
PRINTR " in his rock-hard hands."
?ELS12: PRINTI "The gnome appears increasingly nervous."
CRLF
ZERO? GNOME-FLAG \?CND34
CALL QUEUE,I-NERVOUS,5
PUT STACK,0,1
?CND34: SET 'GNOME-FLAG,TRUE-VALUE
RETURN GNOME-FLAG
.FUNCT I-NERVOUS
IN? GNOME,HERE \?CND1
PRINTI "The gnome glances at his watch. ""Oops. I'm late for an appointment!"" He disappears, leaving you alone on the ledge."
CRLF
?CND1: REMOVE GNOME
RTRUE
.FUNCT PURPLE-BOOK-FCN
EQUAL? PRSA,V?READ \?ELS5
IN? STAMP,PURPLE-BOOK \?ELS5
FSET? PURPLE-BOOK,OPENBIT /?ELS5
GETP PURPLE-BOOK,P?TEXT
PRINT STACK
CRLF
CALL PERFORM,V?OPEN,PURPLE-BOOK
RTRUE
?ELS5: CALL RANDOM-BOOK
RSTACK
.FUNCT RANDOM-BOOK
EQUAL? PRSA,V?PUT,V?MOVE,V?TAKE \FALSE
FSET WHITE-BOOK,TOUCHBIT
FSET PURPLE-BOOK,TOUCHBIT
FSET GREEN-BOOK,TOUCHBIT
FSET BLUE-BOOK,TOUCHBIT
RFALSE
.FUNCT HEAD-FCN
EQUAL? PRSA,V?HELLO \?ELS5
PRINTR "The Flatheads are dead; therefore they do not respond."
?ELS5: EQUAL? PRSA,V?RUB,V?ATTACK,V?KICK /?THN10
EQUAL? PRSA,V?BURN,V?TAKE,V?OPEN \FALSE
?THN10: CALL JIGS-UP,STR?218
RSTACK
.FUNCT CRYPT-ANTEROOM-FCN,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "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. "
PRINTI "The door is "
FSET? CRYPT-DOOR,OPENBIT \?ELS12
PRINTI "open."
JUMP ?CND10
?ELS12: PRINTI "closed."
?CND10: PRINTR " Above the door is the cryptic inscription: ""Feel Free""."
.FUNCT CRYPT-ROOM-FCN,RARG,CLIT?
EQUAL? RARG,M-LOOK \?ELS5
FCLEAR HERE,ONBIT
CALL LIT?,HERE
ZERO? STACK /?ELS8
PRINTI "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 "
FSET? CRYPT-DOOR,OPENBIT \?ELS13
PRINTI "open."
JUMP ?CND11
?ELS13: PRINTI "closed."
?CND11: CRLF
FSET? DIM-DOOR,INVISIBLE /?CND6
PRINTI "Looking closely at the south wall, you can see the dim outline of a secret door labelled with the letter ""F""."
CRLF
JUMP ?CND6
?ELS8: CALL DIM-DOOR-APPEARS
?CND6: FSET HERE,ONBIT
RTRUE
?ELS5: EQUAL? RARG,M-END \FALSE
SET 'CLIT?,CRYPT-LIT?
FCLEAR CRYPT-ROOM,ONBIT
CALL LIT?,CRYPT-ROOM >CRYPT-LIT?
ZERO? CLIT? /?CND29
ZERO? CRYPT-LIT? \?CND29
CALL DIM-DOOR-APPEARS
?CND29: FSET CRYPT-ROOM,ONBIT
RTRUE
.FUNCT DIM-DOOR-APPEARS
PRINTI "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""."
CRLF
FCLEAR DIM-DOOR,INVISIBLE
RTRUE
.FUNCT CRYPT-OBJECT
EQUAL? PRSA,V?OPEN \?ELS5
PRINTR "The crypt is sealed for all time."
?ELS5: EQUAL? PRSA,V?RUB \FALSE
PRINTR "The marble is cool."
.FUNCT CRYPT-DOOR-FCN
EQUAL? PRSA,V?CLOSE,V?OPEN \FALSE
CALL OPEN-CLOSE,PRSO,STR?219,STR?220
RSTACK
.FUNCT TOMB-PSEUDO
EQUAL? PRSA,V?THROUGH \FALSE
CALL DO-WALK,P?EAST
RTRUE
.FUNCT DIM-DOOR-FCN
EQUAL? PRSA,V?KNOCK \?ELS5
PRINTR "A hollow echo responds."
?ELS5: EQUAL? PRSA,V?CLOSE,V?OPEN \FALSE
EQUAL? PRSA,V?OPEN \?ELS12
SET 'DIM-DOOR-FLAG,TRUE-VALUE
JUMP ?CND10
?ELS12: SET 'DIM-DOOR-FLAG,FALSE-VALUE
?CND10: CALL OPEN-CLOSE,PRSO,STR?221,STR?222
RSTACK
.FUNCT REPELLENT-FCN
EQUAL? PRSA,V?SHAKE \?ELS5
ZERO? SPRAY-USED? /?ELS10
PRINTR "The can seems empty."
?ELS10: PRINTR "There is a sloshing sound from inside."
?ELS5: EQUAL? PRSA,V?PUT,V?SPRAY \FALSE
EQUAL? PRSO,REPELLENT \FALSE
ZERO? SPRAY-USED? /?ELS26
PRINTR "The repellent is all gone."
?ELS26: ZERO? PRSI \?ELS31
SET 'SPRAY-USED?,TRUE-VALUE
PRINTR "The spray stinks amazingly for a few moments, then drifts away."
?ELS31: EQUAL? PRSI,ME \?CND36
CALL QUEUE,I-SPRAY,8
PUT STACK,0,1
SET 'SPRAYED?,TRUE-VALUE
?CND36: SET 'SPRAY-USED?,TRUE-VALUE
PRINTR "The spray smells like a mixture of old socks and burning rubber. If I were a grue I'd sure stay clear!"
.FUNCT I-SPRAY
SET 'SPRAYED?,FALSE-VALUE
PRINTR "That horrible smell is much less pungent now."
.FUNCT ZORK3-FCN,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "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. "
IN? WAND,WINNER \?ELS12
PRINTI "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"".)
"
CRLF
SET 'WON-FLAG,TRUE-VALUE
CALL FINISH
RSTACK
?ELS12: CALL JIGS-UP,STR?223
RSTACK
.FUNCT I-BUCKET
IN? WATER,BUCKET \FALSE
SET 'EVAPORATED,TRUE-VALUE
REMOVE WATER
RFALSE
.FUNCT WATER-FCN,AV,W,PI?
EQUAL? PRSA,V?SGIVE /FALSE
EQUAL? PRSA,V?THROUGH \?ELS5
CALL PERFORM,V?SWIM,PRSO
RTRUE
?ELS5: EQUAL? PRSA,V?FILL \?ELS7
SET 'W,PRSI
SET 'PRSA,V?PUT
SET 'PRSI,PRSO
SET 'PRSO,W
SET 'PI?,FALSE-VALUE
JUMP ?CND1
?ELS7: EQUAL? PRSO,GLOBAL-WATER,WATER \?ELS9
SET 'W,PRSO
SET 'PI?,FALSE-VALUE
JUMP ?CND1
?ELS9: ZERO? PRSI /?CND1
SET 'W,PRSI
SET 'PI?,TRUE-VALUE
?CND1: EQUAL? W,GLOBAL-WATER \?CND13
SET 'W,WATER
EQUAL? PRSA,V?PUT,V?TAKE \?CND13
REMOVE W
?CND13: ZERO? PI? /?ELS21
SET 'PRSI,W
JUMP ?CND19
?ELS21: SET 'PRSO,W
?CND19: LOC WINNER >AV
FSET? AV,VEHBIT /?CND25
SET 'AV,FALSE-VALUE
?CND25: EQUAL? PRSA,V?PUT,V?TAKE \?ELS32
ZERO? PI? \?ELS32
ZERO? AV /?ELS39
EQUAL? AV,PRSI \?ELS39
CALL PUDDLE,AV
RSTACK
?ELS39: ZERO? AV /?ELS43
ZERO? PRSI \?ELS43
IN? W,AV /?ELS43
CALL PUDDLE,AV
RSTACK
?ELS43: ZERO? PRSI /?ELS47
EQUAL? PRSI,TEAPOT /?ELS47
PRINTI "The water leaks out of the "
PRINTD PRSI
PRINTI " and evaporates immediately."
CRLF
REMOVE W
RTRUE
?ELS47: IN? TEAPOT,WINNER \?ELS53
FIRST? TEAPOT /?ELS58
EQUAL? HERE,POOL-ROOM \?ELS61
MOVE SALTY-WATER,TEAPOT
JUMP ?CND59
?ELS61: MOVE WATER,TEAPOT
?CND59: PRINTR "The teapot is now full of water."
?ELS58: PRINTR "The teapot isn't currently empty."
?ELS53: IN? PRSO,TEAPOT \?ELS71
EQUAL? PRSA,V?TAKE \?ELS71
ZERO? PRSI \?ELS71
SET 'PRSO,TEAPOT
CALL ITAKE
SET 'PRSO,W
RETURN PRSO
?ELS71: PRINTR "The water slips through your fingers."
?ELS32: ZERO? PI? /?ELS79
PRINTR "Nice try."
?ELS79: EQUAL? PRSA,V?GIVE,V?DROP \?ELS84
EQUAL? PRSO,WATER \?CND85
CALL HELD?,WATER
ZERO? STACK \?CND85
PRINTR "You don't have any water."
?CND85: REMOVE WATER
ZERO? AV /?ELS96
CALL PUDDLE,AV
RSTACK
?ELS96: PRINTI "The water spills to the floor and evaporates."
CRLF
REMOVE WATER
RTRUE
?ELS84: EQUAL? PRSA,V?THROW \FALSE
PRINTI "The water splashes on the walls and evaporates."
CRLF
REMOVE WATER
RTRUE
.FUNCT PUDDLE,AV
PRINTI "There is now a puddle in the bottom of the "
PRINTD AV
PRINTI "."
CRLF
MOVE PRSO,AV
RTRUE
.FUNCT BUCKET-FCN,RARG=M-BEG
EQUAL? RARG,M-BEG \?ELS5
EQUAL? PRSA,V?BURN \?ELS10
EQUAL? PRSO,BUCKET \?ELS10
PRINTR "The bucket is fireproof, and won't burn."
?ELS10: EQUAL? PRSA,V?PUT,V?DROP \?ELS16
EQUAL? PRSO,WATER \?ELS16
EQUAL? PRSI,BUCKET \?ELS16
IN? BUCKET,WELL-BOTTOM \?ELS16
IN? WINNER,BUCKET /?ELS16
PRINTI "The bucket swiftly rises up, and is gone."
CRLF
MOVE BUCKET,WELL-TOP
MOVE WATER,BUCKET
SET 'BUCKET-TOP-FLAG,TRUE-VALUE
CALL QUEUE,I-BUCKET,100
PUT STACK,0,1
RTRUE
?ELS16: EQUAL? PRSA,V?KICK \FALSE
CALL JIGS-UP,STR?224
RSTACK
?ELS5: EQUAL? RARG,M-END \?ELS24
IN? WATER,BUCKET \?ELS29
ZERO? BUCKET-TOP-FLAG \?ELS29
PRINTI "The bucket rises and comes to a stop."
CRLF
CRLF
SET 'BUCKET-TOP-FLAG,TRUE-VALUE
SET 'EVAPORATED,FALSE-VALUE
CALL PASS-THE-BUCKET,WELL-TOP
CALL QUEUE,I-BUCKET,100
PUT STACK,0,1
RTRUE
?ELS29: ZERO? BUCKET-TOP-FLAG /FALSE
IN? WATER,BUCKET /FALSE
ZERO? EVAPORATED /?ELS40
PRINTI "The last of the water evaporates, and the bucket descends."
CRLF
CRLF
JUMP ?CND38
?ELS40: PRINTI "The bucket descends and comes to a stop."
CRLF
CRLF
?CND38: SET 'BUCKET-TOP-FLAG,FALSE-VALUE
CALL PASS-THE-BUCKET,WELL-BOTTOM
RSTACK
?ELS24: EQUAL? PRSA,V?CLIMB-ON \FALSE
CALL PERFORM,V?BOARD,PRSO
RTRUE
.FUNCT PASS-THE-BUCKET,R
MOVE BUCKET,R
IN? WINNER,BUCKET \FALSE
CALL GOTO,R
RSTACK
.FUNCT POSTS-ROOM-FCN,RARG
EQUAL? RARG,M-BEG \FALSE
EQUAL? PRSA,V?TAKE \FALSE
FSET? PRSO,NONLANDBIT \FALSE
PRINTI "The "
PRINTD PRSO
PRINTR " is now much larger than you are. You have no hope of taking it."
.FUNCT EATME-FCN,F,N
EQUAL? PRSA,V?EAT \?ELS5
EQUAL? PRSO,EAT-ME-CAKE \?ELS5
EQUAL? HERE,TEA-ROOM \?ELS5
PRINTI "Suddenly, the room appears to have become very large (although everything you are carrying seems to be its normal size)."
CRLF
CRLF
REMOVE EAT-ME-CAKE
FSET ROBOT,INVISIBLE
FSET ALICE-TABLE,INVISIBLE
FIRST? HERE >F /?KLU24
?KLU24:
?PRG10: ZERO? F \?ELS14
JUMP ?REP11
?ELS14: NEXT? F >N /?KLU25
?KLU25: EQUAL? F,ADVENTURER /?CND12
FSET? F,TAKEBIT \?CND12
FSET F,NONLANDBIT
FSET F,TRYTAKEBIT
MOVE F,POSTS-ROOM
?CND12: SET 'F,N
JUMP ?PRG10
?REP11: CALL GOTO,POSTS-ROOM
RSTACK
?ELS5: CALL CAKE-CRUMBLE
RSTACK
.FUNCT CAKE-CRUMBLE,CAKE
FSET? PRSO,FOODBIT \?ELS3
SET 'CAKE,PRSO
JUMP ?CND1
?ELS3: SET 'CAKE,PRSI
?CND1: EQUAL? HERE,TEA-ROOM,POSTS-ROOM,POOL-ROOM /FALSE
EQUAL? HERE,MACHINE-ROOM,MAGNET-ROOM,CAGE-ROOM /FALSE
EQUAL? HERE,WELL-TOP,IN-CAGE /FALSE
REMOVE CAKE
PRINTI "The "
PRINTD CAKE
PRINTR " has crumbled to dust."
.FUNCT CAKE-FCN,F,N
EQUAL? PRSA,V?READ \?ELS5
FSET? PRSO,NONLANDBIT \?ELS10
PRINTR "The cake is much too tall now for you to read the lettering."
?ELS10: ZERO? PRSI /?ELS14
EQUAL? PRSI,PALANTIR-1,PALANTIR-2,PALANTIR-3 \?ELS20
CALL PERFORM,V?LOOK-INSIDE,PRSI
RSTACK
?ELS20: EQUAL? PRSI,FLASK \?ELS22
PRINTI "The letters, now visible, say """
EQUAL? PRSO,RED-ICING \?ELS27
PRINTI "Evaporate"
JUMP ?CND25
?ELS27: EQUAL? PRSO,ORANGE-ICING \?ELS31
PRINTI "Explode"
JUMP ?CND25
?ELS31: PRINTI "Enlarge"
?CND25: PRINTR """."
?ELS22: PRINTR "You can't see through that!"
?ELS14: PRINTR "The first letter is a capital E. The rest is too small to read."