-
Notifications
You must be signed in to change notification settings - Fork 13
/
verbs.zap
2790 lines (2353 loc) · 51.2 KB
/
verbs.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 DESCRIBE-ROOM,VERB-IS-LOOK=0,FIRST-VISIT=0
ZERO? LIT \?CND1
EQUAL? HERE,ON-POOL-2 /?CND1
CALL NOW-BLACK
CRLF
RFALSE
?CND1: FSET? HERE,TOUCHBIT /?CND6
FSET HERE,TOUCHBIT
SET 'FIRST-VISIT,TRUE-VALUE
?CND6: CALL DPRINT,HERE
LOC PLAYER
FSET? STACK,VEHBIT \?CND9
PRINTI ", on"
LOC PLAYER
CALL TPRINT,STACK
?CND9: CRLF
ZERO? VERB-IS-LOOK \?THN15
EQUAL? VERBOSITY,2 /?THN15
ZERO? FIRST-VISIT /TRUE
EQUAL? VERBOSITY,1 \TRUE
?THN15: GETP HERE,P?ACTION
CALL STACK,M-LOOK
ZERO? STACK \?CND19
GETP HERE,P?LDESC
PRINT STACK
?CND19: CRLF
RTRUE
.FUNCT DESCRIBE-OBJECTS,O,STR,1ST?=1,AV
LOC WINNER >AV
FIRST? HERE >O /?KLU48
?KLU48: ZERO? O /FALSE
?PRG4: ZERO? O /?REP5
CALL DESCRIBABLE?,O
ZERO? STACK /?CND6
FSET? O,TOUCHBIT /?CND6
GETP O,P?FDESC >STR
ZERO? STR /?CND6
CRLF
PRINT STR
FSET? O,CONTBIT \?CND13
ADD D-ALL?,D-PARA?
CALL DESCRIBE-CONTENTS,O,TRUE-VALUE,STACK
?CND13: CRLF
?CND6: NEXT? O >O /?PRG4
JUMP ?PRG4
?REP5: FIRST? HERE >O /?KLU50
?KLU50: SET '1ST?,TRUE-VALUE
?PRG16: ZERO? O /?REP17
CALL DESCRIBABLE?,O
ZERO? STACK /?CND18
GETP O,P?FDESC
ZERO? STACK /?ELS22
FSET? O,TOUCHBIT \?CND18
?ELS22: GETP O,P?DESCFCN >STR
ZERO? STR /?ELS28
CALL STR,M-OBJDESC >STR
ZERO? STR /?ELS28
FSET? O,CONTBIT \?CND31
EQUAL? STR,M-FATAL /?CND31
ADD D-ALL?,D-PARA?
CALL DESCRIBE-CONTENTS,O,TRUE-VALUE,STACK
?CND31: CRLF
JUMP ?CND18
?ELS28: GETP O,P?LDESC >STR
ZERO? STR /?CND18
PRINT STR
FSET? O,CONTBIT \?CND38
ADD D-ALL?,D-PARA?
CALL DESCRIBE-CONTENTS,O,TRUE-VALUE,STACK
?CND38: CRLF
?CND18: NEXT? O >O /?PRG16
JUMP ?PRG16
?REP17: CALL DESCRIBE-CONTENTS,HERE,FALSE-VALUE,0
ZERO? AV /FALSE
EQUAL? HERE,AV /FALSE
CALL DESCRIBE-CONTENTS,AV,FALSE-VALUE,0
RSTACK
.FUNCT DESCRIBE-CONTENTS,OBJ,LEVEL=-1,ALL?=D-ALL?,F=0,N,1ST?=1,IT?=0,START?=0,TWO?=0,PARA?=0
EQUAL? LEVEL,2 \?ELS3
SET 'LEVEL,TRUE-VALUE
SET 'PARA?,TRUE-VALUE
SET 'START?,TRUE-VALUE
JUMP ?CND1
?ELS3: BTST ALL?,D-PARA? \?CND1
SET 'PARA?,TRUE-VALUE
?CND1: FIRST? OBJ >N /?KLU145
?KLU145: ZERO? START? \?THN11
IN? OBJ,ROOMS /?THN11
FSET? OBJ,ACTORBIT /?THN11
FSET? OBJ,CONTBIT \FALSE
FSET? OBJ,OPENBIT /?THN15
FSET? OBJ,TRANSBIT \FALSE
?THN15: FSET? OBJ,SEARCHBIT \FALSE
ZERO? N /FALSE
?THN11:
?PRG17: ZERO? N /?THN26
CALL DESCRIBABLE?,N
ZERO? STACK /?CND19
BTST ALL?,D-ALL? /?THN26
CALL SIMPLE-DESC?,N
ZERO? STACK /?CND19
?THN26: ZERO? F /?CND28
ZERO? 1ST? /?ELS34
SET '1ST?,FALSE-VALUE
EQUAL? LEVEL,FALSE-VALUE,TRUE-VALUE \?ELS38
ZERO? START? \?CND32
ZERO? PARA? \?ELS44
EQUAL? OBJ,PLAYER /?CND45
CRLF
?CND45: SET 'PARA?,TRUE-VALUE
JUMP ?CND42
?ELS44: EQUAL? LEVEL,TRUE-VALUE \?CND42
PRINTC 32
?CND42: EQUAL? OBJ,HERE \?ELS52
PRINT YOU-SEE
JUMP ?CND32
?ELS52: EQUAL? OBJ,PLAYER \?ELS54
PRINTI "You have"
JUMP ?CND32
?ELS54: FSET? OBJ,SURFACEBIT \?ELS56
PRINTI "Sitting on"
CALL TPRINT,OBJ
PRINTI " is"
JUMP ?CND32
?ELS56: PRINTI "It looks as if"
CALL TPRINT,OBJ
FSET? OBJ,ACTORBIT \?ELS61
PRINTI " has"
JUMP ?CND32
?ELS61: PRINTI " contains"
JUMP ?CND32
?ELS38: EQUAL? LEVEL,-1 /?CND32
PRINT LEVEL
JUMP ?CND32
?ELS34: ZERO? N /?ELS70
PRINTC 44
JUMP ?CND32
?ELS70: PRINTI " and"
?CND32: CALL APRINT,F
FSET? F,WORNBIT \?ELS76
PRINTI " (being worn)"
JUMP ?CND74
?ELS76: FSET? F,ONBIT \?CND74
PRINTI " (providing light)"
?CND74: ZERO? IT? \?ELS84
ZERO? TWO? \?ELS84
SET 'IT?,F
JUMP ?CND28
?ELS84: SET 'TWO?,TRUE-VALUE
SET 'IT?,FALSE-VALUE
?CND28: SET 'F,N
?CND19: ZERO? N /?CND89
NEXT? N >N /?CND89
?CND89: ZERO? F \?PRG17
ZERO? N \?PRG17
ZERO? IT? /?CND98
ZERO? TWO? \?CND98
CALL THIS-IS-IT,IT?
?CND98: ZERO? 1ST? /?CND103
ZERO? START? /?CND103
PRINTI " nothing"
RFALSE
?CND103: ZERO? 1ST? \?REP18
EQUAL? LEVEL,FALSE-VALUE,TRUE-VALUE \?REP18
EQUAL? OBJ,HERE \?CND113
PRINTI " here"
?CND113: PRINTC 46
?REP18: FIRST? OBJ >F /?KLU147
?KLU147:
?PRG116: ZERO? F /?REP117
FSET? F,CONTBIT \?CND118
CALL DESCRIBABLE?,F,TRUE-VALUE
ZERO? STACK /?CND118
BTST ALL?,D-ALL? /?THN125
CALL SIMPLE-DESC?,F
ZERO? STACK /?CND118
?THN125: ZERO? PARA? /?ELS134
PUSH 3
JUMP ?CND130
?ELS134: PUSH D-ALL?
?CND130: CALL DESCRIBE-CONTENTS,F,TRUE-VALUE,STACK
ZERO? STACK /?CND118
SET '1ST?,FALSE-VALUE
SET 'PARA?,TRUE-VALUE
?CND118: NEXT? F >F /?PRG116
JUMP ?PRG116
?REP117: ZERO? 1ST? \?CND138
EQUAL? LEVEL,FALSE-VALUE,TRUE-VALUE \?CND138
LOC WINNER
EQUAL? OBJ,HERE,STACK \?CND138
CRLF
?CND138: ZERO? 1ST? \FALSE
RTRUE
.FUNCT DESCRIBABLE?,OBJ,CONT?=0
FSET? OBJ,INVISIBLE /FALSE
EQUAL? OBJ,WINNER /FALSE
LOC WINNER
EQUAL? OBJ,STACK \?ELS9
LOC WINNER
EQUAL? HERE,STACK \FALSE
?ELS9: ZERO? CONT? \TRUE
FSET? OBJ,NDESCBIT \TRUE
RFALSE
.FUNCT SIMPLE-DESC?,OBJ,STR
GETP OBJ,P?FDESC
ZERO? STACK /?ELS5
FSET? OBJ,TOUCHBIT \FALSE
?ELS5: GETP OBJ,P?DESCFCN >STR
ZERO? STR /?ELS9
CALL STR,M-OBJDESC?
ZERO? STACK \FALSE
?ELS9: GETP OBJ,P?LDESC
ZERO? STACK /TRUE
RFALSE
.FUNCT DESCRIBE-NOTHING
CALL DESCRIBE-CONTENTS,PRSO,2
ZERO? STACK /FALSE
IN? PLAYER,PRSO /TRUE
CRLF
RTRUE
.FUNCT V-ALARM
EQUAL? PRSO,ME,ROOMS \?ELS3
PRINTI "But you're "
JUMP ?CND1
?ELS3: FSET? PRSO,ACTORBIT \?ELS5
CALL BUT-THE,PRSO
PRINTI "is "
JUMP ?CND1
?ELS5: CALL WHAT-A-CONCEPT
RTRUE
?CND1: PRINTR "already wide awake!"
.FUNCT ALREADY-OPEN
CALL ITS-ALREADY,STR?23
RSTACK
.FUNCT ALREADY-CLOSED
CALL ITS-ALREADY,STR?24
RSTACK
.FUNCT V-ASK-ABOUT
FSET? PRSO,ACTORBIT \?ELS5
SET 'WINNER,PRSO
CALL PERFORM,V?TELL,PRSO
SET 'WINNER,PLAYER
RTRUE
?ELS5: CALL V-ASK-FOR
RSTACK
.FUNCT V-ASK-FOR
EQUAL? PRSO,ME,ROOMS \?ELS3
CALL PERFORM,V?TELL,ME
JUMP ?CND1
?ELS3: CALL NOT-LIKELY,PRSO,STR?25
?CND1: CALL PCLEAR
RETURN 2
.FUNCT V-BITE
CALL HACK-HACK,STR?26
RSTACK
.FUNCT V-BLOW-INTO
FSET? PRSO,ACTORBIT \?ELS5
CALL PERFORM,V?USE,PRSO
RTRUE
?ELS5: CALL HACK-HACK,STR?27
RSTACK
.FUNCT PRE-BOARD
LOC PLAYER
EQUAL? PRSO,STACK \?ELS5
PRINTR "Look around you."
?ELS5: CALL ULTIMATELY-IN?,PRSO
ZERO? STACK /FALSE
PRINTR "You're holding it!"
.FUNCT V-BOARD
FSET? PRSO,VEHBIT \?ELS5
MOVE PLAYER,PRSO
PRINTI "You are now on"
CALL TPRINT,PRSO
PRINTR "."
?ELS5: PRINTI "You can't get into"
CALL TPRINT,PRSO
PRINTR "!"
.FUNCT V-BURN
FSET? PRSI,FLAMEBIT \?ELS5
FSET? PRSO,BURNBIT \?ELS10
REMOVE PRSO
PRINTI "The "
CALL DPRINT,PRSO
PRINTR " catches fire and is reduced to ashes."
?ELS10: PRINT PYRO
RTRUE
?ELS5: PRINTI "With"
CALL APRINT,PRSI
PRINTI "? "
CALL PICK-ONE,YUKS
PRINT STACK
CRLF
RTRUE
.FUNCT V-BUY
CALL VISIBLE?,PRSO
ZERO? STACK \?ELS5
CALL CANT-SEE-ANY,PRSO
RTRUE
?ELS5: FSET? PRSO,TAKEBIT /?ELS7
FSET? PRSO,TRYTAKEBIT /?ELS7
PRINT YOU-CANT
PRINTR "buy that!"
?ELS7: CALL ULTIMATELY-IN?,PRSO
ZERO? STACK /?ELS11
PRINTR "You already have one."
?ELS11: ZERO? PRSI /?ELS13
CALL NOT-LIKELY,PRSI,STR?31
RSTACK
?ELS13: PRINTR "You don't have any money."
.FUNCT CANT-CLOSE-THAT
PRINT YOU-CANT
PRINTR "close that!"
.FUNCT CANT-GO
PRINT YOU-CANT
PRINTR "go that way."
.FUNCT CANT-LOCK,UN?=0
PRINT YOU-CANT
ZERO? UN? /?CND1
PRINTI "un"
?CND1: PRINTI "lock"
CALL TPRINT,PRSO
PRINTR "!"
.FUNCT V-CHASTISE
ZERO? LIT \?ELS5
CALL TOO-DARK
RSTACK
?ELS5: EQUAL? PRSO,INTDIR \?ELS7
PRINTR "You'll have to go in that direction to see what's there."
?ELS7: PRINTR "Use prepositions to indicate precisely what you want to do. For example, LOOK AT the object, LOOK INSIDE it, LOOK UNDER it, etc."
.FUNCT V-CLEAN
CALL NOT-A,STR?32
RSTACK
.FUNCT V-CLIMB
CALL PERFORM,V?CLIMB-UP,PRSO
RTRUE
.FUNCT V-CLIMB-DOWN
EQUAL? PRSO,ROOMS \?ELS5
CALL DO-WALK,P?DOWN
RSTACK
?ELS5: CALL WHAT-A-CONCEPT
RSTACK
.FUNCT V-CLIMB-ON
EQUAL? P-PRSA-WORD,W?HOLD \?ELS5
CALL PERFORM,V?TAKE,PRSO
RTRUE
?ELS5: PRINT YOU-CANT
PRINTR "climb onto that."
.FUNCT V-CLIMB-OVER
EQUAL? PRSO,ROOMS \?ELS5
CALL V-WALK-AROUND
RSTACK
?ELS5: PRINT YOU-CANT
PRINTR "climb over that."
.FUNCT V-CLIMB-UP
EQUAL? PRSO,ROOMS \?ELS5
CALL DO-WALK,P?UP
RSTACK
?ELS5: CALL WHAT-A-CONCEPT
RSTACK
.FUNCT V-CLOSE
FSET? PRSO,ACTORBIT \?ELS5
CALL NOT-A,STR?33
RSTACK
?ELS5: FSET? PRSO,SURFACEBIT \?ELS7
CALL CANT-CLOSE-THAT
RSTACK
?ELS7: FSET? PRSO,CONTBIT /?ELS9
FSET? PRSO,DOORBIT /?ELS9
CALL PERFORM,V?OPEN,PRSO
RTRUE
?ELS9: FSET? PRSO,SURFACEBIT /?ELS13
GETP PRSO,P?CAPACITY
ZERO? STACK /?ELS13
FSET? PRSO,OPENBIT \?ELS20
CALL NOW-CLOSED-OR-OPEN,PRSO
CALL SAY-IF-NOT-LIT
RSTACK
?ELS20: CALL ALREADY-CLOSED
RSTACK
?ELS13: FSET? PRSO,DOORBIT \?ELS24
FSET? PRSO,OPENBIT \?ELS29
FCLEAR PRSO,OPENBIT
CALL SAY-THE,PRSO
PRINTC 32
CALL PICK-ONE,DOOR-NOISES
PRINT STACK
PRINTR " as it closes."
?ELS29: CALL ALREADY-CLOSED
RSTACK
?ELS24: CALL CANT-CLOSE-THAT
RSTACK
.FUNCT V-COMPARE
PRINTR "You compare the two items and find nothing interesting."
.FUNCT V-COUNT
CALL WASTE-OF-TIME
RSTACK
.FUNCT V-COVER
CALL PERFORM,V?PUT-ON,PRSI,PRSO
RTRUE
.FUNCT V-CROSS
PRINT YOU-CANT
PRINTR "cross that!"
.FUNCT V-CUT
CALL NOT-LIKELY,PRSI,STR?34
RSTACK
.FUNCT V-$DEBUG
ZERO? DEBUG /?ELS5
SET 'DEBUG,FALSE-VALUE
PRINTR "Debug off."
?ELS5: SET 'DEBUG,TRUE-VALUE
PRINTR "Debug on."
.FUNCT V-DIAGNOSE
PRINTI "You're in good health"
RANDOM 100
LESS? 50,STACK /?CND1
PRINTI "... at the moment"
?CND1: PRINTR "."
.FUNCT V-DIG-WITH
CALL PERFORM,V?DIG,GROUND,PRSO
RTRUE
.FUNCT V-DIG
ZERO? PRSI \?CND1
IN? SHOVEL,PLAYER \?ELS6
SET 'PRSI,SHOVEL
PRINTI "[with the shovel]"
CRLF
JUMP ?CND1
?ELS6: SET 'PRSI,HANDS
PRINTI "[with your hands]"
CRLF
?CND1: EQUAL? PRSO,SAND,GROUND \?ELS13
EQUAL? PRSI,SHOVEL /?ELS18
PRINTR "I suppose you also excavate tunnels with a teaspoon."
?ELS18: EQUAL? PRSO,SAND /?THN21
EQUAL? HERE,BEACH \?ELS20
?THN21: PRINTR "You find nothing, so you fill in the hole."
?ELS20: GETP HERE,P?CAPACITY
EQUAL? STACK,2 \?ELS24
PRINTR "You attempt to dig in the stone path, but it proves too tough for your efforts."
?ELS24: GETP HERE,P?CAPACITY
ZERO? STACK \?ELS26
PRINTR "The ground is too hard here."
?ELS26: GETP HERE,P?CAPACITY
EQUAL? STACK,10 /?THN29
GETP HERE,P?CAPACITY
EQUAL? STACK,20 \?ELS28
?THN29: PRINTR "You can't dig a hole here!"
?ELS28: EQUAL? HERE,HEART-OF-MAZE \?ELS37
IN? HEART-OF-MAZE-HOLE,HEART-OF-MAZE \?ELS42
PRINTR "You already dug a hole here."
?ELS42: PRINTI "You dig a hole and uncover"
CALL ARPRINT,RUBBER-STAMP
MOVE HEART-OF-MAZE-HOLE,HEART-OF-MAZE
RTRUE
?ELS37: GETP HERE,P?CAPACITY
EQUAL? STACK,1 \?ELS51
GETB HM-TABLE,HM-ROOM
GRTR? STACK,15 \?ELS51
PRINTR "You've already dug a hole here."
?ELS51: GETP HERE,P?CAPACITY
EQUAL? STACK,1 \FALSE
MOVE MAZE-HOLE,HERE
GETB HM-TABLE,HM-ROOM
BOR STACK,X-H
PUTB HM-TABLE,HM-ROOM,STACK
GETB HM-TABLE,HM-ROOM >HM-BITS
PRINTR "You dig a good sized hole, but find nothing."
?ELS13: CALL WASTE-OF-TIME
RSTACK
.FUNCT V-DISEMBARK
LOC PLAYER
EQUAL? STACK,PRSO /?ELS5
PRINTI "Look around you."
CRLF
RETURN 2
?ELS5: MOVE WINNER,HERE
PRINTI "You are no longer on"
CALL TPRINT,PRSO
PRINTR "."
.FUNCT V-DRINK
PRINT YOU-CANT
PRINTR "drink that!"
.FUNCT V-DRINK-FROM
CALL WHAT-A-CONCEPT
RSTACK
.FUNCT SPECIAL-DROP
EQUAL? HERE,ROOF-1,ROOF-2 \?ELS5
EQUAL? PRSO,FINCH \?ELS12
FSET? FINCH,BROKEN-BIT \?THN9
?ELS12: CALL ULTIMATELY-IN?,FINCH,PRSO
ZERO? STACK /?CND6
FSET? FINCH,BROKEN-BIT /?CND6
?THN9: CALL BREAK-FINCH,TRUE-VALUE
?CND6: EQUAL? PRSO,BLUE-CANDLE,WHITE-CANDLE,RED-CANDLE \?CND15
FSET? PRSO,FLAMEBIT \?CND15
CALL BLOW-OUT-CANDLE,PRSO,TRUE-VALUE
?CND15: MOVE PRSO,PATIO
PRINTI "The "
CALL DPRINT,PRSO
PRINTR " slides off the roof."
?ELS5: EQUAL? HERE,ON-POOL-1,ON-POOL-2,INLET /?THN22
EQUAL? HERE,IN-POOL-1,IN-POOL-2 \?ELS21
?THN22: CALL PERFORM,V?PUT,PRSO,WATER
RTRUE
?ELS21: EQUAL? HERE,CHIMNEY-2 /?THN26
EQUAL? HERE,CHIMNEY-1 \FALSE
?THN26: CALL PERFORM,V?PUT,PRSO,CHIMNEY
RTRUE
.FUNCT V-DROP
CALL SPECIAL-DROP
ZERO? STACK \TRUE
CALL IDROP
ZERO? STACK /FALSE
PRINTR "Dropped."
.FUNCT IDROP
CALL DONT-HAVE?,PRSO
ZERO? STACK \FALSE
IN? PRSO,WINNER /?ELS5
LOC PRSO
FSET? STACK,OPENBIT /?ELS5
PRINT YOU-CANT
PRINTI "do that while"
CALL TPRINT,PRSO
CALL IS-CLOSED
CRLF
RFALSE
?ELS5: FSET? PRSO,WORNBIT \?ELS9
PRINTI "You'll have to take off"
CALL TPRINT,PRSO
PRINTI " first."
CRLF
RFALSE
?ELS9: MOVE PRSO,HERE
RTRUE
.FUNCT V-EAT
CALL NOT-LIKELY,PRSO,STR?35
RSTACK
.FUNCT V-EMPTY,OBJ,NXT
FSET? PRSO,CONTBIT \?ELS3
FSET? PRSO,OPENBIT \?ELS6
FIRST? PRSO >OBJ /?KLU28
?KLU28: ZERO? OBJ /?ELS9
?PRG11: ZERO? OBJ /TRUE
NEXT? OBJ >NXT /?KLU29
?KLU29: FSET? OBJ,NARTICLEBIT /?CND17
PRINTI "The "
?CND17: CALL DPRINT,OBJ
PRINTI ": "
CALL PERFORM,V?TAKE,OBJ,PRSO
SET 'OBJ,NXT
JUMP ?PRG11
?ELS9: CALL BUT-THE,PRSO
PRINTR "is already empty!"
?ELS6: CALL ITS-CLOSED,PRSO
RTRUE
?ELS3: PRINT YOU-CANT
PRINTR "empty that!"
.FUNCT V-ENTER
EQUAL? PRSO,ROOMS \?ELS5
CALL DO-WALK,P?IN
RSTACK
?ELS5: FSET? PRSO,DOORBIT \?ELS7
CALL OTHER-SIDE,PRSO
CALL DO-WALK,STACK
RSTACK
?ELS7: IN? PRSO,WINNER \?ELS9
PRINTR "That would involve quite a contortion!"
?ELS9: FSET? PRSO,WEARBIT \?ELS11
CALL PRESUMABLY-YOU-WANT-TO,STR?36,PRSO
CALL PERFORM,V?WEAR,PRSO
RTRUE
?ELS11: FSET? PRSO,VEHBIT \?ELS13
CALL PERFORM,V?BOARD,PRSO
RTRUE
?ELS13: PRINTI "You hit your head against"
CALL TPRINT,PRSO
PRINTR " as you attempt this feat."
.FUNCT PRE-EXAMINE
ZERO? LIT \FALSE
CALL TOO-DARK
RTRUE
.FUNCT V-EXAMINE
FSET? PRSO,DOORBIT \?ELS5
PRINTI "It looks as if"
CALL TPRINT,PRSO
PRINTI " is "
FSET? PRSO,OPENBIT \?ELS8
PRINTI "open"
JUMP ?CND6
?ELS8: PRINTI "closed"
?CND6: PRINTR "."
?ELS5: FSET? PRSO,SURFACEBIT \?ELS12
CALL V-LOOK-ON
RSTACK
?ELS12: FSET? PRSO,CONTBIT \?ELS14
FSET? PRSO,OPENBIT /?THN20
FSET? PRSO,TRANSBIT \?ELS19
?THN20: CALL V-LOOK-INSIDE
RSTACK
?ELS19: CALL ITS-CLOSED,PRSO
RSTACK
?ELS14: FSET? PRSO,READBIT \?ELS25
CALL PERFORM,V?READ,PRSO
RSTACK
?ELS25: PRINTI "You see nothing "
CALL PICK-ONE,YAWNS
PRINT STACK
PRINTI " about"
CALL TRPRINT,PRSO
RSTACK
.FUNCT V-EXIT
CALL DO-WALK,P?OUT
RSTACK
.FUNCT FAILED
PRINTR "Failed."
.FUNCT V-FILL
ZERO? PRSI \?ELS5
CALL GLOBAL-IN?,WATER,HERE
ZERO? STACK /?ELS10
CALL PERFORM,V?FILL,PRSO,WATER
RTRUE
?ELS10: FSET? PRSO,CONTBIT \?ELS12
PRINTR "There's nothing to fill it with."
?ELS12: CALL V-STAND-UNDER
RSTACK
?ELS5: EQUAL? PRSI,PORTABLE-WATER,WATER \?ELS16
CALL GLOBAL-IN?,WATER,HERE
ZERO? STACK \?ELS21
CALL CANT-SEE-ANY,WATER
RSTACK
?ELS21: EQUAL? PRSO,BUCKET /?ELS23
CALL V-STAND-UNDER
RSTACK
?ELS23: FIRST? BUCKET \?ELS25
FIRST? BUCKET /?KLU34
?KLU34: EQUAL? STACK,PORTABLE-WATER /?ELS25
PRINTR "That would get the stuff in the bucket all wet."
?ELS25: MOVE PORTABLE-WATER,BUCKET
CALL QUEUE,I-DRIP,2
SET 'AMOUNT-OF-WATER,26
PRINTI "You fill"
CALL TPRINT,BUCKET
PRINTR ", which naturally leaks slowly."
?ELS16: EQUAL? PRSI,PORTABLE-WATER \?ELS31
CALL PERFORM,V?POUR,PORTABLE-WATER,PRSO
CALL THIS-IS-IT,PRSO
RTRUE
?ELS31: CALL V-STAND-UNDER
RSTACK
.FUNCT V-FIND,L
LOC PRSO >L
EQUAL? PRSO,ME,HANDS \?ELS3
PRINTI "You're right here"
JUMP ?CND1
?ELS3: IN? PRSO,PLAYER \?ELS5
PRINTI "You're holding it"
JUMP ?CND1
?ELS5: IN? PRSO,HERE /?THN8
EQUAL? PRSO,PSEUDO-OBJECT \?ELS7
?THN8: CALL BUT-THE,PRSO
PRINTI "is right in front of you"
JUMP ?CND1
?ELS7: IN? PRSO,LOCAL-GLOBALS \?ELS11
CALL HOW?
RTRUE
?ELS11: FSET? L,ACTORBIT \?ELS13
CALL VISIBLE?,L
ZERO? STACK /?ELS13
PRINTI "It looks as if"
CALL TPRINT,L
PRINTI " has it"
JUMP ?CND1
?ELS13: CALL SEE-INSIDE?,L
ZERO? STACK /?ELS17
CALL VISIBLE?,L
ZERO? STACK /?ELS17
PRINTI "It's "
FSET? L,SURFACEBIT \?ELS22
PRINTI "on"
JUMP ?CND20
?ELS22: PRINTI "in"
?CND20: CALL TPRINT,L
JUMP ?CND1
?ELS17: PRINTI "You'll have to do that yourself"
?CND1: PRINTR "."
.FUNCT FIND-IN,WHERE,WHAT,W
FIRST? WHERE >W /?KLU11
?KLU11: ZERO? W /FALSE
?PRG4: FSET? W,WHAT \?ELS8
RETURN W
?ELS8: NEXT? W >W /?PRG4
RFALSE
.FUNCT FINISH,REPEATING=0,WORD
CRLF
ZERO? REPEATING \?CND1
CALL V-SCORE
CRLF
?CND1: PRINTI "Do you want to restart the story, restore a saved position, or quit?
(Please type RESTART, RESTORE or QUIT.) >"
READ P-INBUF,P-LEXV
GET P-LEXV,1 >WORD
EQUAL? WORD,W?RESTAR \?ELS8
RESTART
CALL FAILED
CALL FINISH,TRUE-VALUE
RSTACK
?ELS8: EQUAL? WORD,W?RESTOR \?ELS10
RESTORE \?ELS15
CALL SAY-OKAY
RSTACK
?ELS15: CALL FAILED
CALL FINISH,TRUE-VALUE
RSTACK
?ELS10: EQUAL? WORD,W?QUIT,W?Q \?ELS19
QUIT
RTRUE
?ELS19: CALL FINISH,TRUE-VALUE
RSTACK
.FUNCT V-FLY
PRINTR "That's not in the script!"
.FUNCT V-FOCUS
PRINTR "It's your thinking that's out of focus."
.FUNCT V-FOLLOW,WHERE
LOC PRSO >WHERE
CALL BUT-THE,PRSO
PRINTI "is "
EQUAL? WHERE,HERE /?THN4
CALL GLOBAL-IN?,PRSO,HERE
ZERO? STACK /?ELS3
?THN4: PRINTI "right here in front of you"
JUMP ?CND1
?ELS3: EQUAL? WHERE,PLAYER \?ELS7
PRINTI "in"
CALL DPRINT,HANDS
PRINTC 115
JUMP ?CND1
?ELS7: IN? WHERE,PLAYER \?ELS9
PRINTI "in"
CALL TPRINT,WHERE
JUMP ?CND1
?ELS9: PRINTI "nowhere to be seen"
?CND1: PRINTR "!"
.FUNCT PRE-GIVE
ZERO? PRSO /?THN6
ZERO? PRSI \?ELS5
?THN6: CALL REFERRING
RTRUE
?ELS5: IN? PRSO,LOCAL-GLOBALS /?THN10
IN? PRSO,PSEUDO-OBJECT \?ELS9
?THN10: CALL NOT-HOLDING
RTRUE
?ELS9: CALL DONT-HAVE?,PRSO
ZERO? STACK \TRUE
FSET? PRSI,ACTORBIT /?ELS15
PRINT YOU-CANT
PRINTR "give anything to that!"
?ELS15: FSET? PRSO,WORNBIT \FALSE
CALL TAKE-OFF-PRSO-FIRST
RSTACK
.FUNCT V-GIVE
FSET? PRSI,ACTORBIT \FALSE
PRINTI "Politely,"
CALL TPRINT,PRSI
PRINTR " refuses your offer."
.FUNCT V-SGIVE
CALL PERFORM,V?GIVE,PRSI,PRSO
RTRUE
.FUNCT GOTO,RM,V?=1,OLIT,OHERE,X
GETP HERE,P?ACTION
CALL STACK,M-EXIT >X
SET 'OHERE,HERE
SET 'OLIT,LIT
MOVE WINNER,RM
SET 'HERE,RM
CALL LIT?,HERE >LIT
GETP HERE,P?ACTION
CALL STACK,M-ENTER
CALL DESCRIBE-ROOM
ZERO? STACK /TRUE
ZERO? VERBOSITY /TRUE
CALL DESCRIBE-OBJECTS
RTRUE
.FUNCT HACK-HACK,STR
PRINT STR
CALL TPRINT,PRSO
PRINTC 32
CALL PICK-ONE,HO-HUM
PRINT STACK
PRINTR "."
.FUNCT PRE-HANG-UP
CALL ULTIMATELY-IN?,PRSO
ZERO? STACK \FALSE
EQUAL? PRSO,PHONE /FALSE
CALL NOT-HOLDING,PRSO
RSTACK
.FUNCT V-HANG-UP
ZERO? PRSI \?ELS5
EQUAL? HERE,CLOSET \?ELS10
PRINTR "Next time, say which peg to hang it on."
?ELS10: PRINTR "There's no place to hang it up."
?ELS5: PRINTI "You can't hang something on"
CALL ARPRINT,PRSI
RSTACK
.FUNCT V-HELLO,WHO
ZERO? PRSO /?ELS3
SET 'WHO,PRSO
JUMP ?CND1
?ELS3: CALL ANYONE-HERE? >WHO
ZERO? WHO /?CND1
CALL SPOKEN-TO,WHO
CALL PERFORM,V?HELLO,WHO
RTRUE
?CND1: ZERO? WHO /?ELS15
FSET? WHO,ACTORBIT \?ELS21
PRINTI "It's apparent that"
CALL TPRINT,WHO
PRINTR " didn't expect you to say that."
?ELS21: CALL NOT-LIKELY,WHO,STR?25
RSTACK
?ELS15: CALL TALK-TO-SELF
RSTACK
.FUNCT V-HELP
PRINTR "[If you're really stuck, maps and InvisiClues (TM) hint booklets are available using the order form that came in your HOLLYWOOD HIJINX package.]"
.FUNCT V-HIDE
PRINTR "There aren't any good hiding places here."
.FUNCT V-INVENTORY
CALL DESCRIBE-CONTENTS,WINNER,FALSE-VALUE
ZERO? STACK \?CND1
PRINTI "You are empty-handed."
?CND1: CRLF
RTRUE
.FUNCT ITS-ALREADY,STR
PRINTI "It's already "
PRINT STR
PRINTR "."
.FUNCT JIGS-UP,REASON=0
ZERO? REASON /?CND1
PRINT REASON
CRLF
?CND1: CALL KILL-INTERRUPTS
CRLF
PRINTI "Fade to black:
**** You have died ****"
CRLF
CALL FINISH
RSTACK
.FUNCT V-KICK
CALL HACK-HACK,STR?44
RSTACK
.FUNCT V-KILL
FSET? PRSO,ACTORBIT /?ELS3
PRINT YOU-CANT
PRINTI "attack"
CALL TPRINT,PRSO