-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmarine-sabotage.inf
3584 lines (3376 loc) · 116 KB
/
submarine-sabotage.inf
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
!% -~S
!% $OMIT_UNUSED_ROUTINES=1
!% $ZCODE_LESS_DICT_DATA=1
!% $MAX_ABBREVS=96
!========================================
! Submarine Sabotage
! Copyright © 2023 Garry Francis
!========================================
!Constant DEBUG;
Abbreviate "quick-release latch";
Abbreviate "There's nothing ";
Abbreviate "You'll have to ";
Abbreviate " Petty Officer ";
Abbreviate "ell me what to ";
Abbreviate " the skipper";
Abbreviate "service duct";
Abbreviate "ommunication";
Abbreviate " equipment";
Abbreviate "You can't ";
Abbreviate "The grille";
Abbreviate "currently ";
Abbreviate "submarine";
Abbreviate " through";
Abbreviate "er hatch";
Abbreviate "aqualung";
Abbreviate " to the ";
Abbreviate "gas mask";
Abbreviate "saboteur";
Abbreviate "already ";
Abbreviate " of the ";
Abbreviate " because";
Abbreviate " in the ";
Abbreviate "USS Ibis";
Abbreviate "bulkhead";
Abbreviate "torpedo";
Abbreviate " system";
Abbreviate "Holland";
Abbreviate "It's a ";
Abbreviate "the sub";
Abbreviate "This is";
Abbreviate ". You ";
Abbreviate " your ";
Abbreviate "grille";
Abbreviate ", but ";
Abbreviate " again";
Abbreviate " when ";
Abbreviate " about";
Abbreviate ". The";
Abbreviate "water";
Abbreviate " you ";
Abbreviate "screw";
Abbreviate " from";
Abbreviate "ould ";
Abbreviate " with";
Abbreviate "thing";
Abbreviate " that";
Abbreviate "It's ";
Abbreviate " and ";
Abbreviate " the ";
Abbreviate "board";
Abbreviate " time";
Abbreviate "floor";
Abbreviate "close";
Abbreviate ". It ";
Abbreviate " some";
Abbreviate " are ";
Abbreviate "ing ";
Abbreviate "The ";
Abbreviate " of ";
Abbreviate " is ";
Abbreviate "wire";
Abbreviate "You'";
Abbreviate "tion";
Abbreviate "ound";
Abbreviate "n't ";
Abbreviate "his ";
Abbreviate " any";
Abbreviate " to ";
Abbreviate "here";
Abbreviate " for";
Abbreviate "lock";
Abbreviate "You ";
Abbreviate "have";
Abbreviate "open";
Abbreviate " you";
Abbreviate "an ";
Abbreviate "'s ";
Abbreviate "hat";
Abbreviate "ly ";
Abbreviate ".^^";
Abbreviate "re ";
Abbreviate "and";
Abbreviate "ing";
Abbreviate " in";
Abbreviate " do";
Abbreviate "ed ";
Abbreviate "all";
Abbreviate "er ";
Abbreviate "ver";
Abbreviate "the";
Abbreviate " a ";
Abbreviate " on";
Abbreviate " it";
Abbreviate ", ";
Abbreviate ". ";
Constant Story "Submarine Sabotage";
#Ifv5;
Zcharacter table + '@{A9}'; !Add copyright symbol
Constant Headline "^Copyright @{A9} 2023 Garry Francis^Type ABOUT for further info and credits.^^";
#Ifnot;
Constant Headline "^Copyright (c) 2023 Garry Francis^Type ABOUT for further info and credits.^^";
#Endif;
Array UUID_ARRAY string "UUID://e62d06eb-b03c-4a8d-8252-fcb956d3a8dc//";
#Ifdef UUID_ARRAY;
#Endif;
Release 3;
Serial "230512";
!Inform 6 constants
Constant DEATH_MENTION_UNDO;
Constant MAX_CARRIED = 10;
Constant NO_SCORE;
Statusline time;
!PunyInform constants
Constant CUSTOM_ABBREVIATIONS;
Constant MAX_SCOPE 64;
Constant OPTIONAL_EXTENDED_METAVERBS;
Constant OPTIONAL_EXTENDED_VERBSET;
Constant OPTIONAL_FULL_DIRECTIONS;
Constant OPTIONAL_MANUAL_REACTIVE;
Constant OPTIONAL_MANUAL_SCOPE;
#Ifv5;
Constant OPTIONAL_PROVIDE_UNDO;
#Endif;
Constant OPTIONAL_SHIP_DIRECTIONS;
Constant RUNTIME_ERRORS = 0; !Change to 2 during debugging
!PunyInform static messages
Constant MSG_JUMP "Clang, clang, clang.";
Constant MSG_PARSER_UNKNOWN_VERB "That's not a verb I recognise.";
Constant MSG_PRAY_DEFAULT "You pray that you can get out of this predicament alive.";
Constant MSG_SING_DEFAULT "You start singing Vanda and Young's 'Down Among the Dead Men', but stop when you realise that the lyrics may be prophetic.";
Constant MSG_SLEEP_DEFAULT "Not now. You had a sleep in the airlock, remember?";
Constant MSG_SORRY_DEFAULT "Oh, don't apologise.";
Constant MSG_SWIM_DEFAULT "If you want to go swimming, you'll have to leave the sub.";
Constant MSG_TAKE_YOURSELF "That would be a clever trick.";
Constant MSG_THINK_DEFAULT "You wonder how you're going to get out of this predicament.";
Constant MSG_WAIT_DEFAULT "A minute passes.";
Constant MSG_WAVEHANDS_DEFAULT "There's nothing worth waving at.";
!PunyInform dynamic messages
Constant MSG_CLOSE_NOT_OPEN 1000;
Constant MSG_LOCK_ALREADY_LOCKED 1001;
Constant MSG_LOCK_CLOSE_FIRST 1002;
Constant MSG_LOCK_KEY_DOESNT_FIT 1003;
Constant MSG_UNLOCK_ALREADY_UNLOCKED 1004;
Constant MSG_UNLOCK_KEY_DOESNT_FIT 1005;
!Game-specific constants
Constant AN "an";
Constant SOME "some";
Constant THE "the";
Constant TWO "two";
Constant ALREADY_OFF "It's already off.";
Constant ATTACHED_TO_BOMB "It's firmly attached to the bomb.";
Constant BOTTOM_OF_OCEAN "You're on the bottom of the ocean, so you can't go any deeper.";
Constant CANT_REACH_IT "You can't reach it.";
Constant CANT_REACH_OPENING "The opening is out of your reach.";
Constant CLAMBER_THROUGH_OPENING "You clamber through the opening in the service duct.^^";
Constant DROP_TO_FLOOR_BELOW "You drop to the floor below.^^";
Constant HULL_ABOVE_YOU "The submarine's hull prevents you going up.";
Constant ITS_EVIDENCE "It's evidence. You'd better leave it alone.";
Constant NOTHING_ELSE_TO_DO "There's nothing else to do here.";
Constant SEARCH_AGAIN "again, but don't find anything else of interest.";
Constant THINKING_ABOUT_STOMACH "This is no time to be thinking about your stomach.";
Constant UNKNOWN_TERRITORY "As you're in unknown territory and you're not familiar with the ocean currents, you'd best not venture away from the submarine.";
!Game-specific variables
Attribute underwater;
!Replaced actions
Replace GoSub;
Replace LockSub;
Replace UnlockSub;
Include "globals.h";
!========================================
! Entry point routines
!========================================
[ ChooseObjects obj code;
if (code == 2)
{
! Stage 1: Disambiguation
if (action_to_be == ##Take && obj notin player)
return 1; !Appropriate
if (action_to_be == ##Drop && obj in player && obj hasnt worn)
return 1; !Appropriate
return 0; !Inappropriate
}
! Stage 2: Processing an "all"
if (obj has scenery or concealed or static or animate)
return 2; !Force exclusion
if (action_to_be == ##Take && obj ~= player && obj notin player)
return 1; !Force inclusion
if (action_to_be == ##Drop && obj in player && obj hasnt worn)
return 1; !Force inclusion
return 0; !Accept parser's decision
];
[ LibraryMessages p_msg p_arg_1 p_arg_2;
switch (p_msg)
{
MSG_CLOSE_NOT_OPEN:
print_ret (CTheyreOrIts)noun, " already closed.";
MSG_LOCK_ALREADY_LOCKED:
print_ret (CTheyreOrIts)noun, " already locked.";
MSG_LOCK_CLOSE_FIRST:
"You'll have to close ", (ItOrThem)noun, " first.";
MSG_LOCK_KEY_DOESNT_FIT:
print_ret (The)second, " ", (DoesntOrDont)second, " fit the lock.";
MSG_UNLOCK_ALREADY_UNLOCKED:
print_ret (CTheyreOrIts)noun, " already unlocked.";
MSG_UNLOCK_KEY_DOESNT_FIT:
print_ret (The)second, " ", (DoesntOrDont)second, " fit the lock.";
}
p_arg_1 = p_arg_2;
];
Include "puny.h";
!========================================
! Initialisation
!========================================
[ Initialise;
Directions.parse_name = DirectionsParseName;
lookmode = 2;
move coveralls to player;
give coveralls worn;
move watch to player;
give watch worn;
no_implicit_actions = true;
normal_directions_enabled = false;
player.description = PlayerDescription;
SetTime(540, 1);
location = room01;
"You are currently serving aboard the USS Ibis, the first of the US Navy's top-secret Puny class submarines. The Puny class is an attack submarine that packs maximum firepower into a minimum-sized hull. It relies on speed and stealth to surprise the enemy.^^The USS Ibis is currently on a training exercise in the North Atlantic, just off the coast of Newfoundland. You were doing some routine maintenance at the aft end of the submarine when the sirens sounded. You thought this might have been a training exercise until you noticed a whitish-coloured gas approaching you from the aft bulkhead. Training and instinct took over. You couldn't get to a gas mask in time, so you dived into the nearby airlock and closed the air-tight hatch behind you.^^You are now alone and have no idea what is happening throughout the rest of the sub. You can't leave the airlock through the inner hatch (the one you entered by), or you'll get gassed, and you can't leave through the outer hatch, or you'll drown. What can you do?^";
];
!========================================
! Classes
!========================================
Class Body
with
life
[;
Ask:
"You're not likely to get an answer from a lifeless body.";
Attack, ThrowAt:
"Show some empathy. Allow the dead to rest in peace.";
Give:
"Dead bodies aren't normally in the habit of accepting gifts.";
Kiss:
"Eww, gross.";
Show:
"The dead body shows no interest in ", (the)noun, ". I wonder why.";
Talk:
"You strike up a one-sided conversation with the dead body, but it's bored to death.";
Tell:
"The corpse listens intently to what you have to say. Or maybe it's not listening at all. It's hard to tell.";
WakeOther:
"You give ", (the)noun, " a shake, but it doesn't respond.";
],
before
[;
Pull, Push, Take:
"You know better than to disturb a crime scene, as a crime has surely been committed.";
],
has animate;
Class OpenableContainer
with
invent
[;
if (inventory_stage == 2 && (self hasnt open || children(self) == 0))
rtrue;
],
has container openable;
Class OpenContainer
with
invent
[;
if (inventory_stage == 2 && children(self) == 0)
rtrue;
],
has container open;
!========================================
! Room 1: Airlock
!========================================
Object room01 "Airlock"
with
description "You're in the submarine's airlock. It's a small chamber that separates the interior of the submarine from the surrounding ocean. The inner hatch allows you to go up to the main deck of the submarine. The outer hatch allows you to go down to the ocean. The safety system is fully automated with interlocks to ensure that the two hatches can't be open simultaneously.",
u_to inner_hatch,
d_to outer_hatch,
before
[;
Hint:
if (the_time < 780 && room02 hasnt visited && self.time_left == 0)
"You can't go up and you can't go down, so you'll just have to WAIT it out.";
if (the_time < 780 && room02 hasnt visited)
"The best way to kill time is to have a SLEEP.";
if (room02 hasnt visited && watch hasnt general)
"Did you check your watch?";
if (room02 hasnt visited && inner_hatch hasnt open)
"It's now safe to open the inner hatch.";
if (room02 hasnt visited)
"It's now safe to enter the sub through the inner hatch.";
if (room16 hasnt visited && outer_hatch hasnt open)
"You can now open the outer hatch, but make sure you are wearing something to protect you from the cold Atlantic seawater and something that allows you to breath underwater.";
print_ret (string)NOTHING_ELSE_TO_DO;
Sleep:
if (the_time < 780 && room02 hasnt visited)
{
SetTime(817, 1);
"There's nothing else you can do to kill the time, so you settle down to have a snooze. Zzzzz...^^You are suddenly woken by a bang and a shudder throughout the sub. It feels like the sub has landed on the floor of the ocean. That's not good. You wonder what's going on. You'd better check your watch to see how long you've been asleep.";
}
"You're no longer sleepy.";
Wait:
self.time_left++;
if (the_time < 780 && room02 hasnt visited && self.time_left == 1)
"You know from your basic training that it takes about 4 hours for the sub's filtration system to clear the air of toxic substances. You'd better settle in for a long wait. Maybe you should have a snooze.";
if (the_time < 780 && room02 hasnt visited && self.time_left == 5)
"You've got a long time to wait. Why don't you just have a sleep?";
],
time_left 0,
has light;
!----------------------------------------
! Submarine (floating object)
!----------------------------------------
Object "submarine"
with
parse_name
[ i;
while (NextWord() == 'uss' or 'ibis' or 'puny' or 'class' or 'attack' or 'sub' or 'submarine')
i++;
return i;
],
description "This is the USS Ibis, a Puny class attack submarine. It's your home for the next few months.",
react_before
[;
Listen:
if (location has underwater)
"The seawater blocks out all sound.";
else
"You hear the soft hum of the submarine's machinery.";
],
found_in
[;
rtrue;
],
has reactive scenery;
!----------------------------------------
! Airlock
!----------------------------------------
Object "airlock" room01
with
article AN,
name 'airlock' 'small' 'chamber' 'interior',
description "It's a small chamber that's used to control the pressure and flow of water into and out of the submarine. As it's purely functional, it's devoid of any unnecessary equipment that could foul diving gear or cause harm to the occupants when seawater is pumped into or out of the chamber.",
before
[;
Open:
"You can only open the airlock by opening one of the hatches.";
],
has scenery;
!----------------------------------------
! Safety system
!----------------------------------------
Object "safety system" room01
with
name 'safety' 'system' 'interlock' 'interlocks//p',
description "The safety system is not visible, but it's comforting to know that it's there.",
has scenery;
!----------------------------------------
! Hatches
!----------------------------------------
Object "hatches" room01
with
name 'hatches//p',
description "There are two hatches, the inner hatch and the outer hatch.",
has scenery;
!----------------------------------------
! Outer hatch (floating object)
!----------------------------------------
Object outer_hatch "outer hatch"
with
article THE,
name 'outer' 'hatch',
description
[;
print "The outer hatch is ";
if (self in room01)
print "at your feet";
else
print "above your head";
print ". It provides access to the ";
if (self in room01)
print "outside of the submarine";
else
print "airlock inside the submarine";
". It's currently ", (OpenOrClosed)self, ".";
],
door_dir
[;
if (self in room01)
return d_to;
else
return u_to;
],
door_to
[;
if (self in room01)
return room16;
else
return room01;
],
before
[;
Close:
if (self in room01 && location has underwater)
{
give self ~open;
give location ~underwater;
MoveFloatingObjects();!This sets scope_modified = true
StopDaemon(wetsuit);
StopDaemon(aqualung);
"You close the outer hatch to seal it off against the seawater. When it's fully sealed, the automated system pumps the seawater out of the airlock. You can now breathe normally.";
}
Open:
if (self in room01)
{
if (inner_hatch has open)
"The safety system prevents you opening the outer hatch while the inner hatch is open, otherwise the submarine would be flooded.";
print "Seawater floods into the airlock. ";
if (aqualung hasnt worn)
{
deadflag = 1;
"You suddenly realise that you have no way of breathing underwater. You try holding your breath and struggle to close the hatch again, but it's too late. The rush of seawater quickly covers your head, your breath runs out, the seawater fills your lungs and you lose consciousness.";
}
if (wetsuit hasnt worn)
{
deadflag = 1;
"You breathe through the aqualung as the seawater covers your head, but you quickly realise that you have no insulation against the cold Atlantic seawater. Your body turns numb as you struggle to close the hatch again, but it's too late. As you flounder about in the freezing water, you start to shiver and quickly lose consciousness.";
}
give self open;
give location underwater;
MoveFloatingObjects();!This sets scope_modified = true
StartDaemon(wetsuit);
StartDaemon(aqualung);
"The wetsuit protects you from the cold. You plug the mouthpiece of the aqualung into your mouth and start breathing the life-saving oxygen. The airlock is soon full of seawater.";
}
],
found_in room01 room16,
has door openable static;
!----------------------------------------
! Inner hatch (floating object)
!----------------------------------------
Object inner_hatch "inner hatch"
with
article THE,
name 'inner' 'hatch',
description
[;
print "The inner hatch is ";
if (self in room01)
print "above your head";
else
print "at your feet";
print ". It provides access to the ";
if (self in room01)
print "inner parts of the submarine";
else
print "airlock";
". It's currently ", (OpenOrClosed)self, ".";
],
door_dir
[;
if (self in room01)
return u_to;
else
return d_to;
],
door_to
[;
if (self in room01)
return room02;
else
return room01;
],
before
[;
Open:
if (outer_hatch has open)
"The safety system prevents you opening the inner hatch while the outer hatch is open, otherwise the submarine would be flooded.";
if (the_time < 780 && room02 hasnt visited)
{
deadflag = 1;
"Poisonous gas seeps into the airlock. You quickly close the hatch, but it's too late. You start gasping for breath, but the more you gasp, the worse it gets. You break out into a sweat, then start vomiting. You can't breathe. Then you pass out.";
}
],
found_in room01 room02,
has door openable static;
!----------------------------------------
! Seawater (floating object)
!----------------------------------------
Object "seawater"
with
article "lots of",
parse_name
[ i;
while (NextWord() == 'seawater' or 'sea' or 'water' or 'atlantic' or 'ocean')
i++;
return i;
],
description "There's a lot of it.",
react_before
[;
Jump:
"Under water? Yeah, sure.";
Sing:
"Glubble, blubble, burble...";
Swim:
"Just give me a direction.";
],
before
[;
Take:
"You're surrounded by seawater. You can't take it with you.";
],
found_in
[;
if (location has underwater)
rtrue;
],
has reactive static;
!----------------------------------------
! Digital watch
!----------------------------------------
Object watch "digital watch"
with
parse_name
[ i;
while (NextWord() == 'waterproof' or 'diver^s' or 'digital' or 'watch' or 'time')
i++;
return i;
],
description
[;
print "It's a waterproof diver's watch. It shows the time as ", (TimeOfDay)self;
if (the_time > 780 && room02 hasnt visited && self hasnt general)
{
give self general;
print " It should be safe to leave the airlock now.";
}
"";
],
has clothing;
!----------------------------------------
! Blue coveralls
!----------------------------------------
Object coveralls "blue coveralls"
with
article "a pair of",
name 'blue' 'coveralls',
description "They're baggy blue coveralls, which is the standard shipboard working uniform. They're probably one size too big for you, but that's better than being one size too small. Being one piece, the coveralls aren't very popular because you have to get half undressed every time you want to go to the loo.",
before
[;
Disrobe:
"You can't walk around the sub in your underwear. Keep them on unless you need to wear something else.";
Wear:
if (aqualung has worn)
"You can't put them on over the aqualung.";
if (wetsuit has worn)
"You can't put them on over the wetsuit.";
],
has clothing pluralname;
!========================================
! Room 2: Long Corridor
!========================================
Object room02 "Long Corridor"
with
description "You're in a long narrow corridor that goes fore and aft along the length of the sub, except for the occasional watertight bulkhead, such as the one to fore. There are exits from the corridor to port and starboard, a grille overhead and the inner hatch to the airlock in the floor.",
n_to aft_bulkhead,
s_to room03,
e_to room04,
w_to room05,
d_to inner_hatch,
u_to aft_opening,
before
[;
Hint:
if (player notin chair)
"That grille looks interesting, but it's out of your reach. Can you get closer? Maybe stand on something.";
if (aft_grille hasnt open && screwdriver in nothing)
"The grille is screwed shut, so you'll need something to unscrew it. Have you tried engineering?";
if (aft_grille hasnt open && aft_grille hasnt general)
"Try unscrewing the screws.";
if (aft_grille hasnt open && screws hasnt general)
"You'll need something to lubricate the screws. Have you tried engineering?";
if (aft_grille hasnt open)
"Try unscrewing the screws.";
"You can go up to enter the opening.";
],
has light;
!----------------------------------------
! Long corridor (floating object)
!----------------------------------------
Object "long corridor"
with
name 'long' 'corridor' 'lighting',
description "It's a narrow, cramped space equipped with low-level lighting. The floor is a grate covered in a non-slip material to provide traction and reduce the risk of a fall.",
found_in room02 room14,
has scenery;
!----------------------------------------
! Floor (floating object)
!----------------------------------------
Object "floor"
with
parse_name
[ i;
while (NextWord() == 'floor' or 'grate' or 'grating' or 'non-slip' or 'material')
i++;
return i;
],
description
[;
print "The floor is a grate covered in a non-slip material. Many a small item has been dropped on the floor, only to disappear down the grate, never to be seen again.";
if (self in room02 && screws in limbo)
print " You know the screws are down there somewhere, but you can't see them. It doesn't matter, as you won't need them again.";
"";
],
found_in room02 room14,
has scenery;
!----------------------------------------
! Aft bulkhead door (floating object)
!----------------------------------------
Object aft_bulkhead "bulkhead door"
with
parse_name
[ i;
while (NextWord() == 'bulkhead' or 'door' or 'heavy-steel' or 'heavy' or 'steel' or 'rectangular' or 'rounded' or 'corner' or 'corners//p' or 'watertight')
i++;
return i;
],
description
[;
"It's a heavy-steel, rectangular door with rounded corners and a rubber seal around the edges. It has a dog handle in the middle and a quick-release latch at the side. It's currently ", (OpenOrClosed)self, ".";
],
door_dir
[;
if (self in room02)
return n_to;
else
return s_to;
],
door_to
[;
if (self in room02)
return room14;
else
return room02;
],
before
[;
Pull:
if (self in room02)
<<Close self>>;
else
<<Open self>>;
Push:
if (self in room02)
<<Open self>>;
else
<<Close self>>;
Open:
if (debris in room14)
if (self in room02)
"You turn the quick-release latch and give the door a push, but it won't budge. There's something blocking it from the other side.";
else
"You can't get to the door because of the debris.";
],
add_to_scope clamps seal handle latch,
found_in room02 room14,
has door openable reactive static;
!----------------------------------------
! Rubber seal around edge of door (attached to both doors)
!----------------------------------------
Object seal "rubber seal"
with
name 'rubber' 'seal' 'edge' 'edges//p',
description "The rubber seal around the edge of the door forms a water-tight seal when the door is closed.",
has scenery;
!----------------------------------------
! Dog handle (attached to both doors)
!----------------------------------------
Object handle "dog handle"
with
name 'dog' 'handle',
description "The dog handle spins to engage the gear mechanism and lock the eight dog clamps into place when closing the door.",
before
[;
Turn:
if (location == room02 or room14)
<<Close aft_bulkhead>>;
if (location == room11 or room12)
<<Close fore_bulkhead>>;
],
has scenery;
!----------------------------------------
! Dog clamps (attached to both doors)
!----------------------------------------
Object clamps "dog clamps"
with
name 'eight' 'dog' 'clamp' 'clamps//p',
description "There are eight of them. They engage when the bulkhead door is closed.",
has scenery;
!----------------------------------------
! Quick-release latch (attached to both doors)
!----------------------------------------
Object latch "quick-release latch"
with
name 'quick-release' 'quick' 'release' 'latch',
description "The quick-release latch is turned to release all eight dog clamps when opening the door.",
before
[;
Turn:
if (location == room02 or room14)
<<Open aft_bulkhead>>;
if (location == room11 or room12)
<<Open fore_bulkhead>>;
],
has scenery;
!----------------------------------------
! Aft grille
!----------------------------------------
Object aft_grille "grille" room02
with
name 'grille',
description
[;
if (self hasnt open && player notin chair)
"You can't see it clearly from the floor, but you can see that it conceals an opening to a service duct.";
if (self hasnt open)
"It has two hinges along one side and is screwed shut along the other side. You can see a service duct on the other side of the grille.";
"It's swinging freely by two hinges to reveal an opening in the service duct.";
],
before
[;
if (action ~= ##Examine && player notin chair)
print_ret (string)CANT_REACH_IT;
Close:
if (self hasnt open)
"It's already closed.";
"The only way to close it is to screw it shut again, but the screws fell through the grate on the floor.";
Cut:
if (second == nothing && pliers in player)
{
print "(with the pliers)^";
<<Cut self pliers>>;
}
if (second == nothing)
"You'll have to tell me what to cut it with.";
if (second ~= pliers)
"You can't cut the grille with ", (ThatOrThose)second, ".";
"The slats in the grille are too closely spaced to get the pliers in there. The pliers wouldn't be strong enough anyway. They're made for cutting wire.";
Enter:
<<Go FAKE_U_OBJ>>;
Open:
if (self has open)
"It's already open and swinging freely by the hinges.";
"It's screwed shut.";
Screw, Unscrew:
"Try the screws.";
],
add_to_scope hinges,
has openable lockable locked reactive static;
!----------------------------------------
! Hinges
!----------------------------------------
Object hinges "hinges"
with
name 'hinge' 'hinges//p',
has scenery;
!----------------------------------------
! Screws
!----------------------------------------
Object screws "screws" room02
with
name 'phillips' 'head' 'screw' 'screws//p',
description "They're Phillips head screws.",
before
[;
if (action ~= ##Examine && player notin chair)
"You can't reach them.";
Screw:
if (second == nothing && screwdriver in player)
{
print "(with the screwdriver)^";
<<Screw self screwdriver>>;
}
if (second == nothing)
"You'll have to tell me what to screw them with.";
if (second ~= screwdriver)
"You can't screw them with ", (ThatOrThose)second, ".";
"The screws are already screwed in. Maybe you should try unscrewing them.";
Spray:
if (second == nothing && wd40 in player)
{
print "(with the WD-40)^";
<<Spray self wd40>>;
}
if (second == nothing)
"You'll have to tell me what to ", (address)verb_word, " them with.";
if (second ~= wd40)
"You can't ", (address)verb_word, " them with ", (ThatOrThose)second, ".";
give self general;
"You spray the screws with the WD-40. If the claims on the can are true, you should now be able to unscrew them.";
Unscrew:
if (second == nothing && screwdriver in player)
{
print "(with the screwdriver)^";
<<Unscrew self screwdriver>>;
}
if (second == nothing)
"You'll have to tell me what to unscrew them with.";
if (second ~= screwdriver)
"You can't unscrew them with ", (ThatOrThose)second, ".";
if (self hasnt general)
{
give aft_grille general;
"The screws are too tight. They may have been rusted by the salt air from the seawater in the sub. You'll have to loosen them somehow.";
}
move screws to limbo;
give aft_grille ~locked open;
give aft_opening ~scenery static;
scope_modified = true;
"You unscrew both screws and they fall to the floor and disappear below the grate. The grille swings open and hangs by the hinges.";
],
has pluralname scenery;
!----------------------------------------
! Aft opening in service duct
!----------------------------------------
Object aft_opening "opening in the service duct"
with
article AN,
name 'opening',
description "It's an opening in the service duct.",
door_dir
[;
if (self in room02)
return u_to;
else
return d_to;
],
door_to
[;
if (self in room08)
{
print (string)DROP_TO_FLOOR_BELOW;
PlayerTo(room02);
rtrue;
}
if (player notin chair && aft_grille hasnt open)
print_ret (string)"The grille is out of your reach.";
if (player notin chair)
print_ret (string)CANT_REACH_OPENING;
if (aft_grille hasnt open)
"The grille is closed.";
return room08;
],
found_in room02 room08,
has door open scenery;
!========================================
! Room 3: Engineering Section
!========================================
Object room03 "Engineering Section"
with
description "You're in the engineering section. This is the biggest part of the sub, because it houses all the engines, motors and generators for the power and propulsion systems. It also contains the batteries, cooling and ventilation systems. The way out of here is to fore.",
n_to room02,
before
[;
Hint:
if (screwdriver in nothing)
"What do police do when they find a dead body at a crime scene?";
if (aft_grille hasnt open)
"The things you found here will be useful elsewhere.";
print_ret (string)NOTHING_ELSE_TO_DO;
],
has light;
!----------------------------------------
! Engineering section
!----------------------------------------
Object "engineering section" room03
with
article THE,
parse_name
[ i;
while (NextWord() == 'engineering' or 'section' or 'engine' or 'engines//p' or 'motor' or 'motors//p' or 'generator' or 'generators//p' or 'power' or 'propulsion' or 'battery' or 'batteries//p' or 'cooling' or 'ventilation' or 'system' or 'systems//p')
i++;
return i;
],
description "This is a highly complex and technical area - way above your pay grade. You think it best to leave everything alone, as you don't want to cause any damage that will prevent you getting back to the surface.",
has scenery;
!----------------------------------------
! Nelson's body
!----------------------------------------
Object nelson "Nelson's body" room03
class Body
with
parse_name
[ i;
while (NextWord() == 'engineer' or 'engineer^s' or 'mechanic' or 'mechanic^s' or 'dead' or 'body' or 'corpse' or 'petty' or 'officer' or 'first' or 'class' or 'nelson' or 'nelson^s' or 'pickles' or 'pickles^' or 'pocket' or 'pockets//p' or 'man')
i++;
return i;
],
description "It's Petty Officer First Class Nelson, but everyone calls him Pickles. He's the engineer-come-mechanic and probably the hardest working person aboard the sub. Unfortunately, his working days are over, as he's crumpled in a lifeless heap on the floor.",
before
[;
Search:
print "You search Nelson's pockets ";
if (screwdriver in nothing)
{
move screwdriver to location;
scope_modified = true;
"and find a screwdriver.";
}
print_ret (string)SEARCH_AGAIN;
],
has animate proper;
!----------------------------------------
! Screwdriver
!----------------------------------------
Object screwdriver "screwdriver"
with
parse_name
[ i;
while (NextWord() == 'medium-sized' or 'medium' or 'sized' or 'phillips' or 'head' or 'screwdriver')
i++;
return i;
],
description "It's a medium-sized Phillips head screwdriver.",
has;
!----------------------------------------
! Can of WD-40
!----------------------------------------
Object wd40 "can of WD-40" room03
with
parse_name
[ i;
while (NextWord() == 'can' or 'of' or 'wd-40' or 'wd40' or 'spray' or 'nozzle' or 'lubricant' or 'instruction' or 'instructions//p')
i++;
return i;
],
description "It's a small blue and yellow can with a spray nozzle. The instructions on the back talk about protecting metal from rust and corrosion, penetrating stuck parts, displacing moisture and lubricating almost anything.",
before
[;