-
Notifications
You must be signed in to change notification settings - Fork 23
/
verbs.zil
1399 lines (1207 loc) · 36.6 KB
/
verbs.zil
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
"VERBS for
Interlogic SF Game
(c) Copyright 1981,1982 Infocom, Inc. All Rights Reserved
"
"SUBTITLE DESCRIBE THE UNIVERSE"
"SUBTITLE SETTINGS FOR VARIOUS LEVELS OF DESCRIPTION"
<GLOBAL VERBOSE <>>
<GLOBAL SUPER-BRIEF <>>
<GDECL (VERBOSE SUPER-BRIEF) <OR ATOM FALSE>>
<ROUTINE V-VERBOSE ()
<SETG VERBOSE T>
<SETG SUPER-BRIEF <>>
<TELL "Maximum verbosity." CR>>
<ROUTINE V-BRIEF ()
<SETG VERBOSE <>>
<SETG SUPER-BRIEF <>>
<TELL "Brief descriptions." CR>>
<ROUTINE V-SUPER-BRIEF ()
<SETG SUPER-BRIEF T>
<TELL "Super-brief descriptions." CR>>
\
"SUBTITLE DESCRIBERS"
<ROUTINE V-LOOK ()
<COND (<DESCRIBE-ROOM T>
<DESCRIBE-OBJECTS T>)>>
<ROUTINE V-FIRST-LOOK ()
<COND (<DESCRIBE-ROOM>
<COND (<NOT ,SUPER-BRIEF> <DESCRIBE-OBJECTS>)>)>>
<ROUTINE V-EXAMINE ()
<COND (<GETP ,PRSO ,P?TEXT>
<TELL <GETP ,PRSO ,P?TEXT> CR>)
(<OR <FSET? ,PRSO ,CONTBIT>
<FSET? ,PRSO ,DOORBIT>>
<V-LOOK-INSIDE>)
(ELSE
<TELL "I see nothing special about the "
D ,PRSO "." CR>)>>
<GLOBAL LIT <>>
<ROUTINE DESCRIBE-ROOM ("OPTIONAL" (LOOK? <>) "AUX" V? STR AV)
<SET V? <OR .LOOK? ,VERBOSE>>
<COND (<NOT ,LIT>
<TELL
"It is pitch black. You are likely to be eaten by a grue." CR>
<RETURN <>>)>
<COND (<NOT <FSET? ,HERE ,TOUCHBIT>>
<FSET ,HERE ,TOUCHBIT>
<SET V? T>)>
<COND (<IN? ,HERE ,ROOMS> <TELL D ,HERE CR>)>
<COND (<OR .LOOK? <NOT ,SUPER-BRIEF>>
<SET AV <LOC ,WINNER>>
<COND (<FSET? .AV ,VEHBIT>
<TELL "(You are in the " D .AV ".)" CR>)>
<COND (<AND .V? <APPLY <GETP ,HERE ,P?ACTION> ,M-LOOK>>
<RTRUE>)
(<AND .V? <SET STR <GETP ,HERE ,P?LDESC>>>
<TELL .STR CR>)
(T <APPLY <GETP ,HERE ,P?ACTION> ,M-FLASH>)>
<COND (<AND <NOT <==? ,HERE .AV>> <FSET .AV ,VEHBIT>>
<APPLY <GETP .AV ,P?ACTION> ,M-LOOK>)>)>
<COND (<AND <NOT <FSET? ,HERE ,ONBIT>> ,ALWAYS-LIT>
<TELL
"The room is lit by an emergency lighting system." CR>)>
T>
<ROUTINE DESCRIBE-OBJECTS ("OPTIONAL" (V? <>))
<COND (,LIT
<COND (<FIRST? ,HERE>
<PRINT-CONT ,HERE <SET V? <OR .V? ,VERBOSE>> -1>)>)
(ELSE
<TELL "I can't see anything in the dark." CR>)>>
"DESCRIBE-OBJECT -- takes object and flag. if flag is true will print a
long description (fdesc or ldesc), otherwise will print short."
<ROUTINE DESCRIBE-OBJECT (OBJ V? LEVEL "AUX" (STR <>) AV)
<COND (<AND <0? .LEVEL>
<APPLY <GETP .OBJ ,P?DESCFCN> ,M-OBJDESC>>
<RTRUE>)
(<AND <0? .LEVEL>
<OR <AND <NOT <FSET? .OBJ ,TOUCHBIT>>
<SET STR <GETP .OBJ ,P?FDESC>>>
<SET STR <GETP .OBJ ,P?LDESC>>>>
<TELL .STR>)
(<0? .LEVEL>
<TELL "There is a " D .OBJ " here.">)
(ELSE
<TELL <GET ,INDENTS .LEVEL>>
<TELL "A " D .OBJ>
<COND (<FSET? .OBJ ,WEARBIT> <TELL " (being worn)">)
(<==? .OBJ ,SAFETY-LINE>
<COND (<AND ,THIS-END ,THAT-END>
<TELL " (connecting the suit and a hook)">)
(,THIS-END <TELL " (tied to the suit)">)
(,THAT-END <TELL " (tied to a hook)">)>)>)>
<COND (<AND <0? .LEVEL>
<SET AV <LOC ,WINNER>>
<FSET? .AV ,VEHBIT>>
<TELL " (outside the " D .AV ")">)>
<CRLF>
<COND (<AND <SEE-INSIDE? .OBJ> <FIRST? .OBJ>>
<PRINT-CONT .OBJ .V? .LEVEL>)>>
<ROUTINE PRINT-CONT (OBJ "OPTIONAL" (V? <>) (LEVEL 0)
"AUX" Y 1ST? AV STR (PV? <>) (INV? <>))
#DECL ((OBJ) OBJECT (LEVEL) FIX)
<COND (<NOT <SET Y <FIRST? .OBJ>>> <RTRUE>)>
<COND (<AND <SET AV <LOC ,WINNER>> <FSET? .AV ,VEHBIT>>
T)
(ELSE <SET AV <>>)>
<SET 1ST? T>
<COND (<EQUAL? ,WINNER .OBJ <LOC .OBJ>>
<SET INV? T>)
(ELSE
<REPEAT ()
<COND (<NOT .Y> <RETURN <NOT .1ST?>>)
(<==? .Y .AV> <SET PV? T>)
(<==? .Y ,WINNER>)
(<AND <NOT <FSET? .Y ,INVISIBLE>>
<NOT <FSET? .Y ,TOUCHBIT>>
<SET STR <GETP .Y ,P?FDESC>>>
<COND (<NOT <FSET? .Y ,NDESCBIT>>
<TELL .STR CR>)>
<COND (<AND <SEE-INSIDE? .Y>
<NOT <GETP <LOC .Y> ,P?DESCFCN>>
<FIRST? .Y>>
<PRINT-CONT .Y .V? 0>)>)>
<SET Y <NEXT? .Y>>>)>
<SET Y <FIRST? .OBJ>>
<REPEAT ()
<COND (<NOT .Y>
<COND (<AND .PV? .AV <FIRST? .AV>>
<PRINT-CONT .AV .V? .LEVEL>)>
<RETURN <NOT .1ST?>>)
(<EQUAL? .Y .AV ,ADVENTURER>)
(<AND <NOT <FSET? .Y ,INVISIBLE>>
<OR .INV?
<FSET? .Y ,TOUCHBIT>
<NOT <GETP .Y ,P?FDESC>>>>
<COND (<NOT <FSET? .Y ,NDESCBIT>>
<COND (.1ST?
<COND (<FIRSTER .OBJ .LEVEL>
<COND (<L? .LEVEL 0>
<SET LEVEL 0>)>)>
<SET LEVEL <+ 1 .LEVEL>>
<SET 1ST? <>>)>
<DESCRIBE-OBJECT .Y .V? .LEVEL>)
(<AND <FIRST? .Y> <SEE-INSIDE? .Y>>
<PRINT-CONT .Y .V? .LEVEL>)>)>
<SET Y <NEXT? .Y>>>>
<ROUTINE FIRSTER (OBJ LEVEL)
<COND (<==? .OBJ ,WINNER>
<TELL "You are carrying:" CR>)
(<NOT <IN? .OBJ ,ROOMS>>
<COND (<G? .LEVEL 0>
<TELL <GET ,INDENTS .LEVEL>>)>
<COND (<==? .OBJ ,TRASH-BIN>
<TELL
"Among the trash near the top of the bin you see:" CR>)
(<FSET? .OBJ ,SURFACEBIT>
<TELL
"Sitting on the " D .OBJ " is:" CR>)
(ELSE
<TELL
"The " D .OBJ " contains:" CR>)>)
(<FSET? .OBJ ,RMUNGBIT>
<TELL
"Floating nearby is: " CR>)>>
\
"SUBTITLE SCORING"
<GLOBAL MOVES 0>
<GLOBAL SCORE 0>
<GLOBAL WON-FLAG <>>
<ROUTINE SCORE-UPD (NUM)
#DECL ((NUM) FIX)
<SETG SCORE <+ ,SCORE .NUM>>
T>
<ROUTINE SCORE-OBJ (OBJ)
#DECL ((OBJ) OBJECT (TEMP) FIX)
<COND (<G? <GETP .OBJ ,P?VALUE> 0>
<FSET .OBJ ,TOUCHBIT>
<SCORE-UPD <GETP .OBJ ,P?VALUE>>
<PUTP .OBJ ,P?VALUE 0>)>>
<GLOBAL SCORE-MAX 400>
<ROUTINE V-SCORE ("OPTIONAL" (ASK? T))
#DECL ((ASK?) <OR ATOM FALSE>)
<TELL "Your score ">
<COND (.ASK? <TELL "would be ">) (ELSE <TELL "is ">)>
<TELL N ,SCORE>
<TELL " (total of ">
<TELL N ,SCORE-MAX>
<TELL " points), in ">
<TELL N ,MOVES>
<COND (<1? ,MOVES> <TELL " move.">) (ELSE <TELL " moves.">)>
<CRLF>
<TELL "This score gives you the rank of ">
<COND (,WON-FLAG <TELL "Galactic Overlord">)
(<G? ,SCORE 360> <TELL "Cluster Admiral">)
(<G? ,SCORE 320> <TELL "System Captain">)
(<G? ,SCORE 240> <TELL "Planetary Commodore">)
(<G? ,SCORE 160> <TELL "Lieutenant">)
(<G? ,SCORE 80> <TELL "Ensign">)
(<G? ,SCORE 40> <TELL "Space Cadet">)
(T <TELL "Beginner">)>
<TELL "." CR>
,SCORE>
<ROUTINE FINISH ()
<V-SCORE>
<QUIT>>
<ROUTINE V-QUIT ("OPTIONAL" (ASK? T) "AUX" SCOR)
#DECL ((ASK?) <OR ATOM <PRIMTYPE LIST>> (SCOR) FIX)
<V-SCORE>
<COND (<OR <AND .ASK?
<TELL
"Do you wish to leave the game? (Y is affirmative): ">
<YES?>>
<NOT .ASK?>>
<QUIT>)
(ELSE <TELL "Ok." CR>)>>
<ROUTINE YES? ()
<PRINTI ">">
<READ ,P-INBUF ,P-LEXV>
<COND (<EQUAL? <GET ,P-LEXV 1> ,W?YES ,W?Y>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE V-VERSION ("AUX" (CNT 17))
<TELL
"STARCROSS|
Infocom interactive fiction - a science-fiction story|
Copyright (c) 1982 by Infocom, Inc. All rights reserved.|
STARCROSS is a registered trademark of Infocom, Inc.|
Release ">
<PRINTN <BAND <GET 0 1> *3777*>>
<TELL " / Serial number ">
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> 23>
<RETURN>)
(T
<PRINTC <GETB 0 .CNT>>)>>
<CRLF>>
;<ROUTINE V-AGAIN ("AUX" OBJ)
<COND (<==? ,L-PRSA ,V?WALK>
<DO-WALK ,L-PRSO>)
(T
<SET OBJ
<COND (<AND ,L-PRSO <NOT <LOC ,L-PRSO>>>
,L-PRSO)
(<AND ,L-PRSI <NOT <LOC ,L-PRSI>>>
,L-PRSI)>>
<COND (.OBJ
<TELL "I can't see the " D .OBJ " anymore." CR>
<RFATAL>)
(T
<PERFORM ,L-PRSA ,L-PRSO ,L-PRSI>)>)>>
;"Hopefully improved AGAIN"
<ROUTINE V-AGAIN ("AUX" CONT LEXV INBUF V)
<SET LEXV <TABLE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>>
<SET INBUF <TABLE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0>>
<COND (<0? ,P-LEN> <SET CONT <>>)
(T <SET CONT ,P-CONT>)>
<TABLE-COPY ,P-LEXV .LEXV 60 ;120>
<TABLE-COPY ,P-INBUF .INBUF 50 ;100>
<TABLE-COPY ,A-LEXV ,P-LEXV 60 ;120>
<TABLE-COPY ,A-INBUF ,P-INBUF 50 ;100>
<SETG P-CONT ,A-PTR>
<SETG NOT-AGAIN <>>
<SET V <MAIN-LOOP>>
<SETG NOT-AGAIN 1>
<SETG PRSA ,V?AGAIN>
<COND (<==? .V ,M-FATAL>
<SETG P-CONT <>>)
(T <SETG P-CONT .CONT>)>
<TABLE-COPY .LEXV ,P-LEXV 60 ;120>
<TABLE-COPY .INBUF ,P-INBUF 50 ;100>
<RETURN .V>>
\
"SUBTITLE DEATH AND TRANSFIGURATION"
<GLOBAL DEATHS 0>
<GLOBAL LUCKY 1>
<ROUTINE JIGS-UP (DESC "OPTIONAL" (PLAYER? <>))
<TELL .DESC CR>
<PROG ()
<SCORE-UPD -10>
<TELL "
| **** You have died ****
|
|">
<SETG DEATHS <+ ,DEATHS 1>>
<COND (<==? ,DEATHS 4>
<COND (,DOCKED?
<TELL
"The expressionless voice seems despairing. \"Four failures. They would not
be pleased. Such promising candidates, too. If only...\"
The voice trails off into background hiss. Nothing more happens, ever." CR>)
(ELSE
<TELL
"This time, you aren't given another chance." CR>)>
<FINISH>)
(<G? ,POISON-COUNT 3>
<TELL
"An expressionless voice seems to be trying to express outrage, but not
successfully. \"The candidate has not made the necessary repairs in time.
This is a disaster. All are now dead, and repairs are
not possible. They would not approve. This area will be marked, that is
certain.\" Everything fades to black, and silence reigns." CR>
<FINISH>)>
<RANDOMIZE-OBJECTS>
<COND (<FSET? ,RED-THREE ,TOUCHBIT>
<MOVE ,WINNER ,RED-THREE>)
(ELSE
<SETG IN-ARTIFACT? <>>
<FCLEAR ,AIRLOCK-OUTER ,OPENBIT>
<FCLEAR ,AIRLOCK-INNER ,OPENBIT>
<MOVE ,WINNER ,SPACESHIP-BRIDGE>
<MOVE ,SPACESUIT ,SPACESHIP-STORES>)>
<COND (,DOCKED?
<TELL
"You hear, if that is the right word, an expressionless voice. It seems
to be inside your head. \"This is not promising. The candidate does not
deserve another chance, but the instructions are explicit. There are not
even any more docking ports. They would be disappointed if they knew.\"
You wake to a brief glimpse of a pallet (on which you are lying) surrounded
by metallic threads. The whole apparatus begins to vibrate and you feel very
dizzy. As you lose consciousness, you realize that you can't see the rest of
your body. There is a feeling of dislocation, and then..." CR>)
(ELSE
<TELL
"You wake to find yourself alive, on board the \"Starcross.\" It appears
you have been given another chance." CR>)>
<SETG LIT T>
<FCLEAR ,SPACESUIT ,WEARBIT>
<SETG SUIT-ON? <>>
<SETG THIS-END <>>
<SETG THAT-END <>>
<SETG P-CONT <>>
<SETG COUNTDOWN <>>
<SETG R-VALUE 0>
<SETG PHI-VALUE 0>
<SETG THETA-VALUE 0>
<SETG LOST <>>
<SETG GIVE-UP <>>
<KILL-INTERRUPTS>
<RFATAL>>>
<ROUTINE RANDOMIZE-OBJECTS ("AUX" (R <>) F N L)
<SET N <FIRST? ,WINNER>>
<REPEAT ()
<SET F .N>
<COND (<NOT .F> <RETURN>)>
<SET N <NEXT? .F>>
<COND (<FSET? ,RED-THREE ,TOUCHBIT>
<COND (<FSET? .F ,KEYBIT> <MOVE .F ,HERE>)
(ELSE <MOVE .F ,RED-LOCK>)>)
(ELSE
<COND (<FSET? .F ,KEYBIT> <MOVE .F ,HERE>)
(ELSE
<MOVE .F ,SPACESHIP-STORES>)>)>>>
<ROUTINE KILL-INTERRUPTS ()
<DISABLE <INT I-BURN>>
<RTRUE>>
<ROUTINE V-RESTORE ()
<COND (<RESTORE>
<TELL "Ok." CR>
<V-FIRST-LOOK>)
(T
<TELL "Failed." CR>)>>
<ROUTINE V-SAVE ()
<COND (<SAVE>
<TELL "Ok." CR>)
(T
<TELL "Failed." CR>)>>
<ROUTINE V-RESTART ()
<V-SCORE T>
<TELL "Do you wish to restart? (Y is affirmative): ">
<COND (<YES?>
<TELL "Restarting." CR>
<RESTART>
<TELL "Failed." CR>)>>
<CONSTANT REXIT 0>
<CONSTANT UEXIT 1>
<CONSTANT NEXIT 2>
<CONSTANT FEXIT 3>
<CONSTANT CEXIT 4>
<CONSTANT DEXIT 5>
<CONSTANT NEXITSTR 0>
<CONSTANT FEXITFCN 0>
<CONSTANT CEXITFLAG 1>
<CONSTANT CEXITSTR 1>
<CONSTANT DEXITOBJ 1>
<CONSTANT DEXITSTR 1>
<ROUTINE V-WALK-AROUND ()
<TELL "Use directions for movement here." CR>>
<ROUTINE V-LAUNCH ()
<TELL "You can't launch that!" CR>>
<ROUTINE GO-NEXT (TBL "AUX" VAL)
#DECL ((TBL) TABLE (VAL) ANY)
<COND (<SET VAL <LKP ,HERE .TBL>>
<GOTO .VAL>)>>
<ROUTINE LKP (ITM TBL "AUX" (CNT 0) (LEN <GET .TBL 0>))
#DECL ((ITM) ANY (TBL) TABLE (CNT LEN) FIX)
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .LEN>
<RFALSE>)
(<==? <GET .TBL .CNT> .ITM>
<COND (<==? .CNT .LEN> <RFALSE>)
(T
<RETURN <GET .TBL <+ .CNT 1>>>)>)>>>
<ROUTINE V-WALK ("AUX" PT PTS STR OBJ RM)
<COND (<NOT ,P-WALK-DIR>
<PERFORM ,V?WALK-TO ,PRSO>
<RTRUE>)
(<SET PT <GETPT ,HERE ,PRSO>>
<COND (<==? <SET PTS <PTSIZE .PT>> ,UEXIT>
<GOTO <GETB .PT ,REXIT>>)
(<==? .PTS ,NEXIT>
<TELL <GET .PT ,NEXITSTR> CR>
<RFATAL>)
(<==? .PTS ,FEXIT>
<COND (<SET RM <APPLY <GET .PT ,FEXITFCN>>>
<GOTO .RM>)
(T
<RFATAL>)>)
(<==? .PTS ,CEXIT>
<COND (<VALUE <GETB .PT ,CEXITFLAG>>
<GOTO <GETB .PT ,REXIT>>)
(<SET STR <GET .PT ,CEXITSTR>>
<TELL .STR CR>
<RFATAL>)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>)
(<==? .PTS ,DEXIT>
<COND (<FSET? <SET OBJ <GETB .PT ,DEXITOBJ>> ,OPENBIT>
<GOTO <GETB .PT ,REXIT>>)
(<SET STR <GET .PT ,DEXITSTR>>
<TELL .STR CR>
<RFATAL>)
(T
<TELL "The " D .OBJ " is closed." CR>
<THIS-IS-IT .OBJ>
<RFATAL>)>)>)
(<AND <NOT ,LIT> <PROB 75>>
<JIGS-UP
"Oh, no! You have walked into the slavering fangs of a lurking grue!">)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>>
<ROUTINE THIS-IS-IT (OBJ)
<SETG P-IT-OBJECT .OBJ>
<SETG P-IT-LOC ,HERE>>
<ROUTINE V-INVENTORY ()
<COND (<FIRST? ,WINNER> <PRINT-CONT ,WINNER>)
(T <TELL "You are empty handed." CR>)>>
<GLOBAL INDENTS
<TABLE ""
" "
" "
" "
" "
" ">>
\
<ROUTINE PRE-TAKE ()
<COND (<IN? ,PRSO ,WINNER> <TELL "You already have it." CR>)
(<AND <FSET? <LOC ,PRSO> ,CONTBIT>
<NOT <FSET? <LOC ,PRSO> ,OPENBIT>>>
<TELL "I can't reach that." CR>
<RTRUE>)
(<AND ,PRSI <NOT <==? ,PRSO ,SPEAR>>>
<COND (<NOT <==? ,PRSI <LOC ,PRSO>>>
<TELL "It's not in that!" CR>)
(T
<SETG PRSI <>>
<RFALSE>)>)
(<==? ,PRSO <LOC ,WINNER>> <TELL "You are in it, loser!" CR>)>>
<ROUTINE V-TAKE ()
<COND (<==? <ITAKE> T>
<TELL "Taken." CR>)>>
<GLOBAL FUMBLE-NUMBER 7>
<GLOBAL FUMBLE-PROB 8>
<ROUTINE TRYTAKE ()
<COND (<IN? ,PRSO ,WINNER> <RTRUE>)
(<AND <FSET? ,PRSO ,TRYTAKEBIT>
<GETP ,PRSO ,P?ACTION>>
<PERFORM ,V?TAKE ,PRSO>
<IN? ,PRSO ,WINNER>)
(ELSE <ITAKE>)>>
<ROUTINE ITAKE ("OPTIONAL" (VB T) "AUX" CNT OBJ WLOC)
#DECL ((VB) <OR ATOM FALSE> (CNT) FIX (OBJ) OBJECT)
<COND (<NOT <FSET? ,PRSO ,TAKEBIT>>
<COND (.VB
<TELL <PICK-ONE ,YUKS> CR>)>
<RFALSE>)
(<AND <NOT <IN? <LOC ,PRSO> ,WINNER>>
<G? <+ <WEIGHT ,PRSO> <WEIGHT ,WINNER>> ,LOAD-ALLOWED>>
<COND (.VB
<TELL "Your load is too heavy." CR>)>
<RFATAL>)
(<AND <G? <SET CNT <CCOUNT ,WINNER>> ,FUMBLE-NUMBER>
<PROB <* .CNT ,FUMBLE-PROB>>>
<SET OBJ <FIRST? ,WINNER>>
<SET OBJ <NEXT? .OBJ>>
;"This must go! Chomping compiler strikes again"
<TELL
"Oh, no. The " D .OBJ " slips from your arms while taking the "
D ,PRSO " and both tumble to the floor." CR>
<SET WLOC <LOC ,WINNER>>
<COND (<==? ,PRSO ,UNDER-GLOBE>
<SETG UNDER-GLOBE <>>
<FCLEAR ,PRSO ,NDESCBIT>)>
<COND (<OR <FSET? .WLOC ,RMUNGBIT>
<EQUAL? .WLOC
,UP-A-TREE
,TREETOP-ROOM
,DRIVE-BUBBLE-ENTRANCE>
<EQUAL? .WLOC
,CONTROL-BUBBLE-ENTRANCE>>
<PERFORM ,V?DROP .OBJ>
<MOVE ,PRSO ,WINNER>
<PERFORM ,V?DROP ,PRSO>)
(ELSE
<MOVE .OBJ .WLOC>
<MOVE ,PRSO .WLOC>)>
<RFATAL>)
(T
<MOVE ,PRSO ,WINNER>
<FCLEAR ,PRSO ,NDESCBIT>
<SCORE-OBJ ,PRSO>
<FSET ,PRSO ,TOUCHBIT>
<RTRUE>)>>
<GLOBAL YUKS
<LTABLE
"A valiant attempt."
"You can't be serious."
"Not bloody likely."
"An interesting idea..."
"What a concept!">>
<ROUTINE PRE-PUT ()
<COND (<OR <IN? ,PRSO ,GLOBAL-OBJECTS>
<NOT <FSET? ,PRSO ,TAKEBIT>>>
<TELL "Nice try." CR>)>>
<ROUTINE V-PUT ()
<COND (<OR <FSET? ,PRSI ,OPENBIT>
<OPENABLE? ,PRSI>
<FSET? ,PRSI ,VEHBIT>>)
(T
<TELL "I can't do that." CR>
<RTRUE>)>
<COND (<NOT <FSET? ,PRSI ,OPENBIT>>
<TELL "The " D ,PRSI " isn't open." CR>)
(<==? ,PRSI ,PRSO>
<TELL "How can you do that?" CR>)
(<IN? ,PRSO ,PRSI>
<TELL "The " D ,PRSO " is already in the " D ,PRSI "." CR>)
(<G? <- <+ <WEIGHT ,PRSI> <WEIGHT ,PRSO>>
<GETP ,PRSI ,P?SIZE>>
<GETP ,PRSI ,P?CAPACITY>>
<TELL "There's no room." CR>)
(<AND <NOT <HELD? ,PRSO>>
<NOT <TRYTAKE>>>
<RTRUE>)
(T
<SCORE-OBJ ,PRSO>
<MOVE ,PRSO ,PRSI>
<FSET ,PRSO ,TOUCHBIT>
<TELL "Done." CR>)>>
<ROUTINE PRE-DROP ()
<COND (<==? ,PRSO <LOC ,WINNER>>
<PERFORM ,V?DISEMBARK ,PRSO>
<RTRUE>)>>
"SZAP => ZAP who WITH what"
<ROUTINE PRE-SZAP ()
<PERFORM ,V?ZAP ,PRSI ,PRSO>
<RTRUE>>
"ZAP => ZAP <weapon> <who>"
<ROUTINE PRE-ZAP ()
<COND (,PRSI <RFALSE>)
(<FSET? ,PRSO ,WEAPONBIT> <RFALSE>)
(<IN? ,ZAP-GUN ,WINNER>
<PERFORM ,V?ZAP ,ZAP-GUN ,PRSO>
<RTRUE>)
(ELSE <TELL
"You have nothing to shoot the " D ,PRSO " with." CR>)>>
<ROUTINE DONT-HAVE (OBJ)
<TELL "You don't have the " D .OBJ "." CR>>
<ROUTINE V-ZAP ()
<COND (<NOT <IN? ,PRSO ,WINNER>>
<DONT-HAVE ,PRSO>)
(<NOT <FSET? ,PRSO ,WEAPONBIT>>
<TELL "You can't use a " D ,PRSO " as a ray gun!" CR>)
(<NOT ,PRSI> <TELL "At what?" CR>)
(ELSE <TELL "Nothing happens." CR>)>>
<ROUTINE V-SZAP ()
<TELL "ZAPPP!!" CR>>
<ROUTINE PRE-GIVE ()
<COND (<NOT <HELD? ,PRSO>>
<TELL
"That's easy for you to say since you don't even have it." CR>)>>
<ROUTINE PRE-SGIVE ()
<PERFORM ,V?GIVE ,PRSI ,PRSO>
<RTRUE>>
<ROUTINE V-GIVE ()
<COND (<NOT <FSET? ,PRSI ,VICBIT>>
<TELL "You can't give a " D ,PRSO " to a " D ,PRSI "!" CR>)
(<IDROP> <TELL "Given." CR>)>>
<ROUTINE V-SGIVE ()
<TELL "FOOOO!!" CR>>
<ROUTINE V-DROP () <COND (<IDROP> <TELL "Dropped." CR>)>>
<ROUTINE V-THROW () <COND (<IDROP> <TELL "Thrown." CR>)>>
<ROUTINE IDROP ()
<COND (<EQUAL? <LOC ,PRSO> ,GLOBAL-OBJECTS ,LOCAL-GLOBALS>
<TELL "You can't throw that." CR>
<RFALSE>)
(<NOT <HELD? ,PRSO>>
<TELL "You're not carrying the " D ,PRSO "." CR>
<RFALSE>)
(<AND <NOT <IN? ,PRSO ,WINNER>>
<NOT <FSET? <LOC ,PRSO> ,OPENBIT>>>
<TELL "The " D ,PRSO " is closed." CR>
<RFALSE>)
(T <MOVE ,PRSO <LOC ,WINNER>> <RTRUE>)>>
\
<ROUTINE ALREADY (ON-OFF "OPTIONAL" (OBJ <>))
<COND (.OBJ
<TELL "The " D .OBJ " is ">)
(ELSE
<TELL "It's ">)>
<TELL "already " .ON-OFF "." CR>>
<ROUTINE V-OPEN ("AUX" F STR)
<COND (<NOT <FSET? ,PRSO ,CONTBIT>>
<TELL
"You must be very clever to do that to the " D ,PRSO "." CR>)
(<OR <FSET? ,PRSO ,DOORBIT>
<NOT <==? <GETP ,PRSO ,P?CAPACITY> 0>>>
<COND (<FSET? ,PRSO ,OPENBIT> <ALREADY "open">)
(T
<FSET ,PRSO ,OPENBIT>
<COND (<FSET? ,PRSO ,DOORBIT>
<TELL "The " D ,PRSO " is now open." CR>)
(<OR <NOT <FIRST? ,PRSO>> <FSET? ,PRSO ,TRANSBIT>>
<TELL "Opened." CR>)
(<AND <SET F <FIRST? ,PRSO>>
<NOT <NEXT? .F>>
<SET STR <GETP .F ,P?FDESC>>>
<TELL "The " D ,PRSO " opens." CR>
<TELL .STR CR>)
(T
<TELL "Opening the " D ,PRSO " reveals ">
<PRINT-CONTENTS ,PRSO>
<TELL "." CR>)>)>)
(T <TELL "The " D ,PRSO " cannot be opened." CR>)>>
<ROUTINE PRINT-CONTENTS (OBJ "AUX" F N (1ST? T))
#DECL ((OBJ) OBJECT (F N) <OR FALSE OBJECT>)
<COND (<SET F <FIRST? .OBJ>>
<REPEAT ()
<SET N <NEXT? .F>>
<COND (.1ST? <SET 1ST? <>>)
(ELSE
<TELL ", ">
<COND (<NOT .N> <TELL "and ">)>)>
<TELL "a " D .F>
<SET F .N>
<COND (<NOT .F> <RETURN>)>>)>>
<ROUTINE V-CLOSE ()
<COND (<NOT <FSET? ,PRSO ,CONTBIT>>
<TELL "You must tell me how to do that to a " D ,PRSO "." CR>)
(<AND <NOT <FSET? ,PRSO ,SURFACEBIT>>
<OR <NOT <==? <GETP ,PRSO ,P?CAPACITY> 0>>
<FSET? ,PRSO ,DOORBIT>>>
<COND (<FSET? ,PRSO ,OPENBIT>
<FCLEAR ,PRSO ,OPENBIT>
<TELL "Closed." CR>)
(T <ALREADY "closed">)>)
(ELSE
<TELL "You cannot close that." CR>)>>
<ROUTINE CCOUNT (OBJ "AUX" (CNT 0) X)
<COND (<SET X <FIRST? .OBJ>>
<REPEAT ()
<SET CNT <+ .CNT 1>>
<COND (<NOT <SET X <NEXT? .X>>>
<RETURN>)>>)>
.CNT>
"WEIGHT: Get sum of SIZEs of supplied object, recursing to the nth level."
<ROUTINE WEIGHT
(OBJ "AUX" CONT (WT 0))
#DECL ((OBJ) OBJECT (CONT) <OR FALSE OBJECT> (WT) FIX)
<COND (<SET CONT <FIRST? .OBJ>>
<REPEAT ()
<SET WT <+ .WT <WEIGHT .CONT>>>
<COND (<NOT <SET CONT <NEXT? .CONT>>> <RETURN>)>>)>
<+ .WT <GETP .OBJ ,P?SIZE>>>
<GLOBAL COPR-NOTICE
" a transcript of interaction with STARCROSS.|
STARCROSS is a registered trademark of Infocom, Inc.|
Copyright (c) 1982 Infocom, Inc. All rights reserved.|">
<ROUTINE V-SCRIPT ()
<PUT 0 8 <BOR <GET 0 8> 1>>
<TELL "Here begins" ,COPR-NOTICE CR>>
<ROUTINE V-UNSCRIPT ()
<TELL "Here ends" ,COPR-NOTICE CR>
<PUT 0 8 <BAND <GET 0 8> -2>>
<RTRUE>>
<ROUTINE PRE-MOVE
()
<COND (<HELD? ,PRSO> <TELL "I don't juggle objects!" CR>)>>
<ROUTINE V-MOVE ()
<COND (<FSET? ,PRSO ,TAKEBIT>
<TELL "Moving the " D ,PRSO " reveals nothing." CR>)
(T <TELL "You can't move the " D ,PRSO "." CR>)>>
<ROUTINE V-LAMP-ON
()
<COND (<FSET? ,PRSO ,LIGHTBIT>
<COND (<FSET? ,PRSO ,ONBIT> <ALREADY "on">)
(ELSE
<FSET ,PRSO ,ONBIT>
<TELL "The " D ,PRSO " is now on." CR>
<COND (<NOT ,LIT>
<SETG LIT <LIT? ,HERE>>
<V-LOOK>)>)>)
(T
<TELL "You can't turn that on." CR>)>
<RTRUE>>
<ROUTINE V-LAMP-OFF
()
<COND (<FSET? ,PRSO ,LIGHTBIT>
<COND (<NOT <FSET? ,PRSO ,ONBIT>>
<ALREADY "off">)
(ELSE
<FCLEAR ,PRSO ,ONBIT>
<COND (,LIT
<SETG LIT <LIT? ,HERE>>)>
<TELL "The " D ,PRSO " is now off." CR>
<COND (<NOT <SETG LIT <LIT? ,HERE>>>
<TELL "It is now pitch black." CR>)>)>)
(ELSE <TELL "You can't turn that off." CR>)>
<RTRUE>>
<ROUTINE V-WAIT ("OPTIONAL" (NUM 3))
#DECL ((NUM) FIX)
<TELL "Time passes..." CR>
<REPEAT ()
<COND (<L? <SET NUM <- .NUM 1>> 0> <RETURN>)
(<CLOCKER> <RETURN>)>
<SETG MOVES <+ ,MOVES 1>>>
<SETG CLOCK-WAIT T>>
<ROUTINE PRE-BOARD ("AUX" AV)
<SET AV <LOC ,WINNER>>
<COND (<FSET? ,PRSO ,VEHBIT>
<COND (<FSET? .AV ,VEHBIT>
<TELL "You are already in it!" CR>)
(T <RFALSE>)>)
(<EQUAL? ,PRSO ,SPACESUIT ,JUNK-SPACESUIT ,MOUSE>
<RFALSE>)
(T
<TELL "I suppose you have a theory on boarding a "
D
,PRSO
"." CR>)>
<RFATAL>>
<ROUTINE V-BOARD ("AUX" AV)
#DECL ((AV) OBJECT)
<TELL "You are now in the " D ,PRSO "." CR>
<MOVE ,WINNER ,PRSO>
<APPLY <GETP ,PRSO ,P?ACTION> ,M-ENTER>
<RTRUE>>
<ROUTINE V-DISEMBARK
()
<COND (<NOT <==? <LOC ,WINNER> ,PRSO>>
<TELL "You're not in that!" CR>
<RFATAL>)
(T
<TELL "You are on your own feet again." CR>
<MOVE ,WINNER ,HERE>)>>
<ROUTINE GOTO (RM "OPTIONAL" (V? T) "AUX" (WLOC <LOC ,WINNER>) OLIT)
#DECL ((RM WLOC) OBJECT)
<SET OLIT ,LIT>
<MOVE ,WINNER .RM>
<SETG MFOLLOW <>> ;"we moved, so can't follow him"
<SETG CHFOLLOW <>> ;"ditto"
<SETG HERE .RM>
<SETG LIT <LIT? ,HERE>>
<COND (<AND <NOT .OLIT>
<NOT ,LIT>
<PROB 75>>
<JIGS-UP
"Oh, no! A lurking grue slithered into the room and devoured you!">
<RTRUE>)>
<COND (<==? <APPLY <GETP ,HERE ,P?ACTION> ,M-ENTER> 2>
<RTRUE>)>
<COND (<NOT <==? ,ADVENTURER ,WINNER>>
<TELL "The " D ,WINNER " leaves the room." CR>)
(.V? <V-FIRST-LOOK>)>
<SCORE-OBJ .RM>
<RTRUE>>
<ROUTINE V-DRINK ()
<V-EAT>>
<ROUTINE V-EAT ()
<TELL "I don't think that the "
D
,PRSO
" would agree with you." CR>>
<ROUTINE V-CURSES ()
<COND (,PRSO
<COND (<FSET? ,PRSO ,VILLAIN>
<TELL "Insults won't help you." CR>)
(T
<TELL "What a loony!" CR>)>)
(T
<TELL
"Such language in a high-class establishment like this!" CR>)>>
<ROUTINE V-LISTEN ()
<TELL "The " D ,PRSO " makes no sound." CR>>
<ROUTINE V-FOLLOW ()
<TELL "You're nuts!" CR>>
<ROUTINE V-LEAP ("AUX" TX S)
#DECL ((T) <OR FALSE TABLE>)
<COND (,PRSO
<COND (<IN? ,PRSO ,HERE>
<COND (<FSET? ,PRSO ,VILLAIN>
<TELL "The "
D
,PRSO
" is too big to jump over." CR>)
(T <V-SKIP>)>)
(T <TELL "That would be a good trick." CR>)>)
(<SET TX <GETPT ,HERE ,P?DOWN>>
<SET S <PTSIZE .TX>>
<COND (<OR <==? .S 2> ;NEXIT
<AND <==? .S 4> ;CEXIT
<NOT <VALUE <GETB .TX 1>>>>>
<TELL
"This was not a safe place to try jumping." CR>
<JIGS-UP "You should have looked before you leaped.">)
(T <V-SKIP>)>)
(ELSE <V-SKIP>)>>
<ROUTINE V-SKIP () <TELL <PICK-ONE ,WHEEEEE> CR>>
<ROUTINE V-LEAVE () <DO-WALK ,P?OUT>>
<GLOBAL HS 0>
<ROUTINE V-HELLO ()
<COND (,PRSO
<TELL
"Only schizophrenics say \"Hello\" to a " D ,PRSO "." CR>)
(ELSE <TELL <PICK-ONE ,HELLOS> CR>)>>
<GLOBAL HELLOS
<LTABLE "Hello."
"Nice weather we're having."
"Goodbye.">>
<GLOBAL WHEEEEE
<LTABLE "Have you tried skipping from star to star, too?"
"Are you enjoying yourself?"
"Wheeeeeeeeee!!!!!">>
<ROUTINE PRE-READ ()
;<COND (<NOT ,LIT> <TELL "It is impossible to read in the dark." CR>)
(<AND ,PRSI <NOT <FSET? ,PRSI ,TRANSBIT>>>
<TELL "How does one look through a " D ,PRSI "?" CR>)>
<RFALSE>>
<ROUTINE V-READ ()
<COND (<NOT <FSET? ,PRSO ,READBIT>>
<TELL "How can I read a " D ,PRSO "?" CR>)
(ELSE <TELL <GETP ,PRSO ,P?TEXT> CR>)>>
<ROUTINE V-LOOK-UNDER () <TELL "There is nothing but dust there." CR>>
<ROUTINE V-LOOK-BEHIND () <V-LOOK-UNDER>>
<ROUTINE V-LOOK-INSIDE
()
<COND (<FSET? ,PRSO ,DOORBIT>
<COND (<FSET? ,PRSO ,OPENBIT>
<TELL "The "
D
,PRSO
" is open, but I can't tell what's beyond it.">)
(ELSE <TELL "The " D ,PRSO " is closed.">)>
<CRLF>)
(<FSET? ,PRSO ,CONTBIT>
<COND (<FSET? ,PRSO ,VICBIT>
<TELL "There is nothing special to be seen." CR>)
(<SEE-INSIDE? ,PRSO>
<COND (<AND <FIRST? ,PRSO> <PRINT-CONT ,PRSO>>
<RTRUE>)
(<FSET? ,PRSO ,SURFACEBIT>
<TELL "There is nothing on the " D ,PRSO "." CR>)
(T
<TELL "The " D ,PRSO " is empty." CR>)>)
(ELSE <TELL "The " D ,PRSO " is closed." CR>)>)
(<FSET? ,PRSO ,TRANSBIT>
<TELL "You can see dimly through the " D ,PRSO "." CR>)
(ELSE <TELL "I don't know how to look inside a " D ,PRSO "." CR>)>>
<ROUTINE SEE-INSIDE? (OBJ)
<AND <NOT <FSET? .OBJ ,INVISIBLE>>
<OR <FSET? .OBJ ,TRANSBIT> <FSET? .OBJ ,OPENBIT>>>>
<ROUTINE PRE-TURN