forked from historicalsource/enchanter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verbs.zap
2319 lines (1921 loc) · 45.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 V-VERBOSE
SET 'VERBOSE,TRUE-VALUE
SET 'SUPER-BRIEF,FALSE-VALUE
PRINTR "Maximum verbosity."
.FUNCT V-BRIEF
SET 'VERBOSE,FALSE-VALUE
SET 'SUPER-BRIEF,FALSE-VALUE
PRINTR "Brief descriptions."
.FUNCT V-SUPER-BRIEF
SET 'SUPER-BRIEF,TRUE-VALUE
PRINTR "Super-brief descriptions."
.FUNCT V-LOOK
ZERO? PRSO /?CND1
EQUAL? PRSO,ROOMS /?CND1
CALL PERFORM,V?EXAMINE,PRSO
RTRUE
?CND1: CALL DESCRIBE-ROOM,TRUE-VALUE
ZERO? STACK /FALSE
CALL DESCRIBE-OBJECTS,TRUE-VALUE
RSTACK
.FUNCT V-FIRST-LOOK
CALL DESCRIBE-ROOM
ZERO? STACK /FALSE
ZERO? SUPER-BRIEF \FALSE
CALL DESCRIBE-OBJECTS
RSTACK
.FUNCT V-EXAMINE
GETP PRSO,P?TEXT
ZERO? STACK /?ELS5
GETP PRSO,P?TEXT
PRINT STACK
CRLF
RTRUE
?ELS5: FSET? PRSO,CONTBIT /?THN10
FSET? PRSO,DOORBIT \?ELS9
?THN10: CALL V-LOOK-INSIDE
RSTACK
?ELS9: PRINTI "You see nothing special about the "
PRINTD PRSO
PRINTR "."
.FUNCT DESCRIBE-ROOM,LOOK?=0,V?,STR,AV
ZERO? LOOK? /?ORP4
PUSH LOOK?
JUMP ?THN1
?ORP4: PUSH VERBOSE
?THN1: POP 'V?
ZERO? LIT \?CND5
PRINTI "It is pitch black and there is evil in the darkness."
CRLF
RETURN FALSE-VALUE
?CND5: FSET? HERE,TOUCHBIT /?CND10
FSET HERE,TOUCHBIT
SET 'V?,TRUE-VALUE
?CND10: IN? HERE,ROOMS \?CND13
PRINTD HERE
CRLF
?CND13: ZERO? LOOK? \?THN21
ZERO? SUPER-BRIEF \TRUE
?THN21: LOC WINNER >AV
FSET? AV,VEHBIT \?CND23
PRINTI "(You are in the "
PRINTD AV
PRINTI ".)"
CRLF
?CND23: ZERO? V? /?ELS30
GETP HERE,P?ACTION
CALL STACK,M-LOOK
ZERO? STACK \TRUE
?ELS30: ZERO? V? /?ELS34
FSET? HERE,RMUNGBIT \?ELS34
GETP HERE,P?MUNGDESC >STR
ZERO? STR /?ELS34
PRINT STR
CRLF
JUMP ?CND28
?ELS34: ZERO? V? /?ELS40
GETP HERE,P?LDESC >STR
ZERO? STR /?ELS40
FSET? HERE,RMUNGBIT \?CND43
EQUAL? HERE,ALTAR,JUNCTION /?CND43
PRINTI "Everything you see is grey and lifeless, as though covered with a veil of ash. Sound is muted and there is a faint acrid odor."
CRLF
?CND43: PRINT STR
CRLF
JUMP ?CND28
?ELS40: GETP HERE,P?ACTION
CALL STACK,M-FLASH
?CND28: EQUAL? HERE,AV /?CND54
FSET AV,VEHBIT
GETP AV,P?ACTION
CALL STACK,M-LOOK
?CND54: FSET? HERE,LIGHTBIT \TRUE
GRTR? TOD,NIGHTFALL \?ELS63
PRINTR "The stars shine down on you from a clear, dark sky."
?ELS63: GRTR? TOD,DUSK \?ELS67
PRINTR "The darkening sky is lit by a waning moon."
?ELS67: LESS? TOD,DAWN /TRUE
ADD DAWN,3
LESS? TOD,STACK \TRUE
PRINTI "The sun is rising over the lands to the east."
CRLF
RTRUE
.FUNCT DESCRIBE-OBJECTS,V?=0
ZERO? LIT /?ELS5
FIRST? HERE \FALSE
ZERO? V? /?ORP15
PUSH V?
JUMP ?THN12
?ORP15: PUSH VERBOSE
?THN12: POP 'V?
CALL PRINT-CONT,HERE,V?,-1
RSTACK
?ELS5: PRINTR "You can't see anything in the dark."
.FUNCT LIGHTED?,OBJ
FSET? OBJ,LIGHTBIT \FALSE
FSET? OBJ,ONBIT \FALSE
PRINTI " (providing light)"
RTRUE
.FUNCT DESCRIBE-OBJECT,OBJ,V?,LEVEL,STR=0,AV
SET 'DESC-OBJECT,OBJ
ZERO? LEVEL \?ELS3
GETP OBJ,P?DESCFCN
CALL STACK,M-OBJDESC
ZERO? STACK \TRUE
?ELS3: ZERO? LEVEL \?ELS7
FSET? OBJ,TOUCHBIT /?ELS13
GETP OBJ,P?FDESC >STR
ZERO? STR \?THN10
?ELS13: GETP OBJ,P?LDESC >STR
ZERO? STR /?ELS7
?THN10: PRINT STR
CALL LIGHTED?,OBJ
JUMP ?CND1
?ELS7: ZERO? LEVEL \?ELS17
PRINTI "There is "
CALL PRINTA,OBJ
PRINTI " here"
CALL LIGHTED?,OBJ
PRINTI "."
JUMP ?CND1
?ELS17: GET INDENTS,LEVEL
PRINT STACK
PRINTI "A"
FSET? OBJ,VOWELBIT \?CND28
PRINTI "n"
?CND28: EQUAL? OBJ,BREAD \?ELS35
GETP OBJ,P?SIZE
LESS? STACK,8 \?CND33
PRINTI " partially eaten"
JUMP ?CND33
?ELS35: EQUAL? OBJ,WATER \?CND33
GETP OBJ,P?SIZE
LESS? STACK,2 \?CND43
PRINTI " very"
?CND43: GETP OBJ,P?SIZE
LESS? STACK,3 \?CND33
PRINTI " small"
?CND33: PRINTI " "
PRINTD OBJ
CALL LIGHTED?,OBJ
?CND1: ZERO? LEVEL \?CND55
LOC WINNER >AV
ZERO? AV /?CND55
FSET? AV,VEHBIT \?CND55
PRINTI " (outside the "
PRINTD AV
PRINTI ")"
?CND55: CRLF
CALL SEE-INSIDE?,OBJ
ZERO? STACK /FALSE
FIRST? OBJ \FALSE
CALL PRINT-CONT,OBJ,V?,LEVEL
RSTACK
.FUNCT PRINT-CONT,OBJ,V?=0,LEVEL=0,Y,1ST?,AV,STR,PV?=0,INV?=0
FIRST? OBJ >Y \TRUE
LOC WINNER >AV
ZERO? AV /?ELS6
FSET? AV,VEHBIT \?ELS6
JUMP ?CND4
?ELS6: SET 'AV,FALSE-VALUE
?CND4: SET '1ST?,TRUE-VALUE
LOC OBJ
EQUAL? WINNER,OBJ,STACK \?ELS13
SET 'INV?,TRUE-VALUE
JUMP ?CND11
?ELS13:
?PRG16: ZERO? Y \?ELS20
JUMP ?CND11
?ELS20: EQUAL? Y,AV \?ELS22
SET 'PV?,TRUE-VALUE
JUMP ?CND18
?ELS22: EQUAL? Y,WINNER \?ELS24
JUMP ?CND18
?ELS24: FSET? Y,INVISIBLE /?CND18
FSET? Y,TOUCHBIT /?CND18
GETP Y,P?FDESC >STR
ZERO? STR /?CND18
FSET? Y,NDESCBIT /?CND29
PRINT STR
CALL LIGHTED?,Y
CRLF
?CND29: CALL SEE-INSIDE?,Y
ZERO? STACK /?CND18
LOC Y
GETP STACK,P?DESCFCN
ZERO? STACK \?CND18
FIRST? Y \?CND18
CALL PRINT-CONT,Y,V?,0
?CND18: NEXT? Y >Y /?KLU76
?KLU76: JUMP ?PRG16
?CND11: FIRST? OBJ >Y /?KLU77
?KLU77:
?PRG39: ZERO? Y \?ELS43
ZERO? PV? /?CND44
ZERO? AV /?CND44
FIRST? AV \?CND44
CALL PRINT-CONT,AV,V?,LEVEL
?CND44: ZERO? 1ST? \FALSE
RTRUE
?ELS43: EQUAL? Y,AV,PLAYER \?ELS52
JUMP ?CND41
?ELS52: FSET? Y,INVISIBLE /?CND41
ZERO? INV? \?THN57
FSET? Y,TOUCHBIT /?THN57
GETP Y,P?FDESC
ZERO? STACK \?CND41
?THN57: FSET? Y,NDESCBIT /?ELS61
ZERO? 1ST? /?CND62
CALL FIRSTER,OBJ,LEVEL
ZERO? STACK /?CND66
LESS? LEVEL,0 \?CND66
SET 'LEVEL,0
?CND66: INC 'LEVEL
SET '1ST?,FALSE-VALUE
?CND62: CALL DESCRIBE-OBJECT,Y,V?,LEVEL
JUMP ?CND41
?ELS61: FIRST? Y \?CND41
CALL SEE-INSIDE?,Y
ZERO? STACK /?CND41
CALL PRINT-CONT,Y,V?,LEVEL
?CND41: NEXT? Y >Y /?KLU78
?KLU78: JUMP ?PRG39
.FUNCT FIRSTER,OBJ,LEVEL
EQUAL? OBJ,WINNER \?ELS5
PRINTR "You are carrying:"
?ELS5: IN? OBJ,ROOMS /FALSE
GRTR? LEVEL,0 \?CND10
GET INDENTS,LEVEL
PRINT STACK
?CND10: EQUAL? OBJ,ADVENTURER \?ELS19
PRINTR "The adventurer is carrying:"
?ELS19: FSET? OBJ,SURFACEBIT \?ELS23
PRINTI "Sitting on the "
PRINTD OBJ
PRINTR " is:"
?ELS23: PRINTI "The "
PRINTD OBJ
PRINTR " contains:"
.FUNCT V-SCORE,ASK?=1
PRINTI "Your score is "
PRINTN SCORE
PRINTI " of a possible "
PRINTN SCORE-MAX
PRINTI ", in "
PRINTN MOVES
EQUAL? MOVES,1 \?ELS9
PRINTI " move."
JUMP ?CND7
?ELS9: PRINTI " moves."
?CND7: CRLF
LESS? SCORE,0 \?ELS18
PRINTI "This gives you the rank of Menace to Society."
CRLF
RETURN SCORE
?ELS18: PRINTI "This puts you in the class of "
DIV SCORE,50
GET RANKINGS,STACK
PRINT STACK
PRINTI "."
CRLF
RETURN SCORE
.FUNCT FINISH,REPEATING=0
CRLF
ZERO? REPEATING \?CND1
CALL V-SCORE
CRLF
?CND1: PRINTI "Would you like to restart the game from the beginning, restore a saved game position, or end this session of the game?
(Type RESTART, RESTORE, or QUIT):
>"
READ P-INBUF,P-LEXV
GET P-LEXV,1
EQUAL? STACK,W?RESTART \?ELS10
RESTART
PRINTI "Failed."
CRLF
CALL FINISH,TRUE-VALUE
RSTACK
?ELS10: GET P-LEXV,1
EQUAL? STACK,W?RESTORE \?ELS14
RESTORE \?ELS19
PRINTR "Okay."
?ELS19: PRINTI "Failed."
CRLF
CALL FINISH,TRUE-VALUE
RSTACK
?ELS14: QUIT
RTRUE
.FUNCT V-QUIT,ASK?=1,SCOR
CALL V-SCORE
ZERO? ASK? /?ELS9
PRINTI "Do you wish to leave the game? (Y is affirmative): "
CALL YES?
ZERO? STACK \?THN6
?ELS9: ZERO? ASK? \?ELS5
?THN6: QUIT
RTRUE
?ELS5: PRINTR "Ok."
.FUNCT YES?
PRINTI ">"
READ P-INBUF,P-LEXV
GET P-LEXV,1
EQUAL? STACK,W?YES,W?Y \FALSE
RTRUE
.FUNCT V-VERSION,CNT=17
PRINTI "ENCHANTER
Infocom interactive fiction - a fantasy story
Copyright (C) 1983, 1984, 1986 by Infocom, Inc. All rights reserved.
ENCHANTER is a trademark of Infocom, Inc.
Release "
GET 0,1
BAND STACK,2047
PRINTN STACK
PRINTI " / Serial number "
?PRG5: IGRTR? 'CNT,23 \?ELS9
JUMP ?REP6
?ELS9: GETB 0,CNT
PRINTC STACK
JUMP ?PRG5
?REP6: CRLF
RTRUE
.FUNCT JIGS-UP,DESC,SURVIVE?=1,BOTH=0,OZMOOD?=0,CHEATED?=0
EQUAL? DEATH-CHEATED,WINNER,ME /?PRD1
PUSH 0
JUMP ?PRD2
?PRD1: PUSH 1
?PRD2: SET 'CHEATED?,STACK
ZERO? SURVIVE? /?ELS4
SET 'OZMOOD?,CHEATED?
JUMP ?PRD5
?ELS4: SET 'OZMOOD?,0
?PRD5: SET 'DEATH-CHEATED,FALSE-VALUE
ZERO? DESC /?CND6
PRINT DESC
CRLF
?CND6: EQUAL? PLAYER,WINNER /?CND12
PRINTI "
*** The "
PRINTD WINNER
PRINTI " has died ***
"
ZERO? OZMOOD? /?ELS19
PRINTI "Fortunately the "
PRINTD WINNER
PRINTI " has been magically protected from violent death and appears to be none the worse for his horrible experience."
CRLF
JUMP ?CND17
?ELS19: ZERO? CHEATED? /?CND25
PRINTI "Unfortunately, even the ozmoo spell was not enough to protect the "
PRINTD WINNER
PRINTI " from this eventuality."
CRLF
?CND25: REMOVE WINNER
?CND17: SET 'WINNER,PLAYER
LOC WINNER >HERE
CALL LIT?,HERE >LIT
RETURN 2
?CND12: CALL FORGET-ALL
PRINTI "
**** You have died ****
"
ZERO? OZMOOD? /?ELS37
PRINTI "Fortunately, you had the foresight to protect yourself against this eventuality by a judicious use of the ozmoo spell. You survive this horrible experience none the worse for wear, if somewhat chastened."
CRLF
JUMP ?CND35
?ELS37: ZERO? CHEATED? /?CND43
PRINTI "Unfortunately, even the ozmoo spell was not enough to protect you from this eventuality."
CRLF
?CND43: IGRTR? 'DEATHS,3 \?ELS51
PRINTI "You awaken among the members of the Circle. Belboz the Necromancer is exhausted, and the other members of the Circle are disgusted. ""I told you Krill was too powerful for such as this,"" says one. ""We must send someone who has a chance to defeat a warlock of Krill's experience and guile."" Acrimonious discussion begins, as you are waved away to join the apprentices in the scullery. A long acquaintance with potatoes and dirty pots is about to begin."
CRLF
CALL FINISH
JUMP ?CND35
?ELS51: PRINTI "You awaken among the members of the Circle. Belboz the Necromancer looks tired, and scattered about are the remains of the components of a spell of great healing power. The other members of the Circle are pleased to see you revived, but worried by the setback. ""I think Krill is too powerful,"" says one. ""This inexperienced wizard will never defeat one so puissant as he."" Quiet discussion ensues, with well-concealed acrimony beneath the surface."
CRLF
CALL HELD?,DISPEL-SCROLL
ZERO? STACK \?THN61
CALL HELD?,BANISH-SCROLL
ZERO? STACK /?CND58
?THN61: CALL HELD?,DISPEL-SCROLL
ZERO? STACK /?CND63
CALL HELD?,BANISH-SCROLL
ZERO? STACK /?CND63
SET 'BOTH,TRUE-VALUE
?CND63: PRINTI "Belboz tilts his head, as if sensing something amiss. He examines your possessions and is taken aback: ""You have acquired "
ZERO? BOTH /?ELS72
PRINTI "scrolls"
JUMP ?CND70
?ELS72: PRINTI "a scroll"
?CND70: PRINTI " of great power. Using spells of this kind requires surpassing wisdom."" With a wave of his hand, the scroll"
ZERO? BOTH /?ELS84
PRINTI "s disappear"
JUMP ?CND82
?ELS84: PRINTI " disappears"
?CND82: PRINTI "."
CRLF
CALL HELD?,DISPEL-SCROLL
ZERO? STACK /?CND94
REMOVE DISPEL-SCROLL
?CND94: CALL HELD?,BANISH-SCROLL
ZERO? STACK /?CND58
REMOVE BANISH-SCROLL
?CND58: MOVE SPELL-BOOK,WINNER
FCLEAR SPELL-BOOK,NDESCBIT
FSET SPELL-BOOK,TAKEBIT
FSET? JUG,TOUCHBIT \?CND100
MOVE JUG,EAST-FORK
?CND100: FSET? BREAD,TOUCHBIT \?CND103
GETP BREAD,P?SIZE
GRTR? STACK,0 \?CND103
MOVE BREAD,EAST-FORK
?CND103: PRINTI "Debate ensues, with Belboz returning frequently to the contents of the ancient manuscript. His wishes prevail, and it is agreed to send you back...."
CRLF
SET 'THIRST-COUNT,0
SET 'HUNGER-COUNT,0
SET 'LOCKED-IN-TOWER,FALSE-VALUE
?CND35: CRLF
CALL RANDOMIZE-OBJECTS
ZERO? OZMOOD? \?CND110
CALL KILL-INTERRUPTS
CALL GOTO,EAST-FORK
?CND110: SET 'P-CONT,FALSE-VALUE
RETURN 2
.FUNCT RANDOMIZE-OBJECTS,F,N
FIRST? WINNER >F /?KLU12
?KLU12:
?PRG1: ZERO? F /TRUE
NEXT? F >N /?KLU13
?KLU13: FSET? F,SCROLLBIT \?CND7
MOVE F,HERE
?CND7: SET 'F,N
JUMP ?PRG1
.FUNCT KILL-INTERRUPTS
SET 'ADVENTURER-CHARMED,FALSE-VALUE
CALL STOP-FLYING
CALL QUEUE,I-TURTLE,0
CALL QUEUE,I-TAKE-TO-ALTAR,0
CALL QUEUE,I-GANG,0
CALL QUEUE,I-GUARDS-ARRIVE,0
RTRUE
.FUNCT V-RESTORE
RESTORE \?ELS5
PRINTI "Ok."
CRLF
CALL V-FIRST-LOOK
RSTACK
?ELS5: PRINTR "Failed."
.FUNCT V-SAVE
SAVE \?ELS5
PRINTR "Ok."
?ELS5: PRINTR "Failed."
.FUNCT V-RESTART
CALL V-SCORE,TRUE-VALUE
PRINTI "Do you wish to restart? (Y is affirmative): "
CALL YES?
ZERO? STACK /FALSE
PRINTI "Restarting."
CRLF
RESTART
PRINTR "Failed."
.FUNCT V-WALK-AROUND
CALL USE-DIRECTIONS
RSTACK
.FUNCT USE-DIRECTIONS
PRINTR "You should use compass directions if you wish to move."
.FUNCT V-LAUNCH
FSET? PRSO,VEHBIT \?ELS5
PRINTR "You can't launch that by saying ""launch""!"
?ELS5: PRINTR "How in blazes does one launch that?"
.FUNCT V-WALK,PT,PTS,STR,OBJ,RM
ZERO? TRY-FLY /?CND1
CALL PRE-FLY
ZERO? STACK \TRUE
?CND1: ZERO? P-WALK-DIR \?ELS10
CALL PERFORM,V?WALK-TO,PRSO
RTRUE
?ELS10: GETPT HERE,PRSO >PT
ZERO? PT /?ELS12
PTSIZE PT >PTS
EQUAL? PTS,UEXIT \?ELS17
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?ELS17: EQUAL? PTS,NEXIT \?ELS19
GET PT,NEXITSTR
PRINT STACK
CRLF
RETURN 2
?ELS19: EQUAL? PTS,FEXIT \?ELS25
GET PT,FEXITFCN
CALL STACK >RM
ZERO? RM /?ELS30
CALL GOTO,RM
RSTACK
?ELS30: RETURN 2
?ELS25: EQUAL? PTS,CEXIT \?ELS36
GETB PT,CEXITFLAG
VALUE STACK
ZERO? STACK /?ELS41
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?ELS41: GET PT,CEXITSTR >STR
ZERO? STR /?ELS43
PRINT STR
CRLF
RETURN 2
?ELS43: EQUAL? WINNER,TURTLE \?ELS49
LOC PLAYER
IN? TURTLE,STACK \?ELS52
PRINTI """I can't go that way."""
CRLF
RETURN 2
?ELS52: CALL NO-RESPONSE
RETURN 2
?ELS49: CALL OUTSIDE?,HERE
ZERO? STACK /?ELS60
PRINTI "There's no path in that direction."
CRLF
RETURN 2
?ELS60: PRINTI "You can't go that way."
CRLF
RETURN 2
?ELS36: EQUAL? PTS,DEXIT \FALSE
GETB PT,DEXITOBJ >OBJ
FSET? OBJ,OPENBIT \?ELS77
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?ELS77: GET PT,DEXITSTR >STR
ZERO? STR /?ELS79
PRINT STR
CRLF
CALL THIS-IS-IT,OBJ
RETURN 2
?ELS79: PRINTI "The "
PRINTD OBJ
PRINTI " is closed."
CRLF
CALL THIS-IS-IT,OBJ
RETURN 2
?ELS12: EQUAL? WINNER,PLAYER \?ELS91
ZERO? LIT \?ELS91
RANDOM 100
GRTR? 90,STACK \?ELS91
CALL JIGS-UP,STR?12
RETURN 2
?ELS91: EQUAL? WINNER,TURTLE \?ELS97
LOC PLAYER
IN? TURTLE,STACK \?ELS100
PRINTI """I can't go that way."""
CRLF
RETURN 2
?ELS100: CALL NO-RESPONSE
RETURN 2
?ELS97: PRINTI "You can't go that way."
CRLF
RETURN 2
.FUNCT THIS-IS-IT,OBJ
SET 'P-IT-OBJECT,OBJ
RETURN P-IT-OBJECT
.FUNCT V-INVENTORY
FIRST? WINNER \?ELS5
CALL PRINT-CONT,WINNER
RSTACK
?ELS5: PRINTR "You are empty-handed."
.FUNCT PRE-TAKE
IN? PRSO,WINNER \?ELS5
PRINTR "You already have it."
?ELS5: LOC PRSO
ZERO? STACK /?ELS14
LOC PRSO
FSET? STACK,CONTBIT \?ELS14
LOC PRSO
FSET? STACK,OPENBIT /?ELS14
PRINTR "You can't reach that."
?ELS14: ZERO? PRSI /?ELS20
EQUAL? PRSO,ME \?ELS26
CALL PERFORM,V?DROP,PRSI
RTRUE
?ELS26: LOC PRSO
EQUAL? PRSI,STACK /?ELS28
PRINTI "The "
PRINTD PRSO
PRINTI " isn't in the "
PRINTD PRSI
PRINTR "."
?ELS28: SET 'PRSI,FALSE-VALUE
RFALSE
?ELS20: LOC WINNER
EQUAL? PRSO,STACK \FALSE
PRINTR "You are in it!"
.FUNCT V-TAKE
CALL ITAKE
EQUAL? STACK,TRUE-VALUE \FALSE
PRINTR "Taken."
.FUNCT ITAKE,VB=1,CNT,OBJ,?TMP1
FSET? PRSO,TAKEBIT /?ELS5
ZERO? VB /FALSE
CALL PICK-ONE,YUKS
PRINT STACK
CRLF
RFALSE
?ELS5: LOC PRSO
IN? STACK,WINNER /?ELS13
CALL WEIGHT,PRSO >?TMP1
CALL WEIGHT,WINNER
ADD ?TMP1,STACK
GRTR? STACK,LOAD-ALLOWED \?ELS13
ZERO? VB /?CND16
PRINTI "Your load is too heavy"
LESS? LOAD-ALLOWED,LOAD-MAX \?ELS24
PRINTI ", especially in light of your exhaustion."
JUMP ?CND22
?ELS24: PRINTI "."
?CND22: CRLF
?CND16: RETURN 2
?ELS13: CALL CCOUNT,WINNER >CNT
GRTR? CNT,FUMBLE-NUMBER \?ELS34
MUL CNT,FUMBLE-PROB >?TMP1
RANDOM 100
GRTR? ?TMP1,STACK \?ELS34
PRINTI "You're holding too many things already."
CRLF
RETURN 2
?ELS34: MOVE PRSO,WINNER
FSET PRSO,TOUCHBIT
RTRUE
.FUNCT V-PUT-ON
FSET? PRSI,SURFACEBIT \?ELS5
CALL V-PUT
RSTACK
?ELS5: PRINTI "There's no good surface on the "
PRINTD PRSI
PRINTR "."
.FUNCT PRE-PUT
IN? PRSO,GLOBAL-OBJECTS /?THN6
FSET? PRSO,TAKEBIT /FALSE
?THN6: PRINTR "Nice try."
.FUNCT V-PUT,?TMP1
FSET? PRSI,OPENBIT /?CND1
FSET? PRSI,DOORBIT /?CND1
FSET? PRSI,CONTBIT /?CND1
FSET? PRSI,VEHBIT \?ELS3
JUMP ?CND1
?ELS3: PRINTR "I can't do that."
?CND1: FSET? PRSI,OPENBIT /?ELS14
PRINTI "The "
PRINTD PRSI
PRINTR " isn't open."
?ELS14: EQUAL? PRSI,PRSO \?ELS18
PRINTR "How can you do that?"
?ELS18: IN? PRSO,PRSI \?ELS22
PRINTI "The "
PRINTD PRSO
PRINTI " is already in the "
PRINTD PRSI
PRINTR "."
?ELS22: CALL WEIGHT,PRSI >?TMP1
CALL WEIGHT,PRSO
ADD ?TMP1,STACK >?TMP1
GETP PRSI,P?SIZE
SUB ?TMP1,STACK >?TMP1
GETP PRSI,P?CAPACITY
GRTR? ?TMP1,STACK \?ELS26
PRINTR "There's no room."
?ELS26: CALL HELD?,PRSO
ZERO? STACK \?ELS30
CALL ITAKE
EQUAL? STACK,M-FATAL,FALSE-VALUE /TRUE
?ELS30: MOVE PRSO,PRSI
FSET PRSO,TOUCHBIT
PRINTR "Done."
.FUNCT PRE-GIVE
CALL HELD?,PRSO
ZERO? STACK \FALSE
PRINTR "That's easy for you to say since you don't even have it."
.FUNCT PRE-SGIVE
CALL PERFORM,V?GIVE,PRSI,PRSO
RTRUE
.FUNCT HELD?,OBJ
ZERO? OBJ /FALSE
IN? OBJ,WINNER /TRUE
IN? OBJ,ROOMS /FALSE
IN? OBJ,GLOBAL-OBJECTS /FALSE
LOC OBJ
CALL HELD?,STACK
RSTACK
.FUNCT V-GIVE
FSET? PRSI,VICBIT /?ELS5
PRINTI "You can't give "
CALL PRINTA,PRSO
PRINTI " to "
CALL PRINTA,PRSI
PRINTR "!"
?ELS5: PRINTI "The "
PRINTD PRSI
PRINTR " refuses it politely."
.FUNCT V-SGIVE
PRINTR "**Bug"
.FUNCT V-DROP
CALL IDROP
ZERO? STACK /FALSE
PRINTR "Dropped."
.FUNCT V-THROW
CALL IDROP
ZERO? STACK /FALSE
PRINTR "Thrown."
.FUNCT IDROP
IN? PRSO,WINNER /?ELS5
LOC PRSO
IN? STACK,WINNER /?ELS5
PRINTI "You're not carrying the "
PRINTD PRSO
PRINTI "."
CRLF
RFALSE
?ELS5: IN? PRSO,WINNER /?ELS11
LOC PRSO
FSET? STACK,OPENBIT /?ELS11
PRINTI "The "
PRINTD PRSO
PRINTI " is closed."
CRLF
RFALSE
?ELS11: LOC WINNER
MOVE PRSO,STACK
RTRUE
.FUNCT V-OPEN,F,STR
FSET? PRSO,CONTBIT /?ELS5
PRINTI "You must tell me how to do that to "
CALL PRINTA,PRSO
PRINTR "."
?ELS5: GETP PRSO,P?CAPACITY
ZERO? STACK /?ELS9
FSET? PRSO,OPENBIT \?ELS14
PRINTR "It is already open."
?ELS14: FSET PRSO,OPENBIT
FIRST? PRSO \?THN24
FSET? PRSO,TRANSBIT \?ELS23
?THN24: PRINTR "Opened."
?ELS23: FIRST? PRSO >F \?ELS29
NEXT? F /?ELS29
GETP F,P?FDESC >STR
ZERO? STR /?ELS29
PRINTI "The "
PRINTD PRSO
PRINTI " opens."
CRLF
PRINT STR
CRLF
RTRUE
?ELS29: PRINTI "Opening the "
PRINTD PRSO
PRINTI " reveals "
CALL PRINT-CONTENTS,PRSO
PRINTR "."
?ELS9: FSET? PRSO,DOORBIT \?ELS43
FSET? PRSO,OPENBIT \?ELS48
PRINTR "It is already open."
?ELS48: PRINTI "The "
PRINTD PRSO
PRINTI " opens."
CRLF
FSET PRSO,OPENBIT
RTRUE
?ELS43: PRINTI "The "
PRINTD PRSO
PRINTR " fails to open."
.FUNCT PRINT-CONTENTS,OBJ,F,N,1ST?=1
FIRST? OBJ >F \FALSE
?PRG6: NEXT? F >N /?KLU26
?KLU26: ZERO? 1ST? /?ELS10
SET '1ST?,FALSE-VALUE
JUMP ?CND8
?ELS10: PRINTI ", "
ZERO? N \?CND8
PRINTI "and "
?CND8: CALL PRINTA,F
SET 'F,N
ZERO? F \?PRG6
RTRUE
.FUNCT V-CLOSE
FSET? PRSO,CONTBIT /?ELS5
PRINTI "You must tell me how to do that to "
CALL PRINTA,PRSO
PRINTR "."
?ELS5: FSET? PRSO,SURFACEBIT /?ELS9
GETP PRSO,P?CAPACITY
ZERO? STACK /?ELS9
FSET? PRSO,OPENBIT \?ELS16
FCLEAR PRSO,OPENBIT
PRINTR "Closed."
?ELS16: PRINTR "It is already closed."
?ELS9: FSET? PRSO,DOORBIT \?ELS24
FSET? PRSO,OPENBIT \?ELS29
PRINTI "The "
PRINTD PRSO
PRINTI " is now closed."
CRLF
FCLEAR PRSO,OPENBIT
RTRUE
?ELS29: PRINTR "It is already closed."
?ELS24: PRINTR "You cannot close that."
.FUNCT CCOUNT,OBJ,CNT=0,X
FIRST? OBJ >X \?CND1
?PRG4: INC 'CNT
NEXT? X >X /?PRG4
?CND1: RETURN CNT
.FUNCT WEIGHT,OBJ,CONT,WT=0
FIRST? OBJ >CONT \?CND1
?PRG4: CALL WEIGHT,CONT
ADD WT,STACK >WT
NEXT? CONT >CONT /?PRG4
?CND1: GETP OBJ,P?SIZE
ADD WT,STACK
RSTACK
.FUNCT V-SCRIPT
GET 0,8
BOR STACK,1
PUT 0,8,STACK
PRINTI "Here begins"
PRINT COPR-NOTICE
CRLF
RTRUE
.FUNCT V-UNSCRIPT
PRINTI "Here ends"
PRINT COPR-NOTICE
CRLF
GET 0,8
BAND STACK,-2
PUT 0,8,STACK
RTRUE
.FUNCT PRE-MOVE
EQUAL? PRSO,EGG-KNOB-1,EGG-KNOB-2,EGG-KNOB-3 /FALSE
EQUAL? PRSO,EGG-KNOB-4,EGG-KNOB-5 /FALSE
CALL HELD?,PRSO
ZERO? STACK /FALSE
PRINTR "I don't juggle objects!"
.FUNCT V-MOVE
FSET? PRSO,TAKEBIT \?ELS5
PRINTI "Moving the "
PRINTD PRSO
PRINTR " reveals nothing."
?ELS5: PRINTI "You can't move the "
PRINTD PRSO
PRINTR "."
.FUNCT V-LAMP-ON
FSET? PRSO,LIGHTBIT \?ELS3
FSET? PRSO,ONBIT \?ELS6
PRINTR "It is already on."
?ELS6: FSET PRSO,ONBIT
PRINTI "The "
PRINTD PRSO
PRINTI " is now on."
CRLF
ZERO? LIT \TRUE
CALL LIT?,HERE >LIT
CRLF
CALL V-LOOK
RTRUE
?ELS3: PRINTR "You can't turn that on."
.FUNCT V-LAMP-OFF
FSET? PRSO,LIGHTBIT \?ELS3
FSET? PRSO,ONBIT /?ELS6
PRINTR "It is already off."
?ELS6: FCLEAR PRSO,ONBIT
EQUAL? ETERNAL-FLAME,LANTERN /?CND11
FCLEAR PRSO,LIGHTBIT
?CND11: ZERO? LIT /?CND14