-
Notifications
You must be signed in to change notification settings - Fork 0
/
tristam-en.inf
executable file
·6048 lines (4978 loc) · 343 KB
/
tristam-en.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
!% $TRANSCRIPT_FORMAT=1
!% $MAX_ABBREVS=96;
!% $MAX_DYNAMIC_STRINGS=0;
! Writing todos
! TODO : REREAD THE WHOLE TEXT AND CAREFUL WITH THE SEMICOLONS
! TODO : not enough weather related talk: big blue sky, sun that burns your skin a bit (to hint at drying stuff), nice chill wind
Constant Story "TRISTAM ISLAND";
Constant Headline "^By Hugo Labrande.^";
Release 4;
Constant STATUSLINE_SCORE; Statusline score;
!Constant IS_DEMO;
!Constant DEBUG;
!Constant DEBUG_PARSEANDPERFORM;
!Constant DEBUG_PARSEPATTERN;
!Constant DEBUG_PARSETOKEN;
!Constant DEBUG_CHECKNOUN;
!Constant DEBUG_GETNEXTNOUN;
!Constant DEBUG_SCOPE;
Constant OPTIONAL_MANUAL_SCOPE;
Constant CUSTOM_ABBREVIATIONS;
!Switches f; ! see how useful abbreviations are
! 155196 sans abbrev
! PunyInform : 142396 bytes
!Abbreviate ". " ", " "You " "'t " "That's not something you can " "_to/" "nothing" "That " "close" "already" "(which is " " is ""thing" "ed." "t's" "lock" "rea" "witch" "can" "open" "empty" "You" "t first." "rrying" "contain" "when_" "that." "t wa" "But you" "t of" "Tha" "Res" " the " "all" "yourself" "_to" "ter" "here" "able" "ing" "are" "have" "and" "unexpected" "ion" "side" "talk" "see" "sco" "ake" "ame" "urn" " to " "ore" "the" "tha" "you" "ome" "t i" "off" "rin" "pec" "on." "ste";
! Inform -u : 139036 bytes
!Abbreviate ". " ", " " the " "You" "The" "ing" "and" "you" "This" "ther" "all" "is " "the" "'t " "nd " "to " "'s " "re " "that " "ould " "ight " "ll " "; it " "r a" "with " "of " "probably " "have " "ut " "look" "ds " "which " "lbatross " "platform" "It " " a " "here" "white" "ght" "wit" "ook" "abl" "ator" "nder" "while" "house" "door" "s it" "some" "d i" "already" "air" "our" "side" "for" "any" "close" "ver" " on" " th" " wa" " do" " like" "rea";
! My python script : 135744 bytes
!Abbreviate " the " "You " " you" " and " " to " "ing " ", " "The " " is " "here" "n't " ". " " of" " a " " th" "island" "ould " "ight" " are " "ther " "all" "; " "This" "probably " " in" " it" "ing" " on" "with" "albatross" "look" " to" " for" "door" "'s " "platform" "and" "have" "house" "ter" " like" "You'" "already" " see" " some" "re " "which" "ed " "ough" "very " " can" "tion" "out" "side" " be" "but" "close" "white " "able" "ly " " --" "at " " back" "fish" ;
! 96 optimal abbreviations, thanks heasm
Abbreviate "manage to " " from the " "generator" " you can " "albatross" " doesn't " "There is " "probably " " rather " " on the " " towards" " to the " " at the " "platform" "already " " of the " " in the " " a few " " around" ", which" " your " ". You " "ou're " "small " "white " ". The " "don't " "island" " this " " with" "ould " " are " "have " " you " ", and" " some" ", but" " that" "cliff" "This " "house" " and " " the " " like" " what" "thing" " back" "close" "fish" " for" "ight" "ence" " of " "n't " "here" "The " " is " "look" "ing " "door" "You " "tion" " you" " to " ". It" "not " "side" "able" "ough" "ent" " a " "re " "ood" "ind" " be" "rea" "ed " "the" "est" "ly " "ver" "out" " --" "'s " "ing" " it" "see" " on" "and" " in" "all" "ter" "ear" ". " ", " ";";
Constant OPTIONAL_FULL_DIRECTIONS; ! northeast and such
Constant MAX_SCORE = 150;
!Constant RUNTIME_ERRORS = 2; ! TODO: remove in production, save 1600 bytes!!
Constant MAX_FLOATING_OBJECTS = 32;
Constant MAX_SCOPE = 56;
! This speeds up the game, but put the "reactive" attribute in the each_turn/react_before/react_after objects
Constant OPTIONAL_MANUAL_REACTIVE;
! This makes less code for simple doors
Constant OPTIONAL_SIMPLE_DOORS;
! Initial location - needed to be ok for the Gameboy interpreter
Constant INITIAL_LOCATION_VALUE=Immaculatebeach;
! You only have two hands + 1 pocket
Constant MAX_CARRIED = 3;
Constant SACK_OBJECT = backpack;
! Don't define globals before including globals.h, or it wont work on some terps!
Include "globals.h";
! My globals
! This replaces flags because it saves space: if(var) takes 3 bytes, if(FlagIsSet(flag)) takes 9 bytes
! You can do that if you dont have too many variables; Inform uses the 240 global variables anyway, so declaring one doesn't save any space
! Did we go up the island yet?
Global F_ACT2_STARTED = 0;
! Did we see Tristam Island yet?
Global F_TRISTAM_DISCOVERED = 0;
! Have we eaten fish yet
Global F_ATE_SOMETHING = 0;
! Have we slept yet
Global F_SLEPT = 0;
! Have we climbed the cliff via the platform yet
Global F_CLIMBED_CLIFF = 0;
! Have we scraped a bit and realized it was a staircase
Global WE_KNOW_IT_IS_STAIRS=0;
! Have we climbed the steps yet
Global F_CLIMBED_STEPS = 0;
! Have we seen the tower through the trees from the ocean
Global TOWER_SEEN_THROUGH_TREES = 0;
! The fire has been arranged with dry wood; ready to burn
Global FIRE_IS_READY = 0;
! Is the fish elevator up the cliff, or down?
Global FISH_ELEVATOR_UP = 0; ! this is faster than figuring out the parent of the parent / visibility ceiling
! Has the albatross already pestered us once and stole our fish?
Global ALBATROSS_ALREADY_STOLE=0;
! Have we gathered firewood to cook the fish
Global ALREADY_GOT_FIREWOOD=0;
! Have we smashed the woodshop window yet
Global F_WOODSHOP_SMASHED = 0;
! Have we smashed the "bits and bobs" shop yet
Global F_SHOP_SMASHED = 0;
! Have we smashed the window of the house by the cliff for fun yet
Global F_HOUSE_CLIFF_SMASHED = 0;
! Have we taken the pin out of the hinges of the crude door
Global F_CRUDE_DOOR_OUT = 0;
! Have we climbed over the fence using the tree
Global F_CLIMBED_TREE = 0;
! Have we found the hole in the fence (by looking at it a second time or searching the bush)
Global F_FOUND_HOLE_IN_FENCE = 0;
! Have we crawled through the hole in the fence
Global F_CRAWLED_IN_HOLE = 0;
! is the fire at the scenic view on
Global F_SCENIC_FIRE = 0;
! Have we fixed the ladder
Global F_LADDER_FIXED = 0;
! Have we searched the grass and found the guard key
Global F_GRASS_SEARCHED = 0;
! is the tank full of melted cooking oil
Global F_TANK_FULL = 0;
! Have we started the generators
Global F_GENERATORS_ON = 0;
! How hard are the generators working
Global generators_load = 100;
Constant LOW_POWER 81; ! 10 for jukebox, 5 for pub landlord light, 5 for light in insidehouses, 15 for the fridge
! Have we entered the white mansion
Global F_ACT3_STARTED = 0;
! Have we entered the underground lab
Global F_ACT4_STARTED = 0;
! Is the elevator down
Global F_ELEVATOR_DOWN = 0;
! need to define this here but it's only needed later
Global room_shore;
Global vecteur_normal;
Global sandbankDepth;
Constant TRISTAM_SANDBANK_DEPTH 8;
Constant FISHES_VECTEUR_NORMAL 2;
!Constant F_TRISTAM_NAME_KNOWN = 10;
!Constant F_ISLAND_NAME_KNOWN = 11;
!Constant F_PULLED_ROPE_TIRED = 15;
!Constant F_CLEARED_STEP_TIRED = 16;
!Constant F_TOWER_SEEN = 17;
!Constant F_CODE_READ = 18;
!Constant F_FIXED_PIPE = 19;
!Constant F_CLEANED_BUCKET = 20;
!Constant F_FIXED_RADIO = 21;
!Constant F_FOUND_REPORT_CLEAN = 22;
!Constant F_FOUND_REPORT_CRUMPLED = 23;
!Constant F_COOKING_OIL = 25;
!Constant F_MATCHES_DONE = 26;
!Constant F_TRENCHES_SEARCHED = 27;
!Constant F_BEHIND_FENCE = 28;
!Constant F_CLIMBED_TREE = 29;
!Constant F_WORCESTERSHIRE = 30;
!Constant F_MARMITE = 31;
! Fix for the gameboy interpreter
Constant MSG_PROMPT 1018;
Constant MSG_PUSHDIR_DEFAULT "You're not sure what this would accomplish.";
Constant MSG_SURVIVAL "This would seriously diminish your chances of survival.";
Constant MSG_UNTIE "You cannot untie this.";
Constant MSG_PLATFORM_SHORT_DESC "The platform against the cliff looks a bit like a bucket, and a very long rope is tied to its metal handle, up to a pulley mechanism.";
Constant MSG_YOU_TIED_THE_ROPE " You tied the other end of the rope to the platform's railing so it would stay up, in case you need to use it again.";
Constant MSG_CLIFF_SAFELY "You manage to climb up the cliff safely; you tie the rope to the railing of the platform.^";
Constant MSG_PLATFORM_IS_ALREADY_UP "The platform can't go any higher than this.";
Constant MSG_PLATFORM_IS_ALREADY_DOWN "The platform is already as low as it can be.";
Constant MSG_BURN_DEFAULT "This dangerous act would achieve little.";
Constant MSG_EAT_INEDIBLE 1025;
Constant MSG_ALBATROSS_VICTORY_LAP "swoops in and snatches the fish out of your hand. It's too late -- it already gulped the fish down. The albatross lets out a satisfied squawk, and flies around you energetically, like a victory lap of sorts.";
Constant MSG_TOO_IMMENSE 1027;
Constant MSG_OCEAN_WATER "Ocean water is hardly drinkable.";
Constant MSG_FELL_A_TREE "You doubt you could fell a tree with the tools you have.";
Constant MSG_NOT_SOMETHING_YOU_CAN_VERB 1030;
Constant MSG_FILL_NO_WATER "You're not sure how to accomplish that.";
Constant MSG_DONT_GET_WHAT_TO_DO 1032;
Constant MSG_TIE_DEFAULT 1033;
Constant MSG_INSERT_ITSELF "You can't put something inside itself.";
Constant MSG_PUTON_ITSELF "You can't put something on itself.";
Constant MSG_PUT_IN_SEA "You'd rather not release your meager possessions into the sea.";
Constant MSG_SANDBANK_DESC "A submerged sandbank extending southwest makes it so you can walk further into the ocean without getting too wet.";
Constant MSG_COVE_DESC "This small cove is made of a steep beach made of wet sand; the waves are a little more turbulent here, and there seems to be movement deeper in the waters.";
Constant MSG_UNTOUCHABLE "This is untouchable.";
Constant MSG_NOT_VERY_GOOD_AT_CLIMBING "You're not very good at climbing";
Constant MSG_WRONG_LOCATION "You are in the wrong location to attempt this.";
Constant MSG_YOU_DECIDE_CLOSER_LOOK "You decide to go take a closer look at ";
Constant MSG_AND_HEAD ", and head ";
Constant MSG_LISTEN_HEADPHONES 1034;
Constant MSG_BURSTING_WITH_ENERGY " bursting with energy and ready to explore the island.";
Constant MSG_BIGOBJECT_PARSING_ERROR "(parsing error)";
Constant MSG_TAKE_NO_CAPACITY 1035;
Constant MSG_CANT_LOOK_THROUGH "You cannot look through this.";
Constant MSG_UNCOVERING_STAIRS " You reckon you have time, and you don't have to finish today; so you sit down and start clearing the dirt off the steps. There's a few inches of soft mud covering the small steps, but with some patience, and your sturdy fishing knife to carve out some of the mud, you manage to clear enough mud to step on the next step. You continue methodically uncovering them, one by one. On the morning of the second day, you finally reach the ";
Constant MSG_CALL_FOR_HELP_REPEAT 1036;
Constant MSG_FAR_TOO_LARGE "This is far too large";
Constant MSG_ONLY_WAY_IS_OUT ". The only way is out";
Constant MSG_INCREDIBLY_DESCVILLAGE "Incredibly, there are a dozen buildings here, of various sizes and all fairly recent-looking, the tallest one being the radio tower at the southwest, and the most imposing one being the tall, white house looming in the backdrop, to the east.";
Constant MSG_DROP_ROD_ALBATROSS_PERKS_UP "You kneel to carefully drop your fishing rod. The albatross perks up; you look at your rod for just one second, and it ";
[ LibraryMessages p_msg p_arg_1 ; ! p_arg_2 not used, it's ok if it's not featured here if it's never called with 3 args anyway
! saves 2 bytes over a switch
if (p_msg == MSG_PROMPT) { print ">";rtrue; }
if (p_msg == MSG_TAKE_NO_CAPACITY) { print "You are carrying too many things already"; if (backpack in player) {print ", and you can't put any of them in the backpack";} "."; }
if (p_msg == MSG_EAT_INEDIBLE) { if (F_ACT2_STARTED) {print "T";} else { print "You're worried about not finding enough food to survive, but t"; } "his is definitely not edible."; }
if (p_msg == MSG_TOO_IMMENSE) { print "This is far too immense to be "; rtrue; }
if (p_msg == MSG_NOT_SOMETHING_YOU_CAN_VERB) { PrintMsg(MSG_OPEN_YOU_CANT, p_arg_1); rtrue; } ! that's not something you can verbword ! TODO replace this with OPEN_YOU_CANT in the final code to save 10ish bytes
if (p_msg == MSG_TIE_DEFAULT or MSG_DONT_GET_WHAT_TO_DO) { "I don't understand what you want to do with ", (the) noun, "."; }
#ifndef IS_DEMO;
if (p_msg == MSG_LISTEN_HEADPHONES) {
if (Wireinalockedlocker in radio) {"You can hear some static in the headphones.";} else {print_ret "T", (string) MSG_NO_NOISE_HEADPHONES; }
}
if (p_msg == MSG_CALL_FOR_HELP_REPEAT) {
print "You push the microphone's button and call for help repeatedly on the frequency ";
PrintFreq();
print ", but you get no response";
}
#endif;
! switch(p_msg) {
! MSG_PROMPT: print ">"; p_arg_1 = p_arg_2; rtrue;
! MSG_EAT_INEDIBLE: if (F_ACT2_STARTED) {print "T";} else { print "You're worried about not finding enough food to survive, but t"; } "his is definitely not edible.";
! MSG_TOO_IMMENSE: print "This is far too immense to be "; rtrue;
! MSG_NOT_SOMETHING_YOU_CAN_VERB: PrintMsg(MSG_OPEN_YOU_CANT, p_arg_1); rtrue; ! that's not something you can verbword ! TODO replace this with OPEN_YOU_CANT in the final code to save 10ish bytes
! MSG_TIE_DEFAULT, MSG_DONT_GET_WHAT_TO_DO: print_ret "I don't understand what you want to do with ", (the) noun, ".";
! }
];
! ====================================
! Rank
! ====================================
[ PrintRank;
print ", thus giving you the rank of: ";
if(score== 150) "Nuclear Investigator.";
if(score>= 100) "Curious Explorer.";
if(score>= 50) "Robinson Crusoe.";
"Castaway.";
];
! =====================================
! Special thing to not count coins in the capacity
! =====================================
#ifndef IS_DEMO;
Replace _AtFullCapacity;
[ _AtFullCapacity p_s _obj _k;
if (p_s == player) {
objectloop (_obj in p_s)
if (~~(_obj has worn || _obj ofclass Coin)) _k++;
} else
_k = children(p_s);
#IfDef SACK_OBJECT;
if (_k < ObjectCapacity(p_s) || (p_s == player && _RoomInSack())) rfalse;
#IfNot;
if (_k < ObjectCapacity(p_s)) rfalse;
#EndIf;
];
#endif;
! =====================================
! Manage darkness's scope and restore ability to examine in the darkness
! =====================================
Attribute semidark;
#Ifdef IS_DEMO;
Object odd
with semidark_description "",
has semidark;
#Endif;
! add any object in location that is semidark
[InScope x;
if(location == thedark && real_location has semidark)
objectloop(x in real_location) {
if(x has semidark) {
PlaceInScope(x);
ScopeWithin(x);
}
}
rfalse;
];
[GamePreRoutine;
! Examine normally doesn't work in dark locations. We want it to work
! in semidark locations though.
if(location == thedark && action == ##Examine &&
real_location has semidark) {
if(noun provides description) {
PrintOrRun(noun, description);
rtrue;
} else {
PrintMsg(MSG_EXAMINE_NOTHING_SPECIAL);
rtrue;
}
}
rfalse;
];
! still list objects (for instance the ones you dropped) if they are semidark
[LookRoutine x;
if(location == thedark && real_location has semidark) {
objectloop(x in real_location) {
give x ~workflag;
! game design choice : i want the player's former possessions to still be listed: he put them there, he knows where to find them ish
if(x has semidark && x hasnt scenery or concealed or door || x has moved)
!if(x has semidark && x hasnt scenery or concealed or door)
give x workflag;
}
if(PrintContents("^You can barely make out ", real_location, true)) " here.";
}
];
[DescribeTheDark;
if(real_location has semidark) {
if(real_location provides semidark_description) {
PrintOrRun(real_location, semidark_description);
rtrue;
} else {
PrintOrRun(real_location, description);
rtrue;
}
}
"It's too dark to see here.";
];
[ TheDarkShortName ;
if (real_location has semidark) {
print (name) real_location;
rtrue;
}
rfalse; ! ? I mean it's fine, all my dark locations have semidark
];
Include "puny.h";
! ============================================================================
! Extra grammar
[ BlowSub ;
"You can't usefully blow in ", (the) noun, ".";
];
Verb 'blow'
* held -> Blow
* 'in'/'into' held -> Blow;
[ PlaySub ;
PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'play');
];
Verb 'play'
* noun ->Play;
[ SwimSub;
if (noun) { "You cannot swim in there."; }
if (location == OnlyRoomWaistDeep) { "You swim a little bit, but there's no use swimming too far from the shore."; }
if (location provides vec_norm) { print "You enter the ocean and swim a bit, trying to see if anything interesting is under the water.^"; PlayerTo(EnterOcean()); rtrue; } ! EnterOcean is defined after the code to navigate the waters (line 650 ish)
"You cannot swim here.";
];
! doesn't work and super flourishy
![ SwimDirSub;
! if (location == OnlyRoomWaistDeep) <<Go noun>>;
! "You aren't in water at the moment.";
!];
Verb 'swim'
* ->Swim
!* noun=ADirection ->SwimDir
* 'in' noun ->Swim;
[ LookUnderSub ;
"You can't really look under that.";
];
Extend 'look' first
* 'under' noun ->LookUnder;
[ ThrowSub;
<Drop noun>; rtrue;
];
Extend only 'throw' first
* multiheld ->Throw;
Extend 'eat' replace ! instead of 'held'
* noun ->Eat;
!Verb 'lick' ! why do we need this? lick fish??
!* noun ->Eat;
Extend 'climb'
* 'on'/'in' noun ->Enter;
! Insert thing in door
[ LocUnlocSub ;
if (second has locked) { <<Unlock second noun>>; } else { <<Lock second noun>>; }
];
Extend 'insert' first
* noun 'in' door ->LocUnloc;
[ Cut1Sub ;
if (noun has scenery) { PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'cut'); rtrue;}
#ifndef IS_DEMO;
if (Fishingknife notin player && Saw notin player) "You don't have anything to cut this with.";
#endif;
#ifdef IS_DEMO;
if (Fishingknife notin player) "You don't have anything to cut this with.";
#endif;
PrintMsg(MSG_CUT_NO_USE); rtrue;
];
[ Cut2Sub ;
if (noun has scenery) { PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'cut'); rtrue;}
#ifndef IS_DEMO;
if (~~(second == Fishingknife or Saw)) { "This cannot be used to cut anything."; }
#endif;
#ifdef IS_DEMO;
if (~~(second == Fishingknife)) { "This cannot be used to cut anything."; }
#endif;
PrintMsg(MSG_CUT_NO_USE); rtrue;
];
Extend 'cut' replace
* noun -> Cut1
* noun 'with' held -> Cut2
!* noun 'on' held -> Cut2
!* noun 'onto' held -> Cut2
;
Extend 'slice' replace
* noun -> Cut1
* noun 'with' held -> Cut2;
Verb 'stab' = 'cut';
Verb 'carve' = 'cut';
[ GutSub ;
PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'gut'); rtrue;
];
Verb 'gut'
* noun ->Gut;
[ BaitSub ;
if (noun ~= FishingRodReel) { PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'bait'); rtrue; }
if (second) { "You cannot bait the hook with this."; }
"Please specify what you want to bait the hook with.";
];
Verb 'bait'
* noun ->Bait
* noun 'with' noun ->Bait;
Verb 'gather' = 'take';
[ UntieSub ;
print_ret (string) MSG_UNTIE;
];
Verb 'untie' 'detach'
* noun -> Untie;
! not very intuitive branches here...
[ SleepSub ;
if (hammock in location) {
if (F_SLEPT == false) {
F_SLEPT = true; score = score + 5;
print_ret "This net should be sturdy enough -- after all, it is made to catch a lot of fish and not break... You climb inside the hammock, which bends under your weight. The net's knots are digging in your back, but you find a way to be comfortable. You close your eyes and finally get the restful sleep you needed...^^You wake up in the morning,", (string) MSG_BURSTING_WITH_ENERGY;
}
} else {
if (location == OnlyRoomWaistDeep) {"You are unable to sleep in water, since you sleep on your stomach.";}
if (location == Deepinthewoods) {"The floor of the forest doesn't seem particularly comfy. Maybe there would be a way to sleep higher up...";}
if (location ofclass Shore) {
if (location == Edgeofthewoods) { "One look at the critters, and you decide not to sleep on the floor of the forest."; }
else {"You'd be awoken by the high tide soaking you wet, judging by the fact that the sand doesn't seem to get dry here.";}
}
}
if (F_ACT3_STARTED == 0) {print_ret "You don't feel sleepy anymore -- you are", (string) MSG_BURSTING_WITH_ENERGY; }
else { "You're way too excited for this right now -- the secrets of the white house await you!"; }
];
[ SleepOnSub ;
"This is not something you can sleep on.";
];
Verb 'sleep' 'nap' 'rest'
* ->Sleep
* 'on' noun ->SleepOn;
Verb 'shoo' = 'attack';
Extend 'shout'
* 'at' noun ->Attack;
Verb 'strike' = 'attack'; ! strike match
[ BurnSub ;
print_ret (string) MSG_BURN_DEFAULT;
];
Verb 'burn' 'light' 'cook'
* noun -> Burn
* noun 'with' held -> Burn;
Verb 'set'
! TODO: set noun ->Set (for the frequency)
* 'fire' 'to' noun ->Burn;
! hacky
[ ArrangeSub _k;
if (noun == firewood) {
if (FIRE_IS_READY) {<<Take firewood>>;} ! quite proud
if (firewood in player) {<<Drop firewood>>;}
! we want the same message as drop, but not if the hands are full
! keep_silent : silent if everything was good, if not it isn't silent about the reason
_k = keep_silent; keep_silent = true;
if (TryToTakeNoun() == 0) { ! taking the object was successful - i know i know
! then we're good and we drop it
keep_silent = _k;
<Drop firewood>;
} ! else : trytotakenoun will have displayed the reason
keep_silent = _k;
rtrue;
}
PrintMsg(MSG_DONT_GET_WHAT_TO_DO); ! complex message, don't change to a print_ret
];
Verb 'arrange'
* noun ->Arrange;
[ CampfireSub;
if (parent(firewood) == player or location && firewood.dampness < 2) {<Arrange firewood>; rtrue;}
#ifndef IS_DEMO;
if (location == Scenicview) {<<Burn Fire>>;}
#endif;
"You first have to find some wood and make it dry enough.";
];
[ HamSub ;
if (Fishingnet in player) {
if (Trees in location) { <Tie Fishingnet Trees>; rtrue; }
else {"You need to tie your hammock to something stable.";}
}
else {"You don't have anything to make a hammock with.";}
];
Constant MSG_NOTHING_FOR_FIRE "You don't have anything to light a fire with.";
Verb 'make' 'build'
* 'fire'/'campfire' ->Campfire
* 'hammock' ->Ham;
[ LightFireSub ;
#ifndef IS_DEMO;
if (noun ~= 0 && ~~(noun == Lighter or matchbook)) { "This cannot be used to light a fire."; }
if ((Lighter in player || matchbook in player) && parent(firewood) == location or player) { <Burn firewood>; rtrue;} else {"You need to find dry wood first."; }
if (Fire in location) { <Burn Fire>; rtrue; }
#endif;
#ifdef IS_DEMO;
if (noun ~= 0 && noun ~= matchbook) { "This cannot be used to light a fire."; }
if (matchbook in player && parent(firewood) == location or player) { <Burn firewood>; rtrue;} else {"You need to find dry wood first."; }
#endif;
print_ret (string) MSG_NOTHING_FOR_FIRE;
];
! Burn, Attack: if (parent(firewood) == location or player) {<Burn firewood>; rtrue;} else {"You'd rather save your matches to start a campfire.";}
Extend 'light'
* 'fire'/'campfire' ->LightFire
* 'fire'/'campfire' 'with' noun ->LightFire;
Verb 'start'
* 'fire' ->LightFire
* noun ->SwitchOn; ! start jukebox, start generators, etc
Verb 'smoke' = 'burn';
[ DrySub ;
"This doesn't seem like it needs to be dried.";
];
Verb 'dry'
* noun ->Dry;
Extend 'tie'
* noun 'in'/'on'/'onto' noun ->Tie;
!Verb 'bind' = 'tie';
Verb 'hang' = 'tie';
[ CountSub ;
"You have better things to do than counting this.";
];
Verb 'count'
* noun ->Count;
! Fix for ">remove mud : But you're not wearing the mud
[NotHeld;
if(noun in player || noun == 0) {rfalse;} else {rtrue;}
];
[ TakeWithSub; ! only accessible with befores
print_ret "I don't understand how ", (the) second, " would help with ", (the) noun, ".";
];
Extend 'remove' first
* noun=NotHeld 'with' noun ->TakeWith;
Extend 'take'
* worn 'off' ->Disrobe
* noun=NotHeld 'with' noun ->TakeWith;
Extend 'get'
* noun=NotHeld 'with' noun ->TakeWith;
Extend 'remove' first
* noun=NotHeld -> Take;
Extend 'fill'
* noun 'with' noun ->Fill;
[ LowerSub;
PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'lower'); rtrue;
];
Verb 'lower'
* noun ->Lower;
[ RaiseSub;
PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'raise'); rtrue;
];
Verb 'raise'
* noun ->Raise;
[ FixSub;
PrintMSG(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'fix');
];
Extend only 'fix' replace
* noun ->Fix;
Verb 'repair'
* noun ->Fix;
[ FluteSub;
if (TinyFlute in player) { <Blow TinyFlute>; rtrue; } else { "You shout for the albatross, but it doesn't come."; }
];
[ CallSub;
PrintMsg(MSG_DONT_GET_WHAT_TO_DO);
];
[ SOSSub;
#ifndef IS_DEMO;
if (location == Commsroom) { <<Mic radio>>; }
if (F_ACT2_STARTED || TOWER_SEEN_THROUGH_TREES) { "The only way to call for help is to get the radio working.";}
#endif;
"Calling for help is useless, as nobody will hear you.";
];
Verb 'call'
* noun ->Call
* 'bird'/'albatros' ->Flute
* 'help'/'sos' ->SOS
* 'for' 'help'/'SOS' ->SOS;
Verb 'send'
* 'sos' ->SOS
* 'a'/'an' 'sos' ->SOS
* 'sos'/'help'/'distress' 'call'/'message' ->SOS
* 'a'/'an' 'sos'/'help'/'distress' 'call'/'message' ->SOS;
[ LisSub;
#ifndef IS_DEMO;
if (noun == 0 && geiger has on && parent(geiger) == location or player) { <<Listen geiger>>;}
#endif;
<<Listen noun>>;
];
Extend 'listen' replace
* -> Lis
* noun -> Lis
* 'to' noun -> Lis
* 'to' 'the' noun -> Lis;
#ifndef IS_DEMO;
Verb 'pry'
* noun=NotHeld ->Take
* noun=NotHeld 'with' noun ->TakeWith;
! Drink water from bottle, drink from bottle
Extend 'drink'
* 'water' 'from' noun ->Drink
* 'from' noun ->Drink;
! Pump
[Pump2Sub;
if (location == Centralplaza) {<<Drink Fountain>>;}
if (parent(Bikepump) == player or location) { <<Pump Bikepump>>;}
PrintMsg(MSG_PARSER_NOTHING_TO_VERB, 'pump');
];
[ PumpSub;
PrintMsg(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'pump');
];
Verb 'pump'
* noun ->Pump
* ->Pump2;
[ CrawlSub;
if (Holeinthefence in location) { <Enter Holeinthefence>; rtrue;}
print_ret (string) MSG_PUSHDIR_DEFAULT;
];
Verb 'crawl' 'kneel'
* ->Crawl
* 'in' noun ->Enter;
[ GoAroundSub;
"Please rephrase using a direction.";
];
[ GoNothingSub;
"Please provide the name of a direction or an object.";
];
Extend 'go'
* 'in'/'through'/'towards' noun ->Enter
* 'around' noun ->GoAround
* ->GoNothing;
[ BinocSub;
if (second ~= Binoculars) { print_ret (string) MSG_CANT_LOOK_THROUGH; }
"You doubt the binoculars would reveal any interesting details.";
];
[ Binoc2Sub;
if (noun ~= Binoculars) { print_ret (string) MSG_CANT_LOOK_THROUGH; }
if ( (location == Topofthetower or BaseOfTower or Communitygarden) || (location == OnlyRoomWaistDeep && vecteur_normal == 1 && sandbankDepth > TRISTAM_SANDBANK_DEPTH)) { <<Binoc TristamIsland>>; }
"Nothing here needs to be looked at through binoculars.";
];
Extend 'look'
* 'at' noun 'through'/'with' noun ->Binoc
* 'through'/'with' noun ->Binoc2;
Extend 'examine'
* noun 'through'/'with' noun ->Binoc;
Verb 'chew' = 'eat'; ! chew gum
[ TryLockOrUnlock n;
if (noun hasnt lockable) {
if (n == 'unlock') { PrintMsg(MSG_UNLOCK_NOT_A_LOCK, n); rtrue;}
if (n == 'lock') { PrintMsg(MSG_LOCK_NOT_A_LOCK, 'lock'); rtrue; }
}
if (n=='lock' && noun has locked) { PrintMsg(MSG_LOCK_ALREADY_LOCKED, n); rtrue; }
if (n=='lock' && noun has open) { PrintMsg(MSG_LOCK_CLOSE_FIRST); rtrue; }
if (n=='unlock' && noun hasnt locked) { PrintMsg(MSG_UNLOCK_ALREADY_UNLOCKED, n); rtrue; }
if (noun == CrudeDoor or OneBigDoor or OneBigLockableDoor or BossRoomDoor or CommsRoomDoor) {
print_ret "To ", (verbname) n, " this door, you'll have to specify with which key.";
} else { PrintMsg(MSG_UNLOCK_NOT_A_LOCK, n); rtrue; }
];
[ TryUnlockSub;
TryLockOrUnlock('unlock');
];[ TryLockSub;
TryLockOrUnlock('lock');
];
Extend 'unlock'
* noun ->TryUnlock;
Extend 'lock'
* noun ->TryLock;
[ PickSub; ! need to have a separate verb so we can detect "pick lock"
<<Take noun>>;
];
Extend 'pick'
* noun ->Pick;
! NOTE HERE:
! roger firth tells you how to do it for a new verb
! but if you're extending a meta verb, you need to do a "notmeta" token instead
[ notMeta; meta = false; return GPR_PREPOSITION; ];
Extend 'restart' replace
* ->Restart
* notMeta noun ->SwitchOn; ! restart generator
Extend only 'unscrew'
* noun 'with' noun ->Unlock;
[ UnplugSub;
if (second == 0 && noun has switchable) { <<SwitchOff noun>>; }
else { <<Untie noun>>; }
];
Verb 'connect'
* noun 'to'/'in'/'with'/'on'/'and' noun ->Tie;
Verb 'plug'
* 'in' noun 'to' noun ->Tie
* noun 'to'/'in'/'with'/'on'/'and' noun ->Tie;
Verb 'unplug' 'disconnect'
* noun ->Unplug
* noun 'and' noun ->Unplug;
[ MicSub;
"Talking into this will not do anything.";
];
Verb 'talk'
* 'to' noun ->Tell
* 'in' noun ->Mic;
[ ShootSub;
PrintMSG(MSG_NOT_SOMETHING_YOU_CAN_VERB, 'fire');
];
Verb 'shoot' 'fire'
* noun ->Shoot;
#endif; ! IS_DEMO
! In the manual or not?
[ CreditsSub ;
"[The author would like to thank:^Infocom, creators of the Z-Machine and of so many awesome adventure games that we're still using their tools 40 years after;^Graham Nelson, creator of Inform 6;^Andrew Plotkin, for his hard work and dedication to fixing the Inform 6 compiler's bugs that had prevented z3 releases for years;^Fredrik Ramsberg and Johan Berntsson, for the amazing PunyInform library, and many optimizations and bugfixes;^My testers: Manon Burz-Labrande, CrocMiam, Steve Flintham, Grimmnebulin, Brennen Kinch, Juhana Leinonen, Samuel Verschelde, Mark Walker, Jack Welch;^The players who reported bugs in the initial release: Davide Bucci, Chris Carter, Wade Clarke, Denk, Richard Hawkins, Christopher Merrimer, Brian Rushton, Tiffany Zhao;^All the programmers and maintainers of interpreters, which keep the Z-Machine alive on so many platforms;^Stefan Vogt, for his help setting up ports of this game, and his detailed answers to my technical questions;^And last but not least, my wife and my kids, for their love, support, and patience.]";
];
Verb 'credits' 'thanks' 'about' 'info'
* -> Credits;
[ HelpSub ;
print "[There is no built-in help in this game. However, some of the later puzzles can be skipped ";
if (ALBATROSS_ALREADY_STOLE == 0) {print "using an object you haven't gotten yet."; } else { print "by calling the albatross with the flute; this can only be done once.";}
"^Purchasing the game also allows you to download a hint book. If you're still stuck after that, ask for help online.]";
];
Verb 'help' 'hint' 'hints'
* ->Help;
![SpecSub _ks;
! _ks = keep_silent;
! keep_silent = 1;
! <Insert noun SACK_OBJECT>;
! keep_silent = _ks;
!];
!Verb 'spec'
!* noun ->Spec;
#ifndef IS_DEMO;
Constant FIRST_FLOATING_ACT2 = 15; ! OneBigLockableDoor is the 15th floating object
Constant FIRST_FLOATING_ACT3 = 24; ! the angled pipe by the roof is the 40th floating object
Constant FIRST_FLOATING_ACT4 = 29; ! the door of the lieutenant-general's room is the 43th floating object
#endif;
Global freq = 4020;
[ Initialise ;
location = Immaculatebeach;
lookmode = 2;
move matchbook to player; scope_modified = true;
! changes to thedark
thedark.description = DescribeTheDark;
thedark.short_name = TheDarkShortName;
#ifndef IS_DEMO;
! FOR TESTING ACT 2 ONLY
! remove matchbook;
! location=Topofthestairs;
! give Northerncliffs visited;
! FISH_ELEVATOR_UP = 1;f
! move Fishingknife to player;
! move Fishingrod to player;
! move TinyFlute to player;
! F_ACT2_STARTED = 1;
! F_CLIMBED_STEPS = 1;
! F_ATE_SOMETHING = 1;
! F_SLEPT = 1;
! ALBATROSS_ALREADY_STOLE=1;
! FOR TESTING ACT 3 ONLY
! F_ACT3_STARTED = 1;
! move Flatheadscrewdriver to player;
! location=WhiteHouseLobby;
! FOR TESTING ACT 4 ONLY
! F_ACT4_STARTED = 1;
! F_ELEVATOR_DOWN = 1;
! location = Insidetheelevator;
#endif;
player.description = "You're doing OK, all things considered. Still a bit shaken by the accident, but this island sure is interesting and warrants further exploration. You are fairly confident you will manage to escape, one way or another. You don't really know why -- just a hunch.";
! accented tests
!print "Restaurant @<<l'@AEther@>> - @^Ile de Malm@/o^^(@cCa, c'est le menu de tant@^ot, pour @LL36:)^^Rago@^ut et p@^at@'e de t@^ete o@`u la sauce fermi@`ere vient d'Ha@:y-les-Roses, et beurre ma@^itre d'h@^otel^@OEufs @>>die Stra@sse@<<, servis entre le P@`o et A@'yna, re@ccus hier (1 @oeuf @`a la fran@ccaise, a@~nejo de Guadalaj@'ara, et c@aetera)^B@'anh m@`i et ses sp@:atzele en n@oeuds @<<@`a la M@:otley Cr@:ue@>>^B@^uche de No@:el de 15 @oA (@oangstr@:om) de long^^@^Ag@'e de 20 ans et employ@'e par @/Orsted, @!!al jefe se encanta la m@'usica!";
"You lift your eyes up to the island and sigh.^^It was just supposed to be a trip like so many you've flown, taking your small airplane to a remote island in the south Atlantic Ocean to deliver medicine and spare parts. You thought you'd be back by sunset, but a storm like you've never seen before whipped up out of nowhere and battered your airplane. You were losing altitude so fast, you had no choice but to take your parachute and ditch the plane in the drink. You're extremely lucky to have spotted this small island, a tall chunk of rock in the middle of the ocean. It saved you from certain death; but you can't stay on this island forever. You'll have to explore and see what you're working with.^^You look back down and sigh.^^";
];
! 250 bytes
Constant HDR_GAMEFLAGS $10;
Global transcript_mode = false; ! true when game scripting is on
[ ScriptOnSub;
transcript_mode = ((HDR_GAMEFLAGS-->0) & 1);
if (transcript_mode) "Transcripting is already on.";
@output_stream 2;
if (((HDR_GAMEFLAGS-->0) & 1) == 0) "Attempt to begin transcript failed.";
print "Start of a transcript of^";
Banner();
transcript_mode = true;
];
[ ScriptOffSub;
transcript_mode = ((HDR_GAMEFLAGS-->0) & 1);
if (transcript_mode == false) "Transcripting is already off.";
print "^End of transcript.^";
@output_stream -2;
if ((HDR_GAMEFLAGS-->0) & 1) "Attempt to end transcript failed.";
transcript_mode = false;
];
Verb meta 'script' 'transcript'