forked from historicalsource/seastalker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sub.zap
2962 lines (2784 loc) · 72.1 KB
/
sub.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 SUB-EXIT-F,X
FSET? SUB-DOOR,OPENBIT /?ELS5
CALL THIS-IS-IT,SUB-DOOR
PRINTI "The "
PRINTD SUB-DOOR
PRINTI " is closed."
CRLF
RFALSE
?ELS5: ZERO? SUB-IN-TANK /?ELS9
GET ON-SUB,0 >X
ZERO? X /?CND11
MOVE X,NORTH-TANK-AREA
?CND11: GET ON-SUB,1 >X
ZERO? X /?CND14
MOVE X,NORTH-TANK-AREA
?CND14: RETURN NORTH-TANK-AREA
?ELS9: ZERO? SUB-IN-DOME /?ELS18
ZERO? AIRLOCK-FULL /?ELS24
PRINTI "You can't go out while the "
PRINTD AIRLOCK
PRINTI " is full of water!"
CRLF
RFALSE
?ELS24: ZERO? DOME-AIR-BAD? \?CND30
FSET? AIR-SUPPLY-SYSTEM,MUNGBIT \?CND30
CALL QUEUE,I-DOME-AIR,DOME-AIR-ONSET
PUT STACK,0,1
IN? OXYGEN-GEAR,PLAYER /?CND30
CALL TELL-HINT,53,OXYGEN-GEAR,FALSE-VALUE
CRLF
?CND30: GET ON-SUB,0 >X
ZERO? X /?CND38
MOVE X,AIRLOCK
?CND38: GET ON-SUB,1 >X
ZERO? X /?CND41
MOVE X,AIRLOCK
?CND41: IN? MAGAZINE,TIP \?CND44
MOVE MAGAZINE,SUB
?CND44: CALL QUEUE,I-POISON-JAB,0
RETURN AIRLOCK
?ELS18: PRINTI "You can't go out of the "
PRINTD SUB
PRINTI " here!"
CRLF
RFALSE
.FUNCT DOCKING-VERB?
EQUAL? NOW-TERRAIN,BAY-TERRAIN,SEA-TERRAIN \FALSE
EQUAL? PRSA,V?DOCK /TRUE
EQUAL? PRSA,V?WALK \?ELS9
EQUAL? PRSO,P?IN /TRUE
?ELS9: EQUAL? PRSA,V?WALK-TO,V?THROUGH \FALSE
EQUAL? NOW-TERRAIN,BAY-TERRAIN \?ELS18
EQUAL? PRSO,YOUR-LABORATORY,TANK-GATE,TEST-TANK \FALSE
RTRUE
?ELS18: EQUAL? PRSO,AIRLOCK-HATCH /TRUE
EQUAL? PRSO,AQUADOME,AIRLOCK,DOCKING-TANK /TRUE
RFALSE
.FUNCT SOMEONE-WORKING?
CALL POPULATION,CRAWL-SPACE,PLAYER
ZERO? STACK \TRUE
CALL POPULATION,SUB,TIP,PLAYER
ZERO? STACK \TRUE
RFALSE
.FUNCT CANT-GO-TO-THRU-CLOSED-HATCH?,X
SET 'X,PRSO
FSET? PRSO,PERSON \?CND1
GETP PRSO,P?CHARACTER
GET CHARACTER-TABLE,STACK >X
?CND1: CALL GLOBAL-IN?,PRSO,SUB
ZERO? STACK \FALSE
CALL GLOBAL-IN?,PRSO,CRAWL-SPACE
ZERO? STACK \FALSE
EQUAL? X,DOCKING-TANK,TEST-TANK /?THN6
CALL META-LOC,X
EQUAL? STACK,SUB,CRAWL-SPACE,GLOBAL-OBJECTS /FALSE
?THN6: CALL SUB-EXIT-F
ZERO? STACK \FALSE
RTRUE
.FUNCT SUB-F,RARG=0,RM,X,?TMP1
EQUAL? RARG,M-BEG \?ELS5
ZERO? SUB-IN-TANK \?THN13
ZERO? SUB-IN-DOME /?ELS10
?THN13: EQUAL? PRSA,V?LAUNCH /?THN15
EQUAL? PRSA,V?LEAVE \?ELS10
EQUAL? PRSO,TEST-TANK,AIRLOCK \?ELS10
?THN15: CALL PERFORM,V?LAMP-ON,LOCAL-SUB
RTRUE
?ELS10: EQUAL? PRSA,V?STAND \?ELS20
PRINTR "There's no room in here!"
?ELS20: EQUAL? PRSA,V?$CALL \?ELS24
EQUAL? PRSO,FAST,MEDIUM,SLOW \FALSE
CALL PERFORM,V?SET,THROTTLE,PRSO
RTRUE
?ELS24: EQUAL? PRSA,V?LEAVE,V?DISEMBARK \?ELS31
ZERO? PRSO /?THN34
EQUAL? PRSO,LOCAL-SUB \?ELS31
?THN34: CALL SUB-EXIT-F >RM
ZERO? RM /TRUE
CALL GOTO,RM
ZERO? STACK /TRUE
EQUAL? WINNER,PLAYER /TRUE
CALL OKAY
RTRUE
?ELS31: CALL DOCKING-VERB?
ZERO? STACK /?ELS45
EQUAL? NOW-TERRAIN,BAY-TERRAIN \?ELS50
PRINTI "You can't go back to the "
PRINTD TEST-TANK
PRINTR " now!"
?ELS50: CALL SUB-OUTSIDE-AIRLOCK?
ZERO? STACK \?ELS54
CALL TOO-BAD-BUT,AIRLOCK,STR?16
RSTACK
?ELS54: FSET? AIRLOCK-HATCH,OPENBIT /?ELS56
CALL TOO-BAD-BUT,AIRLOCK-HATCH,STR?17
RSTACK
?ELS56: SET 'THROTTLE-SETTING,1
SET 'JOYSTICK-DIR,P?NORTH
SET 'SUB-DLON,0
SET 'SUB-DLAT,1
RTRUE
?ELS45: ZERO? SUB-IN-DOME \?ELS60
EQUAL? PRSA,V?WALK-TO,V?FIND \?ELS60
EQUAL? PRSO,DOCKING-TANK,AQUADOME,LOCAL-SUB \?ELS60
EQUAL? NOW-TERRAIN,BAY-TERRAIN,SEA-TERRAIN \FALSE
CALL PERFORM,V?FIND,PLAYER
RTRUE
?ELS60: EQUAL? PRSA,V?LEVEL,V?CLIMB-UP,V?CLIMB-DOWN \?ELS69
ZERO? SUB-IN-TANK \?THN75
ZERO? SUB-IN-DOME /?ELS74
?THN75: PRINTI "You can't do that while the "
PRINTD SUB
PRINTR " is here."
?ELS74: EQUAL? PRSA,V?LEVEL \?ELS80
SET 'TARGET-DEPTH,SUB-DEPTH
RTRUE
?ELS80: FSET? PRSO,UNITBIT \FALSE
EQUAL? PRSA,V?CLIMB-DOWN \?ELS85
MUL 5,SUB-DEPTH
ADD STACK,P-NUMBER >P-NUMBER
JUMP ?CND83
?ELS85: EQUAL? PRSA,V?CLIMB-UP \?CND83
MUL 5,SUB-DEPTH
SUB STACK,P-NUMBER >P-NUMBER
GRTR? 0,P-NUMBER \?CND83
PRINTR "You're not deep enough!"
?CND83: CALL PERFORM,V?DIVE,PRSO
RTRUE
?ELS69: EQUAL? PRSA,V?WALK \?ELS94
EQUAL? PRSO,UNDERWATER \?CND95
SET 'PRSO,P?DOWN
?CND95: LESS? PRSO,LOW-DIRECTION \?CND98
CALL V-WALK-AROUND
RTRUE
?CND98: EQUAL? PRSO,P?OUT,P?IN /FALSE
EQUAL? PRSO,P?UP,P?DOWN \?CND104
SET 'P-NUMBER,5
EQUAL? PRSO,P?UP \?ELS109
CALL PERFORM,V?CLIMB-UP,METER
RTRUE
?ELS109: CALL PERFORM,V?CLIMB-DOWN,METER
RTRUE
?CND104: EQUAL? PRSO,FAST,MEDIUM,SLOW \?CND112
CALL PERFORM,V?SET,THROTTLE,PRSO
RTRUE
?CND112: EQUAL? PRSO,P?EAST,P?SE,P?NE \?ELS117
SET 'SUB-DLON,1
JUMP ?CND115
?ELS117: EQUAL? PRSO,P?WEST,P?SW,P?NW \?ELS119
SET 'SUB-DLON,-1
JUMP ?CND115
?ELS119: SET 'SUB-DLON,0
?CND115: EQUAL? PRSO,P?NORTH,P?NW,P?NE \?ELS124
SET 'SUB-DLAT,1
JUMP ?CND122
?ELS124: EQUAL? PRSO,P?SOUTH,P?SW,P?SE \?ELS126
SET 'SUB-DLAT,-1
JUMP ?CND122
?ELS126: SET 'SUB-DLAT,0
?CND122: FSET? AUTO-PILOT,ONBIT \?ELS131
PRINTI "Let the "
PRINTD AUTO-PILOT
PRINTI " handle that."
CRLF
JUMP ?CND129
?ELS131: ZERO? SUB-IN-TANK /?ELS135
CALL TRY-TO-EMERGE,P?EAST,TANK-GATE,TEST-TANK-FULL
JUMP ?CND129
?ELS135: ZERO? SUB-IN-DOME /?ELS138
CALL TRY-TO-EMERGE,P?SOUTH,AIRLOCK-HATCH,AIRLOCK-FULL
JUMP ?CND129
?ELS138: CALL READY-FOR-SNARK?
ZERO? STACK /?ELS141
ZERO? TOLD-SNARK-WENT /?ELS141
FSET? SNARK,INVISIBLE \?ELS141
EQUAL? SUB-DEPTH,AIRLOCK-DEPTH \?ELS141
EQUAL? PRSO,P?SE \?ELS141
EQUAL? JOYSTICK-DIR,PRSO /?ELS141
PRINTI "Pulses racing and hearts thumping, you and Tip at last set out to capture the monstrous Snark!"
CRLF
JUMP ?CND129
?ELS141: CALL SUB-NOW-HEADING
?CND129: SET 'JOYSTICK-DIR,PRSO
RTRUE
?ELS94: EQUAL? PRSA,V?WALK-UNDER \?ELS149
EQUAL? PRSO,SEA,BAY,GLOBAL-WATER \?ELS149
ZERO? SUB-DEPTH \?ELS156
CALL DO-WALK,P?DOWN
RTRUE
?ELS156: PRINTI "You're already "
PRINTD UNDERWATER
PRINTR "."
?ELS149: CALL EXIT-VERB?
ZERO? STACK /?ELS162
CALL CANT-GO-TO-THRU-CLOSED-HATCH?
ZERO? STACK \TRUE
?ELS162: EQUAL? PRSA,V?LOOK-INSIDE,V?EXAMINE \?ELS169
EQUAL? PRSO,DOCKING-TANK,TEST-TANK \?ELS169
PRINT I-ASSUME
PRINTI " look through the "
PRINTD SUB-WINDOW
PRINTI ".)"
CRLF
CALL PERFORM,V?LOOK-INSIDE,SUB-WINDOW
RTRUE
?ELS169: EQUAL? PRSA,V?EXAMINE \?ELS175
EQUAL? PRSO,GLOBAL-SNARK,SNARK /?THN178
EQUAL? PRSO,GLOBAL-SHARON,GLOBAL-THORPE,THORPE-SUB \?ELS175
?THN178: FSET? SNARK,INVISIBLE /?ELS184
PRINTI "The "
PRINTD GLOBAL-WATER
PRINTR " is too cloudy to see anything."
?ELS184: CALL TOO-BAD-BUT,PRSO,STR?16
RSTACK
?ELS175: EQUAL? PRSA,V?DROP \?ELS190
GET ON-SUB,0 >?TMP1
GET ON-SUB,1
EQUAL? PRSO,?TMP1,STACK \?ELS190
GET ON-SUB,0
EQUAL? PRSO,STACK \?ELS195
PUT ON-SUB,0,FALSE-VALUE
JUMP ?CND193
?ELS195: GET ON-SUB,1
EQUAL? PRSO,STACK \?CND193
PUT ON-SUB,1,FALSE-VALUE
?CND193: ZERO? SUB-IN-TANK /?ELS200
MOVE PRSO,NORTH-TANK-AREA
JUMP ?CND198
?ELS200: ZERO? SUB-IN-DOME /?ELS203
MOVE PRSO,AIRLOCK
JUMP ?CND198
?ELS203: REMOVE PRSO
?CND198: FCLEAR PRSO,NDESCBIT
FSET PRSO,TAKEBIT
FCLEAR PRSO,TRYTAKEBIT
PRINTR "Dropped."
?ELS190: EQUAL? PRSA,V?TAKE-WITH \FALSE
EQUAL? PRSI,CLAW \FALSE
LOC PRSO
EQUAL? STACK,AIRLOCK,NORTH-TANK-AREA /?ELS217
CALL TOO-BAD-BUT,PRSO,STR?18
RSTACK
?ELS217: FSET? PRSO,TAKEBIT /?ELS219
CALL YOU-CANT,STR?19
RSTACK
?ELS219: CALL MOUNT-WEAPON,PRSO
ZERO? STACK /TRUE
PRINTR "Taken."
?ELS5: EQUAL? RARG,M-ENTER \?ELS227
CALL POPULATION,SUB,TIP,PLAYER
ZERO? STACK /?CND228
CALL TOO-CROWDED
ZERO? SUB-IN-DOME /?ELS233
CALL GOTO,AIRLOCK
RTRUE
?ELS233: ZERO? SUB-IN-TANK /TRUE
CALL GOTO,NORTH-TANK-AREA
RTRUE
?CND228: CALL QUEUE,I-POISON-JAB,9
PUT STACK,0,1
GET ON-SUB,0 >X
ZERO? X /?CND238
MOVE X,SUB
?CND238: GET ON-SUB,1 >X
ZERO? X /?CND241
MOVE X,SUB
?CND241: IN? ESCAPE-POD-UNIT,SUB \?CND244
FSET? SYRINGE,MUNGBIT \?CND244
FSET? SYRINGE,TOUCHBIT /?CND244
CALL QUEUE,I-CHECK-POD,1
PUT STACK,0,1
?CND244: ZERO? SUB-IN-DOME /?CND249
CALL READY-FOR-SNARK?
ZERO? STACK /?CND249
CALL SOMEONE-WORKING?
ZERO? STACK \?CND249
FCLEAR SUB-DOOR,OPENBIT
MOVE TIP,HERE
PRINTI "As you and Tip take your places in your seats, "
FSET? AIRLOCK-ROOF,OPENBIT \?ELS258
CALL AIRLOCK-POP?
ZERO? STACK \?ELS258
FCLEAR AIRLOCK-ROOF,OPENBIT
PRINTI "and close the hatch, the "
PRINTD AIRLOCK-ROOF
PRINTI " is also sliding shut."
CRLF
JUMP ?CND249
?ELS258: PRINTI "Tip closes the hatch."
CRLF
?CND249: CALL SCORE-OBJ,SUB
RTRUE
?ELS227: EQUAL? RARG,M-LOOK \FALSE
PRINTI "You're in the pilot's seat of the "
PRINTD SUB
PRINTI ", its operating "
PRINTD CONTROLS-SUB
PRINTI " before you."
FSET? ENGINE-ACCESS-HATCH,OPENBIT \?CND271
PRINTI " The "
PRINTD ENGINE-ACCESS-HATCH
PRINTI " is open."
?CND271: PRINTI "
A wraparound "
PRINTD SUB-WINDOW
PRINTI ", both fore and aft, provides a view ahead and astern."
ZERO? SUB-DEPTH \?CND278
ZERO? SUB-IN-TANK \?CND278
PRINTI " Sunlight pours in through the "
PRINTD SUB-WINDOW
PRINTI "."
?CND278: PRINTI " You can also observe your surroundings with a "
PRINTD SONARSCOPE
PRINTI " and a "
PRINTD HYDROPHONE
PRINTI " listening device. There's a "
PRINTD SONARPHONE
PRINTR " for communication. You'll discover other features when you need them."
.FUNCT TOO-CROWDED
PRINTR "It's too crowded in here! You'll have to wait outside."
.FUNCT TRY-TO-EMERGE,DIR,GATE,FULL?
ZERO? FULL? \?ELS5
PRINTI "You can't turn the sub around while the "
EQUAL? DIR,P?EAST \?ELS10
PRINTD TEST-TANK
JUMP ?CND8
?ELS10: PRINTD AIRLOCK
?CND8: PRINTR " is empty."
?ELS5: EQUAL? PRSO,DIR \?ELS20
ZERO? THROTTLE-SETTING /?ELS25
FSET? ENGINE,ONBIT /?ELS30
PRINTI "Nothing happens when you push the "
PRINTD JOYSTICK
PRINTI ". The engine is off."
ZERO? GATE-CRASHED /?CND33
PRINTI " It was stopped by Automatic Shutoff when you crashed into the sea gate."
?CND33: CRLF
RTRUE
?ELS30: CALL HATCH-GATE-NOT-READY?,GATE
ZERO? STACK \TRUE
EQUAL? DIR,P?SOUTH \?ELS42
CALL SUB-LEAVES,FALSE-VALUE,P?SOUTH
RSTACK
?ELS42: CALL SUB-LEAVES,TRUE-VALUE,P?EAST
RSTACK
?ELS25: CALL SUB-NOW-HEADING
RSTACK
?ELS20: PRINTI "Okay, the "
PRINTD JOYSTICK
PRINTI " is now pointing to "
CALL DIR-PRINT,PRSO
PRINTI ". But the only way the sub can leave the tank is to "
CALL DIR-PRINT,DIR
PRINTR "."
.FUNCT HATCH-GATE-NOT-READY?,GATE
FSET? SUB-DOOR,OPENBIT \?ELS5
CALL THIS-IS-IT,SUB-DOOR
PRINTR "You shouldn't leave the tank with the hatch open!"
?ELS5: FSET? GATE,OPENBIT /FALSE
CALL GATE-CRASH,STR?20,JOYSTICK,GATE
RTRUE
.FUNCT READY-FOR-SNARK?
GET ON-SUB,0
EQUAL? BAZOOKA,STACK /?THN3
GET ON-SUB,1
EQUAL? DART,STACK \FALSE
?THN3: RETURN FINE-SONAR
.FUNCT SUB-LEAVES,FROM-LAB?,DIR
ZERO? FROM-LAB? /?ELS3
SET 'GATE-CRASHED,FALSE-VALUE
SET 'SUB-IN-TANK,FALSE-VALUE
REMOVE SHARON
CALL ROB,SHARON,GLOBAL-SHARON
SET 'ALARM-RINGING,FALSE-VALUE
GETPT VIDEOPHONE-2,P?SYNONYM
PUT STACK,0,W?ZZZZLG
CALL QUEUE,I-UPDATE-SUB-POSITION,-1
PUT STACK,0,1
SET 'MONSTER-GONE,TRUE-VALUE
SET 'NOW-TERRAIN,BAY-TERRAIN
JUMP ?CND1
?ELS3: SET 'SUB-IN-DOME,FALSE-VALUE
SET 'NOW-TERRAIN,SEA-TERRAIN
SET 'SUB-LON,0
SET 'SUB-LAT,-1
SET 'SUB-DEPTH,AIRLOCK-DEPTH
SET 'TARGET-DEPTH,AIRLOCK-DEPTH
?CND1: ZERO? AUTOMATIC-SONAR /?CND7
CALL SPLIT-SCREEN?
ZERO? STACK /?CND7
SET 'SCREEN-NOW-SPLIT,TRUE-VALUE
CALL START-SONAR?
?CND7: PRINTI "The "
PRINTD SUB
PRINTI " glides smoothly out of the tank "
ZERO? FROM-LAB? /?ELS16
PRINTI "onto the surface of "
PRINTD BAY
JUMP ?CND14
?ELS16: PRINTI "into the ocean"
?CND14: PRINTI ". You're heading "
CALL DIR-PRINT,DIR,FALSE-VALUE
PRINTI " at "
PRINTN THROTTLE-SETTING
PRINTI " "
PRINTD GRID-UNIT
EQUAL? 1,THROTTLE-SETTING /?CND28
PRINTI "s"
?CND28: PRINTI " per turn."
CRLF
ZERO? FROM-LAB? /?ELS37
CALL SCORE-OBJ,BAY
JUMP ?CND35
?ELS37: FSET? TIP,BUSYBIT \?CND41
CALL I-TIP-REPORTS
?CND41: CALL READY-FOR-SNARK?
ZERO? STACK /?ELS46
CALL SCORE-OBJ,AIRLOCK
SET 'LEFT-DOME,MOVES
CALL QUEUE,I-THORPE-APPEARS,-1
PUT STACK,0,1
JUMP ?CND35
?ELS46: CALL TIP-SAYS
PRINTI "I've got a bad feeling about this. I don't think we should go out there without a "
ZERO? FINE-SONAR /?ELS53
PRINTI "weapon of some kind."""
CRLF
JUMP ?CND44
?ELS53: PRINTD FINE-GRID
PRINTI "."""
CRLF
?CND44:
?CND35: CALL SAVE-HINT
RTRUE
.FUNCT HEADING-FOR-SEAWALL?,Y-X
EQUAL? NOW-TERRAIN,BAY-TERRAIN \FALSE
CALL OBSTACLE-AHEAD?,SUB-DEPTH,SUB-LON,SUB-LAT
ZERO? STACK \FALSE
EQUAL? PRSO,P?NORTH \?ELS9
GRTR? SUB-LON,29 \FALSE
LESS? SUB-LON,35 /TRUE
?ELS9: EQUAL? PRSO,P?EAST \?ELS18
GRTR? SUB-LAT,35 \FALSE
LESS? SUB-LAT,41 /TRUE
?ELS18: EQUAL? PRSO,P?NE \FALSE
SUB SUB-LAT,SUB-LON >Y-X
GRTR? Y-X,0 \FALSE
LESS? Y-X,12 /TRUE
RFALSE
.FUNCT SUB-NOW-HEADING
PRINTI "Okay, the "
PRINTD SUB
PRINTI " is "
EQUAL? JOYSTICK-DIR,PRSO \?ELS5
ZERO? SUB-IN-BATTLE \?CND6
INC 'SUB-STILL-HEADING
?CND6: PRINTI "still "
JUMP ?CND3
?ELS5: PRINTI "now "
?CND3: ZERO? THROTTLE-SETTING \?ELS17
PRINTI "facing"
JUMP ?CND15
?ELS17: PRINTI "moving"
?CND15: PRINTI " toward "
CALL DIR-PRINT,PRSO
CALL HEADING-FOR-SEAWALL?
ZERO? STACK /?CND26
PRINTI ", straight toward the opening in the "
PRINTD SEA-WALL
?CND26: ZERO? THROTTLE-SETTING \?CND31
CALL THIS-IS-IT,THROTTLE
PRINTI ". But it won't go that way unless you open the "
PRINTD THROTTLE
?CND31: PRINTI "."
CRLF
EQUAL? SUB-STILL-HEADING,9 \FALSE
SET 'SUB-STILL-HEADING,0
PRINTI "(You didn't change the "
PRINTD SUB
PRINTI "'s heading. Remember, you don't have to type a "
PRINTD INTDIR
PRINTR " every turn if you want to WAIT or do something else.)"
.FUNCT SUB-DOOR-F
EQUAL? PRSA,V?CLOSE \?ELS5
ZERO? SUB-IN-DOME /?ELS10
FSET? AIR-SUPPLY-SYSTEM,MUNGBIT \?ELS10
PRINTR "It's too soon for that!"
?ELS10: CALL SOMEONE-WORKING?
ZERO? STACK /?ELS16
PRINTR "There are too many people inside."
?ELS16: EQUAL? HERE,SUB /?ELS20
PRINTI "You should board the "
PRINTD SUB
PRINTR " first."
?ELS20: LOC TIP
EQUAL? STACK,SUB,CRAWL-SPACE /FALSE
FSET? TIP,BUSYBIT \?ELS27
CALL I-TIP-REPORTS
RFALSE
?ELS27: MOVE TIP,SUB
PRINTI "Tip rushes in just before you close it. ""Wait for me, "
CALL PRINT-NAME,FIRST-NAME
PRINTI "!"""
CRLF
RFALSE
?ELS5: EQUAL? PRSA,V?OPEN \FALSE
GRTR? SUB-DEPTH,0 \?ELS38
ZERO? SUB-IN-DOME /?THN41
ZERO? AIRLOCK-FULL /?ELS38
?THN41: CALL YOU-CANT,STR?21,SUB,STR?22
RSTACK
?ELS38: ZERO? SUB-IN-OPEN-SEA /?ELS44
PRINTR "This is no time for a swim!"
?ELS44: EQUAL? HERE,SUB,NORTH-TANK-AREA,AIRLOCK /?ELS49
PRINTI "You can't reach"
CALL THE-PRSO-PRINT
PRINTR " from here."
?ELS49: ZERO? GREENUP-ESCAPE \?THN54
ZERO? GREENUP-TRAPPED /FALSE
?THN54: FSET SUB-DOOR,OPENBIT
PRINTI "Before the crew can carry out your order, the hatch opens. Greenup rises into view from the pilot's seat and gives himself up. "
CALL GREENUP-CUFF
RTRUE
.FUNCT SUB-WINDOW-F,POP,?TMP1
EQUAL? PRSA,V?BRUSH \?ELS5
CALL ALREADY,SUB-WINDOW,STR?23
RSTACK
?ELS5: EQUAL? PRSA,V?LOOK-OUTSIDE,V?LOOK-INSIDE \?ELS7
ZERO? SUB-IN-TANK /?ELS13
PRINTR "You can see the test tank outside."
?ELS13: EQUAL? NOW-TERRAIN,BAY-TERRAIN \?ELS18
ZERO? SUB-DEPTH \?ELS21
PRINTI "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 "
PRINTD UNDERWATER
PRINTR ", you should avoid shallow areas called shoals."
?ELS21: CALL PLENTY-WATER
RTRUE
?ELS18: ZERO? SUB-IN-OPEN-SEA /?ELS27
LESS? DISTANCE-FROM-BAY,AQUADOME-VISIBLE /?ELS31
PRINTI "You can see the "
PRINTD AQUADOME
PRINTR "."
?ELS31: FSET? WHALE,INVISIBLE /?ELS35
PRINTR "The whale is still following you."
?ELS35: FSET? SEARCH-BEAM,ONBIT \?ELS39
PRINTI "Your sub's "
PRINTD SEARCH-BEAM
PRINTI " lights up the "
PRINTD GLOBAL-WATER
PRINTR " outside."
?ELS39: CALL PLENTY-WATER
RTRUE
?ELS27: EQUAL? NOW-TERRAIN,SEA-TERRAIN \?ELS45
EQUAL? SUB-DEPTH,AIRLOCK-DEPTH \?ELS45
MUL SUB-LON,SUB-LON >?TMP1
MUL SUB-LAT,SUB-LAT
ADD ?TMP1,STACK
GRTR? 4,STACK \?ELS45
PRINTI "You can see the "
PRINTD AQUADOME
PRINTR "."
?ELS45: ZERO? SUB-IN-DOME /?ELS51
CALL ROOM-PEEK,AIRLOCK
RTRUE
?ELS51: FSET? SNARK,INVISIBLE /?ELS54
ZERO? SUB-IN-BATTLE /?ELS57
CALL TOO-CLOUDY
RTRUE
?ELS57: PRINTI "You can see the "
PRINTD SNARK
PRINTI " and the "
PRINTD THORPE-SUB
PRINTI " in the "
PRINTD SEARCH-BEAM
PRINTR " beam."
?ELS54: CALL PLENTY-WATER
RTRUE
?ELS7: EQUAL? PRSA,V?MUNG \?ELS66
PRINTR "Vandalism is for vandals, not famous inventors!"
?ELS66: EQUAL? PRSA,V?UNLOCK /?THN71
EQUAL? PRSA,V?LOCK,V?CLOSE,V?OPEN \?ELS70
?THN71: PRINTR "You can't."
?ELS70: EQUAL? PRSA,V?STOP \FALSE
CALL PERFORM,V?LEVEL
RTRUE
.FUNCT TOO-CLOUDY
PRINTI "The "
PRINTD GLOBAL-WATER
PRINTR " is too cloudy to see much."
.FUNCT PLENTY-WATER
PRINTI "You can see plenty of "
PRINTD GLOBAL-WATER
PRINTR "."
.FUNCT ENGINE-ACCESS-HATCH-F
EQUAL? PRSA,V?TAKE \?ELS5
ZERO? PRSI \FALSE
CALL PERFORM,V?OPEN,PRSO
RTRUE
?ELS5: EQUAL? PRSA,V?TAKE-WITH \?ELS12
EQUAL? PRSI,UNIVERSAL-TOOL \FALSE
CALL PERFORM,V?OPEN-WITH,PRSO,PRSI
RTRUE
?ELS12: EQUAL? PRSA,V?OPEN-WITH,V?OPEN \?ELS19
EQUAL? PRSO,ENGINE-ACCESS-HATCH \?ELS19
IN? WINNER,SUB \?ELS19
IN? UNIVERSAL-TOOL,WINNER /?ELS19
PRINTR "Suggest you read the stenciled sign."
?ELS19: EQUAL? PRSA,V?ANALYZE,V?EXAMINE,V?READ \FALSE
IN? WINNER,SUB \FALSE
PRINTI """THIS REQUIRES SPECIAL ULTRA WRENCH FROM SUB TOOL KIT."""
CRLF
IN? UNIVERSAL-TOOL,TIP \TRUE
CALL THIS-IS-IT,UNIVERSAL-TOOL
CALL TELL-HINT,61,TIP,FALSE-VALUE
RTRUE
.FUNCT CRAWL-SPACE-F,RARG=0
EQUAL? RARG,M-BEG \?ELS5
CALL EXIT-VERB?
ZERO? STACK /?CND6
MOVE ENGINE,SUB
RFALSE
?CND6: CALL GAME-VERB?
ZERO? STACK \FALSE
EQUAL? P-ADVERB,W?CAREFULLY /FALSE
RANDOM 100
GRTR? 20,STACK \?ELS19
FSET? ENGINE,ONBIT \?ELS19
ZERO? SUB-IN-TANK \?ELS19
ZERO? SUB-IN-DOME \?ELS19
PRINTI "
Suddenly the "
PRINTD SUB
PRINTI " 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."
CALL FINISH
RSTACK
?ELS19: RANDOM 100
GRTR? 20,STACK \FALSE
FSET? GASH,INVISIBLE \FALSE
FSET ARM,MUNGBIT
FCLEAR GASH,INVISIBLE
PRINTI "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!"
CRLF
RFALSE
?ELS5: EQUAL? RARG,M-ENTER \?ELS31
CALL POPULATION,CRAWL-SPACE,PLAYER
ZERO? STACK /?ELS36
CALL TOO-CROWDED
CALL GOTO,SUB
RSTACK
?ELS36: MOVE ENGINE,CRAWL-SPACE
RFALSE
?ELS31: ZERO? RARG \FALSE
EQUAL? PRSA,V?FIND \?ELS43
EQUAL? HERE,CRAWL-SPACE \?ELS48
PRINTR "You're in it!"
?ELS48: PRINTI "It's located beyond an "
PRINTD ENGINE-ACCESS-HATCH
PRINTR " in the bulkhead just below and to the right of control panel."
?ELS43: EQUAL? PRSA,V?LOOK-INSIDE,V?OPEN \?ELS56
EQUAL? PRSO,CRAWL-SPACE \FALSE
CALL PERFORM,PRSA,ENGINE-ACCESS-HATCH,PRSI
RTRUE
?ELS56: EQUAL? PRSA,V?WALK-TO,V?THROUGH \FALSE
FSET? ENGINE-ACCESS-HATCH,OPENBIT \?ELS68
CALL GOTO,CRAWL-SPACE
ZERO? STACK /TRUE
PRINTI "BE CAREFUL: Too much wriggling may pose SERIOUS DANGERS!"
FSET? ENGINE,ONBIT \?CND74
PRINTI " And wouldn't it be safer to stop the engine first?"
?CND74: CRLF
RTRUE
?ELS68: CALL TOO-BAD-BUT,ENGINE-ACCESS-HATCH,STR?17
CALL THIS-IS-IT,ENGINE-ACCESS-HATCH
RETURN 2
.FUNCT VOLTAGE-REGULATOR-F
EQUAL? PRSA,V?WALK-TO \?ELS5
EQUAL? HERE,CRAWL-SPACE /FALSE
CALL PERFORM,PRSA,CRAWL-SPACE
RTRUE
?ELS5: EQUAL? PRSA,V?FIND \?ELS12
EQUAL? HERE,CRAWL-SPACE \FALSE
FCLEAR VOLTAGE-REGULATOR,NDESCBIT
PRINTR "You find it in the middle of some complicated machinery."
?ELS12: EQUAL? PRSA,V?EXAMINE,V?ANALYZE \?ELS21
FSET? VOLTAGE-REGULATOR,MUNGBIT \FALSE
PRINTR "It's hard to tell anything by looking at it."
?ELS21: EQUAL? PRSA,V?FIX,V?ADJUST \FALSE
FSET? ARM,MUNGBIT \?ELS35
PRINTR "You can't do that since you gashed your arm!"
?ELS35: FSET? VOLTAGE-REGULATOR,MUNGBIT /?ELS39
CALL ALREADY,VOLTAGE-REGULATOR,STR?27
RSTACK
?ELS39: SET 'TEST-BUTTON-READOUT,TEST-BUTTON-NORMAL
PRINTI "Fixed."
CRLF
CALL COOL-BACK
FCLEAR VOLTAGE-REGULATOR,MUNGBIT
RTRUE
.FUNCT COOL-BACK,X
LESS? 20,CIRCUIT-TEMP \FALSE
FSET? VOLTAGE-REGULATOR,MUNGBIT \FALSE
SUB CIRCUIT-TEMP,15 >X
PRINTI "It will take about "
PRINTN X
PRINTI " turn"
EQUAL? X,1 /?CND10
PRINTI "s"
?CND10: PRINTI " for the "
PRINTD CONTROL-CIRCUITS
PRINTR " to cool to a normal operating temperature."
.FUNCT GET5,TBL5,NUM,NUM1,?TMP1
SUB NUM,1 >NUM1
MOD NUM1,5
GET TBL5-MASK,STACK >?TMP1
DIV NUM1,5
ADD 1,STACK
GET TBL5,STACK
BAND ?TMP1,STACK >?TMP1
MOD NUM1,5
GET TBL5-SHIFT,STACK
DIV ?TMP1,STACK
RSTACK
.FUNCT ADD-WARNING,MSG,RTRUE?=0,TBL,LEN,N,M
ZERO? RTRUE? /?CND1
SET 'WARNINGS-RTRUE,TRUE-VALUE
?CND1: SET 'TBL,WARNINGS-THIS-TURN
GET TBL,0
EQUAL? STACK,WARNINGS-USED /TRUE
GET TBL,0 >LEN
SET 'N,0
?PRG8: IGRTR? 'N,LEN /TRUE
GET TBL,N >M
EQUAL? MSG,M /TRUE
EQUAL? MSG,5 \?ELS17
EQUAL? M,3,9 /TRUE
?ELS17: EQUAL? MSG,6 \?ELS21
EQUAL? M,4,11 /TRUE
?ELS21: EQUAL? MSG,8 \?ELS25
EQUAL? M,7 /TRUE
?ELS25: GET TBL,N
ZERO? STACK \?PRG8
PUT TBL,N,MSG
SET 'WARNINGS-USED,N
RTRUE
.FUNCT GIVE-WARNINGS,TBL,LEN,N,MSG,SONAR?=0
SET 'TBL,WARNINGS-THIS-TURN
SET 'LEN,WARNINGS-USED
SET 'N,0
?PRG1: IGRTR? 'N,LEN \?ELS5
JUMP ?REP2
?ELS5: GET TBL,N >MSG
ZERO? MSG \?CND3
JUMP ?REP2
?CND3: SET 'WARNINGS-USED,0
PUT TBL,N,0
ZERO? SUB-IN-OPEN-SEA /?CND8
JUMP ?PRG1
?CND8: EQUAL? MSG,1 \?ELS14
PRINTI "
A speedboat came out of nowhere and almost hit you! It's dangerous on the surface of the bay."
JUMP ?CND12
?ELS14: EQUAL? MSG,2 \?ELS18
SET 'SONAR?,TRUE-VALUE
PRINTI "
If you don't change course or stop, you'll crash!"
JUMP ?CND12
?ELS18: EQUAL? MSG,3,4 \?ELS22
CALL THIS-IS-IT,DEPTHFINDER-LIGHT
PRINTI "Suddenly a loud "
PRINTD ALARM-SUB
PRINTI " begins to ring! The "
PRINTD DEPTHFINDER-LIGHT
PRINTI " has begun to glow "
EQUAL? MSG,3 \?ELS29
PUSH STR?28
JUMP ?CND25
?ELS29: PUSH STR?29
?CND25: PRINT STACK
PRINTI "."
JUMP ?CND12
?ELS22: EQUAL? MSG,5,6 \?ELS33
CALL THIS-IS-IT,ALARM-SUB
PRINTI "The "
PRINTD DEPTHFINDER-LIGHT
PRINTI " is still glowing "
EQUAL? MSG,5 \?ELS40
PUSH STR?28
JUMP ?CND36
?ELS40: PUSH STR?29
?CND36: PRINT STACK
PRINTI ", and the "
PRINTD ALARM-SUB
PRINTI " is still ringing."
JUMP ?CND12
?ELS33: EQUAL? MSG,7,8 \?ELS44
SET 'SONAR?,TRUE-VALUE
PRINTI "The "
PRINTD SONARSCOPE
EQUAL? MSG,8 \?CND47
CALL THIS-IS-IT,SONARSCOPE
PRINTI " still"
?CND47: PRINTI " shows an obstacle ahead!"
EQUAL? MSG,7 \?CND12
CALL THIS-IS-IT,SUB
PRINTI " Unless you change course, you will crash the "
PRINTD SUB
PRINTI "!"
JUMP ?CND12
?ELS44: EQUAL? MSG,9,10,11 \?ELS60
CALL THIS-IS-IT,ALARM-SUB
PRINTI "The "
PRINTD DEPTHFINDER-LIGHT
PRINTI " "
EQUAL? MSG,9 \?ELS67
PUSH STR?30
JUMP ?CND63
?ELS67: EQUAL? MSG,10 \?ELS69
PUSH STR?31
JUMP ?CND63
?ELS69: PUSH STR?32
?CND63: PRINT STACK
PRINTI ", and the "
PRINTD ALARM-SUB
PRINTI " "
EQUAL? MSG,9 \?ELS76
PUSH STR?33
JUMP ?CND72
?ELS76: EQUAL? MSG,10 \?ELS78
PUSH STR?34
JUMP ?CND72
?ELS78: PUSH STR?35
?CND72: PRINT STACK
JUMP ?CND12
?ELS60: EQUAL? MSG,12,13 \?ELS82
SET 'SONAR?,TRUE-VALUE
CALL THIS-IS-IT,FREIGHTER
PRINTI "The "
PRINTD SONARSCOPE-LIGHT
PRINTI " is flashing yellow! A"
EQUAL? MSG,13 \?CND85
PRINTI "nother"
?CND85: PRINTI " ship is approaching!"
JUMP ?CND12
?ELS82: EQUAL? MSG,14 \?CND12
SET 'SONAR?,TRUE-VALUE
PRINTI "
The yellow "
PRINTD SONARSCOPE-LIGHT
PRINTI " just turned red! A loud "
PRINTD ALARM-SUB
PRINTI " is sending chills up and down your spine! The keel of the approaching ship is visible in your "
PRINTD SUB-WINDOW
FSET? HYDROPHONE,ONBIT \?CND96
PRINTI ", and the noise of its screws booms over the "
PRINTD HYDROPHONE
?CND96: PRINTI "!"
?CND12: CRLF
JUMP ?PRG1
?REP2: ZERO? SONAR? /?CND103
ZERO? AUTOMATIC-SONAR \?CND103
ZERO? LOOKED-AT-SONAR \?CND103
CALL THIS-IS-IT,SONARSCOPE
CALL TIP-SAYS
PRINTI "Hey, "
CALL PRINT-NAME,FIRST-NAME
PRINTI ", maybe you should look at the "
PRINTD SONARSCOPE
PRINTI "."""
CRLF
?CND103: ZERO? WARNINGS-RTRUE /FALSE
SET 'WARNINGS-RTRUE,FALSE-VALUE
RTRUE
.FUNCT SAVE-HINT
PRINTR "(This might be a good time to use the command: SAVE.)"
.FUNCT FALL-FROM-CLAW,NUM,X
GET ON-SUB,NUM >X
ZERO? X /FALSE
PRINTI "You can see"
CALL PRINTT,X
PRINTI " fall out of the "
PRINTD CLAW
PRINTI " and sink."
CRLF
REMOVE X
RTRUE
.FUNCT I-UPDATE-SUB-POSITION,LON,LAT,DEP,TH,VAL=0,?ORTMP
ZERO? SUB-IN-TANK \FALSE
LESS? 0,CIRCUIT-TEMP \?CND5
DEC 'CIRCUIT-TEMP
?CND5: FSET? VOLTAGE-REGULATOR,MUNGBIT \?CND8
ADD CIRCUIT-TEMP,THROTTLE-SETTING >CIRCUIT-TEMP
?CND8: LESS? 20,CIRCUIT-TEMP \?ELS13
ZERO? CIRCUIT-TIP \?ELS13
SET 'CIRCUIT-TIP,TRUE-VALUE
MOVE OVERHEATING,GLOBAL-OBJECTS
CRLF
PRINTI "Suddenly "
CALL TIP-SAYS
CALL PRINT-NAME,FIRST-NAME
PRINTI "! Look at the way that "
PRINTD CONTROL-CIRCUITS
PRINTI " "
PRINTD CONTROL-CIRCUITS-GAUGE
PRINTI " is rising!"""
CRLF
SET 'VAL,TRUE-VALUE
JUMP ?CND11
?ELS13: LESS? 20,CIRCUIT-TEMP /?ELS21
ZERO? CIRCUIT-TIP /?ELS21
SET 'CIRCUIT-TIP,FALSE-VALUE
JUMP ?CND11
?ELS21: LESS? 25,CIRCUIT-TEMP /?ELS25
ZERO? CIRCUIT-RED /?ELS25
SET 'CIRCUIT-RED,FALSE-VALUE
EQUAL? HERE,SUB \?CND11
CRLF
PRINTI "The "
PRINTD CONTROL-CIRCUITS-GAUGE
PRINTI " drops below the red danger zone."
CRLF
JUMP ?CND11
?ELS25: LESS? 25,CIRCUIT-TEMP \?ELS34
ZERO? CIRCUIT-RED \?ELS34
SET 'CIRCUIT-RED,TRUE-VALUE
CRLF
PRINTI "The "
PRINTD CONTROL-CIRCUITS-GAUGE
PRINTI " has entered the red danger zone!