-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathactions.zil
4278 lines (3994 loc) · 138 KB
/
actions.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
"ACTIONS for
Interlogic SF Game
(c) Copyright 1981,1982 Infocom, Inc. All Rights Reserved
"
<GLOBAL ALARM? T>
<ROUTINE BRIDGE-FCN (RARG)
<COND (<==? .RARG ,M-LOOK>
<TELL
"This is the control room of the Starcross. There are exits labelled
(arbitrarily) \"Port,\" \"Starboard,\" and \"Out.\" The latter exit has
a heavy bulkhead which is " <COND (<FSET? ,AIRLOCK-INNER ,OPENBIT>
"open.")
(T "closed.")>>
<CRLF>
<TELL
"Your ship's computer does the routine tasks of navigation and life support.
A control couch is mounted before a control panel and a large viewport. The
ship's registration is affixed nearby." CR>
<TELL
"Your mass detector, essential in the search for black holes, sits to one
side. On the detector are a red button, a blue button, and a small screen
on which something is displayed." CR>)>>
<ROUTINE DETECTOR-FCN ()
<COND (<VERB? EXAMINE READ>
<TELL "The display reads: \"">
<PRINTD ,MASS>
<TELL ".\"" CR>)>>
<GLOBAL MASS <>>
<GLOBAL MASSNUM <>>
<ROUTINE I-ALARM ("AUX" (HEAR? <>))
<COND (,ALARM?
<COND (<NOT ,MASS>
<SETG MASSNUM <RANDOM 8>>
<SETG MASS <GET ,MASSES ,MASSNUM>>)>
<ENABLE <QUEUE I-ALARM 1>>
<COND (<EQUAL? ,HERE ,SPACESHIP-BRIDGE
,SPACESHIP-QUARTERS ,SPACESHIP-STORES>
<SET HEAR? T>)
(<AND <==? ,HERE ,SPACESHIP-AIRLOCK>
<FSET? ,AIRLOCK-INNER ,OPENBIT>>
<SET HEAR? T>)>
<COND (.HEAR?
<TELL
"The alarm bell on the mass detector is ringing stridently." CR>)>
<COND (<==? ,MOVES 15>
<SETG ALARM? <>>
<SETG COMPUTER-ON T>
<COND (.HEAR?
<TELL
"\"If you won't turn it off, I will. I can't take the noise any more.\"" CR>)>)
(<AND .HEAR? <==? ,MOVES 10>>
<SETG COMPUTER-ON T>
<TELL
"An expressionless but nonetheless surly voice issues from the computer:
\"Please turn that alarm off! We'll both have headaches if you don't.\"" CR>)>
<RTRUE>)>>
<ROUTINE ALARM-FCN ()
<COND (<VERB? LISTEN>
<TELL "The alarm is ">
<COND (,ALARM? <TELL "ringing.">)(T <TELL "off.">)>
<CRLF>)
(<NOT <==? ,HERE ,SPACESHIP-BRIDGE>>
<TELL "The alarm is on the bridge, not here." CR>)
(<VERB? EXAMINE>
<TELL "The alarm is ">
<COND (,ALARM? <TELL "ringing.">)(T <TELL "off.">)>
<CRLF>)
(<VERB? LAMP-OFF PUSH>
<COND (,ALARM?
<SETG ALARM? <>>
<TELL
"The alarm goes silent." CR>)
(T
<TELL
"The alarm's already off. Your ears must be ringing." CR>)>)
(<VERB? LAMP-ON>
<TELL
"Only the mass detector can turn the alarm on." CR>)>>
<ROUTINE MASS-FCN ()
<COND (<VERB? SET>
<COND (<KVETCH> <RTRUE>)
(ELSE
<TELL
"The computer must be used to set courses, as navigation is fully
automated." CR>)>)
(<VERB? EXAMINE>
<COND (<HELD? ,CHART>
<TELL
"It's still here on the output." CR>)
(ELSE <TELL "You don't have the output." CR>)>)>>
<ROUTINE BUNK-FCN ("OPTIONAL" (RARG <>))
<COND (<AND <==? .RARG ,M-BEG>
<VERB? WALK>
<IN? ,ADVENTURER ,BUNK>>
<TELL "You must get up first!" CR>)>>
<ROUTINE BUTTON-FCN ()
<COND (<VERB? PUSH>
<COND (<FSET? ,CHART ,TOUCHBIT>
<TELL "Nothing happens." CR>)
(T
<MOVE ,CHART ,HERE>
<FSET ,CHART ,TOUCHBIT>
<TELL
"The mass detector produces some output." CR>)>)>>
<ROUTINE V-R ()
<COND (<==? ,WINNER ,COMPUTER>
<COND (<==? ,PRSO ,INTNUM>
<COND (<OR <0? ,P-NUMBER> <G? ,P-NUMBER 360>>
<NOT-IN-RANGE "R">
<RTRUE>)
(T <OK-TELL ,R-VALUE "R">)>
<SETG R-VALUE ,P-NUMBER>
<COURSE-SET>)
(T <NON-NUMERIC "R">)>)
(ELSE
<EXPLAIN-COORDINATES>)>>
<ROUTINE V-THETA ()
<COND (<==? ,WINNER ,COMPUTER>
<COND (<==? ,PRSO ,INTNUM>
<COND (<OR <0? ,P-NUMBER> <G? ,P-NUMBER 360>>
<NOT-IN-RANGE "theta">
<RTRUE>)
(T <OK-TELL ,THETA-VALUE "Theta">)>
<SETG THETA-VALUE ,P-NUMBER>
<COURSE-SET>)
(T <NON-NUMERIC "theta">)>)
(ELSE <EXPLAIN-COORDINATES>)>>
<ROUTINE V-PHI ()
<COND (<==? ,WINNER ,COMPUTER>
<COND (<==? ,PRSO ,INTNUM>
<COND (<OR <0? ,P-NUMBER> <G? ,P-NUMBER 360>>
<NOT-IN-RANGE "phi">
<RTRUE>)
(T <OK-TELL ,PHI-VALUE "Phi">)>
<SETG PHI-VALUE ,P-NUMBER>
<COURSE-SET>)
(T <NON-NUMERIC "phi">)>)
(ELSE <EXPLAIN-COORDINATES>)>>
<ROUTINE OK-TELL (VAL STR)
<TELL "\"">
<COND (.VAL
<TELL "Changing your mind, eh? ">)>
<TELL .STR " set.">>
<ROUTINE NOT-IN-RANGE (STR)
<TELL
"\"That value for " .STR " is out of range.\"" CR>>
<ROUTINE NON-NUMERIC (STR)
<TELL
"\"You must give me a numerical value for " .STR ".\"" CR>>
<ROUTINE EXPLAIN-COORDINATES ()
<COND (<KVETCH> <RTRUE>)
(ELSE
<TELL
"Set a course by telling the computer the R, theta, and phi values of
your destination." CR>)>>
<ROUTINE KVETCH ()
<SETG COMPUTER-COUNT <+ ,COMPUTER-COUNT 1>>
<COND (<==? ,COMPUTER-COUNT 3>
<SETG COMPUTER-COUNT 0>
<TELL
"Please consult the manual for the proper computer operating procedure." CR>)>>
<GLOBAL R-VALUE <>>
<GLOBAL THETA-VALUE <>>
<GLOBAL PHI-VALUE <>>
<GLOBAL COMPUTER-COUNT 0>
<ROUTINE COURSE-SET ()
<COND (<AND ,R-VALUE ,THETA-VALUE ,PHI-VALUE>
<SETG GOT-INSTRUCTIONS T>
<SETG DESTINATION <>>
<SETG LOST <>>
<TELL
"\" Lights blink furiously for a moment. The computer speaks: ">
<SETG GIVE-UP <FIND-DESTINATION ,KNOWN-LOCS ,KNOWNS>>
<COND (,GIVE-UP
<TELL
"\"Navigational program for " D ,GIVE-UP " is ready. Giving up,
huh? Figures, just when we get a good strike. ">)
(<AND <SETG DESTINATION
<FIND-DESTINATION ,MASS-LOCS ,MASSES>>
<==? ,DESTINATION ,MASS>>
<TELL
"\"Sequence for intercept of mass concentration is programmed and ready. ">)
(ELSE
<SETG LOST T>
<TELL
"\"I know my instruments aren't as good as the mass detector, but I see
nothing at that location. Well, if you say so. ">)>
<TELL "Please confirm new navigational
program. I'm waiting...\"" CR>)
(T <TELL " Waiting for additional values.\"" CR>)>>
<GLOBAL GIVE-UP <>>
<GLOBAL LOST <>>
<GLOBAL DESTINATION <>>
<GLOBAL GOT-INSTRUCTIONS <>>
<GLOBAL COUNTDOWN <>>
<ROUTINE FIND-DESTINATION (X M "AUX" (C 0) (N <GET .X 0>))
<REPEAT ()
<SET C <+ .C 1>>
<COND (<AND <==? <GET .X 1> ,R-VALUE>
<==? <GET .X 2> ,THETA-VALUE>
<==? <GET .X 3> ,PHI-VALUE>>
<RETURN <GET .M .C>>)>
<COND (<==? .C .N> <RETURN <>>)>
<SET X <REST .X 6>>>>
<ROUTINE KNOWN-COURSE (D SET? "AUX" X N (C 0))
<SET X ,KNOWN-LOCS>
<SET N <GET .X 0>>
<REPEAT ()
<SET C <+ .C 1>>
<COND (<==? <GET ,KNOWNS .C> .D>
<COND (.SET?
<SETG R-VALUE <GET .X 1>>
<SETG THETA-VALUE <GET .X 2>>
<SETG PHI-VALUE <GET .X 3>>
<RETURN .D>)
(ELSE <RETURN .X>)>)>
<COND (<==? .C .N> <RETURN <>>)>
<SET X <REST .X 6>>>>
;<ROUTINE V-CHEAT ("AUX" (N <+ 1 <* 3 <- ,MASSNUM 1>>>))
<COND (,MASS
<REPORT-LOCATION ,MASS ,MASS-LOCS .N>)
(ELSE <TELL "Now, now, don't anticipate..." CR>)>>
<ROUTINE REPORT-LOCATION (M ML N)
<TELL "\"Coordinates for " D .M
": R is " N <GET .ML .N>
", theta is " N <GET .ML <+ .N 1>>
", phi is " N <GET .ML <+ .N 2>>
".\""
CR>>
<ROUTINE CONTROLS-FCN ()
<COND (<==? ,HERE ,THRONE-ROOM>
<COND (<VERB? EXAMINE> <AS-ADVERTISED>)
(T <TELL
"The controls look in no way operational." CR>)>)
(<VERB? EXAMINE>
<TELL
"This is a standard control panel for this class of single-passenger mining
ship. Most controls are for emergencies only, as the Starcross is normally
controlled by verbal instructions to the computer.">
<COND (<NOT <IN? ,COMPUTER ,HERE>>
<TELL " This set of controls is non-functional.">)>
<CRLF>
<RTRUE>)
(<VERB? RUB SET LAMP-ON LAMP-OFF PLAY>
<COND (<NOT <IN? ,COMPUTER ,HERE>>
<TELL
"The controls are no longer functional." CR>)
(,COMPUTER-ON
<COND (,GOT-INSTRUCTIONS
<TELL
"As you reach for the controls, the computer blares: \"Warning! Warning!
Course is set! Remember what happened last time you played with the controls
in mid-course...\"" CR>)
(ELSE
<TELL
"The computer's voice intrudes. \"Do you really want to touch the controls
just now? Not to impugn your piloting ability, but shouldn't I execute any
course corrections? I'm very good at it, you know.\"" CR>)>)
(ELSE
<SETG COMPUTER-ON T>
<TELL
"The computer comes on and chides, \"Manual operation when the ship's
computer is functional is not recommended. Ship's controls are not
currently enabled.\"" CR>)>)>>
<ROUTINE BRIDGE-EXITS ()
<COND (<==? ,PRSO ,P?WEST> ,SPACESHIP-QUARTERS)
(<==? ,PRSO ,P?EAST> ,SPACESHIP-STORES)
(<EQUAL? ,PRSO ,P?OUT ,P?SOUTH>
<COND (<FSET? ,AIRLOCK-INNER ,OPENBIT> ,SPACESHIP-AIRLOCK)
(T <ITS-CLOSED ,AIRLOCK-INNER>)>)>>
<ROUTINE OPEN-CLOSE (OBJ STROPN STRCLS)
<COND (<VERB? OPEN>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL <PICK-ONE ,DUMMY>>)
(ELSE
<TELL .STROPN>
<FSET .OBJ ,OPENBIT>)>
<CRLF>)
(<VERB? CLOSE>
<COND (<FSET? .OBJ ,OPENBIT>
<TELL .STRCLS>
<FCLEAR .OBJ ,OPENBIT>
T)
(ELSE <TELL <PICK-ONE ,DUMMY> CR>)>
<CRLF>)>>
<GLOBAL DUMMY
<LTABLE "Look around."
"You think it isn't?"
"I think you've already done that.">>
<ROUTINE OBJECT-PSEUDO ()
<COND (<VERB? EXAMINE>
<PERFORM ,V?LOOK-INSIDE ,WINDOW>
<RTRUE>)>>
<ROUTINE PORTHOLE-FCN ()
<COND (<VERB? THROUGH>
<TELL "There is glass in that porthole, dummy!" CR>)
(<VERB? LOOK-INSIDE EXAMINE>
<COND (<==? ,HERE ,SPACESHIP-BRIDGE>
<DESCRIBE-SPACE>)
(<==? ,HERE ,THRONE-ROOM>
<TELL
"You see the green dock, and the stars wheeling by above." CR>)>)>>
<ROUTINE V-THROUGH ("OPTIONAL" (OBJ <>) "AUX" M)
#DECL ((OBJ) <OR OBJECT FALSE> (M) <PRIMTYPE VECTOR>)
<COND (<AND <NOT .OBJ> <FSET? ,PRSO ,VEHBIT>>
<PERFORM ,V?BOARD ,PRSO>
<RTRUE>)
(<AND <NOT .OBJ> <NOT <FSET? ,PRSO ,TAKEBIT>>>
<TELL "You hit your head against the "
D ,PRSO
" as you attempt this feat." CR>)
(.OBJ <TELL "You can't do that!" CR>)
(<IN? ,PRSO ,WINNER>
<TELL "That would involve quite a contortion!" CR>)
(ELSE <TELL <PICK-ONE ,YUKS> CR>)>>
<ROUTINE ROOM? (OBJ "AUX" NOBJ)
<REPEAT ()
<SET NOBJ <LOC .OBJ>>
<COND (<NOT .NOBJ> <RFALSE>)
(<==? .NOBJ ,WINNER> <RFALSE>)
(<==? .NOBJ ,ROOMS> <RETURN .OBJ>)>
<SET OBJ .NOBJ>>>
<ROUTINE GRUE-FUNCTION ()
<COND (<VERB? EXAMINE>
<TELL
"The grue is a sinister, lurking presence in the dark places of the
earth. Its favorite diet is spacers, but its insatiable appetite is
tempered by its fear of light. No grue has ever been seen by the light
of day, and few have survived its fearsome jaws to tell the tale." CR>)
(<VERB? FIND>
<TELL
"There is no grue here, but I'm sure there is at least one lurking
in the darkness nearby. I'd stay in lighted areas if I were you!" CR>)
(<VERB? LISTEN>
<TELL
"It makes no sound but is always lurking in the darkness nearby." CR>)>>
<ROUTINE GROUND-FCN ()
<COND (<AND <VERB? PUT> <==? ,PRSI ,GROUND>>
<PERFORM ,V?DROP ,PRSO>
<RTRUE>)
(<VERB? DIG>
<TELL "The ground is too hard for digging here." CR>)>>
<ROUTINE DEBRIS-FCN ()
<COND (<AND ,DOCKED?
,SEEN-MOUSE?
<VERB? TAKE EXAMINE>>
<TELL
"You should leave debris for the maintenance mice." CR>)>>
<ROUTINE ADVENTURER-FCN ()
<COND (<==? ,ADVENTURER ,WINNER>
<COND (<AND ,THAT-END
,THIS-END
<IN? ,SPACESUIT ,WINNER>
<VERB? WALK>
<NOT <AND <EQUAL? ,HERE ,YELLOW-DOCK>
<EQUAL? ,PRSO ,P?WEST>>>
<NOT <AND <EQUAL? ,HERE ,YELLOW-DOCK-EDGE>
<EQUAL? ,PRSO ,P?EAST>>>
<NOT <AND <EQUAL? ,HERE
,SPACESHIP-AIRLOCK>
<EQUAL? ,PRSO ,P?SOUTH ,P?OUT P?DOWN>>>
<NOT <AND <EQUAL? ,HERE ,DEEP-SPACE>
<EQUAL? ,PRSO ,P?IN>>>>
<TELL
"The safety line prevents you from leaving, as it is only about
five meters long. You must detach it to leave." CR>)
(<AND ,THAT-END
<NOT ,THIS-END>
<VERB? WALK>
<IN? ,SAFETY-LINE ,WINNER>>
<MOVE ,SAFETY-LINE ,HERE>
<TELL
"You leave the half-secured safety line behind." CR>
<>)>)>>
<ROUTINE CRETIN ()
<COND (<VERB? GIVE>
<PERFORM ,V?TAKE ,PRSO>
<RTRUE>)
(<VERB? EAT> <TELL "Auto-cannibalism is not the answer." CR>)
(<VERB? KILL MUNG>
<COND (<==? ,PRSO ,ME>
<JIGS-UP
"If you insist...Poof, you're dead!">)
(ELSE <TELL "What a silly idea!" CR>)>)
(<VERB? TAKE>
<TELL "How romantic!" CR>)
(<VERB? DISEMBARK>
<TELL "You'll have to do that on your own." CR>)
(<VERB? EXAMINE>
<TELL "That's hard unless your eyes are prehensile."
CR>)>>
<ROUTINE FIND-IN (WHERE WHAT "AUX" W)
<SET W <FIRST? .WHERE>>
<COND (<NOT .W> <RFALSE>)>
<REPEAT ()
<COND (<FSET? .W .WHAT> <RETURN .W>)
(<NOT <SET W <NEXT? .W>>> <RETURN <>>)>>>
<ROUTINE FIND-TARGET (TARGET "AUX" P TX L ROOM)
<COND (<IN? .TARGET ,HERE> ,HERE)
(ELSE
<SET P 0>
<REPEAT ()
<COND (<0? <SET P <NEXTP ,HERE .P>>>
<RETURN <>>)
(<NOT <L? .P ,LOW-DIRECTION>>
<SET TX <GETPT ,HERE .P>>
<SET L <PTSIZE .TX>>
<COND (<OR <EQUAL? .L ,UEXIT>
<AND <EQUAL? .L ,CEXIT>
<VALUE <GETB .TX ,CEXITFLAG>>>
<AND <EQUAL? .L ,DEXIT>
<FSET? <GETB .TX ,DEXITOBJ>
,OPENBIT>>>
<SET ROOM <GETB .TX 0>>
<COND (<IN? .TARGET .ROOM>
<RETURN .ROOM>)>)>)>>)>>
<GLOBAL COMPUTER-ON T>
<ROUTINE COMPUTER-FCN ("AUX" N)
<COND (<==? ,WINNER ,COMPUTER>
<COND (<NOT ,COMPUTER-ON>
<SETG COMPUTER-ON T>
<TELL "The computer turns itself on." CR>)>
<COND (<OR <VERB? WALK-TO>
<AND <VERB? SET> <==? ,PRSO ,COURSE>>>
<COND (<VERB? WALK-TO> <SETG PRSI ,PRSO>)>
<COND (,DOCKED?
<TELL ,ROPES-OFF CR>
<RTRUE>)
(,ORBIT-MATCHED
<TELL
"\"We just got here! I think we should look around first!\"" CR>
<RTRUE>)
(,COUNTDOWN
<TELL ,BURN-COMING CR>
<RTRUE>)
(,COURSE-SELECTED
<TELL ,IN-TRANSIT CR>
<RTRUE>)>
<COND (<KNOWN-COURSE ,PRSI T>
<TELL "\"Course being set for " D ,PRSI ".">
<COURSE-SET>)
(ELSE
<TELL
"The computer sounds surly. \"I told you to buy those additional I/O options.
You know as well as I do that I can't talk to that stupid mass detector, so
you'll just have to tell me the coordinates from its output. Maybe next time
you'll listen.\"" CR>)>)
(<VERB? R THETA PHI>
<COND (<G? ,VIEW-COUNT 0>
<TELL
"\"We just got here. You wouldn't be scared, would you?\"" CR>)
(<G? ,TRIP-COUNT 0>
<TELL ,IN-TRANSIT CR>)
(,DOCKED?
<TELL ,ROPES-OFF CR>)
(,COUNTDOWN
<TELL ,BURN-COMING CR>)
(T <>)>)
(<VERB? NO>
<SETG GOT-INSTRUCTIONS <>>
<SETG R-VALUE <>>
<SETG THETA-VALUE <>>
<SETG PHI-VALUE <>>
<SETG GIVE-UP <>>
<SETG LOST <>>
<TELL "\"Okay.\"" CR>)
(<VERB? YES>
<COND (<AND ,PRSO <NOT <==? ,PRSO ,COURSE>>>
<TELL "\"You can't confirm that!\"" CR>)
(,GOT-INSTRUCTIONS
<SETG GOT-INSTRUCTIONS <>>
<SETG COUNTDOWN T>
<ENABLE <QUEUE I-BURN 3>>
<TELL
"\"Thank you. New navigational program will initiate in fifteen seconds.
There will be a course correction burn of " N <+ 30 <RANDOM 30>> " seconds
duration. I advise you to fasten your seat belt.\"" CR>)
(ELSE
<TELL
"\"No pending program. Confirmation ignored.\"" CR>)>)
(<VERB? LAND>
<COND (,PRSO
<COND (<==? ,PRSO ,ARTIFACT>
<PERFORM ,V?LAND>
<RTRUE>)
(ELSE
<PERFORM ,V?SET ,COURSE ,PRSO>
<RTRUE>)>)
(,DOCKED? <TELL
"\"Error. I am already landed. Program cancelled.\"" CR>)
(<G? ,VIEW-COUNT 0>
<TELL
"\"Working...working...program aborted. The object is spinning too fast for a
safe landing. I can maintain current synchronized course indefinitely.\"" CR>)
(ELSE <TELL
"\"Program cancelled. There is nothing nearby to land on.\"" CR>)>)
(<VERB? EXAMINE>
<COND (<EQUAL? ,PRSO ,MISSION-STATUS ,COURSE>
<PERFORM ,V?REPORT ,MISSION-STATUS>
<RTRUE>)
(ELSE <TELL
"\"Your eyes are better than mine for that.\"" CR>)>)
(<VERB? HELLO> <TELL "\"Hello, astronaut.\"" CR>)
(<VERB? FIND>
<COND (<==? ,PRSO ,ME>
<PERFORM ,V?REPORT ,MISSION-STATUS>
<RTRUE>)
(<SET N <KNOWN-COURSE ,PRSO <>>>
<REPORT-LOCATION ,PRSO .N 1>)
(ELSE
<TELL "\"I don't know where that is.\"" CR>)>)
(<OR <AND <VERB? REPORT>
<==? ,PRSO ,MISSION-STATUS>>
<AND <VERB? SGIVE GIVE>
<EQUAL? ,MISSION-STATUS ,PRSO ,PRSI>>>
<COND (,LOST
<TELL
"\"We're on our way somewhere unpromising, that's all I can tell you.\"" CR>)
(,GIVE-UP
<TELL
"\"You've given up and are heading for " D ,GIVE-UP ", remember?\"" CR>)
(,DOCKED?
<TELL
"\"We've docked with this odd object. I think those tentacles may have
broken something; I don't feel too well.\"" CR>)
(<G? ,VIEW-COUNT 0>
<TELL
"\"We're on a parallel course with a strange, rotating artifact.\"" CR>)
(<G? ,TRIP-COUNT 0>
<TELL
"\"We're heading towards that newly reported unknown mass.">
<COND (<G? ,TRIP-COUNT 2>
<TELL
" We are being scanned by radiation emanating from that mass.">)>
<TELL "\"" CR>)
(,COUNTDOWN
<TELL
"\"Counting down to course correction.\"" CR>)
(,GOT-INSTRUCTIONS
<TELL
"\"Waiting for confirmation of new course.\"" CR>)
(<AND <0? ,R-VALUE>
<0? ,THETA-VALUE>
<0? ,PHI-VALUE>>
<TELL
"\"The mass detector has reported discovery of a new mass concentration.
Other than that, things have been pretty dull around here.\"" CR>)
(ELSE
<TELL
"\"We have a partially specified new course:">
<COND (<NOT <0? ,R-VALUE>>
<TELL " R is " N ,R-VALUE ".">)>
<COND (<NOT <0? ,THETA-VALUE>>
<TELL " Theta is " N ,THETA-VALUE ".">)>
<COND (<NOT <0? ,PHI-VALUE>>
<TELL " Phi is " N ,PHI-VALUE ".\"">)>
<CRLF>)>)
(<AND <VERB? LAMP-OFF> <==? ,PRSO ,ALARM>>
<COND (<NOT ,ALARM?>
<TELL "\"It's not on...\"" CR>)
(T
<TELL "\"And about time...\"" CR>
<SETG ALARM? <>>
<QUEUE I-ALARM 0>)>)
(<VERB? WAIT>
<TELL
"\"I can wait quite easily. Probably more easily than you.\"" CR>)
(<AND <VERB? KILL ATTACK MUNG> <==? ,PRSO ,ME>>
<TELL
"\"That is not among my capabilities. Sigh.\"" CR>)
(<PROB 25>
<TELL
"\"That is not among my capabilities. Perhaps if you were to invest in
a few upgrades I could do some of these things, but no...\"" CR>)
(ELSE
<TELL
"\"I'm only a navigational computer. That is not one of my functions.\"" CR>)>)
(<VERB? HELLO>
<TELL
"\"I haven't the patience for small talk.\"" CR>)
(<VERB? LAMP-ON>
<COND (,COMPUTER-ON
<ALREADY "on" ,COMPUTER>)
(ELSE
<SETG COMPUTER-ON T>
<TELL "The computer comes on." CR>)>)
(<VERB? LAMP-OFF>
<COND (,COMPUTER-ON
<SETG COMPUTER-ON <>>
<TELL
"\"If you insist, but my programming impels me to come back on if
anything important happens.\"" CR>)
(ELSE <ALREADY "off" ,COMPUTER>)>)
(<VERB? GIVE>
<TELL
"\"I might be able to take that if you had bought the extensors I asked for,
but no...\"" CR>)
(<AND <VERB? TELL> <NOT ,P-CONT>>
<TELL "\"Yes?\"" CR>)>>
<GLOBAL IN-TRANSIT
"\"We're in the midst of a trip. Are you still asleep?\"">
<GLOBAL BURN-COMING
"\"I'm too busy, I've got a burn coming. You'd better brace yourself.\"">
<GLOBAL ROPES-OFF
"\"I wouldn't try leaving unless you can get those ropes off me.\"">
<GLOBAL SEAT-BELT? <>>
<ROUTINE I-BURN ()
<SETG COUNTDOWN <>>
<ROB ,DEEP-SPACE>
<TELL
"The ship's thrusters spin it into a proper attitude, and then the engines
begin their course correction burn. There are significant G's and not
a little vibration." CR>
<COND (,SEAT-BELT?
<TELL "Fortunately, you are securely belted in." CR>
<SETG COURSE-SELECTED T>
<ENABLE <QUEUE I-TRIP 3>>)
(ELSE
<SETG R-VALUE 0>
<SETG THETA-VALUE 0>
<SETG PHI-VALUE 0>
<SETG GOT-INSTRUCTIONS <>>
<SETG WINNER ,ADVENTURER>
<JIGS-UP
"The G forces drive you against the rear bulkhead (which is unpadded,
of course). You are crushed to death.">)>>
<GLOBAL COURSE-SELECTED <>>
<GLOBAL TRIP-COUNT 0>
<GLOBAL TRIP-DESCS <LTABLE
"You are headed towards a bright starlike object."
"The starlike object now shows some shape."
"You are approaching a huge, cylindrical asteroid."
"The asteroid is unnaturally smooth, but there are surface features on it."
"Filling space before you is an enormous artifact, more than 5 km long
and about a kilometer in diameter. Regularly spaced around its waist are
bumps and other odd protrusions. You cannot see the aft end but the fore
end sports a glass or crystal dome almost 100 meters across.">>
<ROUTINE I-TRIP ()
<TELL "Time passes as you journey towards your destination." CR>
<SETG TRIP-COUNT <+ ,TRIP-COUNT 1>>
<COND (,GIVE-UP
<TELL
"|
You arrive at " D ,GIVE-UP " safe and sound. It would be tedious to continue,
as " D ,GIVE-UP " has no prospects as a locale for quantum black holes, so
this is the end.|
">
<FINISH>
<RTRUE>)>
<COND (<EQUAL? ,HERE
,SPACESHIP-BRIDGE ,SPACESHIP-AIRLOCK ,DEEP-SPACE>
<COND (<OR ,LOST <NOT <==? ,DESTINATION ,MASS>>>
<TELL "There is nothing interesting visible ahead." CR>)
(ELSE
<TELL <GET ,TRIP-DESCS ,TRIP-COUNT> CR>)>)>
<COND (<==? ,TRIP-COUNT 5>
<COND (,LOST
<TELL
"You have reached your destination. The computer speaks: \"There's
nothing here, as I predicted. You never listen do you? This trip is over;
See if I'll ever work with you again...\"|
|" CR>
<FINISH>)
(<==? ,DESTINATION ,MASS>
<TELL
"There is a brief burn as the ship matches course with the artifact. You
are hanging in space about half a kilometer away from the waist of the object.
The Starcross's engines shut down. The computer speaks: \"Program completed.
We are being scanned by low level radiation. Awaiting instructions.\"" CR>
<SETG VIEW-COUNT 1>
<ENABLE <QUEUE I-VIEW 2>>
<SETG ORBIT-MATCHED T>)
(ELSE
<TELL
"Ahead is a nondescript nickel-iron asteroid, rather a small one too.
Obviously, you have picked the wrong destination.|
|" CR>
<FINISH>)>)
(ELSE
<COND (<AND <NOT ,LOST>
<==? ,DESTINATION ,MASS>>
<COND (<==? ,TRIP-COUNT 3>
<TELL
"The computer says, \"Telescopic observations reveal the object ahead to
be extremely regular in shape. This is not your usual asteroid.\"" CR>)
(<==? ,TRIP-COUNT 4>
<TELL
"The computer remarks: \"I detect low-level scanning taking place. The
radiation is not dangerous. I think we may be getting into something
more than we expected here.\"" CR>)>)>
<ENABLE <QUEUE I-TRIP 3>>)>>
<GLOBAL VIEW-COUNT 0>
<GLOBAL ORBIT-MATCHED <>>
<ROUTINE I-VIEW ()
<COND (<EQUAL? ,HERE ,SPACESHIP-BRIDGE ,SPACESHIP-AIRLOCK>
<TELL
"As the object rotates below, the features of a different area become
visible through the viewport." CR>
<TELL <GET ,VIEW-TABLE <MOD <- ,VIEW-COUNT 1> 4>> CR>)>
<SETG VIEW-COUNT <+ ,VIEW-COUNT 1>>
<COND (<==? ,VIEW-COUNT 5> <TENTACLE-APPEARS>)
(ELSE <ENABLE <QUEUE I-VIEW 2>>)>>
<GLOBAL VIEW-TABLE <TABLE
"There is an area with a blue dome below. Near the dome is a spherical object
which just might be a spaceship. It is held down by silvery ropes."
"This area has a yellow dome. The surface of the object here looks damaged
and scorched, and is littered with tangled debris."
"This area has a green dome and a long, silvery spaceship tethered nearby."
"Below is an area with a red dome which has no ship near it.">>
<ROUTINE TENTACLE-APPEARS ()
<ENABLE <QUEUE I-MOUSE 1>>
<ENABLE <QUEUE I-BAD-AIR <+ 75 <RANDOM 50>>>>
<TELL
"Suddenly an odd protrusion near the red dome splits open and a huge
articulated metal tentacle issues from it at great speed.">
<COND (<EQUAL? ,HERE ,DEEP-SPACE>
<CRLF>
<JIGS-UP
"The tentacle grabs the Starcross, spinning you off into the depths of
space!">)
(<EQUAL? ,HERE ,SPACESHIP-BRIDGE ,SPACESHIP-AIRLOCK>
<TELL
" It approaches the ship and delicately wraps itself around the hull."> <COND (,SEAT-BELT?
<TELL
" You are slammed against your seat">)
(ELSE
<TELL
" You are smashed against the bulkhead">)>
<TELL " as the tentacle accelerates the Starcross to the
artifact's speed of rotation. Inexorably, your ship is drawn toward the dome.
When you are a few tens of meters away, three smaller tentacles issue forth
and grapple the ship solidly to the surface of the artifact. The large
tentacle retreats into its housing, which closes.|">
<COND (,SEAT-BELT?
<TELL
"|
You are disoriented: now that you are attached to the artifact, which is
rotating, \"up\" and \"down\" have taken on new meanings. Your sense
of balance tells you that your ship is clinging to the underside of some
enormous object, and if you aren't careful you will fall! \"Up\" now
refers to the center of the object, \"down\" to the immensities of space." CR>)
(ELSE
<JIGS-UP "Unfortunately, the accelerations involved were tremendous,
and being smashed into the walls didn't help your condition either.">)>)
(ELSE
<JIGS-UP
"Something has grabbed the ship! You are slammed against the bulkhead!
After a great deal of buffeting, there is a metallic clang and the ship is
at rest, but unfortunately, so are you.">)>
<SETG DOCKED? T>>
<GLOBAL DOCKED? <>>
<GLOBAL TAPE-ON <>>
<ROUTINE TAPE-FCN ()
<COND (<VERB? TAKE>
<COND (<IN? ,TAPE-PLAYER ,SPIDER>
<TELL "The spider refuses to part with it." CR>)
(ELSE <RFALSE>)>)
(<NOT <IN? ,TAPE-PLAYER ,WINNER>>
<DONT-HAVE ,TAPE-PLAYER>)
(<VERB? LAMP-ON>
<COND (,TAPE-ON
<ALREADY "on" ,TAPE-PLAYER>)
(ELSE
<SETG TAPE-ON T>
<TELL "The " D ,PRSO " comes on." CR>)>)
(<VERB? LAMP-OFF>
<COND (,TAPE-ON
<SETG TAPE-ON <>>
<TELL "The " D ,PRSO " is now off." CR>)
(ELSE <ALREADY "off" ,TAPE-PLAYER>)>)
(<VERB? PLAY WEAR>
<COND (<NOT ,TAPE-ON>
<TELL "First, you must turn on the tape player." CR>)
(ELSE
<TELL
"The player picks a recently referenced selection: ">
<TELL <PICK-ONE ,TAPES> CR>)>)
(<VERB? LISTEN>
<COND (,TAPE-ON
<TELL
"The tape player continues with the previous selection." CR>)
(ELSE <TELL "The player isn't on." CR>)>)>>
<GLOBAL TAPES
<LTABLE
"A lecture on the history of Brazil in the 2030's begins."
"This is a discussion of contemporary trends in literature."
"Bach's \"The Well-Tempered Clavier\" is played."
"\"Fantasia,\" complete with holo-projection, begins."
"A list of the works of Edgar Rice Burroughs is read off."
"This is Pynchon's \"Gravity's Rainbow.\""
"Vernon's \"Origins of the Third World War\" plays."
"The classic computer mystery \"Deadline\" is displayed.">>
\
<ROUTINE MOUSE-CONT ()
<COND (<VERB? TAKE>
<TELL
"The maintenance mouse buzzes briefly, then rotates its \"ears\" in your
direction as you take the " D ,PRSO ". It seems profoundly puzzled at
your behavior." CR>
<RFALSE>)>>
<ROUTINE MOUSE-GOODIES ()
<COND (<FIRST? ,MOUSE>
<TELL " It has already collected ">
<PRINT-CONTENTS ,MOUSE>
<TELL ".">)>
<RTRUE>>
<ROUTINE MOUSE-FCN ("OPTIONAL" (RARG <>))
<COND (<==? .RARG ,M-OBJDESC>
<COND (<IN? ,MOUSE ,GARAGE>
<TELL
"There is a maintenance mouse here.">)
(,SEEN-MOUSE?
<TELL
"There is a maintenance mouse here, cheerfully scouring the area for garbage.">
<MOUSE-GOODIES>)
(ELSE
<SETG SEEN-MOUSE? T>
<TELL
"A small metal contraption about a meter long and half a meter high
enters the room." ,LONG-MOUSE>)>
<CRLF>)
(<AND <NOT <IN? ,MOUSE ,HERE>>
<OR <EQUAL? ,GLOBAL-MOUSE ,PRSO ,PRSI>
<EQUAL? ,MOUSE ,PRSO ,PRSI> ;"CHOMPING AGAIN">>
<COND (<VERB? FOLLOW>
<COND (<NOT ,LIT>
<TELL "It's too dark to follow the mouse." CR>)
(,GARAGED?
<TELL "You can't go through the hole." CR>)
(,MFOLLOW
<DO-WALK ,MFOLLOW> <RTRUE>)
(ELSE
<TELL "You've lost him." CR>)>)
(ELSE <TELL "There is no mouse here." CR>)>)
(<VERB? FOLLOW>
<TELL "He's right here!" CR>)
(<AND <VERB? ZAP> <CAN-ZAP?>>
<DISABLE <INT I-MOUSE>>
<REMOVE ,MOUSE>
<TELL "The mouse is obliterated, squealing piteously." CR>)
(<VERB? MUNG>
<TELL "The maintenance mouse is unscathed." CR>)
(<VERB? EMPTY>
<COND (<ROB ,MOUSE ,WINNER>
<TELL "You get some booty!" CR>)>)
(<VERB? EXAMINE LOOK-INSIDE>
<COND (<VERB? EXAMINE>
<TELL
"The maintenance mouse is a boxy machine with a large receptacle on top in
which garbage it collects can be stored. It is buzzing around cleaning the
area, diligently polishing the floor, and waving its \"ears\" (small dish
antennae) about." CR>)>
<COND (<FIRST? ,MOUSE>
<TELL "The receptacle on the mouse's back contains: ">
<PRINT-CONTENTS ,MOUSE>
<TELL "." CR>)
(ELSE <TELL "The receptacle is empty." CR>)>)
(<VERB? LOOK-UNDER> <TELL "There is no dirt there." CR>)
(<VERB? BOARD>
<TELL
"The mouse buzzes piteously from the overload until you get back off.
It only wants to collect small pieces of debris." CR>)
(<VERB? OPEN CLOSE>
<TELL
"The mouse has no lid, just an open receptacle on its back." CR>)>>
<GLOBAL LONG-MOUSE " Its guidance system (two dish antennae at the front)
circles quizzically. A power antenna juts from the rear. On top is a small
tray. It cleans the floor as it goes, humming contentedly. All in all, it
looks like nothing so much as a mechanical mouse.">
<ROUTINE OUT-OF-HOLE ()
<COND (<AND ,SEEN-MOUSE? ,LIT>
<TELL
"A maintenance mouse" ,HOLE-SHUTS "." CR>)
(ELSE
<SETG SEEN-MOUSE? T>
<TELL
"A small metal contraption" ,HOLE-SHUTS ". The device stops in its tracks and
buzzes briefly, allowing you a closer look." ,LONG-MOUSE CR>)>
<RTRUE>>
<GLOBAL HOLE-SHUTS
" emerges from a hitherto unnoticed hole in the wall. The hole slides shut and
becomes practically invisible">
<GLOBAL SEEN-MOUSE? <>>
<GLOBAL MOUSE-LOC <>>
<GLOBAL GARAGED? <>>
<GLOBAL MFOLLOW <>>
<ROUTINE I-MOUSE ("AUX" (OLDM <LOC ,MOUSE>) (HERE? <IN? ,MOUSE ,HERE>)
ROBBED?)
<ENABLE <QUEUE I-MOUSE 2>>
<REMOVE ,MOUSE-HOLE>
<SETG GARAGED? <>>
<SET ROBBED? <ROB <LOC ,MOUSE> ,MOUSE>>
<COND (<AND .ROBBED? .HERE? <NOT <IN? ,MOUSE ,GARAGE>>>
<COND (,LIT
<TELL
"The maintenance mouse, buzzing happily, picks up some refuse." CR>)
(ELSE <TELL "You hear a cheerful buzzing nearby." CR>)>)>
<COND (<IN? ,MOUSE ,GARAGE>
<COND (<FIRST? ,MOUSE>
<ROB ,MOUSE ,TRASH-BIN>
<COND (<IN? ,BLUE-DISK ,TRASH-BIN>
<MOVE ,BLUE-DISK ,GARAGE>)>
<COND (<IN? ,RED-DISK ,TRASH-BIN>
<MOVE ,RED-DISK ,GARAGE>)>
<COND (<AND .HERE? ,LIT>
<TELL
"The mouse rolls up to the trash bin and dumps some stuff into it." CR>)>)>
<COND (<PROB 40>
<COND (<AND .HERE? ,LIT>
<TELL
"The mouse leaves as unobtrusively as it arrived." CR>)>
<MOVE ,MOUSE ,MOUSE-LOC>
<COND (<==? ,MOUSE-LOC ,HERE>
<MOVE ,MOUSE-HOLE ,HERE>
<OUT-OF-HOLE>)>)>
.HERE?)
(<AND .HERE? <PROB 30>>
<COND (,LIT
<TELL
"The maintenance mouse sits in the middle of the room, buzzing
contentedly." CR>)
(ELSE <TELL "There is buzzing nearby." CR>)>)
(<AND <FIRST? ,MOUSE> <PROB 15>>
<SETG MOUSE-LOC <LOC ,MOUSE>>
<MOVE ,MOUSE ,GARAGE>
<SETG GARAGED? T>
<COND (<==? ,HERE ,GARAGE>
<COND (,LIT
<TELL
"A maintenance mouse enters the garage, preparing to dump a load of
trash." CR>)>)
(.HERE?