-
Notifications
You must be signed in to change notification settings - Fork 11
/
sub.zil
2845 lines (2685 loc) · 90.4 KB
/
sub.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
"SUB for SEASTALKER
Copyright (C) 1984 Infocom, Inc. All rights reserved."
<ROOM SUB
(IN ROOMS)
(DESC "SCIMITAR" ;"Ultramarine Bioceptor")
(TEXT
"This is your revolutionary new Ultramarine Bioceptor, named the SCIMITAR.")
(FLAGS RLANDBIT ONBIT ;VOWELBIT ;VEHBIT)
(OUT PER SUB-EXIT-F)
;(UP PER SUB-EXIT-F)
(IN TO CRAWL-SPACE IF ENGINE-ACCESS-HATCH IS OPEN)
;(DOWN TO CRAWL-SPACE IF ENGINE-ACCESS-HATCH IS OPEN)
(GLOBAL LOCAL-SUB SUB-DOOR ENGINE-ACCESS-HATCH
REACTOR-SWITCH FILL-TANK-BUTTON OPEN-GATE-BUTTON
TEST-BUTTON ENGINE-BUTTON)
(VALUE 1)
(ACTION SUB-F)>
<ROUTINE SUB-EXIT-F ("AUX" X)
<COND (<NOT <FSET? ,SUB-DOOR ,OPENBIT>>
<THIS-IS-IT ,SUB-DOOR>
<TELL "The " D ,SUB-DOOR " is closed." CR>
<RFALSE>)
(,SUB-IN-TANK
<COND (<SET X <GET ,ON-SUB 0>> <MOVE .X ,NORTH-TANK-AREA>)>
<COND (<SET X <GET ,ON-SUB 1>> <MOVE .X ,NORTH-TANK-AREA>)>
,NORTH-TANK-AREA)
(,SUB-IN-DOME
<COND (,AIRLOCK-FULL
;<YOU-CANT "leave" ,AIRLOCK "full of water">
<TELL
"You can't go out while the " D ,AIRLOCK " is full of water!" CR>
<RFALSE>)
(T
<COND (<AND <NOT ,DOME-AIR-BAD?>
<FSET? ,AIR-SUPPLY-SYSTEM ,MUNGBIT>>
<ENABLE <QUEUE I-DOME-AIR ,DOME-AIR-ONSET>>
<COND (<NOT <IN? ,OXYGEN-GEAR ,PLAYER>>
<TELL-HINT 53 ;10 ,OXYGEN-GEAR <>>
<CRLF>)>)
;"(T <ENABLE <QUEUE I-ANTRIM-REPORTS 29>>)">
<COND (<SET X <GET ,ON-SUB 0>> <MOVE .X ,AIRLOCK>)>
<COND (<SET X <GET ,ON-SUB 1>> <MOVE .X ,AIRLOCK>)>
<COND (<IN? ,MAGAZINE ,TIP>
;<FCLEAR ,MAGAZINE ,NDESCBIT>
<MOVE ,MAGAZINE ,SUB>)>
<QUEUE I-POISON-JAB 0>
,AIRLOCK)>)
(T
;<YOU-CANT "leave" ,SUB "here">
<TELL "You can't go out of the " D ,SUB " here!" CR>
<RFALSE>)>>
<ROUTINE DOCKING-VERB? ()
<COND (<NOT <EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN ,SEA-TERRAIN>>
<RFALSE>)
(<VERB? DOCK> <RTRUE>)
(<AND <VERB? WALK> <DOBJ? P?IN>> <RTRUE>)
(<VERB? THROUGH WALK-TO>
<COND (<EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN>
<COND (<DOBJ? TEST-TANK TANK-GATE YOUR-LABORATORY> <RTRUE>)
(T <RFALSE>)>)
(<DOBJ? DOCKING-TANK AIRLOCK AQUADOME AIRLOCK-HATCH> <RTRUE>)>)
;(T <RFALSE>)>>
<ROUTINE SOMEONE-WORKING? ()
<COND (<NOT <0? <POPULATION ,CRAWL-SPACE ,PLAYER>>> <RTRUE>)
(<NOT <0? <POPULATION ,SUB ,TIP ,PLAYER>>> <RTRUE>)
;(<AND <SET P <FIND-FLAG ,SUB ,PERSON ,WINNER>>
<NOT <EQUAL? .P ,TIP>>
;<NOT <EQUAL? ,OLD-HERE ,CRAWL-SPACE>>>
<RTRUE>)>>
<ROUTINE CANT-GO-TO-THRU-CLOSED-HATCH? ("AUX" X)
<SET X ,PRSO>
<COND (<FSET? ,PRSO ,PERSON>
<SET X <GET ,CHARACTER-TABLE <GETP ,PRSO ,P?CHARACTER>>>)>
<AND <NOT <GLOBAL-IN? ,PRSO ,SUB>>
<NOT <GLOBAL-IN? ,PRSO ,CRAWL-SPACE>>
<OR <EQUAL? .X ,DOCKING-TANK ,TEST-TANK>
<NOT <EQUAL? <META-LOC .X>
,SUB ,CRAWL-SPACE ,GLOBAL-OBJECTS>>>
<NOT <SUB-EXIT-F>>>>
<ROUTINE SUB-F ("OPTIONAL" (RARG <>) "AUX" RM X)
<COND (<EQUAL? .RARG ,M-BEG>
<COND (<AND <OR ,SUB-IN-TANK ,SUB-IN-DOME>
<OR <VERB? LAUNCH>
<AND <VERB? ;DROP LEAVE> <DOBJ? AIRLOCK TEST-TANK>>>>
<PERFORM ,V?LAMP-ON ,LOCAL-SUB>
<RTRUE>)
(<VERB? STAND> <TELL "There's no room in here!" CR>)
(<VERB? $CALL>
<COND (<DOBJ? SLOW MEDIUM FAST>
<PERFORM ,V?SET ,THROTTLE ,PRSO>
<RTRUE>)>)
(<AND <VERB? DISEMBARK LEAVE>
<OR <NOT ,PRSO> <DOBJ? LOCAL-SUB>>>
<COND (<SET RM <SUB-EXIT-F>>
<COND (<AND <GOTO .RM> <NOT <==? ,WINNER ,PLAYER>>>
<OKAY>)>)>
<RTRUE>)
(<DOCKING-VERB?>
<COND (<EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN>
<TELL
"You can't go back to the " D ,TEST-TANK " now!" CR>)
(<NOT <SUB-OUTSIDE-AIRLOCK?>>
<TOO-BAD-BUT ,AIRLOCK "too far away">
;<TELL "You're too far from the " D ,AIRLOCK "." CR>)
(<NOT <FSET? ,AIRLOCK-HATCH ,OPENBIT>>
<TOO-BAD-BUT ,AIRLOCK-HATCH "closed">
;<TELL "The " D ,AIRLOCK-HATCH " is closed." CR>)
(T
<SETG THROTTLE-SETTING 1>
;<COND (,DEBUG
<TELL "[Throttle=" N ,THROTTLE-SETTING "]" CR>)>
<SETG JOYSTICK-DIR ,P?NORTH>
;<SETG SUB-IN-REVERSE? T>
<SETG SUB-DLON 0>
<SETG SUB-DLAT 1>
<RTRUE ;RFALSE>)>)
(<AND <NOT ,SUB-IN-DOME>
<VERB? FIND WALK-TO>
<DOBJ? LOCAL-SUB AQUADOME DOCKING-TANK>>
<COND (<EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN ,SEA-TERRAIN>
<PERFORM ,V?FIND ,PLAYER>
<RTRUE>)>)
(<VERB? CLIMB-DOWN CLIMB-UP LEVEL>
<COND (<OR ,SUB-IN-TANK ,SUB-IN-DOME>
<TELL
"You can't do that while the " D ,SUB " is here." CR>
<RTRUE>)
(<VERB? LEVEL>
<SETG TARGET-DEPTH ,SUB-DEPTH>
<RTRUE>) ;"I-UPDATE-SUB should give output"
(<FSET? ,PRSO ,UNITBIT>
<COND (<VERB? CLIMB-DOWN>
<SETG P-NUMBER <+ <* 5 ,SUB-DEPTH> ,P-NUMBER>>)
(<VERB? CLIMB-UP>
<SETG P-NUMBER <- <* 5 ,SUB-DEPTH> ,P-NUMBER>>
<COND (<G? 0 ,P-NUMBER>
<TELL "You're not deep enough!" CR>
<RTRUE>)>)>
<PERFORM ,V?DIVE ,PRSO>
<RTRUE>)>)
(<VERB? WALK>
<COND (<DOBJ? UNDERWATER> <SETG PRSO ,P?DOWN>)>
<COND (<L? ,PRSO ,LOW-DIRECTION>
<V-WALK-AROUND>
<RTRUE>)>
<COND (<DOBJ? P?IN P?OUT>
<RFALSE>)>
<COND (<DOBJ? P?DOWN P?UP>
<SETG P-NUMBER 5>
<COND (<DOBJ? P?UP> <PERFORM ,V?CLIMB-UP ,METER>)
(T <PERFORM ,V?CLIMB-DOWN ,METER>)>
<RTRUE>)>
<COND (<DOBJ? SLOW MEDIUM FAST>
;"never used if these are verbs"
<PERFORM ,V?SET ,THROTTLE ,PRSO>
<RTRUE>)>
<COND (<EQUAL? ,PRSO ,P?EAST ,P?SE ,P?NE>
<SETG SUB-DLON +1>)
(<EQUAL? ,PRSO ,P?WEST ,P?SW ,P?NW>
<SETG SUB-DLON -1>)
(T <SETG SUB-DLON 0>)>
<COND (<EQUAL? ,PRSO ,P?NORTH ,P?NW ,P?NE>
<SETG SUB-DLAT +1>)
(<EQUAL? ,PRSO ,P?SOUTH ,P?SW ,P?SE>
<SETG SUB-DLAT -1>)
(T <SETG SUB-DLAT 0>)>
;<COND (,SUB-IN-REVERSE?
<SETG SUB-DLON <- ,SUB-DLON>>
<SETG SUB-DLAT <- ,SUB-DLAT>>)>
<COND (<FSET? ,AUTO-PILOT ,ONBIT>
<TELL "Let the " D ,AUTO-PILOT " handle that." CR>)
(,SUB-IN-TANK
<TRY-TO-EMERGE ,P?EAST ,TANK-GATE ,TEST-TANK-FULL>)
(,SUB-IN-DOME
<TRY-TO-EMERGE ,P?SOUTH ,AIRLOCK-HATCH ,AIRLOCK-FULL>)
(<AND <READY-FOR-SNARK?>
,TOLD-SNARK-WENT
<FSET? ,SNARK ,INVISIBLE>
<==? ,SUB-DEPTH ,AIRLOCK-DEPTH>
<DOBJ? P?SE>
<NOT <==? ,JOYSTICK-DIR ,PRSO>>>
<TELL
"Pulses racing and hearts thumping, you and Tip at last set out to
capture the monstrous Snark!" CR>)
(T
<SUB-NOW-HEADING>)>
<SETG JOYSTICK-DIR ,PRSO>
<RTRUE>)
(<AND <VERB? WALK-UNDER> <DOBJ? GLOBAL-WATER BAY SEA>>
<COND (<0? ,SUB-DEPTH>
<DO-WALK ,P?DOWN>
<RTRUE>)
(T <TELL "You're already " D ,UNDERWATER "." CR>)>)
(<EXIT-VERB?>
<COND (<CANT-GO-TO-THRU-CLOSED-HATCH?>
<RTRUE>)>)
(<AND <VERB? EXAMINE LOOK-INSIDE>
<DOBJ? TEST-TANK DOCKING-TANK>>
<TELL ,I-ASSUME " look through the " D ,SUB-WINDOW ".)" CR>
<PERFORM ,V?LOOK-INSIDE ,SUB-WINDOW>
<RTRUE>)
(<AND <VERB? EXAMINE>
<DOBJ? THORPE-SUB GLOBAL-THORPE GLOBAL-SHARON
SNARK GLOBAL-SNARK>>
<COND (<NOT <FSET? ,SNARK ,INVISIBLE>> ;,SUB-IN-BATTLE
<TELL
"The " D ,GLOBAL-WATER " is too cloudy to see anything." CR>)
(T
<TOO-BAD-BUT ,PRSO "too far away">
;<HE-SHE-IT ,PRSO T>
;<TELL "'s too far away.">)>)
(<AND <VERB? DROP>
<EQUAL? ,PRSO <GET ,ON-SUB 0> <GET ,ON-SUB 1>>>
<COND (<EQUAL? ,PRSO <GET ,ON-SUB 0>> <PUT ,ON-SUB 0 <>>)
(<EQUAL? ,PRSO <GET ,ON-SUB 1>> <PUT ,ON-SUB 1 <>>)>
<COND (,SUB-IN-TANK <MOVE ,PRSO ,NORTH-TANK-AREA>)
(,SUB-IN-DOME <MOVE ,PRSO ,AIRLOCK>)
(T <REMOVE ,PRSO>)>
<FCLEAR ,PRSO ,NDESCBIT>
<FSET ,PRSO ,TAKEBIT>
<FCLEAR ,PRSO ,TRYTAKEBIT>
<TELL "Dropped." CR>)
(<AND <VERB? TAKE-WITH> <IOBJ? CLAW>>
<COND (<NOT <EQUAL? <LOC ,PRSO> ,AIRLOCK ,NORTH-TANK-AREA>>
<TOO-BAD-BUT ,PRSO "not close enough to the claw">)
(<NOT <FSET? ,PRSO ,TAKEBIT>> <YOU-CANT "take">)
(<MOUNT-WEAPON ,PRSO> <TELL "Taken." CR> <RTRUE>)
(T <RTRUE>)>)
;(T <RFALSE>)>)
(<EQUAL? .RARG ,M-ENTER>
<COND (<NOT <0? <POPULATION ,SUB ,TIP ,PLAYER>>>
<TOO-CROWDED>
<COND (,SUB-IN-DOME <GOTO ,AIRLOCK>)
(,SUB-IN-TANK <GOTO ,NORTH-TANK-AREA>)>
<RTRUE>)>
<ENABLE <QUEUE I-POISON-JAB 9>>
<COND (<SET X <GET ,ON-SUB 0>> <MOVE .X ,SUB>)>
<COND (<SET X <GET ,ON-SUB 1>> <MOVE .X ,SUB>)>
<COND (<AND <IN? ,ESCAPE-POD-UNIT ,SUB>
<FSET? ,SYRINGE ,MUNGBIT>
<NOT <FSET? ,SYRINGE ;,ESCAPE-POD-UNIT ,TOUCHBIT>>>
<ENABLE <QUEUE I-CHECK-POD 1>>)>
<COND (<AND ,SUB-IN-DOME
<READY-FOR-SNARK?>
<NOT <SOMEONE-WORKING?>>>
<FCLEAR ,SUB-DOOR ,OPENBIT>
<MOVE ,TIP ,HERE>
<TELL
"As you and Tip take your places in your seats, ">
<COND (<AND <FSET? ,AIRLOCK-ROOF ,OPENBIT>
<NOT <AIRLOCK-POP?>>>
<FCLEAR ,AIRLOCK-ROOF ,OPENBIT>
<TELL
"and close the hatch, the " D ,AIRLOCK-ROOF ;"watertight roof of the airlock"
" is also sliding shut." CR>)
(T <TELL "Tip closes the hatch." CR>)>)>
<SCORE-OBJ ,SUB>
<RTRUE>)
(<EQUAL? .RARG ,M-LOOK>
<TELL
"You're in the pilot's seat of the " D ,SUB ", its operating "
D ,CONTROLS-SUB " before you.">
<COND (<FSET? ,ENGINE-ACCESS-HATCH ,OPENBIT>
<TELL " The " D ,ENGINE-ACCESS-HATCH " is open.">)>
<TELL "|
A wraparound " D ,SUB-WINDOW ", both fore and aft, provides
a view ahead and astern.">
<COND (<AND <0? ,SUB-DEPTH> <NOT ,SUB-IN-TANK>>
<TELL " Sunlight pours in through the " D ,SUB-WINDOW ".">)>
<TELL
" You can also observe your surroundings with a " D ,SONARSCOPE " and a
" D ,HYDROPHONE " listening device. There's a " D ,SONARPHONE " for
communication. You'll discover other features when you need them." CR>)>>
"| A reactor pokes through the deck.
radio. There's also a , video screen,
<DDESC ' The hatch leading out is ' ,SUB-DOOR '.'>"
<ROUTINE TOO-CROWDED ()
<TELL
"It's too crowded in here! You'll have to wait outside."
;"Oops! Someone's working inside. You'd better wait for them to finish." CR>>
<ROUTINE TRY-TO-EMERGE (DIR GATE FULL?)
<COND (<NOT .FULL?>
<TELL "You can't turn the sub around while the ">
<COND (<==? .DIR ,P?EAST> <TELL D ,TEST-TANK>)
(T <TELL D ,AIRLOCK>)>
<TELL " is empty." CR>)
(<EQUAL? ,PRSO .DIR>
<COND (<NOT <0? ,THROTTLE-SETTING>>
<COND (<NOT <FSET? ,ENGINE ,ONBIT>>
<TELL
"Nothing happens when you push the " D ,JOYSTICK ". The engine is off.">
<COND (,GATE-CRASHED
<TELL
" It was stopped by Automatic Shutoff when you crashed into the
sea gate.">)>
<CRLF>)
(<HATCH-GATE-NOT-READY? .GATE> <RTRUE>)
(<==? .DIR ,P?SOUTH> <SUB-LEAVES <> ,P?SOUTH>)
(T <SUB-LEAVES T ,P?EAST>)>)
(T
<SUB-NOW-HEADING>)>)
(T
;<OKAY ,JOYSTICK>
<TELL "Okay, the " D ,JOYSTICK " is now pointing to ">
<DIR-PRINT ,PRSO>
<TELL ". But the only way the sub can leave the tank is to ">
<DIR-PRINT .DIR>
<TELL "." CR>)>>
<ROUTINE HATCH-GATE-NOT-READY? (GATE)
<COND (<FSET? ,SUB-DOOR ,OPENBIT>
<THIS-IS-IT ,SUB-DOOR>
<TELL
"You shouldn't leave the tank with the hatch open!" CR>)
(<NOT <FSET? .GATE ,OPENBIT>>
<GATE-CRASH "push" ,JOYSTICK .GATE>
<RTRUE>)>>
<GLOBAL LEFT-DOME 0>
<ROUTINE READY-FOR-SNARK? ()
<AND <OR <==? ,BAZOOKA <GET ,ON-SUB 0>>
<==? ,DART <GET ,ON-SUB 1>>>
,FINE-SONAR>>
<ROUTINE SUB-LEAVES (FROM-LAB? DIR)
<COND (.FROM-LAB?
<SETG GATE-CRASHED <>>
<SETG SUB-IN-TANK <>>
<REMOVE ,SHARON>
<ROB ,SHARON ,GLOBAL-SHARON>
<SETG ALARM-RINGING <>>
<PUT <GETPT ,VIDEOPHONE-2 ,P?SYNONYM> 0 ,W?ZZZZLG>
<ENABLE <QUEUE I-UPDATE-SUB-POSITION -1>>
<SETG MONSTER-GONE T>
<SETG NOW-TERRAIN ,BAY-TERRAIN>)
(T
<SETG SUB-IN-DOME <>>
<SETG NOW-TERRAIN ,SEA-TERRAIN>
<SETG SUB-LON 0 ;6>
<SETG SUB-LAT -1 ;5>
<SETG SUB-DEPTH ,AIRLOCK-DEPTH>
<SETG TARGET-DEPTH ,AIRLOCK-DEPTH>)>
<COND (<AND ,AUTOMATIC-SONAR <SPLIT-SCREEN?>>
<SETG SCREEN-NOW-SPLIT T>
<START-SONAR?>)>
<TELL
"The " D ,SUB " glides smoothly out of the tank ">
<COND (.FROM-LAB? <TELL "onto the surface of " D ,BAY>)
(T <TELL "into the ocean">)>
<TELL ". You're heading ">
<DIR-PRINT .DIR <>>
<TELL " at " N ,THROTTLE-SETTING " " D ,GRID-UNIT>
<COND (<NOT <==? 1 ,THROTTLE-SETTING>> <TELL "s">)>
<TELL " per turn." CR>
<COND (.FROM-LAB? <SCORE-OBJ ,BAY>)
(T
<COND (<FSET? ,TIP ,BUSYBIT>
<I-TIP-REPORTS>)>
<COND (<READY-FOR-SNARK?>
<SCORE-OBJ ,AIRLOCK>
<SETG LEFT-DOME ,MOVES>
<ENABLE <QUEUE I-THORPE-APPEARS -1>>)
(T
<TIP-SAYS>
<TELL
"I've got a bad feeling about this. I don't think
we should go out there without a ">
<COND (,FINE-SONAR <TELL "weapon of some kind.\"" CR>)
(T <TELL D ,FINE-GRID ".\"" CR>)>)>)>
<SAVE-HINT>
<RTRUE>>
<ROUTINE HEADING-FOR-SEAWALL? ("AUX" Y-X)
<COND (<NOT <EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN>> <RFALSE>)
(<OBSTACLE-AHEAD? ,SUB-DEPTH ,SUB-LON ,SUB-LAT> <RFALSE>)
(<DOBJ? P?NORTH>
<COND (<AND <G? ,SUB-LON 29> <L? ,SUB-LON 35>> <RTRUE>)>)
(<DOBJ? P?EAST>
<COND (<AND <G? ,SUB-LAT 35> <L? ,SUB-LAT 41>> <RTRUE>)>)
(<DOBJ? P?NE>
<SET Y-X <- ,SUB-LAT ,SUB-LON>>
<COND (<AND <G? .Y-X 0> <L? .Y-X 12>> <RTRUE>)>)>>
<GLOBAL SUB-STILL-HEADING 0>
<ROUTINE SUB-NOW-HEADING ()
;<OKAY ,SUB>
<TELL "Okay, the " D ,SUB " is ">
<COND (<==? ,JOYSTICK-DIR ,PRSO>
<COND (<NOT ,SUB-IN-BATTLE> <INC SUB-STILL-HEADING>)>
<TELL "still ">)
(T <TELL "now ">)>
<COND (<0? ,THROTTLE-SETTING> <TELL "facing" ;"heading">)
(T <TELL "moving">)>
<TELL " toward ">
<DIR-PRINT ,PRSO>
<COND (<HEADING-FOR-SEAWALL?>
<TELL ", straight toward the opening in the " D ,SEA-WALL>)>
<COND (<0? ,THROTTLE-SETTING>
<THIS-IS-IT ,THROTTLE>
<TELL
". But it won't go that way unless you open the " D ,THROTTLE>)>
<TELL "." CR>
<COND (<==? ,SUB-STILL-HEADING 9>
<SETG SUB-STILL-HEADING 0>
<TELL
"(You didn't change the " D ,SUB "'s heading. Remember, you don't have to type
a " D ,INTDIR " every turn if you want to WAIT or do something
else.)" CR>)>>
<OBJECT SUB-DOOR
(IN LOCAL-GLOBALS)
(DESC "entry hatch")
(ADJECTIVE ENTRY BIOCEPTOR SUB SUBMARINE SCIMITAR)
(SYNONYM DOOR HATCH TOP ENTRANCE)
(FLAGS DOORBIT OPENBIT)
(ACTION SUB-DOOR-F)>
<ROUTINE SUB-DOOR-F ()
<COND (<VERB? CLOSE>
<COND (<AND ,SUB-IN-DOME <FSET? ,AIR-SUPPLY-SYSTEM ,MUNGBIT>>
<TELL "It's too soon for that!" CR>)
(<SOMEONE-WORKING?>
<TELL "There are too many people inside." CR>)
(<NOT <EQUAL? ,HERE ,SUB>>
<TELL "You should board the " D ,SUB " first." CR>)
(<NOT <EQUAL? <LOC ,TIP> ,SUB ,CRAWL-SPACE>>
<COND (<FSET? ,TIP ,BUSYBIT> <I-TIP-REPORTS>)
(T
<MOVE ,TIP ,SUB>
<TELL
"Tip rushes in just before you close it. \"Wait for me, "FN"!\"" CR>)>
<RFALSE>)>)
(<VERB? OPEN>
<COND (<AND <G? ,SUB-DEPTH 0>
<OR <NOT ,SUB-IN-DOME> ,AIRLOCK-FULL>>
<YOU-CANT "open" ,SUB "under water">
;<TELL "You can't open the hatch under water!" CR>)
(,SUB-IN-OPEN-SEA
<TELL "This is no time for a swim!" CR>)
(<NOT <EQUAL? ,HERE ,SUB ,NORTH-TANK-AREA ,AIRLOCK>>
<TELL "You can't reach" THE-PRSO " from here." CR>)
(<OR ,GREENUP-ESCAPE ,GREENUP-TRAPPED>
<FSET ,SUB-DOOR ,OPENBIT>
<TELL
;"[more?]" "Before the crew can carry out your order, the hatch opens.
Greenup rises into view from the pilot's seat and gives himself up. ">
<GREENUP-CUFF>
<RTRUE>)>)>>
<OBJECT SUB-WINDOW
(IN SUB)
(DESC "viewport")
;(ADJECTIVE VIEW)
(SYNONYM ;PORT VIEWPORT DIVING ;"WINDOW - gone so FIND WINDOW works")
(FLAGS NDESCBIT WINDOWBIT LOCKED)
;(GENERIC GENERIC-WINDOW-F ;LOCKED-F)
(ACTION SUB-WINDOW-F)>
<ROUTINE SUB-WINDOW-F ("AUX" ;(RM <WINDOW-ROOM ,HERE ,PRSO>) POP)
<COND (<VERB? BRUSH>
<ALREADY ,SUB-WINDOW "clean enough">)
(<VERB? LOOK-INSIDE LOOK-OUTSIDE>
<COND (T ;<EQUAL? ,HERE ,SUB>
<COND (,SUB-IN-TANK
<TELL"You can see the test tank outside."CR>)
(<EQUAL? ,NOW-TERRAIN ,BAY-TERRAIN>
<COND (<0? ,SUB-DEPTH>
<TELL
"Frobton is a busy seaport full of constantly moving pleasure boats,
fishing craft and commercial shipping. The biggest ships move in the shipping
lanes, but you can dive to 15 meters and go under them. Observe all
\"Rules of the Road\", unless you want to submerge. When you're
" D ,UNDERWATER ", you should avoid shallow areas called shoals."
;"(You'll find that information in your SEASTALKER package.)" CR>)
(T <PLENTY-WATER>)>)
(,SUB-IN-OPEN-SEA
<COND (<NOT <L? ,DISTANCE-FROM-BAY
,AQUADOME-VISIBLE>>
<TELL
"You can see the " D ,AQUADOME "." CR>)
(<NOT <FSET? ,WHALE ,INVISIBLE>>
<TELL
"The whale is still following you." CR>)
(<FSET? ,SEARCH-BEAM ,ONBIT>
<TELL
"Your sub's " D ,SEARCH-BEAM " lights up the " D ,GLOBAL-WATER " outside."CR>)
(T <PLENTY-WATER>)>)
(<AND <EQUAL? ,NOW-TERRAIN ,SEA-TERRAIN>
<EQUAL? ,SUB-DEPTH ,AIRLOCK-DEPTH>
<G? 4 <+ <* ,SUB-LON ,SUB-LON>
<* ,SUB-LAT ,SUB-LAT>>>>
<TELL "You can see the " D ,AQUADOME "." CR>)
(,SUB-IN-DOME
<ROOM-PEEK ,AIRLOCK>
<RTRUE>)
(<NOT <FSET? ,SNARK ,INVISIBLE>>
<COND (,SUB-IN-BATTLE
<TOO-CLOUDY>)
(T <TELL
"You can see the " D ,SNARK " and the " D ,THORPE-SUB " in the "
D ,SEARCH-BEAM " beam." CR>)>)
(T <PLENTY-WATER>)>)>
<RTRUE>)
(<VERB? MUNG>
<TELL
"Vandalism is for vandals, not famous inventors!" CR>)
(<VERB? OPEN CLOSE LOCK UNLOCK>
;<COND (<FSET? ,PRSO ,MUNGBIT>
<TELL "It's really broken. ">)>
<TELL "You can't." CR>)
(<VERB? STOP> ;"STOP DIVING!"
<PERFORM ,V?LEVEL>
<RTRUE>)>>
<ROUTINE TOO-CLOUDY ()
<TELL "The " D ,GLOBAL-WATER " is too cloudy to see much." CR>>
<ROUTINE PLENTY-WATER ()
<TELL "You can see plenty of " D ,GLOBAL-WATER "." CR>>
;<ROUTINE WINDOW-KNOCK (RM)
<COND (<INHABITED? .RM>
<TELL "Someone looks up at you inquisitively." CR>)>>
<OBJECT ENGINE-ACCESS-HATCH
(IN LOCAL-GLOBALS)
(DESC "access panel")
(ADJECTIVE ENGINE ACCESS STENCIL)
(SYNONYM PANEL ;DOOR ;HATCH SIGN)
(FLAGS DOORBIT VOWELBIT)
(ACTION ENGINE-ACCESS-HATCH-F)>
<ROUTINE ENGINE-ACCESS-HATCH-F ()
<COND ;(<AND <VERB? LOOK-INSIDE> <IN? ,WINNER ,SUB>> ;"let verb handle it"
<TELL <GETP ,CRAWL-SPACE ,P?LDESC> CR>)
(<VERB? TAKE>
<COND (<NOT ,PRSI>
<PERFORM ,V?OPEN ,PRSO>
<RTRUE>)>)
(<VERB? TAKE-WITH>
<COND (<EQUAL? ,PRSI ,UNIVERSAL-TOOL>
<PERFORM ,V?OPEN-WITH ,PRSO ,PRSI>
<RTRUE>)>)
(<AND <VERB? OPEN OPEN-WITH>
<DOBJ? ENGINE-ACCESS-HATCH>
<IN? ,WINNER ,SUB>
<NOT <IN? ,UNIVERSAL-TOOL ,WINNER>>>
<TELL "Suggest you read the stenciled sign." CR>)
(<AND <VERB? READ EXAMINE ANALYZE> <IN? ,WINNER ,SUB>>
<TELL "\"THIS REQUIRES SPECIAL ULTRA WRENCH FROM SUB TOOL KIT.\""CR>
<COND (<IN? ,UNIVERSAL-TOOL ,TIP>
<THIS-IS-IT ,UNIVERSAL-TOOL>
<TELL-HINT 61 ;7 ,TIP <>>)>
<RTRUE>)>>
<ROOM CRAWL-SPACE
(IN ROOMS)
(DESC "crawl space")
(LDESC
"The space is dimly illuminated by small work lights, but you can see
machinery everywhere.")
(ADJECTIVE ENGINE ;COMPARE CRAWL ACCESS)
(SYNONYM COMPARE ;CRAWL SPACE ROOM AREA)
(FLAGS RLANDBIT ONBIT)
(NORTH "The only way out is \"OUT\".") ;"? SOUTH?"
(NE "The only way out is \"OUT\".")
(EAST "The only way out is \"OUT\".")
(SE "The only way out is \"OUT\".")
(SOUTH "The only way out is \"OUT\".")
(SW "The only way out is \"OUT\".")
(WEST "The only way out is \"OUT\".")
(NW "The only way out is \"OUT\".")
(OUT TO SUB IF ENGINE-ACCESS-HATCH IS OPEN)
(UP TO SUB IF ENGINE-ACCESS-HATCH IS OPEN)
(ACTION CRAWL-SPACE-F)
(GLOBAL LOCAL-SUB ENGINE-ACCESS-HATCH ;CRAWL-SPACE-OBJ
LIGHTS TEST-BUTTON)
(PSEUDO "MACHIN" RANDOM-PSEUDO)
(TEXT "(You'll find that information in your SEASTALKER package.)")>
<OBJECT LIGHTS
(IN LOCAL-GLOBALS)
(DESC "lights")
(SYNONYM LIGHT LIGHTS)>
<ROUTINE CRAWL-SPACE-F ("OPTIONAL" (RARG <>))
<COND (<==? .RARG ,M-BEG>
<COND (<EXIT-VERB?> <MOVE ,ENGINE ,SUB> <RFALSE>)>
<COND (<GAME-VERB?> <RFALSE>)>
<COND (<==? ,P-ADVERB ,W?CAREFULLY> <RFALSE>)>
<COND (<AND <PROB 20 ;10>
<FSET? ,ENGINE ,ONBIT>
<NOT ,SUB-IN-TANK>
<NOT ,SUB-IN-DOME>>
<TELL
"|
Suddenly the " D ,SUB " begins to shake violently! Your foot has
knocked an engine bearing out of alignment! It will be necessary to
surface at once and await rescue! Your mission must be aborted.">
<FINISH>)
(<AND <PROB 20 ;10>
<FSET? ,GASH ,INVISIBLE> ;<NOT >>
<FSET ,ARM ,MUNGBIT>
<FCLEAR ,GASH ,INVISIBLE>
<TELL
"There's a sharp pain in your right arm! A flood of wet warmth and a
spreading red stain mean you've seriously gashed your arm
on a sharp metal corner!" CR>
<RFALSE>)>)
(<EQUAL? .RARG ,M-ENTER>
<COND (<NOT <0? <POPULATION ,CRAWL-SPACE ,PLAYER>>>
;<FIND-FLAG ,CRAWL-SPACE ,PERSON ,WINNER>
<TOO-CROWDED>
<GOTO ,SUB>
;<RTRUE>)
(T <MOVE ,ENGINE ,CRAWL-SPACE> <RFALSE>)>)
;(<EQUAL? .RARG ,M-LOOK>
<TELL <GETP ,CRAWL-SPACE ,P?LDESC> CR>)
(.RARG <RFALSE>)
(<VERB? FIND>
<COND (<EQUAL? ,HERE ,CRAWL-SPACE> <TELL "You're in it!" CR>)
(T <TELL
"It's located beyond an " D ,ENGINE-ACCESS-HATCH " in the bulkhead just
below and to the right of control panel." CR>)>)
(<VERB? OPEN LOOK-INSIDE>
<COND (<DOBJ? CRAWL-SPACE>
<PERFORM ,PRSA ,ENGINE-ACCESS-HATCH ,PRSI>
<RTRUE>)>)
(<VERB? ;ENTER THROUGH WALK-TO>
<COND (<FSET? ,ENGINE-ACCESS-HATCH ,OPENBIT>
<COND (<GOTO ,CRAWL-SPACE>
<TELL
"BE CAREFUL: Too much wriggling may pose SERIOUS DANGERS!">
<COND (<FSET? ,ENGINE ,ONBIT>
<TELL
" And wouldn't it be safer to stop the engine first?">)>
<CRLF>)>
<RTRUE>)
(T
<TOO-BAD-BUT ,ENGINE-ACCESS-HATCH "closed">
<THIS-IS-IT ,ENGINE-ACCESS-HATCH>
<RFATAL>)>)>>
<OBJECT VOLTAGE-REGULATOR
(IN CRAWL-SPACE)
(DESC "voltage regulator")
(ADJECTIVE VOLTAGE)
(SYNONYM REGULATOR)
(FLAGS NDESCBIT MUNGBIT)
(ACTION VOLTAGE-REGULATOR-F)
;(VALUE 4)>
<ROUTINE VOLTAGE-REGULATOR-F ()
<COND (<VERB? WALK-TO>
<COND (<NOT <EQUAL? ,HERE ,CRAWL-SPACE>>
<PERFORM ,PRSA ,CRAWL-SPACE>
<RTRUE>)>)
(<VERB? FIND>
<COND (<EQUAL? ,HERE ,CRAWL-SPACE>
<FCLEAR ,VOLTAGE-REGULATOR ,NDESCBIT>
<TELL
"You find it in the middle of some complicated machinery." CR>)>)
(<VERB? ANALYZE EXAMINE>
<COND (<FSET? ,VOLTAGE-REGULATOR ,MUNGBIT>
<TELL "It's hard to tell anything by looking at it." CR>)>)
(<VERB? ADJUST FIX>
<COND (<FSET? ,ARM ,MUNGBIT>
<TELL "You can't do that since you gashed your arm!" CR>)
(<NOT <FSET? ,VOLTAGE-REGULATOR ,MUNGBIT>>
<ALREADY ,VOLTAGE-REGULATOR "fixed">)
(T
<SETG TEST-BUTTON-READOUT ,TEST-BUTTON-NORMAL>
<TELL "Fixed." CR>
<COOL-BACK>
<FCLEAR ,VOLTAGE-REGULATOR ,MUNGBIT>
;<FSET ,ENGINE-ACCESS-HATCH ,NDESCBIT>
;<SCORE-OBJ ,VOLTAGE-REGULATOR>
<RTRUE>)>)>>
<ROUTINE COOL-BACK ("AUX" X)
<COND (<AND <L? 20 ,CIRCUIT-TEMP>
<FSET? ,VOLTAGE-REGULATOR ,MUNGBIT>>
<SET X <- ,CIRCUIT-TEMP 15>>
<TELL "It will take about " N .X " turn">
<COND (<NOT <1? .X>> <TELL "s">)>
<TELL
" for the " D ,CONTROL-CIRCUITS " to cool to a normal operating temperature."
CR>)>>
"<CONSTANT LAB-LON 1>
<CONSTANT LAB-LAT 9>"
<CONSTANT SEA-WALL-LON 32>
<CONSTANT SEA-WALL-LAT 38>
<CONSTANT SPIRE-LON 29>
<CONSTANT SPIRE-LAT 26>
<GLOBAL SUB-LON 2>
<GLOBAL SUB-LAT 9>
<GLOBAL SUB-DLON 0>
<GLOBAL SUB-DLAT 0>
<GLOBAL TBL5-MASK <PTABLE *77777* *7777* *777* *77* *7*>>
<GLOBAL TBL5-SHIFT <PTABLE *10000* *1000* *100* *10* 1>>
<ROUTINE GET5 (TBL5 NUM "AUX" (NUM1 <- .NUM 1>))
</ <ANDB <GET ,TBL5-MASK <MOD .NUM1 5>>
<GET .TBL5 <+ 1 </ .NUM1 5>>>>
<GET ,TBL5-SHIFT <MOD .NUM1 5>>>>
<DEFINE LT5 ("ARGS" A)
<MAPF ,PLTABLE
<FUNCTION ("AUX" VAL)
<COND (<EMPTY? .A> <MAPSTOP>)>
<SET VAL <LSH <1 .A> 12>>
<COND (<EMPTY? <SET A <REST .A>>>
<MAPSTOP <CHTYPE .VAL FIX>>)>
<SET VAL <ORB .VAL <LSH <1 .A> 9>>>
<COND (<EMPTY? <SET A <REST .A>>>
<MAPSTOP <CHTYPE .VAL FIX>>)>
<SET VAL <ORB .VAL <LSH <1 .A> 6>>>
<COND (<EMPTY? <SET A <REST .A>>>
<MAPSTOP <CHTYPE .VAL FIX>>)>
<SET VAL <ORB .VAL <LSH <1 .A> 3>>>
<COND (<EMPTY? <SET A <REST .A>>>
<MAPSTOP <CHTYPE .VAL FIX>>)>
<SET VAL <ORB .VAL <1 .A>>>
<SET A <REST .A>>
<CHTYPE .VAL FIX>>>>
<GLOBAL BAY-TERRAIN <PLTABLE
%<LT5
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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ETG WARNINGS-RTRUE T>)>
<SET TBL ,WARNINGS-THIS-TURN>
<COND (<==? <GET .TBL 0> ,WARNINGS-USED> <RTRUE>)>
<SET LEN <GET .TBL 0>>
<SET N 0>
<REPEAT ()
<COND (<IGRTR? N .LEN> <RETURN>)>
<SET M <GET .TBL .N>>
<COND (<=? .MSG .M> <RETURN>)
(<AND <EQUAL? .MSG 5> <EQUAL? .M 3 9>> <RETURN>)
(<AND <EQUAL? .MSG 6> <EQUAL? .M 4 11>><RETURN>)
(<AND <EQUAL? .MSG 8> <EQUAL? .M 7>> <RETURN>)
(<0? <GET .TBL .N>>
<PUT .TBL .N .MSG>
<SETG WARNINGS-USED .N>
<RETURN>)>>>
"<GLOBAL TOLD-ABOUT-SHIP <>>"
<ROUTINE GIVE-WARNINGS ("AUX" TBL LEN N MSG (SONAR? <>))
<SET TBL ,WARNINGS-THIS-TURN>
<SET LEN ,WARNINGS-USED>
<SET N 0>
<REPEAT ()
<COND (<IGRTR? N .LEN> <RETURN>)
(<0? <SET MSG <GET .TBL .N>>> <RETURN>)>
<SETG WARNINGS-USED 0>
<PUT .TBL .N 0>
<COND (,SUB-IN-OPEN-SEA <AGAIN>)>
<COND (<EQUAL? .MSG 1>
<TELL
"|
A speedboat came out of nowhere and almost hit you!
It's dangerous on the surface of the bay.">)
(<EQUAL? .MSG 2>
<SET SONAR? T>
<TELL
"|
If you don't change course or stop, you'll crash!">)
(<EQUAL? .MSG 3 4>
<THIS-IS-IT ,DEPTHFINDER-LIGHT>
<TELL
"Suddenly a loud " D ,ALARM-SUB " begins to ring! The " D ,DEPTHFINDER-LIGHT
" has begun to glow "
<COND (<EQUAL? .MSG 3> "orange") (T "red")> ".">)
(<EQUAL? .MSG 5 6>
<THIS-IS-IT ,ALARM-SUB>
<TELL
"The " D ,DEPTHFINDER-LIGHT " is still glowing "
<COND (<EQUAL? .MSG 5> "orange") (T "red")>
", and the " D ,ALARM-SUB " is still ringing.">)
(<EQUAL? .MSG 7 8>
<SET SONAR? T>
<TELL "The " D ,SONARSCOPE>
<COND (<EQUAL? .MSG 8>
<THIS-IS-IT ,SONARSCOPE>
<TELL " still">)>
<TELL " shows an obstacle ahead!">
<COND (<EQUAL? .MSG 7>
<THIS-IS-IT ,SUB>
<TELL
" Unless you change course, you will crash the " D ,SUB "!">)>)
(<EQUAL? .MSG 9 10 11>
<THIS-IS-IT ,ALARM-SUB>
<TELL "The " D ,DEPTHFINDER-LIGHT " "
<COND (<EQUAL? .MSG 9> "changes to orange")
(<EQUAL? .MSG 10> "fades to dark again")
(T "turns red")>
", and the " D ,ALARM-SUB " "
<COND (<EQUAL? .MSG 9> "continues to sound.")
(<EQUAL? .MSG 10> "ceases.")
(T "rises to a shriller whine.")>>)
(<EQUAL? .MSG 12 13>
<SET SONAR? T>
;<SETG TOLD-ABOUT-SHIP T>
<THIS-IS-IT ,FREIGHTER>
<TELL"The "D ,SONARSCOPE-LIGHT" is flashing yellow! A">
<COND (<EQUAL? .MSG 13> <TELL "nother">)>
<TELL " ship is approaching!">)
(<EQUAL? .MSG 14>
<SET SONAR? T>
<TELL
"|
The yellow " D ,SONARSCOPE-LIGHT " just turned red! A loud " D ,ALARM-SUB " is
sending chills up and down your spine! The keel of the approaching ship
is visible in your " D ,SUB-WINDOW>
<COND (<FSET? ,HYDROPHONE ,ONBIT>
<TELL
", and the noise of its screws booms over the " D ,HYDROPHONE>)>
<TELL "!">)>
<CRLF>>
<COND (<AND .SONAR?
<NOT ,AUTOMATIC-SONAR>
<0? ,LOOKED-AT-SONAR>>
<THIS-IS-IT ,SONARSCOPE>
<TIP-SAYS>
<TELL
"Hey, "FN", maybe you should look at the " D ,SONARSCOPE
".\"" CR>)>
<COND (,WARNINGS-RTRUE <SETG WARNINGS-RTRUE <>> <RTRUE>)>>
<ROUTINE SAVE-HINT ()
<TELL "(This might be a good time to use the command: SAVE.)" CR>>
<GLOBAL REGULATOR-MSG-SEEN <>>
<ROUTINE FALL-FROM-CLAW (NUM "AUX" X)
<COND (<SET X <GET ,ON-SUB .NUM>>
<TELL
"You can see" THE .X " fall out of the " D ,CLAW " and sink." CR>
<REMOVE .X>)>>
<ROUTINE I-UPDATE-SUB-POSITION ("AUX" ;DLON ;DLAT LON LAT DEP TH (VAL <>))
<COND (,SUB-IN-TANK <RFALSE>)>
<COND (<L? 0 ,CIRCUIT-TEMP>
<SETG CIRCUIT-TEMP <- ,CIRCUIT-TEMP 1>>)>
<COND (<FSET? ,VOLTAGE-REGULATOR ,MUNGBIT>
<SETG CIRCUIT-TEMP <+ ,CIRCUIT-TEMP ,THROTTLE-SETTING>>)>
<COND (<AND <L? 20 ,CIRCUIT-TEMP> <NOT ,CIRCUIT-TIP>>
<SETG CIRCUIT-TIP T>
<MOVE ,OVERHEATING ,GLOBAL-OBJECTS>
<TELL CR "Suddenly ">
<TIP-SAYS>
<TELL
FN "! Look at the way that
" D ,CONTROL-CIRCUITS " " D ,CONTROL-CIRCUITS-GAUGE " is rising!\"" CR>
<SET VAL T>)
(<AND <NOT <L? 20 ,CIRCUIT-TEMP>> ,CIRCUIT-TIP>
<SETG CIRCUIT-TIP <>>)
(<AND <NOT <L? 25 ,CIRCUIT-TEMP>> ,CIRCUIT-RED>
<SETG CIRCUIT-RED <>>
<COND (<EQUAL? ,HERE ,SUB>
<TELL CR
"The " D ,CONTROL-CIRCUITS-GAUGE " drops below the red danger zone." CR>)>)
(<AND <L? 25 ,CIRCUIT-TEMP> <NOT ,CIRCUIT-RED>>
<SETG CIRCUIT-RED T>
<TELL CR
"The " D ,CONTROL-CIRCUITS-GAUGE " has entered the red danger zone!|
The circuit tester is activated. Push " D ,TEST-BUTTON " for readout." CR>
<SETG TEST-BUTTON-READOUT ,REGULATOR-MSG>
<SET VAL T>)
(<L? 30 ,CIRCUIT-TEMP>
<TELL CR
"The " D ,CONTROL-CIRCUITS-GAUGE " has gone off the scale!|
The engine grinds to a halt. Your mission is finished.">
<FINISH>)>
<COND (,SUB-IN-DOME <RETURN .VAL>)
(<FSET? ,AUTO-PILOT ,ONBIT>
<SET TH ,THROTTLE-SETTING>
<REPEAT ()
<COND (<DLESS? TH 0> <RETURN>)>
<SETG DISTANCE-FROM-BAY <+ ,DISTANCE-FROM-BAY 1>>
<SET DEP </ ,DISTANCE-FROM-BAY 2>>
<COND (T ;<L? ,SUB-DEPTH .DEP>
<SETG TARGET-DEPTH .DEP>
<SETG SUB-DEPTH .DEP>)>
<COND (<==? ,DISTANCE-FROM-BAY 20>
<FALL-FROM-CLAW 0>
<FALL-FROM-CLAW 1>)
(<==? ,DISTANCE-FROM-BAY 30>