-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrooms.zap
925 lines (494 loc) · 12.4 KB
/
rooms.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
.FUNCT NOTE-F
EQUAL? PRSA,V?LOOK-INSIDE,V?EXAMINE,V?READ \FALSE
FSET? NOTE,READBIT /?CND6
FSET NOTE,READBIT
CALL PICK-ONE,CUPID-COMBS >CUPID-KEY
?CND6: PRINTI "Dearie, The magic number is """
GET CUPID-KEY,0
PRINTN STACK
PRINTR "."" Love, Aunt Hildegard"
.FUNCT FLASHLIGHT-F
EQUAL? PRSA,V?EXAMINE \?ELS5
FSET? FLASHLIGHT,WETBIT \?ELS10
PRINTR "The soggy flashlight is switched on, but isn't working."
?ELS10: PRINTI "The "
CALL DPRINT,FLASHLIGHT
PRINTI " is turned "
FSET? FLASHLIGHT,ONBIT \?ELS21
PRINTI "on"
RTRUE
?ELS21: PRINTI "off"
PRINTC 46
CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS31
FSET? FLASHLIGHT,WETBIT \?ELS34
PRINTR "You can't turn it on now, it's ruined. You took it in the water!"
?ELS34: FSET? FLASHLIGHT,ONBIT \?ELS38
PRINTR "It's already on."
?ELS38: FSET FLASHLIGHT,ONBIT
PRINTI "Okay,"
CALL TPRINT,FLASHLIGHT
PRINTI " is now on."
CRLF
ZERO? LIT \TRUE
SET 'LIT,TRUE-VALUE
CRLF
CALL V-LOOK
RTRUE
?ELS31: EQUAL? PRSA,V?LAMP-OFF \FALSE
FSET? FLASHLIGHT,WETBIT \?ELS52
PRINTI "It's wet. It's ruined. Who cares if it's on or off?"
RTRUE
?ELS52: FSET? FLASHLIGHT,ONBIT \?ELS56
FCLEAR FLASHLIGHT,ONBIT
PRINTI "Okay,"
CALL TPRINT,FLASHLIGHT
PRINTR " is now off."
?ELS56: PRINTR "It's already off."
.FUNCT STAIRS-F
EQUAL? PRSA,V?PUSH-DOWN \?ELS5
CALL MOVE-OBJ-DOWN
RSTACK
?ELS5: EQUAL? PRSA,V?SKI \FALSE
CALL DO-WALK,P?DOWN
RSTACK
.FUNCT FOYER-STAIRS-F
EQUAL? PRSA,V?PUSH-DOWN \?ELS5
CALL MOVE-OBJ-DOWN
RSTACK
?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
PRINTI "The stairs"
ZERO? RAMP /?ELS12
PRINTI ", or what used to be the stairs is now a ramp"
JUMP ?CND10
?ELS12: PRINTI " look like stairs and need a better desc"
?CND10: PRINTC 46
CRLF
RTRUE
.FUNCT TO-UPSTAIRS-HALL
FSET? KNUEL,TOUCHBIT /?ELS5
PRINTI "You start to go up but suddenly the staircase flattens out and you slide back down the flatten stairs."
CRLF
SET 'RAMP,TRUE-VALUE
FSET KNUEL,TOUCHBIT
RFALSE
?ELS5: ZERO? RAMP /?ELS9
PRINTI "You start to go up the flatten stairs but slide back down."
CRLF
RFALSE
?ELS9: RETURN UPSTAIRS-HALL
.FUNCT KNUEL-F
EQUAL? PRSA,V?TURN \FALSE
PRINTI "You turn"
CALL TPRINT,KNUEL
PRINTI " and the "
FSET KNUEL,TOUCHBIT
ZERO? RAMP /?ELS10
PRINTI "ramp becomes stairs"
SET 'RAMP,FALSE-VALUE
JUMP ?CND8
?ELS10: PRINTI "stairs become a ramp"
SET 'RAMP,TRUE-VALUE
?CND8: PRINTC 46
CRLF
RTRUE
.FUNCT FOYER-CLOSET-ENTER-F
FSET? FOYER-CD,OPENBIT /?ELS5
CALL ITS-CLOSED,FOYER-CD
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,FOYER \?ELS7
RETURN CLOSET
?ELS7: EQUAL? CLOSET-FLOOR,CELLAR \?ELS9
RETURN CLOSET-TOP-2
?ELS9: CALL JIGS-UP,STR?81
RFALSE
.FUNCT ARMOR-F,OARG=0
ZERO? OARG /?ELS5
PRINTI "Standing demurely in the corner is a suit or armor, somewhat reminiscent of the suits of armor that once graced the castle of Winston Churchill. It is currrently in the position that Masters and Johnson described as "
GET ARMOR-DESCS,ARMOR-DESC-NUM
PRINT STACK
PRINTC 46
RTRUE
?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
CALL ARMOR-F,M-OBJDESC
RSTACK
.FUNCT I-ARMOR-MOVE
EQUAL? HERE,FOYER \?ELS3
CALL QUEUE,I-ARMOR-MOVE,2
RFALSE
?ELS3: INC 'ARMOR-DESC-NUM
EQUAL? ARMOR-DESC-NUM,7 \FALSE
SET 'ARMOR-DESC-NUM,0
RFALSE
.FUNCT CELLAR-RAMP-F
EQUAL? PRSA,V?PUSH-DOWN \FALSE
CALL MOVE-OBJ-DOWN
RSTACK
.FUNCT CELLAR-CLOSET-ENTER-F
FSET? CELLAR-CD,OPENBIT /?ELS5
CALL ITS-CLOSED,CELLAR-CD
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,CELLAR \?ELS7
RETURN CLOSET
?ELS7: RETURN SHAFT-BOTTOM
.FUNCT TO-FOYER-F
ZERO? RAMP /?ELS5
PRINTI "You slide down the flattened stairs."
CRLF
RETURN FOYER
?ELS5: RETURN FOYER
.FUNCT UPSTAIRS-CLOSET-ENTER-F
FSET? UPSTAIRS-CD,OPENBIT /?ELS5
CALL ITS-CLOSED,UPSTAIRS-CD
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,UPSTAIRS-HALL \?ELS7
RETURN CLOSET
?ELS7: EQUAL? CLOSET-FLOOR,FOYER \?ELS9
RETURN CLOSET-TOP-3
?ELS9: CALL JIGS-UP,STR?91
RSTACK
.FUNCT CLOSET-EXIT-F,DOOR
CALL WHICH-DOOR? >DOOR
FSET? DOOR,OPENBIT /?ELS5
CALL ITS-CLOSED,CLOSET-DOOR
RFALSE
?ELS5: EQUAL? CLOSET-FLOOR,CELLAR \?ELS7
RETURN CELLAR
?ELS7: EQUAL? CLOSET-FLOOR,FOYER \?ELS9
RETURN FOYER
?ELS9: RETURN UPSTAIRS-HALL
.FUNCT WHICH-DOOR?
EQUAL? CLOSET-FLOOR,CELLAR \?ELS5
RETURN CELLAR-CD
?ELS5: EQUAL? CLOSET-FLOOR,FOYER \?ELS7
RETURN FOYER-CD
?ELS7: RETURN UPSTAIRS-CD
.FUNCT CLOSET-REF-F
EQUAL? PRSA,V?SEARCH,V?LOOK-INSIDE,V?EXAMINE \FALSE
EQUAL? HERE,FOYER \?ELS8
CALL LOOK-IN-CLOSET,FOYER-CD
RTRUE
?ELS8: EQUAL? HERE,UPSTAIRS-HALL \?ELS10
CALL LOOK-IN-CLOSET,UPSTAIRS-CD
RTRUE
?ELS10: CALL LOOK-IN-CLOSET,CELLAR-CD
RTRUE
.FUNCT LOOK-IN-CLOSET,DOOR
FSET? DOOR,OPENBIT /?ELS5
CALL ITS-CLOSED,DOOR
RSTACK
?ELS5: EQUAL? CLOSET-FLOOR,HERE \?ELS7
PRINTI "You see "
CALL DESCRIBE-CONTENTS,CLOSET,-1
PRINTC 46
CRLF
RTRUE
?ELS7: PRINTR "You see a dark shaft."
.FUNCT PEGS-F
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "You see three rather worn coat pegs."
.FUNCT PEG-3-F
EQUAL? PRSA,V?PUSH,V?PULL,V?MOVE /?THN6
EQUAL? PRSA,V?RUB,V?LOWER,V?RAISE \FALSE
?THN6: EQUAL? CLOSET-FLOOR,UPSTAIRS-HALL \?ELS10
CALL HUM
JUMP ?CND8
?ELS10: PRINTI "The closet moves up "
EQUAL? CLOSET-FLOOR,FOYER \?ELS17
PRINTI "a floor"
JUMP ?CND15
?ELS17: PRINTI "two floors"
?CND15: PRINTI " to the upstairs hall."
CRLF
SET 'CLOSET-FLOOR,UPSTAIRS-HALL
?CND8: FSET? UPSTAIRS-CD,OPENBIT \?ELS28
FSET CLOSET-DOOR,OPENBIT
RTRUE
?ELS28: FCLEAR CLOSET-DOOR,OPENBIT
RTRUE
.FUNCT PEG-2-F
EQUAL? PRSA,V?PUSH,V?PULL,V?MOVE /?THN6
EQUAL? PRSA,V?RUB,V?LOWER,V?RAISE \FALSE
?THN6: EQUAL? CLOSET-FLOOR,FOYER \?ELS10
CALL HUM
JUMP ?CND8
?ELS10: PRINTI "The closet moves "
EQUAL? CLOSET-FLOOR,UPSTAIRS-HALL \?ELS17
PRINTI "down a floor"
JUMP ?CND15
?ELS17: PRINTI "up a floor"
?CND15: PRINTI " to the front hall."
CRLF
SET 'CLOSET-FLOOR,FOYER
?CND8: FSET? FOYER-CD,OPENBIT \?ELS28
FSET CLOSET-DOOR,OPENBIT
RTRUE
?ELS28: FCLEAR CLOSET-DOOR,OPENBIT
RTRUE
.FUNCT PEG-1-F
EQUAL? PRSA,V?PUSH,V?PULL,V?MOVE /?THN6
EQUAL? PRSA,V?RUB,V?LOWER,V?RAISE \FALSE
?THN6: EQUAL? CLOSET-FLOOR,CELLAR \?ELS10
CALL HUM
JUMP ?CND8
?ELS10: PRINTI "The closet moves down "
EQUAL? CLOSET-FLOOR,FOYER \?ELS17
PRINTI "a floor"
JUMP ?CND15
?ELS17: PRINTI "two floors"
?CND15: PRINTI " to the cellar."
CRLF
SET 'CLOSET-FLOOR,CELLAR
?CND8: FSET? CELLAR-CD,OPENBIT \?ELS28
FSET CLOSET-DOOR,OPENBIT
RTRUE
?ELS28: FCLEAR CLOSET-DOOR,OPENBIT
RTRUE
.FUNCT HUM
PRINTR "You hear a humming noise."
.FUNCT VERTICAL-MAP-F
EQUAL? PRSA,V?EXAMINE,V?READ \?ELS5
PRINTR "You see the following:~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~"
?ELS5: EQUAL? PRSA,V?PUT-ON \FALSE
CALL WHOLE-MAP
RSTACK
.FUNCT HORIZONTAL-MAP-F
EQUAL? PRSA,V?EXAMINE,V?READ \?ELS5
PRINTR "You see the following:~ _______________________________________~ _____ __ ___ __~ ____ __ ___ _~ ____ ___ ___ _______ ___~ ____ ___ __ ___~ ____ _ _ ___~ ________ __ ___~ ___ __~ __ __ _ __ ___ ___~ _ _______ x _______ ______~ _____________ _ _ ______ ___~ ____ _____ __ __ ___ __~ ___~ __ _____ ___~ ___ __ _____~ _ _ ___ ____~ ___ _____ ________ ____~ _____ ___ ____~ _ __ _ ____~ ___ ____ _________ __ ___ ___ _______~"
?ELS5: EQUAL? PRSA,V?PUT-ON \FALSE
CALL WHOLE-MAP
RSTACK
.FUNCT WHOLE-MAP
PRINTI "You see the following:~ _______________________________________~
_____
__ ___
__
~
____
__
___
_
~
____
___
___
_______
___
~
____
___ __
___
~
____
_ _
___
~
________
__ ___
~
___
__
~
__ __
_
__
___
___
~
_
_______
x
_______
______
~
_____________
_
_
______ ___
~
____
_____
__
__ ___ __
~
___
~
__
_____
___
~
___
__ _____
~
_
_
___
____
~
___
_____
________
____
~
_____ ___
____
~
_
__
_
____
~
___
____
_________ __
___
___
_______
~"
RTRUE
.FUNCT BOWL-F
EQUAL? PRSA,V?EXAMINE \FALSE
CALL HELD?,FLASHLIGHT
ZERO? STACK /?ELS10
FSET? FLASHLIGHT,ONBIT \?ELS10
PRINTR "You shine your light on the bowl of the chandelier. Its thick, slick surface, covered with a rose-like pattern, reflects a rose colored light around the room. You can see a square shape in the bottom of the bowl."
?ELS10: PRINTR "The light from the flame reflects off the thick, slick surface of the chandelier's bowl. You can barely make out a rose-like pattern on the bowl."
.FUNCT 8-BALL-F
EQUAL? PRSA,V?TURN \FALSE
PRINTI "Looking into the bottom of the eight ball you the message"
PRINTC 34
CALL PICK-ONE,EIGHTISMS
PRINT STACK
PRINTR "."""
.FUNCT POOL-TABLE-F
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTI "The pool table is made of the finest wood and on the table is"
CALL DESCRIBE-SENT,POOL-TABLE
CRLF
RTRUE
.FUNCT CUE-BALL-F
EQUAL? PRSA,V?SHOOT,V?DROP,V?PUT \FALSE
EQUAL? PRSI,POCKET \FALSE
EQUAL? PRSA,V?SHOOT \?ELS10
CALL HELD?,POOL-CUE
ZERO? STACK \?ELS13
PRINTI "You're not holding"
CALL TRPRINT,POOL-CUE
RTRUE
?ELS13: IN? CUE-BALL,POOL-TABLE /?ELS17
PRINTI "The "
CALL DPRINT,CUE-BALL
PRINTI " isn't on"
CALL TRPRINT,POOL-TABLE
JUMP ?CND8
?ELS17: PRINTI "The ball speeds across the smooth, green surface into"
CALL TPRINT,POCKET
PRINTI ". You"
JUMP ?CND8
?ELS10: PRINTI "You "
PRINTB P-PRSA-WORD
CALL TPRINT,CUE-BALL
PRINTI " in"
CALL TPRINT,POCKET
PRINTI " and"
?CND8: PRINTI " hear it roll towards"
CALL TPRINT,BALL-RETURN
PRINTI ". As"
CALL TPRINT,CUE-BALL
PRINTI " drops into the return, a panel on the east wall swings open."
CRLF
MOVE CUE-BALL,BALL-RETURN
RTRUE
.FUNCT RACKED-BALLS-F
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTI "You see a set of pool balls "
CALL HELD?,RACKED-BALLS
ZERO? STACK /?CND8
PRINTI "all glued to one another "
?CND8: PRINTR "in a triangle shape."
.FUNCT I-LIGHTS-DIM
FSET? HERE,OUTDOORSBIT \?ELS3
PRINTI "The sun is rapidly sinking into west. It's getting dark out here."
CRLF
JUMP ?CND1
?ELS3: FSET? HERE,ONBIT \?CND1
PRINTI "The sun is going down. It's getting dark in here."
CRLF
?CND1: CALL QUEUE,I-LIGHTS-OUT,10
RSTACK
.FUNCT I-LIGHTS-OUT
FCLEAR FOYER,ONBIT
FCLEAR CLOSET,ONBIT
FCLEAR CELLAR,ONBIT
PRINTI "The sun has set. "
CALL LIT?,HERE >LIT
ZERO? LIT \?ELS7
CALL TOO-DARK
RSTACK
?ELS7: CRLF
RTRUE
.FUNCT WINDOW-F
EQUAL? PRSA,V?EXAMINE \?ELS5
ZERO? SACK-IN-WINDOW /?ELS10
FSET? WINDOW,OPENBIT /?ELS10
PRINTR "The window is closed on a cloth which is tied in a knot. "
?ELS10: PRINTI "The "
CALL DPRINT,WINDOW
PRINTI " is "
FSET? WINDOW,OPENBIT \?ELS21
PRINTI "open."
JUMP ?CND19
?ELS21: PRINTI "closed"
?CND19: PRINTC 46
CRLF
RTRUE
?ELS5: EQUAL? PRSA,V?OPEN \?ELS31
FSET? WINDOW,OPENBIT \?ELS36
CALL ALREADY-OPEN
RSTACK
?ELS36: ZERO? SACK-IN-WINDOW /?ELS38
PRINTI "As you lift up the window, the sack slides off the window ceil and falls to the ground with a decided thud."
CRLF
FSET WINDOW,OPENBIT
SET 'SACK-IN-WINDOW,FALSE-VALUE
RETURN SACK-IN-WINDOW
?ELS38: FSET? WINDOW,RMUNGBIT \?ELS43
PRINTI "With one hand you lift the window and with the other you pull the sack inside. "
CRLF
MOVE SACK,PLAYER
FSET? WINDOW,OPENBIT
SET 'SACK-IN-WINDOW,FALSE-VALUE
RETURN SACK-IN-WINDOW
?ELS43: PRINTI "You open the window."
CRLF
FSET WINDOW,OPENBIT
SET 'SACK-IN-WINDOW,FALSE-VALUE
RETURN SACK-IN-WINDOW
?ELS31: EQUAL? PRSA,V?CLOSE \FALSE
FSET? WINDOW,OPENBIT /?ELS56
CALL ALREADY-CLOSED
RSTACK
?ELS56: PRINTI "You close"
CALL TRPRINT,WINDOW
RSTACK
.ENDI