This repository has been archived by the owner on Jul 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
english.h
1469 lines (1381 loc) · 54.5 KB
/
english.h
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
! ==============================================================================
! ENGLISH: Language Definition File
!
! Supplied for use with Inform 6 -- Release 6.12.2 -- Serial number 180520
!
! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2018
!
! This code is licensed under either the traditional Inform license as
! described by the DM4 or the Artistic License version 2.0. See the
! file COPYING in the distribution archive or at
! https://github.com/DavidGriffith/inform6lib/
!
! This file is automatically Included in your game file by "parserm".
! Strictly, "parserm" includes the file named in the "language__" variable,
! whose contents can be defined by+language_name=XXX compiler setting (with a
! default of "english").
!
! Define the constant DIALECT_US before including "Parser" to obtain American
! English.
! ==============================================================================
System_file;
#Ifndef LIBRARY_ENGLISH; ! if this file is already included,
! don't try to include it again.
! ------------------------------------------------------------------------------
! Part I. Preliminaries
! ------------------------------------------------------------------------------
Constant EnglishNaturalLanguage; ! Needed to keep old pronouns mechanism
Class CompassDirection
with number 0, article "the",
description [;
if (location provides compass_look && location.compass_look(self)) rtrue;
if (self.compass_look()) rtrue;
L__M(##Look, 7, self);
],
compass_look false,
parse_name [; return -1; ]
has scenery;
Object Compass "compass" has concealed;
#Ifndef WITHOUT_DIRECTIONS;
CompassDirection -> n_obj with short_name "north", door_dir n_to,
name 'n//' 'north';
CompassDirection -> s_obj with short_name "south", door_dir s_to,
name 's//' 'south';
CompassDirection -> e_obj with short_name "east", door_dir e_to,
name 'e//' 'east';
CompassDirection -> w_obj with short_name "west", door_dir w_to,
name 'w//' 'west';
CompassDirection -> ne_obj with short_name "northeast", door_dir ne_to,
name 'ne' 'northeast';
CompassDirection -> nw_obj with short_name "northwest", door_dir nw_to,
name 'nw' 'northwest';
CompassDirection -> se_obj with short_name "southeast", door_dir se_to,
name 'se' 'southeast';
CompassDirection -> sw_obj with short_name "southwest", door_dir sw_to,
name 'sw' 'southwest';
CompassDirection -> u_obj with short_name "up above", door_dir u_to,
name 'u//' 'up' 'ceiling' 'above' 'sky';
CompassDirection -> d_obj with short_name "ground", door_dir d_to,
name 'd//' 'down' 'floor' 'below' 'ground';
#endif; ! WITHOUT_DIRECTIONS
CompassDirection -> in_obj with short_name "inside", door_dir in_to;
CompassDirection -> out_obj with short_name "outside", door_dir out_to;
! ------------------------------------------------------------------------------
! Part II. Vocabulary
! ------------------------------------------------------------------------------
Constant AGAIN1__WD = 'again';
Constant AGAIN2__WD = 'g//';
Constant AGAIN3__WD = 'again';
Constant OOPS1__WD = 'oops';
Constant OOPS2__WD = 'o//';
Constant OOPS3__WD = 'oops';
Constant UNDO1__WD = 'undo';
Constant UNDO2__WD = 'undo';
Constant UNDO3__WD = 'undo';
Constant ALL1__WD = 'all';
Constant ALL2__WD = 'each';
Constant ALL3__WD = 'every';
Constant ALL4__WD = 'everything';
Constant ALL5__WD = 'both';
Constant AND1__WD = 'and';
Constant AND2__WD = 'and';
Constant AND3__WD = 'and';
Constant BUT1__WD = 'but';
Constant BUT2__WD = 'except';
Constant BUT3__WD = 'but';
Constant ME1__WD = 'me';
Constant ME2__WD = 'myself';
Constant ME3__WD = 'self';
Constant OF1__WD = 'of';
Constant OF2__WD = 'of';
Constant OF3__WD = 'of';
Constant OF4__WD = 'of';
Constant OTHER1__WD = 'another';
Constant OTHER2__WD = 'other';
Constant OTHER3__WD = 'other';
Constant THEN1__WD = 'then';
Constant THEN2__WD = 'then';
Constant THEN3__WD = 'then';
Constant NO1__WD = 'n//';
Constant NO2__WD = 'no';
Constant NO3__WD = 'no';
Constant YES1__WD = 'y//';
Constant YES2__WD = 'yes';
Constant YES3__WD = 'yes';
Constant AMUSING__WD = 'amusing';
Constant FULLSCORE1__WD = 'fullscore';
Constant FULLSCORE2__WD = 'full';
Constant QUIT1__WD = 'q//';
Constant QUIT2__WD = 'quit';
Constant RESTART__WD = 'restart';
Constant RESTORE__WD = 'restore';
Array LanguagePronouns table
! word possible GNAs connected
! to follow: to:
! a i
! s p s p
! mfnmfnmfnmfn
'it' $$001000111000 NULL
'him' $$100000100000 NULL
'her' $$010000010000 NULL
'them' $$000111000111 NULL;
Array LanguageDescriptors table
! word possible GNAs descriptor connected
! to follow: type: to:
! a i
! s p s p
! mfnmfnmfnmfn
'my' $$111111111111 POSSESS_PK 0
'this' $$111111111111 POSSESS_PK 0
'these' $$000111000111 POSSESS_PK 0
'that' $$111111111111 POSSESS_PK 1
'those' $$000111000111 POSSESS_PK 1
'his' $$111111111111 POSSESS_PK 'him'
'her' $$111111111111 POSSESS_PK 'her'
'their' $$111111111111 POSSESS_PK 'them'
'its' $$111111111111 POSSESS_PK 'it'
'the' $$111111111111 DEFART_PK NULL
'a//' $$111000111000 INDEFART_PK NULL
'an' $$111000111000 INDEFART_PK NULL
'some' $$000111000111 INDEFART_PK NULL
'lit' $$111111111111 light NULL
'lighted' $$111111111111 light NULL
'unlit' $$111111111111 (-light) NULL;
Array LanguageNumbers table
'one' 1 'two' 2 'three' 3 'four' 4 'five' 5
'six' 6 'seven' 7 'eight' 8 'nine' 9 'ten' 10
'eleven' 11 'twelve' 12 'thirteen' 13 'fourteen' 14 'fifteen' 15
'sixteen' 16 'seventeen' 17 'eighteen' 18 'nineteen' 19 'twenty' 20;
! ------------------------------------------------------------------------------
! Part III. Translation
! ------------------------------------------------------------------------------
[ LanguageToInformese;
];
! ------------------------------------------------------------------------------
! Part IV. Printing
! ------------------------------------------------------------------------------
Constant LanguageAnimateGender = male;
Constant LanguageInanimateGender = neuter;
Constant LanguageContractionForms = 2; ! English has two:
! 0 = starting with a consonant
! 1 = starting with a vowel
[ LanguageContraction text;
if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u'
or 'A' or 'E' or 'I' or 'O' or 'U') return 1;
return 0;
];
Array LanguageArticles -->
! Contraction form 0: Contraction form 1:
! Cdef Def Indef Cdef Def Indef
"The " "the " "a " "The " "the " "an " ! Articles 0
"The " "the " "some " "The " "the " "some "; ! Articles 1
! a i
! s p s p
! m f n m f n m f n m f n
Array LanguageGNAsToArticles --> 0 0 0 1 1 1 0 0 0 1 1 1;
[ LanguageDirection d;
switch (d) {
n_to: print "north";
s_to: print "south";
e_to: print "east";
w_to: print "west";
ne_to: print "northeast";
nw_to: print "northwest";
se_to: print "southeast";
sw_to: print "southwest";
u_to: print "up";
d_to: print "down";
in_to: print "in";
out_to: print "out";
default: return RunTimeError(9,d);
}
];
[ LanguageNumber n f;
if (n == 0) { print "zero"; rfalse; }
if (n < 0) { print "minus "; n = -n; }
if (n >= 1000) { print (LanguageNumber) n/1000, " thousand"; n = n%1000; f = 1; }
if (n >= 100) {
if (f == 1) print ", ";
print (LanguageNumber) n/100, " hundred"; n = n%100; f = 1;
}
if (n == 0) rfalse;
#Ifdef DIALECT_US;
if (f == 1) print " ";
#Ifnot;
if (f == 1) print " and ";
#Endif;
switch (n) {
1: print "one";
2: print "two";
3: print "three";
4: print "four";
5: print "five";
6: print "six";
7: print "seven";
8: print "eight";
9: print "nine";
10: print "ten";
11: print "eleven";
12: print "twelve";
13: print "thirteen";
14: print "fourteen";
15: print "fifteen";
16: print "sixteen";
17: print "seventeen";
18: print "eighteen";
19: print "nineteen";
20 to 99: switch (n/10) {
2: print "twenty";
3: print "thirty";
4: print "forty";
5: print "fifty";
6: print "sixty";
7: print "seventy";
8: print "eighty";
9: print "ninety";
}
if (n%10 ~= 0) print "-", (LanguageNumber) n%10;
}
];
[ LanguageTimeOfDay hours mins i;
i = hours%12;
if (i == 0) i = 12;
if (i < 10) print " ";
print i, ":", mins/10, mins%10;
if ((hours/12) > 0) print " pm"; else print " am";
];
[ LanguageVerb i;
switch (i) {
'i//','inv','inventory':
print "take inventory";
'l//': print "look";
'x//': print "examine";
'z//': print "wait";
default: rfalse;
}
rtrue;
];
! ----------------------------------------------------------------------------
! LanguageVerbIsDebugging is called by SearchScope. It should return true
! if word w is a debugging verb which needs all objects to be in scope.
! ----------------------------------------------------------------------------
#Ifdef DEBUG;
[ LanguageVerbIsDebugging w;
if (w == 'purloin' or 'tree' or 'abstract'
or 'gonear' or 'scope' or 'showobj')
rtrue;
rfalse;
];
#Endif;
! ----------------------------------------------------------------------------
! LanguageVerbLikesAdverb is called by PrintCommand when printing an UPTO_PE
! error or an inference message. Words which are intransitive verbs, i.e.,
! which require a direction name as an adverb ('walk west'), not a noun
! ('I only understood you as far as wanting to touch /the/ ground'), should
! cause the routine to return true.
! ----------------------------------------------------------------------------
[ LanguageVerbLikesAdverb w;
if (w == 'look' or 'go' or 'push' or 'walk')
rtrue;
rfalse;
];
! ----------------------------------------------------------------------------
! LanguageVerbMayBeName is called by NounDomain when dealing with the
! player's reply to a "Which do you mean, the short stick or the long
! stick?" prompt from the parser. If the reply is another verb (for example,
! LOOK) then then previous ambiguous command is discarded /unless/
! it is one of these words which could be both a verb /and/ an
! adjective in a 'name' property.
! ----------------------------------------------------------------------------
[ LanguageVerbMayBeName w;
if (w == 'long' or 'short' or 'normal'
or 'brief' or 'full' or 'verbose')
rtrue;
rfalse;
];
Constant NKEY__TX = "N = next subject";
Constant PKEY__TX = "P = previous";
Constant QKEY1__TX = " Q = resume game";
Constant QKEY2__TX = "Q = previous menu";
Constant RKEY__TX = "RETURN = read subject";
Constant NKEY1__KY = 'N';
Constant NKEY2__KY = 'n';
Constant PKEY1__KY = 'P';
Constant PKEY2__KY = 'p';
Constant QKEY1__KY = 'Q';
Constant QKEY2__KY = 'q';
Constant SCORE__TX = "Score: ";
Constant MOVES__TX = "Moves: ";
Constant TIME__TX = "Time: ";
Constant CANTGO__TX = "You can't go that way.";
Constant FORMER__TX = "your former self";
Constant MYFORMER__TX = "my former self";
Constant YOURSELF__TX = "yourself";
Constant MYSELF__TX = "myself";
Constant YOU__TX = "You";
Constant DARKNESS__TX = "Darkness";
Constant THOSET__TX = "those things";
Constant THAT__TX = "that";
Constant OR__TX = " or ";
Constant NOTHING__TX = "nothing";
Constant IS__TX = " is";
Constant ARE__TX = " are";
Constant IS2__TX = "is ";
Constant ARE2__TX = "are ";
Constant WAS__TX = " was";
Constant WERE__TX = " were";
Constant WAS2__TX = "was ";
Constant WERE2__TX = "were ";
Constant AND__TX = " and ";
Constant WHOM__TX = "whom ";
Constant WHICH__TX = "which ";
Constant COMMA__TX = ", ";
Constant COLON__TX = ": ";
! ----------------------------------------------------------------------------
! FYI on nominative pronouns versus accusative pronouns...
! Consider the sentence "She hit him.".
! "She" is in the nominative case. It appears at the beginning of a sentence.
! "him" is in the accusative case. It won't appear at the beginning.
! ----------------------------------------------------------------------------
! Accusative
[ ThatOrThose obj;
if (obj == player) {
if (player provides narrative_voice) {
if (player.narrative_voice == 1) { print "me"; return; }
if (player.narrative_voice == 3) { CDefart(player); return; }
}
print "you";
return;
}
if (obj has pluralname) { print "those"; return; }
if (obj has female) { print "her"; return; }
if (obj has male or animate)
if (obj hasnt neuter) { print "him"; return; }
print "that";
];
! Accusative
[ ItOrThem obj;
if (obj == player) {
if (player provides narrative_voice) {
if (player.narrative_voice == 1) { print "myself"; return; }
if (player.narrative_voice == 3) { CDefart(player); return; }
}
print "yourself";
return;
}
if (obj has pluralname) { print "them"; return; }
if (obj has female) { print "her"; return; }
if (obj has male or animate)
if (obj hasnt neuter) { print "him"; return; }
print "it";
];
! Nominative
[ CThatOrThose obj;
if (obj == player) {
if (player provides narrative_voice) {
if (player.narrative_voice == 1) { print "I"; return; }
if (player.narrative_voice == 3) { CDefart(player); return; }
}
print "You";
return;
}
if (obj has pluralname) { print "Those"; return; }
if (obj has female) { print "She"; return; }
if (obj has male or animate) {
if (obj hasnt neuter) { print "He"; return; }
}
print "That";
];
! Nominative
[ CTheyreorThats obj;
if (obj == player) {
if (player provides narrative_voice) {
if (player.narrative_voice == 1) { Tense("I'm", "I was"); return; }
if (player.narrative_voice == 3) { CDefart(player); Tense("'s", " was"); return; }
}
Tense("You're", "You were");
return;
}
if (obj has pluralname) { Tense("They're", "They were"); return; }
if (obj has female) { Tense("She's", "She was"); return; }
if (obj has male or animate) {
if (obj hasnt neuter) { Tense("He's", "He was"); return; }
}
Tense("That's", "That was");
];
[ IsOrAre obj;
if (player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
if (obj has pluralname || obj == player) print "were"; else print "was";
return;
}
if (obj has pluralname || obj == player) print "are"; else print "is";
return;
];
[ nop x; x = x; ]; ! print rule to absorb unwanted return value
[ SubjectNotPlayer obj reportage v2 v3 past;
if (past && player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
v2 = past;
v3 = past;
}
if (reportage && actor ~= player) {
L__M(##Miscellany, 60, actor);
if (obj == actor) {
print (theActor) obj, " ", (string) v3;
return;
}
else
if (obj has pluralname) {
print (the) obj, " ", (string) v2;
return;
}
else {print (the) obj, " ", (string) v3; return;}
}
else
if (obj has pluralname) { print (The) obj, " ", (string) v2; return;}
else { print (The) obj, " ", (string) v3; return;}
];
[ CSubjectVoice obj v1 v2 v3 past;
if (past && player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
v1 = past;
v2 = past;
v3 = past;
} else {
if (v2 == 0) v2 = v1;
if (v3 == 0) v3 = v1;
}
if (obj ~= player) { print (string) v3; return; }
if (player provides narrative_voice) switch (player.narrative_voice) {
1: print (string) v1; return;
2: ! Do nothing.
3: print (string) v3; return;
default: RunTimeError(16, player.narrative_voice);
}
print (string) v2; return;
];
[ CSubjectVerb obj reportage nocaps v1 v2 v3 past;
if (past && player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
v1 = past;
v2 = past;
v3 = past;
} else {
if (v2 == 0) v2 = v1;
if (v3 == 0) v3 = v1;
}
if (obj == player) {
if (player provides narrative_voice) switch (player.narrative_voice) {
1: print "I ", (string) v1; return;
2: ! Do nothing.
3: CDefart(player);
print " ", (string) v3; return;
default: RunTimeError(16, player.narrative_voice);
}
if (nocaps) { print "you ", (string) v2; return; }
print "You ", (string) v2; return;
}
SubjectNotPlayer(obj, reportage, v2, v3);
];
[ CSubjectIs obj reportage nocaps;
if (obj == player) {
if (player provides narrative_voice) switch (player.narrative_voice) {
1: Tense("I'm", "I was"); return;
2: ! Do nothing.
3: CDefart(player);
Tense(" is", " was"); return;
default: RunTimeError(16, player.narrative_voice);
}
if (nocaps) Tense("you're", "you were");
else Tense("You're", "You were");
return;
}
SubjectNotPlayer(obj, reportage, "are", "is", "was");
];
[ CSubjectIsnt obj reportage nocaps;
if (obj == player) {
if (player provides narrative_voice) switch (player.narrative_voice) {
1: Tense("I'm not", "I wasn't"); return;
2: ! Do nothing.
3: CDefart(player);
Tense(" isn't", " wasn't"); return;
default: RunTimeError(16, player.narrative_voice);
}
if (nocaps) Tense("you aren't", "you weren't");
else Tense("You aren't", "You weren't");
return;
}
SubjectNotPlayer(obj, reportage, "aren't", "isn't", "wasn't");
];
[ CSubjectHas obj reportage nocaps;
if (obj == player) {
if (player provides narrative_voice) switch (player.narrative_voice) {
1: Tense("I've", "I had"); return;
2: ! Do nothing.
3: CDefart(player);
Tense(" has", " had"); return;
default: RunTimeError(16, player.narrative_voice);
}
if (nocaps) Tense("you've", "you'd");
else Tense("You've", "You'd");
return;
}
SubjectNotPlayer(obj, reportage, "have", "has", "had");
];
[ CSubjectWill obj reportage nocaps;
if (obj == player) {
if (player provides narrative_voice) switch (player.narrative_voice) {
1: Tense("I'll", "I would've"); return;
2: ! Do nothing.
3: CDefart(player);
Tense(" will", " would've"); return;
default: RunTimeError(16, player.narrative_voice);
}
if (nocaps) Tense("you'll", "you'd");
else Tense("You'll", "You'd");
return;
}
SubjectNotPlayer(obj, reportage, "will", "will", "would");
];
[ CSubjectCan obj reportage nocaps;
CSubjectVerb(obj, reportage, nocaps, "can", 0, "can", "could");
];
[ CSubjectCant obj reportage nocaps;
CSubjectVerb(obj, reportage, nocaps, "can't", 0, "can't", "couldn't");
];
[ CSubjectDont obj reportage nocaps;
CSubjectVerb(obj, reportage, nocaps, "don't", 0, "doesn't", "didn't");
];
[ OnesSelf obj;
if (obj == player) {
if (player provides narrative_voice) switch(player.narrative_voice) {
1: print (string) MYSELF__TX; return;
2: ! Do nothing.
3: if (obj has female) {print "herself"; return;}
print "himself"; return;
default: RunTimeError(16, player.narrative_voice);
}
print "yourself"; return;
}
if (obj has male) { print "himself"; return; }
if (obj has female) {print "herself"; return; }
print "itself"; return;
];
[ Possessive obj caps;
if (obj == player) {
if (player provides narrative_voice) switch(player.narrative_voice) {
1: if (caps) print "M"; else print "m"; print "y"; return;
2: ! Do nothing.
3: CDefart(player);
print "'s"; return;
default: RunTimeError(16, player.narrative_voice);
}
if (caps) print "Y"; else print "y";
print "our"; return;
}
if (caps) print "H"; else print "h";
if (obj has male) { print "is"; return; }
if (obj has female) { print "er"; return; }
if (caps) print "I"; else { print "i"; print "ts"; return; }
];
[ PossessiveCaps obj;
Possessive(obj, true);
];
[ theActor obj;
if (obj == player) {
if (obj provides narrative_voice) {
switch (obj.narrative_voice) {
1: print "I"; return;
2: ! Do nothing.
3: if (obj has neuter) { print "it"; return; }
if (obj has female) { print "she"; return; }
print "he"; return;
default: RunTimeError(16, player.narrative_voice);
}
}
print "you"; return;
}
if (obj has pluralname) { print "they"; return; }
if (obj has female) { print "she"; return; }
if (obj has male or animate)
if (obj hasnt neuter) { print "he"; return; }
print "that";
];
[ SupportObj obj s1 s2;
if (obj has supporter) print (string) s1;
else print (string) s2;
];
[ PluralObj obj s1 s2 past;
if (player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
print (string) past;
return;
}
if (obj has pluralname) print (string) s1;
else print (string) s2;
];
! ----------------------------------------------------------------------------
! Tense is a little helper function to present the correct tense of a
! verb. The first parameter is the verb in present tense. The second
! parameter is the verb in past tense. If the second parameter is
! omitted, then nothing will be printed if the appropriate tense is past.
! ----------------------------------------------------------------------------
[ Tense present past;
if (player provides narrative_tense && player.narrative_tense == PAST_TENSE) {
if (past == false) return;
print (string) past;
}
else
print (string) present;
];
[ DecideAgainst;
CSubjectVerb(actor, false, false, "decide",0,"decides","decided");
print " that";
Tense("'s not", " wasn't");
" such a good idea.";
];
#Ifdef TARGET_ZCODE;
[ LowerCase c; ! for ZSCII matching ISO 8859-1
switch (c) {
'A' to 'Z': c = c + 32;
202, 204, 212, 214, 221: c--;
217, 218: c = c - 2;
158 to 160, 167, 168, 208 to 210: c = c - 3;
186 to 190, 196 to 200: c = c - 5 ;
175 to 180: c = c - 6;
}
return c;
];
[ UpperCase c; ! for ZSCII matching ISO 8859-1
switch (c) {
'a' to 'z': c = c - 32;
201, 203, 211, 213, 220: c++;
215, 216: c = c + 2;
155 to 157, 164, 165, 205 to 207: c = c + 3;
181 to 185, 191 to 195: c = c + 5 ;
169 to 174: c = c + 6;
}
return c;
];
#Ifnot; ! TARGET_GLULX
[ LowerCase c; return glk_char_to_lower(c); ];
[ UpperCase c; return glk_char_to_upper(c); ];
#Endif; ! TARGET_
[ LanguageLM n x1 x2;
Answer,Ask:
print "There ";
Tense("is", "was");
" no reply.";
! Ask: see Answer
Attack: print "Violence ";
Tense("isn't", "wasn't");
" the answer to this one.";
Blow: CSubjectCant(actor,true);
" usefully blow ", (thatorthose) x1, ".";
Burn: switch (n) {
1: print "This dangerous act would ";
Tense("achieve", "have achieved");
" little.";
2: DecideAgainst();
}
Buy: print "Nothing ";
Tense("is", "was");
" on sale.";
Climb: switch (n) {
1: print "Climbing ", (ThatOrThose) x1, " would ";
Tense("achieve", "have achieved");
" little.";
2: DecideAgainst();
}
Close: switch (n) {
1: CSubjectIs(x1,true);
print " not something ", (theActor) actor;
Tense(" can close", " could have closed");
".";
2: CSubjectIs(x1,true); " already closed.";
3: CSubjectVerb(actor,false,false,"close",0,"closes","closed");
" ", (the) x1, ".";
4: "(first closing ", (the) x1, ")";
}
CommandsOff: switch (n) {
1: "[Command recording off.]";
#Ifdef TARGET_GLULX;
2: "[Command recording already off.]";
#Endif; ! TARGET_
}
CommandsOn: switch (n) {
1: "[Command recording on.]";
#Ifdef TARGET_GLULX;
2: "[Commands are currently replaying.]";
3: "[Command recording already on.]";
4: "[Command recording failed.]";
#Endif; ! TARGET_
}
CommandsRead: switch (n) {
1: "[Replaying commands.]";
#Ifdef TARGET_GLULX;
2: "[Commands are already replaying.]";
3: "[Command replay failed. Command recording is on.]";
4: "[Command replay failed.]";
5: "[Command replay complete.]";
#Endif; ! TARGET_
}
Consult: CSubjectVerb(actor,true,false,"discover",0,"discovers","discovered");
print " nothing of interest in ";
if (x1 == player) { OnesSelf(x1); ".";}
else print_ret (the) x1, ".";
Cut: switch (n) {
1: print "Cutting ", (ThatOrThose) x1, " up would ";
Tense("achieve", "have achieved");
" little.";
2: DecideAgainst();
}
Dig: print "Digging would ";
Tense("achieve", "have achieved");
" nothing here.";
Disrobe: switch (n) {
1: CSubjectIsnt(actor,true); " wearing ", (ThatOrThose) x1, ".";
2: CSubjectVerb(actor,false,false,"take off",0,"takes off", "took off");
" ", (the) x1, ".";
}
Drink: print "There";
Tense("'s", " was");
" nothing suitable to drink here.";
Drop: switch (n) {
1: CSubjectIs(x1,true); " already here.";
2: CSubjectVerb(actor, false, false, "haven't got", 0, "hasn't got",
"didn't have");
" ", (the) x1, ".";
3: "(first taking ", (the) x1, " off)";
4: "Dropped.";
}
Eat: switch (n) {
1: CSubjectIs(x1,true); " plainly inedible.";
2: CSubjectVerb(actor,false,false,"eat",0,"eats", "ate"); print " ", (the) x1;
if (actor == player) ". Not bad."; else ".";
}
EmptyT: switch (n) {
1: CSubjectCant(x1,true); " contain things.";
2: CSubjectIs(x1,true); " closed.";
3: CSubjectIs(x1,true); " empty already.";
4: print "That wouldn't ";
Tense("empty", "have emptied");
" anything.";
}
Enter: switch (n) {
1: print "But "; CSubjectIs(actor,true,true);
" already ", (nop) SupportObj(x1,"on ","in "), (the) x1, ".";
2: CSubjectIs(x1,true);
print " not something ", (theActor) actor;
Tense(" can ", " could ");
switch (x2) {
'stand': "stand on.";
'sit': "sit down on.";
'lie': "lie down on.";
default: "enter.";
}
3: CSubjectCant(actor,true);
" get into the closed ", (name) x1, ".";
4: CSubjectCan(actor,true);
" only get into something free-standing.";
5: CSubjectVerb(actor,false,false,"get",0,"gets","got");
SupportObj(x1," onto"," into"); " ", (the) x1, ".";
6: "(getting ", (nop) SupportObj(x1,"off","out of"), " ", (the) x1, ")";
7: if (x1 has supporter) "(getting onto ", (the) x1, ")";
if (x1 has container) "(getting into ", (the) x1, ")";
"(entering ", (the) x1, ")";
}
Examine: switch (n) {
1: "Darkness, noun. An absence of light to see by.";
2: CSubjectVerb(actor,true,false,"see",0,"sees","saw");
" nothing special about ", (the) x1, ".";
3: CSubjectIs(x1,true);
Tense(" currently");
print " switched ";
if (x1 has on) "on."; else "off.";
}
Exit: switch (n) {
1: print "But ";
CSubjectIsnt(actor,true,true);
" in anything at the moment.";
2: CSubjectCant(actor,false);
" get out of the closed ", (name) x1, ".";
3: CSubjectVerb(actor,false,false,"get",0,"gets", "got");
print " ";
SupportObj(x1,"off","out of"); " ", (the) x1, ".";
4: CSubjectIsnt(actor,true);
print " ";
SupportObj(x1,"on","in"); " ", (the) x1, ".";
5: "(first getting ", (nop) SupportObj(x1,"off","out of"),
" ", (the) x1, ")";
6: CSubjectVerb(actor,false,false,"stand",0,"stands","stood"); " up.";
}
Fill: switch (n) {
1: print "There ";
Tense("isn't", "wasn't");
" anything obvious with which to fill ", (the) x1, ".";
2: print "Filling ", (the) x1, " from ", (the) x2;
Tense(" doesn't", " didn't");
" make sense.";
}
FullScore: switch (n) {
1: if (deadflag) print "The score was "; else print "The score is ";
"made up as follows:^";
2: "finding sundry items";
3: "visiting various places";
4: print "total (out of ", MAX_SCORE; ")";
}
GetOff: print "But ";
CSubjectIsnt(actor,true,true); " on ", (the) x1, " at the moment.";
Give: switch (n) {
1: CSubjectIsnt(actor,true); " holding ", (the) x1, ".";
2: CSubjectVerb(actor,false,false,"juggle",0,"juggles","juggled");
print " ", (the) x1, " for a while, but ";
CSubjectVoice(actor,"don't","don't","doesn't","didn't");
" achieve much.";
3: CSubjectDont(x1,true); " seem interested.";
4: CSubjectVerb(actor,false,false,"hand over",0,"hands over","handed over");
" ", (the) x1, ".";
}
Go: switch (n) {
1: CSubjectWill(actor,true);
Tense(" have", " had");
" to get ", (nop) SupportObj(x1,"off","out of"), " ", (the) x1, " first.";
2: CSubjectCant(actor,true); " go that way.";
3: CSubjectIs (actor,true); " unable to climb ", (the) x1, ".";
4: CSubjectIs (actor,true); " unable to descend by ", (the) x1, ".";
5: CSubjectCant(actor,true); " since ", (the) x1, " ", (IsOrAre) x1, " in the way.";
6: CSubjectCant(actor,true); " since ", (the) x1, " ", (nop) PluralObj(x1,"lead","leads","led"), " nowhere.";
7: CSubjectVerb(actor,false,false,"depart",0,"departs","departed"); ".";
}
Insert: switch (n) {
1: CSubjectVerb(actor,true,false,"need",0,"needs","needed");
print " to be holding ", (the) x1, " before ", (theActor) actor;
Tense(" can", " could");
" put ", (ItOrThem) x1, " into something else.";
2: CSubjectCant(x1,true); " contain things.";
3: CSubjectIs (x1,true); " closed.";
4: CSubjectWill(actor,true);
Tense(" need", " needed");
" to take ", (ItOrThem) x1, " off first.";
5: CSubjectCant(actor,true); " put something inside itself.";
6: "(first taking ", (ItOrThem) x1, " off)";
7: print "There ";
Tense(" is", " was");
" no more room in ", (the) x1, ".";
8: "Done.";
9: CSubjectVerb(actor,false,false,"put",0,"puts","put"); " ", (the) x1, " into ", (the) x2, ".";
}
Inv: switch (n) {
1: CSubjectIs (actor,false); " carrying nothing.";
2: CSubjectIs (actor,false); print " carrying";
3: ":";
4: ".";
}
Jump: CSubjectVerb(actor,false,false,"jump",0,"jumps","jumped"); " on the spot, fruitlessly.";
JumpIn:
print "Jumping in ", (the) x1, " ";
Tense("would achieve", "would have achieved");
" nothing here.";
JumpOn:
print "Jumping upon ", (the) x1, " ";
Tense("would achieve", "would have achieved");
" nothing here.";
JumpOver: switch (n) {
1: CSubjectVerb(actor,true,false,"achieve",0,"achieve","achieved"); " nothing by this.";
2: DecideAgainst();
}
Kiss: "Keep your mind on the game.";
Listen: CSubjectVerb(actor,true,false,"hear",0,"hears","heard"); " nothing unexpected.";
ListMiscellany: switch (n) {
1: print " (providing light)";
2: print " (which ", (IsOrAre) x1, " closed)";
3: print " (closed and providing light)";
4: print " (which ", (IsOrAre) x1, " empty)";
5: print " (empty and providing light)";
6: print " (which ", (IsOrAre) x1, " closed and empty)";
7: print " (closed, empty and providing light)";
8: print " (providing light and being worn";
9: print " (providing light";
10: print " (being worn";
11: print " (which ", (IsOrAre) x1, " ";
12: print "open";
13: print "open but empty";
14: print "closed";
15: print "closed and locked";
16: print " and empty";
17: print " (which ", (IsOrAre) x1, " empty)";
18: print " containing ";
19: print " (on ";
20: print ", on top of ";
21: print " (in ";
22: print ", inside ";
}
LMode1: print (string) Story, " is now in its ";
if (initial_lookmode == 1) print "normal ";
"~brief~ printing mode, which gives long descriptions
of places never before visited and short descriptions otherwise.";
LMode2: print (string) Story, " is now in its ";
if (initial_lookmode ~= 1 or 3) print "normal ";
"~verbose~ mode, which always gives long descriptions
of locations (even if you've been there before).";