-
Notifications
You must be signed in to change notification settings - Fork 24
/
verbs.zap
2280 lines (1909 loc) · 42.6 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
PRINTI "Maximum verbosity."
CRLF
CRLF
CALL V-LOOK
RSTACK
.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
SET 'C-ELAPSED,9
CALL DESCRIBE-ROOM,TRUE-VALUE
ZERO? STACK /FALSE
CALL DESCRIBE-OBJECTS,TRUE-VALUE
RSTACK
.FUNCT V-LOOK-CRETIN
PRINTR "This isn't a primitive two-word-parser adventure game. If you want to look AT that object, please say so."
.FUNCT V-FIRST-LOOK
CALL DESCRIBE-ROOM
ZERO? STACK /FALSE
ZERO? SUPER-BRIEF \FALSE
CALL DESCRIBE-OBJECTS
RSTACK
.FUNCT PRE-EXAMINE
CALL HERE?,PRSO
ZERO? STACK \FALSE
IN? PRSO,GLOBAL-OBJECTS /FALSE
EQUAL? PRSO,PSEUDO-OBJECT /FALSE
IN? PRSO,LOCAL-GLOBALS \?PRD8
CALL GLOBAL-IN?,PRSO,HERE
ZERO? STACK \FALSE
?PRD8: EQUAL? PRSO,GRUE /FALSE
PRINTI "You can't see any"
CALL PRSO-PRINT
PRINTR " here!"
.FUNCT V-EXAMINE
SET 'C-ELAPSED,32
GETP PRSO,P?TEXT
ZERO? STACK /?CCL3
GETP PRSO,P?TEXT
PRINT STACK
CRLF
RTRUE
?CCL3: FSET? PRSO,DOORBIT \?CCL5
CALL V-LOOK-INSIDE
RSTACK
?CCL5: FSET? PRSO,CONTBIT \?CCL7
FSET? PRSO,OPENBIT \?CCL10
CALL V-LOOK-INSIDE
RSTACK
?CCL10: PRINTI "The "
PRINTD PRSO
PRINTR " is closed."
?CCL7: PRINTI "I see nothing special about the "
PRINTD PRSO
PRINTR "."
.FUNCT DESCRIBE-ROOM,LOOK?=0,V?,STR,AV
ZERO? LOOK? /?PRD3
SET 'V?,LOOK?
JUMP ?PEN1
?PRD3: SET 'V?,VERBOSE
?PEN1: ZERO? LIT \?CND4
PRINTI "It is pitch black. You might be eaten by a grue."
CRLF
EQUAL? HERE,TRANSPORTATION-SUPPLY \FALSE
PRINTI "There is light to the south."
CRLF
RFALSE
?CND4: FSET? HERE,TOUCHBIT /?CND8
FSET HERE,TOUCHBIT
SET 'V?,TRUE-VALUE
?CND8: IN? HERE,ROOMS \?CND10
PRINTD HERE
LOC ADVENTURER
FSET? STACK,VEHBIT \?CND12
PRINTI ", in the "
LOC ADVENTURER
PRINTD STACK
?CND12: CRLF
?CND10: ZERO? LOOK? \?CCL15
ZERO? SUPER-BRIEF \TRUE
?CCL15: LOC ADVENTURER >AV
ZERO? V? /?CCL20
GETP HERE,P?ACTION
CALL STACK,M-LOOK
ZERO? STACK \TRUE
?CCL20: ZERO? V? /?CCL24
GETP HERE,P?LDESC >STR
ZERO? STR /?CCL24
PRINT STR
CRLF
JUMP ?CND18
?CCL24: GETP HERE,P?ACTION
CALL STACK,M-FLASH
?CND18: EQUAL? HERE,AV /TRUE
FSET? AV,VEHBIT \TRUE
GETP AV,P?ACTION
CALL STACK,M-LOOK
RTRUE
.FUNCT DESCRIBE-OBJECTS,V?=0
ZERO? LIT /?CCL3
FIRST? HERE \FALSE
ZERO? V? /?PRD9
SET 'V?,V?
JUMP ?PEN7
?PRD9: SET 'V?,VERBOSE
?PEN7: CALL PRINT-CONT,HERE,V?,-1
RSTACK
?CCL3: PRINTR "You can't see anything in the dark."
.FUNCT DESCRIBE-OBJECT,OBJ,V?,LEVEL,STR=0,AV
ZERO? LEVEL \?CCL3
GETP OBJ,P?DESCFCN
CALL STACK,M-OBJDESC
ZERO? STACK \TRUE
?CCL3: EQUAL? OBJ,SPOUT-PLACED /TRUE
ZERO? LEVEL \?CCL9
FSET? OBJ,TOUCHBIT /?PRD13
GETP OBJ,P?FDESC >STR
ZERO? STR \?CTR8
?PRD13: GETP OBJ,P?LDESC >STR
ZERO? STR /?CCL9
?CTR8: PRINT STR
JUMP ?CND1
?CCL9: ZERO? LEVEL \?CCL17
PRINTI "There is "
FSET? OBJ,VOWELBIT \?CCL21
PRINTI "an "
JUMP ?CND19
?CCL21: PRINTI "a "
?CND19: PRINTD OBJ
PRINTI " here."
JUMP ?CND1
?CCL17: GET INDENTS,LEVEL
PRINT STACK
FSET? OBJ,VOWELBIT \?CCL24
PRINTI "An "
JUMP ?CND22
?CCL24: PRINTI "A "
?CND22: PRINTD OBJ
FSET? OBJ,WORNBIT \?CND1
PRINTI " (being worn)"
?CND1: ZERO? LEVEL \?CND27
LOC ADVENTURER >AV
ZERO? AV /?CND27
FSET? AV,VEHBIT \?CND27
PRINTI " (outside the "
PRINTD AV
PRINTC 41
?CND27: 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 ADVENTURER >AV
ZERO? AV /?CCL5
FSET? AV,VEHBIT /?CND3
?CCL5: SET 'AV,FALSE-VALUE
?CND3: SET '1ST?,TRUE-VALUE
LOC OBJ
EQUAL? ADVENTURER,OBJ,STACK \?PRG11
SET 'INV?,TRUE-VALUE
FIRST? OBJ >Y /?PRG35
?PRG35: ZERO? Y \?CCL39
ZERO? PV? /?CND40
ZERO? AV /?CND40
FIRST? AV \?CND40
CALL PRINT-CONT,AV,V?,LEVEL
?CND40: ZERO? 1ST? /TRUE
RFALSE
?PRG11: ZERO? Y \?CCL15
ZERO? 1ST? /TRUE
RFALSE
?CCL15: EQUAL? Y,AV \?CCL20
SET 'PV?,TRUE-VALUE
JUMP ?CND13
?CCL20: EQUAL? Y,WINNER /?CND13
FSET? Y,INVISIBLE /?CND13
FSET? Y,TOUCHBIT /?CND13
GETP Y,P?FDESC >STR
ZERO? STR /?CND13
FSET? Y,NDESCBIT /?CND26
PRINT STR
CRLF
?CND26: CALL SEE-INSIDE?,Y
ZERO? STACK /?CND13
LOC Y
GETP STACK,P?DESCFCN
ZERO? STACK \?CND13
FIRST? Y \?CND13
CALL PRINT-CONT,Y,V?,0
?CND13: NEXT? Y >Y /?PRG11
JUMP ?PRG11
?CCL39: EQUAL? Y,AV,ADVENTURER /?CND37
FSET? Y,INVISIBLE /?CND37
ZERO? INV? \?CCL49
FSET? Y,TOUCHBIT /?CCL49
GETP Y,P?FDESC
ZERO? STACK \?CND37
?CCL49: FSET? Y,NDESCBIT /?CCL57
ZERO? 1ST? /?CND58
CALL FIRSTER,OBJ,LEVEL
ZERO? STACK /?CND60
LESS? LEVEL,0 \?CND60
SET 'LEVEL,0
?CND60: INC 'LEVEL
SET '1ST?,FALSE-VALUE
?CND58: CALL DESCRIBE-OBJECT,Y,V?,LEVEL
JUMP ?CND37
?CCL57: FIRST? Y \?CND37
CALL SEE-INSIDE?,Y
ZERO? STACK /?CND37
CALL PRINT-CONT,Y,V?,LEVEL
?CND37: NEXT? Y >Y /?PRG35
JUMP ?PRG35
.FUNCT FIRSTER,OBJ,LEVEL
EQUAL? OBJ,ADVENTURER \?CCL3
PRINTR "You are carrying:"
?CCL3: IN? OBJ,ROOMS /FALSE
GRTR? LEVEL,0 \?CND6
GET INDENTS,LEVEL
PRINT STACK
?CND6: FSET? OBJ,SURFACEBIT \?CCL10
PRINTI "Sitting on the "
PRINTD OBJ
PRINTR " is:"
?CCL10: FSET? OBJ,ACTORBIT \?CCL12
PRINTI "The "
PRINTD OBJ
PRINTR " is holding:"
?CCL12: PRINTI "The "
PRINTD OBJ
PRINTR " contains:"
.FUNCT SCORE-OBJ,OBJ
GETP OBJ,P?VALUE
GRTR? STACK,0 \FALSE
FSET OBJ,TOUCHBIT
GETP OBJ,P?VALUE
ADD SCORE,STACK >SCORE
PUTP OBJ,P?VALUE,0
RTRUE
.FUNCT V-SCORE,ASK?=1
PRINTI "Your score "
ZERO? ASK? /?CCL3
PRINTI "would be "
JUMP ?CND1
?CCL3: PRINTI "is "
?CND1: PRINTN SCORE
PRINTI " (out of 80 points). It is Day "
PRINTN DAY
PRINTI " of your adventure. Current Galactic Standard Time "
IN? CHRONOMETER,ADVENTURER \?CCL6
PRINTI "(adjusted to your local day-cycle) is "
FSET? CHRONOMETER,MUNGEDBIT \?CCL9
PRINTN MUNGED-TIME
JUMP ?CND4
?CCL9: PRINTN INTERNAL-MOVES
JUMP ?CND4
?CCL6: PRINTI "is impossible to determine, since you're not wearing your chronometer"
?CND4: PRINTC 46
CRLF
PRINTI "This score gives you the rank of "
EQUAL? SCORE,80 \?CCL12
PRINTI "Galactic Overlord"
JUMP ?CND10
?CCL12: GRTR? SCORE,72 \?CCL14
PRINTI "Cluster Admiral"
JUMP ?CND10
?CCL14: GRTR? SCORE,64 \?CCL16
PRINTI "System Captain"
JUMP ?CND10
?CCL16: GRTR? SCORE,48 \?CCL18
PRINTI "Planetary Commodore"
JUMP ?CND10
?CCL18: GRTR? SCORE,36 \?CCL20
PRINTI "Lieutenant"
JUMP ?CND10
?CCL20: GRTR? SCORE,24 \?CCL22
PRINTI "Ensign First Class"
JUMP ?CND10
?CCL22: GRTR? SCORE,12 \?CCL24
PRINTI "Space Cadet"
JUMP ?CND10
?CCL24: PRINTI "Beginner"
?CND10: PRINTC 46
CRLF
RETURN SCORE
.FUNCT FINISH,DIED,REPEATING=0
CRLF
ZERO? REPEATING \?CND1
CALL V-SCORE
ZERO? DIED /?CND1
CRLF
PRINTI "Oh, well. According to the Treaty of Gishen IV, signed in 8747 GY, all adventure game players must be given another chance after dying. In the interests of interstellar peace..."
CRLF
?CND1: PUTB P-INBUF,0,10
CRLF
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.)"
CRLF
CRLF
PRINTC 62
READ P-INBUF,P-LEXV
PUTB P-INBUF,0,80
GET P-LEXV,1
EQUAL? STACK,W?RESTAR \?CCL7
RESTART
PRINTI "Failed."
CRLF
CALL FINISH,FALSE-VALUE,TRUE-VALUE
RSTACK
?CCL7: GET P-LEXV,1
EQUAL? STACK,W?RESTOR \?CCL9
RESTORE \?CCL12
PRINTR "Ok."
?CCL12: PRINTI "Failed."
CRLF
CALL FINISH,FALSE-VALUE,TRUE-VALUE
RSTACK
?CCL9: GET P-LEXV,1
EQUAL? STACK,W?QUIT,W?Q \?CCL14
QUIT
RTRUE
?CCL14: CALL FINISH,FALSE-VALUE,TRUE-VALUE
RSTACK
.FUNCT V-QUIT
CALL V-SCORE
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
CRLF
PRINTI "Floyd grins impishly. ""Giving up, huh?"""
CRLF
?CND1: CRLF
PRINTI "Do you wish to leave the game? (Y is affirmative): "
CALL YES?
ZERO? STACK /?CCL7
QUIT
RTRUE
?CCL7: PRINTR "Ok."
.FUNCT YES?
PUTB P-INBUF,0,10
PRINTC 62
READ P-INBUF,P-LEXV
PUTB P-INBUF,0,80
GET P-LEXV,1
EQUAL? STACK,W?YES,W?Y /TRUE
RFALSE
.FUNCT V-VERSION,CNT=17
PRINTI "PLANETFALL
Infocom interactive fiction - a science fiction story
Copyright (c) 1983 by Infocom, Inc. All rights reserved.
"
PRINTI "PLANETFALL is a registered trademark of Infocom, Inc.
Release "
GET 0,1
BAND STACK,2047
PRINTN STACK
PRINTI " / Serial number "
?PRG1: IGRTR? 'CNT,23 /?REP2
GETB 0,CNT
PRINTC STACK
JUMP ?PRG1
?REP2: CRLF
IN? FLOYD,HERE \FALSE
FSET? FLOYD,RLANDBIT \FALSE
SET 'FLOYD-SPOKE,TRUE-VALUE
CRLF
PRINTR """Last version was better,"" says Floyd. ""More bugs. Bugs make game fun."""
.FUNCT V-AGAIN,OBJ
ZERO? L-PRSA \?CCL3
CALL ANYMORE
RSTACK
?CCL3: EQUAL? HERE,LAST-PSEUDO-LOC /?CCL5
EQUAL? PSEUDO-OBJECT,L-PRSO,L-PRSI \?CCL5
SET 'L-PRSA,FALSE-VALUE
CALL ANYMORE
RSTACK
?CCL5: EQUAL? L-PRSA,V?WALK \?CCL9
CALL DO-WALK,L-PRSO
RSTACK
?CCL9: ZERO? L-PRSO /?CCL12
LOC L-PRSO
EQUAL? STACK,FALSE-VALUE \?CCL12
SET 'OBJ,L-PRSO
JUMP ?CND10
?CCL12: ZERO? L-PRSI /?CFL15
LOC L-PRSI
EQUAL? STACK,FALSE-VALUE /?CCL16
?CFL15: SET 'OBJ,0
JUMP ?CND10
?CCL16: SET 'OBJ,L-PRSI
?CND10: ZERO? OBJ /?CCL21
EQUAL? OBJ,PSEUDO-OBJECT,ROOMS /?CCL21
CALL ANYMORE
RETURN 2
?CCL21: CALL PERFORM,L-PRSA,L-PRSO,L-PRSI
RTRUE
.FUNCT JIGS-UP,DESC,PLAYER?=0
PRINT DESC
CRLF
CRLF
PRINTI " **** You have died ****"
CRLF
CALL FINISH,TRUE-VALUE
RSTACK
.FUNCT V-RESTORE
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
PRINTI "Floyd looks disappointed, but understanding. ""That part of the game was more fun than this part,"" he admits."
CRLF
CRLF
?CND1: RESTORE \?CCL7
PRINTR "Ok."
?CCL7: PRINTR "Failed."
.FUNCT V-SAVE
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
PRINTI "Floyd's eyes light up. ""Oh boy! Are we gonna try something dangerous now?"""
CRLF
CRLF
?CND1: SAVE \?CCL7
PRINTR "Ok."
?CCL7: PRINTR "Failed."
.FUNCT V-RESTART
CALL V-SCORE,TRUE-VALUE
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
PRINTI "Floyd looks sad. ""Going away?"" he asks."
CRLF
?CND1: CRLF
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 V-WALK-TO
IN? PRSO,HERE /?CTR2
CALL GLOBAL-IN?,PRSO,HERE
ZERO? STACK /?CCL3
?CTR2: PRINTR "It's here!"
?CCL3: CALL USE-DIRECTIONS
RSTACK
.FUNCT V-WALK,PT,PTS,STR,OBJ,RM,TEMP-ELAPSED,?TMP1
ZERO? P-WALK-DIR \?CCL3
CALL PERFORM,V?WALK-TO,PRSO
RTRUE
?CCL3: GETPT HERE,PRSO >PT
ZERO? PT /?CCL5
GETP HERE,P?C-MOVE >?TMP1
SUB PRSO,LOW-DIRECTION
GET ?TMP1,STACK >TEMP-ELAPSED
ZERO? TEMP-ELAPSED \?CND6
SET 'TEMP-ELAPSED,DEFAULT-MOVE
?CND6: PTSIZE PT >PTS
EQUAL? PTS,UEXIT \?CCL10
SET 'C-ELAPSED,TEMP-ELAPSED
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?CCL10: EQUAL? PTS,NEXIT \?CCL12
GET PT,NEXITSTR
PRINT STACK
CRLF
RETURN 2
?CCL12: EQUAL? PTS,FEXIT \?CCL16
GET PT,FEXITFCN
CALL STACK >RM
ZERO? RM /?PRG20
CALL GOTO,RM
RSTACK
?PRG20: RETURN 2
?CCL16: EQUAL? PTS,CEXIT \?CCL23
GETB PT,CEXITFLAG
VALUE STACK
ZERO? STACK /?CCL26
SET 'C-ELAPSED,TEMP-ELAPSED
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?CCL26: GET PT,CEXITSTR >STR
ZERO? STR /?CCL28
PRINT STR
CRLF
RETURN 2
?CCL28: PRINTI "You can't go that way."
CRLF
RETURN 2
?CCL23: EQUAL? PTS,DEXIT \FALSE
GETB PT,DEXITOBJ >OBJ
FSET? OBJ,OPENBIT \?CCL37
SET 'C-ELAPSED,TEMP-ELAPSED
GETB PT,REXIT
CALL GOTO,STACK
RSTACK
?CCL37: GET PT,DEXITSTR >STR
ZERO? STR /?CCL39
PRINT STR
CRLF
RETURN 2
?CCL39: PRINTI "The "
PRINTD OBJ
PRINTI " is closed."
CRLF
CALL THIS-IS-IT,OBJ
RETURN 2
?CCL5: ZERO? LIT \?CCL45
RANDOM 100
LESS? 75,STACK /?CCL45
CALL JIGS-UP,STR?63
RSTACK
?CCL45: PRINTI "You can't go that way."
CRLF
RETURN 2
.FUNCT V-INVENTORY
SET 'C-ELAPSED,18
FIRST? ADVENTURER \?CCL3
CALL PRINT-CONT,ADVENTURER
RSTACK
?CCL3: PRINTR "You are empty-handed."
.FUNCT PRE-TAKE
IN? PRSO,ADVENTURER \?CCL3
PRINTR "You already have it."
?CCL3: EQUAL? PRSO,GOOD-BOARD \?CCL5
FSET? GOOD-BOARD,NDESCBIT /FALSE
?CCL5: LOC PRSO
FSET? STACK,CONTBIT \?CCL9
LOC PRSO
FSET? STACK,OPENBIT /?CCL9
PRINTR "You can't reach into a closed container."
?CCL9: ZERO? PRSI /?CCL13
LOC PRSO
EQUAL? PRSI,STACK /?CCL16
EQUAL? PRSO,KEY \?CCL19
FSET? KEY,TOUCHBIT \FALSE
?CCL19: EQUAL? PRSO,CELERY \?CCL23
EQUAL? PRSI,AMBASSADOR /FALSE
?CCL23: PRINTR "It's not in that!"
?CCL16: SET 'PRSI,FALSE-VALUE
RFALSE
?CCL13: LOC ADVENTURER
EQUAL? PRSO,STACK \FALSE
PRINTR "You are in it, asteroid-brain!"
.FUNCT V-TAKE
CALL ITAKE
EQUAL? STACK,TRUE-VALUE \FALSE
PRINTR "Taken."
.FUNCT TRYTAKE
IN? PRSO,WINNER /TRUE
FSET? PRSO,TRYTAKEBIT \?CCL5
GETP PRSO,P?ACTION
ZERO? STACK /?CCL5
CALL PERFORM,V?TAKE,PRSO
RTRUE
?CCL5: CALL ITAKE
RSTACK
.FUNCT ITAKE,VB=1,CNT,OBJ,?TMP1
FSET? PRSO,TAKEBIT /?CCL3
ZERO? VB /FALSE
CALL PICK-ONE,YUKS
PRINT STACK
CRLF
RFALSE
?CCL3: LOC PRSO
IN? STACK,ADVENTURER /?CCL7
CALL WEIGHT,PRSO >?TMP1
CALL WEIGHT,ADVENTURER
ADD ?TMP1,STACK
GRTR? STACK,LOAD-ALLOWED \?CCL7
ZERO? VB /?PRG12
PRINTI "Your load is too heavy."
CRLF
?PRG12: RETURN 2
?CCL7: CALL CCOUNT,ADVENTURER >CNT
GRTR? CNT,FUMBLE-NUMBER \?CCL15
MUL CNT,FUMBLE-PROB >?TMP1
RANDOM 100
LESS? ?TMP1,STACK /?CCL15
FIRST? ADVENTURER >OBJ /?PRG19
?PRG19: FSET? OBJ,WORNBIT \?REP20
NEXT? OBJ >OBJ /?PRG19
JUMP ?PRG19
?REP20: PRINTI "Oh, no. The "
PRINTD OBJ
PRINTI " slips from your arms while taking the "
PRINTD PRSO
PRINTI " and both tumble to the ground."
CRLF
EQUAL? FLASK,OBJ,PRSO \?CND25
IN? CHEMICAL-FLUID,FLASK \?CND25
REMOVE CHEMICAL-FLUID
PRINTI "Unfortunately, the chemical spills out of the flask and evaporates."
CRLF
?CND25: EQUAL? CANTEEN,OBJ,PRSO \?CND29
IN? HIGH-PROTEIN,CANTEEN \?CND29
FSET? CANTEEN,OPENBIT \?CND29
REMOVE HIGH-PROTEIN
PRINTI "To make matters worse, the high-protein liquid spills all over the place and then evaporates."
CRLF
?CND29: MOVE OBJ,HERE
MOVE PRSO,HERE
RETURN 2
?CCL15: MOVE PRSO,ADVENTURER
FCLEAR PRSO,NDESCBIT
CALL SCORE-OBJ,PRSO
FSET PRSO,TOUCHBIT
EQUAL? PRSO,SPOUT-PLACED \TRUE
SET 'SPOUT-PLACED,GROUND
RTRUE
.FUNCT PRE-PUT
ZERO? PRSO /FALSE
FSET? PRSO,WORNBIT \?CCL5
PRINTR "You can't while you're wearing it."
?CCL5: IN? PRSO,GLOBAL-OBJECTS /?CCL7
FSET? PRSO,TAKEBIT /FALSE
?CCL7: PRINTR "Nice try."
.FUNCT V-PUT,?TMP1,?TMP2,?TMP3
FSET? PRSI,OPENBIT /?CND1
FSET? PRSI,DOORBIT /?CND1
FSET? PRSI,CONTBIT /?CND1
FSET? PRSI,VEHBIT /?CND1
PRINTR "You can't do that."
?CND1: FSET? PRSI,OPENBIT /?CCL9
PRINTI "The "
PRINTD PRSI
PRINTR " isn't open."
?CCL9: EQUAL? PRSI,PRSO \?CCL11
PRINTR "How can you do that?"
?CCL11: IN? PRSO,PRSI \?CCL13
PRINTI "The "
PRINTD PRSO
PRINTI " is already in the "
PRINTD PRSI
PRINTR "."
?CCL13: IN? PRSI,PRSO \?CCL15
PRINTI "How can you put the "
PRINTD PRSO
PRINTI " in the "
PRINTD PRSI
PRINTI " when the "
PRINTD PRSI
PRINTI " is already in the "
PRINTD PRSO
PRINTR "?"
?CCL15: CALL WEIGHT,PRSI >?TMP3
CALL WEIGHT,PRSO
ADD ?TMP3,STACK >?TMP2
GETP PRSI,P?SIZE
SUB ?TMP2,STACK >?TMP1
GETP PRSI,P?CAPACITY
GRTR? ?TMP1,STACK \?CCL17
PRINTR "There's no room."
?CCL17: CALL HELD?,PRSO
ZERO? STACK \?CCL19
CALL TRYTAKE
ZERO? STACK /TRUE
?CCL19: CALL SCORE-OBJ,PRSO
MOVE PRSO,PRSI
FSET PRSO,TOUCHBIT
PRINTR "Done."
.FUNCT V-SLIDE
CALL PICK-ONE,YUKS
PRINT STACK
CRLF
RTRUE
.FUNCT PRE-GIVE
CALL HELD?,PRSO
ZERO? STACK \FALSE
CALL NOT-HOLDING
RSTACK
.FUNCT PRE-SGIVE
CALL PERFORM,V?GIVE,PRSI,PRSO
RTRUE
.FUNCT V-GIVE
FSET? PRSI,ACTORBIT /?CCL3
PRINTI "You can't give "
CALL A-AN
PRINTD PRSO
PRINTI " to "
FSET? PRSI,VOWELBIT \?CCL6
PRINTI "an "
JUMP ?CND4
?CCL6: PRINTI "a "
?CND4: PRINTD PRSI
PRINTR "!"
?CCL3: PRINTI "The "
PRINTD PRSI
PRINTR " declines your offer."
.FUNCT V-SGIVE
PRINTR "Foo!"
.FUNCT V-DROP
CALL IDROP
ZERO? STACK /FALSE
PRINTR "Dropped."
.FUNCT V-THROW
CALL IDROP
ZERO? STACK /FALSE
PRINTR "Thrown."
.FUNCT IDROP
CALL HELD?,PRSO
ZERO? STACK \?CCL3
PRINTI "You're not carrying the "
PRINTD PRSO
PRINTC 46
CRLF
RFALSE
?CCL3: FSET? PRSO,WORNBIT \?CCL5
CALL TAKE-IT-OFF
RFALSE
?CCL5: IN? PRSO,WINNER /?CCL7
LOC PRSO
FSET? STACK,OPENBIT /?CCL7
PRINTI "The "
PRINTD PRSO
PRINTI " is closed."
CRLF
RFALSE
?CCL7: MOVE PRSO,HERE
RTRUE
.FUNCT V-OPEN,F,STR
FSET? PRSO,CONTBIT /?CCL3
FSET? PRSO,DOORBIT /?CCL3
PRINTI "You must be very clever to do that to the "
PRINTD PRSO
PRINTR "."
?CCL3: FSET? PRSO,DOORBIT /?CTR6
GETP PRSO,P?CAPACITY
ZERO? STACK /?CCL7
?CTR6: FSET? PRSO,OPENBIT \?CCL12
CALL ALREADY,STR?70
RSTACK
?CCL12: FSET PRSO,OPENBIT
FSET? PRSO,DOORBIT \?CCL15
PRINTI "The "
PRINTD PRSO
PRINTR " is now open."
?CCL15: FIRST? PRSO \?CTR16
FSET? PRSO,TRANSBIT \?CCL17
?CTR16: PRINTR "Opened."
?CCL17: FIRST? PRSO >F \?CCL21
NEXT? F /?CCL21
GETP F,P?FDESC >STR
ZERO? STR /?CCL21
PRINTI "The "
PRINTD PRSO
PRINTI " opens."
CRLF
PRINT STR
CRLF
RTRUE
?CCL21: PRINTI "Opening the "
PRINTD PRSO
PRINTI " reveals "
CALL PRINT-CONTENTS,PRSO
PRINTR "."
?CCL7: PRINTI "The "
PRINTD PRSO
PRINTR " cannot be opened."
.FUNCT V-OPEN-WITH
EQUAL? PRSI,HANDS \?CCL3
CALL PERFORM,V?OPEN,PRSO
RTRUE
?CCL3: PRINTR "That doesn't work."
.FUNCT PRINT-CONTENTS,OBJ,F,N,1ST?=1,IT?=0,TWO?=0
FIRST? OBJ >F \FALSE
?PRG4: NEXT? F >N /?BOGUS6
?BOGUS6: ZERO? 1ST? /?CCL9
SET '1ST?,FALSE-VALUE
JUMP ?CND7
?CCL9: PRINTI ", "
ZERO? N \?CND7
PRINTI "and "
?CND7: PRINTI "a "
PRINTD F
ZERO? IT? \?CCL14
ZERO? TWO? \?CCL14
SET 'IT?,F
JUMP ?CND12
?CCL14: SET 'TWO?,TRUE-VALUE
SET 'IT?,FALSE-VALUE
?CND12: SET 'F,N
ZERO? F \?PRG4
ZERO? IT? /TRUE
ZERO? TWO? \TRUE
CALL THIS-IS-IT,IT?
RTRUE
.FUNCT V-CLOSE
FSET? PRSO,CONTBIT /?CCL3
FSET? PRSO,DOORBIT /?CCL3
PRINTI "You can't do that to "
CALL A-AN
PRINTD PRSO
PRINTR "."
?CCL3: FSET? PRSO,SURFACEBIT /?CCL7
GETP PRSO,P?CAPACITY
ZERO? STACK \?CTR6
FSET? PRSO,DOORBIT \?CCL7
?CTR6: FSET? PRSO,OPENBIT \?CCL14
FCLEAR PRSO,OPENBIT
PRINTR "Closed."
?CCL14: CALL ALREADY,STR?71
RSTACK
?CCL7: PRINTR "You cannot close that."
.FUNCT CCOUNT,OBJ,CNT=0,X
FIRST? OBJ >X /?PRG3
RETURN CNT
?PRG3: INC 'CNT
NEXT? X >X /?PRG3
RETURN CNT
.FUNCT WEIGHT,OBJ,CONT,WT=0
FIRST? OBJ >CONT \?CND1
?PRG3: FSET? CONT,WORNBIT /?CND5
CALL WEIGHT,CONT
ADD WT,STACK >WT
?CND5: NEXT? CONT >CONT /?PRG3
?CND1: GETP OBJ,P?SIZE
ADD WT,STACK
RSTACK
.FUNCT V-SCRIPT
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
PRINTI "Floyd hops around excitedly. ""Oh boy! I've never seen my name in print before!"""
CRLF
CRLF
?CND1: GET 0,8
BOR STACK,1
PUT 0,8,STACK
PRINTI "Here begins"
PRINT COPR-NOTICE
CRLF
RTRUE
.FUNCT V-UNSCRIPT
IN? FLOYD,HERE \?CND1
FSET? FLOYD,RLANDBIT \?CND1
SET 'FLOYD-SPOKE,TRUE-VALUE
PRINTI """Can I have a copy of the printout?"" asks Floyd, looking up at you."
CRLF
CRLF
?CND1: PRINTI "Here ends"
PRINT COPR-NOTICE
CRLF
GET 0,8
BAND STACK,-2
PUT 0,8,STACK
RTRUE
.FUNCT PRE-MOVE
CALL HELD?,PRSO
ZERO? STACK /FALSE
PRINTR "Why juggle objects?"
.FUNCT V-MOVE
FSET? PRSO,TAKEBIT \?CCL3
PRINTI "Moving the "
PRINTD PRSO
PRINTR " reveals nothing."
?CCL3: PRINTI "You can't move the "
PRINTD PRSO
PRINTR "."
.FUNCT V-LAMP-ON
FSET? PRSO,LIGHTBIT \?CCL3
FSET? PRSO,ONBIT \?CCL6
CALL ALREADY,STR?73
RTRUE
?CCL6: FSET PRSO,ONBIT
PRINTI "The "
PRINTD PRSO
PRINTR " is now on."
?CCL3: PRINTR "You can't turn that on."
.FUNCT V-LAMP-OFF
FSET? PRSO,LIGHTBIT \?CCL3
FSET? PRSO,ONBIT /?CCL6
CALL ALREADY,STR?74
RTRUE
?CCL6: FCLEAR PRSO,ONBIT
PRINTI "The "
PRINTD PRSO
PRINTR " is now off."