! ==============================================================================
! ENGLISH: Language Definition File
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
! ----------------------------------------------------------------------------
[ LanguageVerbLikesAdverb w;
- if (w == 'look' or 'go' or 'push' or 'walk')
+ if (w == 'look' or 'go' or 'run' or 'leave' or 'l//' or 'push' or 'walk')
rtrue;
rfalse;
];
"didn't have");
" ", (the) x1, ".";
3: "Dropped.";
+ 4: CSubjectVerb(actor, false, false, "need to take", 0, 0, "had to take");
+ print " ", (the) x1, " ";
+ if (x2 has container)
+ print "out";
+ else
+ print "off";
+ " of ", (the) x2, " before dropping ", (ItOrThem) x1, ".";
}
Eat: switch (n) {
1: CSubjectIs(x1,true); " plainly inedible.";
2: print "But ";
CSubjectIsnt(x1,true,true); " there now.";
3: "Removed.";
+ 4: print "But ";
+ CSubjectIsnt(x1,true,true); " in or on anything.";
}
Restart: switch (n) {
1: print "Are you sure you want to restart? ";
11: CSubjectIs (x1,true); " fixed in place.";
12: CSubjectIs (actor,true); " carrying too many things already.";
13: "(putting ", (the) x1, " into ", (the) x2, " to make room)";
- 14: CSubjectVerb(actor, false, false, "should take", 0, 0, "should have taken");
- " ", (the) x1, " first.";
}
Taste: switch (n) {
1: CSubjectVerb(actor,true,false,"taste",0,"tastes","tasted"); " nothing unexpected.";
2: CSubjectIs (actor,true); " not holding ", (ThatOrThose) x1, ".";
3: CSubjectIs (actor,true); " already wearing ", (ThatOrThose) x1, ".";
4: CSubjectVerb(actor,false,false,"put on",0,"puts on","put on"); " ", (the) x1, ".";
+ 5: CSubjectVerb(actor, false, false, "need to take", 0, 0, "had to take");
+ print " ", (the) x1, " ";
+ if (x2 has container)
+ print "out";
+ else
+ print "off";
+ " of ", (the) x2, " before wearing ", (ItOrThem) x1, ".";
}
! Yes: see No.
];
! ==============================================================================
! GRAMMAR: Grammar table entries for the standard verbs library.
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
+!
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
* noun -> Climb
* 'up'/'over' noun -> Climb;
+Verb 'carry'
+ * multi -> Take
+ * multiinside 'from'/'off' noun -> Remove
+ * 'inventory' -> Inv;
+
Verb 'close' 'cover' 'shut'
* noun -> Close
* 'up' noun -> Close
Verb 'disrobe' 'doff' 'shed'
- * held -> Disrobe;
+ * multi -> Disrobe;
Verb 'drink' 'sip' 'swallow'
* noun -> Drink;
* 'in'/'inside' -> GoIn
* 'into'/'in'/'inside'/'through' noun -> Enter;
+Verb 'hold'
+ * multi -> Take
+ * multiinside 'from'/'off' noun -> Remove
+ * 'inventory' -> Inv;
+
Verb 'in' 'inside'
* -> GoIn;
Verb 'put'
* multiexcept 'in'/'inside'/'into' noun -> Insert
* multiexcept 'on'/'onto' noun -> PutOn
- * 'on' held -> Wear
+ * 'on' multiheld -> Wear
* 'down' multiheld -> Drop
* multiheld 'down' -> Drop;
* topic 'in' noun -> Consult;
Verb 'remove'
- * held -> Disrobe
- * multi -> Take
+ * worn -> Disrobe
+ * multi -> Remove
* multiinside 'from' noun -> Remove;
Verb 'rub' 'clean' 'dust' 'polish' 'scrub'
* 'on' noun -> SwitchOn
* 'off' noun -> SwitchOff;
-Verb 'take' 'carry' 'hold'
+Verb 'take'
* multi -> Take
- * 'off' held -> Disrobe
+ * 'off' multiheld -> Disrobe
* multiinside 'from'/'off' noun -> Remove
* 'inventory' -> Inv;
* 'at' noun -> WaveHands;
Verb 'wear' 'don'
- * held -> Wear;
+ * multiheld -> Wear;
Verb 'yes' 'y//'
* -> Yes;
! ==============================================================================
! INFIX: Support for the optional library debugger extension "Infix".
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
! ==============================================================================
! LINKLPA: Link declarations of common properties and attributes.
!
-! Supplied for use with Inform 6 -- Release 6.12.4pre -- Serial number 200528
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
! License along with this program. If not, see
! https://gnu.org/licenses/
!
-! This file is automatically Included in your game file by "Parser".
+! This file is automatically Included in your game file by "parser".
! ==============================================================================
System_file;
Attribute neuter;
Attribute pluralname;
+#Ifdef INFIX;
+Attribute infix__watching;
+#Endif;
+
! ------------------------------------------------------------------------------
Property additive before NULL;
! ==============================================================================
! PARSER: Front end to parser.
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! Affero General Public License for more details.
!
+! You should have received a copy of the GNU Affero General Public
+! License along with this program. If not, see
+! https://gnu.org/licenses/
+!
! In your game file, Include three library files in this order:
! Include "parser";
-! Include "berblib";
+! Include "verblib";
! Include "grammar";
!
! ------------------------------------------------------------------------------
! ------------------------------------------------------------------------------
#Ifndef VN_1633;
-Message fatalerror "*** Library 6.12.3 needs Inform v6.33 or later to work ***";
+Message fatalerror "*** Library 6.12.x needs Inform v6.33 or later to work ***";
#Endif; ! VN_
Include "version";
i = (~~i);
#Endif; ! TARGET_
if (i == 0) { L__M(##Miscellany, 7); return 0; }
- L__M(##Miscellany, 1);
+ L__M(##Miscellany, 6);
return 1;
];
oops_from = 0;
! ...explain any inferences made (using the pattern)...
-
+ ! This is where the parser replies (the sword) if things aren't clear.
if (inferfrom ~= 0 && no_infer_message == false) {
print "("; PrintCommand(inferfrom); print ")^";
}
if (etype == NUMBER_PE) L__M(##Miscellany, 29);
if (etype == CANTSEE_PE) { L__M(##Miscellany, 30); oops_from=saved_oops;}
if (etype == TOOLIT_PE) L__M(##Miscellany, 31);
- if (etype == NOTHELD_PE) {
- if (parent(noun) has container)
- L__M(##Take, 14, noun);
- else
- L__M(##Miscellany, 32, not_holding);
- oops_from=saved_oops;
- }
+ if (etype == NOTHELD_PE) { L__M(##Miscellany, 32, not_holding); oops_from=saved_oops; }
if (etype == MULTI_PE) L__M(##Miscellany, 33);
if (etype == MMULTI_PE) L__M(##Miscellany, 34);
if (etype == VAGUE_PE) L__M(##Miscellany, 35, pronoun_word);
indef_nspec_at = 0;
];
-[ Descriptors allows_multiple o x flag cto type m n;
+[ Descriptors allows_multiple o x y flag cto type m n;
ResetDescriptors();
if (wn > num_words) return 0;
m = wn;
for (flag=true : flag :) {
o = NextWordStopped(); flag = false;
- for (x=1 : x<=LanguageDescriptors-->0 : x=x+4)
+ for (x=1 : x<=LanguageDescriptors-->0 : x=x+4) {
if (o == LanguageDescriptors-->x) {
+ ! Attempt to compensate for her-her confusion.
+ for (y = 1 : y<=LanguagePronouns-->0 : y=y+2) {
+ if (o == LanguagePronouns-->y)
+ jump PersonalPronoun;
+ }
flag = true;
type = LanguageDescriptors-->(x+2);
if (type ~= DEFART_PK) indef_mode = true;
if (type == light) indef_type = indef_type | LIT_BIT;
if (type == -light) indef_type = indef_type | UNLIT_BIT;
}
+ }
+ .PersonalPronoun;
+
if (o == OTHER1__WD or OTHER2__WD or OTHER3__WD) {
indef_mode = 1; flag = 1;
indef_type = indef_type | OTHER_BIT;
if (actor ~= player) rtrue;
if (obj has animate) rtrue;
if (obj hasnt talkable) rfalse;
- if (action_to_be == ##Ask or ##Answer or ##Tell or ##AskFor) rtrue;
+ if (action_to_be == ##Ask or ##Answer or ##Tell or ##AskFor or ##AskTo) rtrue;
rfalse;
];
parsed_number = l; return GPR_NUMBER;
CREATURE_TOKEN:
- if (action_to_be == ##Answer or ##Ask or ##AskFor or ##Tell)
+ if (action_to_be == ##Answer or ##Ask or ##AskFor or ##AskTo or ##Tell)
scope_reason = TALKING_REASON;
TOPIC_TOKEN:
#Endif; ! DEBUG
l = NounDomain(actors_location, actor, token);
if (l == REPARSE_CODE) return l; ! Reparse after Q&A
- if ((metaclass(l) == Class || metaclass(l) == Object) && l ~= 1 && l notin actor && token == MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN) {
- if (ImplicitTake(l)) {
- etype = NOTHELD_PE;
- jump FailToken;
- }
- }
if (indef_wanted == 100 && l == 0 && number_matched == 0)
l = 1; ! ReviseMulti if TAKE ALL FROM empty container
! allowing singulars (so that words like "six" are not swallowed up as
! Descriptors)
- noun = l; ! Allow the noun to be mentioned by the *_PE error messages.
if (allow_plurals && indef_guess_p == 1) {
#Ifdef DEBUG;
if (parser_trace >= 4) print " [Retrying singulars after failure ", etype, "]^";
}
if (flag) {
+ if(match_length == 1) {
+ k = 0;
+ for (i=1 : i<=number_of_classes : i++) {
+ while ((match_classes-->k) ~= i or -i) k++;
+ j = match_list-->k;
+
+ if(MatchWord(j, match_from)) {
+ no_infer_message = true;
+ return j;
+ }
+ }
+ }
#Ifdef DEBUG;
if (parser_trace >= 4) print " Unable to choose best group, so ask player.]^";
#Endif; ! DEBUG
rtrue;
];
+
+! ----------------------------------------------------------------------------
+! MatchWord matches a word to the name of an object. This is used to assume
+! that an object simply named "key" is meant when the player types TAKE KEY
+! rather than TAKE BRASS KEY.
+! ----------------------------------------------------------------------------
+
+[ MatchWord p_obj p_word_no len_name len_input start_input i;
+
+ p_word_no--;
+
+ PrintToBuffer(StorageForShortName, SHORTNAMEBUF_LEN, p_obj);
+ len_name = StorageForShortName --> 0;
+
+ if(len_name > 9) {
+ for(i = 9 : i < len_name : i++)
+ if(StorageForShortName -> (WORDSIZE + i) == 32) rfalse;
+ len_name = 9;
+ }
+
+#Ifdef TARGET_ZCODE;
+ start_input = (parse + 2) -> (4 * p_word_no + 3);
+ len_input = (parse + 2) -> (4 * p_word_no + 2);
+ if(len_input > 9) len_input = 9;
+ if(len_name ~= len_input) rfalse;
+ for(i = 0 : i < len_name : i++) {
+ if(StorageForShortName -> (WORDSIZE + i) ~= buffer -> (start_input + i))
+ rfalse;
+ }
+#Ifnot; ! TARGET_GLULX
+ start_input = parse --> (((p_word_no+1) * 3)) - 2;
+ len_input = parse --> ((p_word_no+1) * 3 - 1);
+ if(len_input > 9) len_input = 9;
+ if(len_name ~= len_input) rfalse;
+ for(i = 0 : i < len_name : i++) {
+ if(StorageForShortName -> (WORDSIZE + i) ~= buffer -> (start_input + i + 2))
+ rfalse;
+ }
+#Endif; ! TARGET_
+
+ rtrue;
+];
+
+
! ----------------------------------------------------------------------------
! PrintCommand reconstructs the command as it presently reads, from
! the pattern which has been built up
-This directory contains version 6.12.4 of the Inform 6 standard
+This directory contains version 6.12.5 of the Inform 6 standard
library. It has been modified slightly to not print out the version of
Inform and the version of the standard library in use in the game's
banner.
! ==============================================================================
! VERBLIB: Front end to standard verbs library.
!
-! Supplied for use with Inform 6 -- Release 6.12.4 -- Serial number 200718
+! Supplied for use with Inform 6 -- Release 6.12.5 -- Serial number 210605
!
-! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2020
+! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2021
!
! This file is free software: you can redistribute it and/or modify
! it under the terms of the GNU Affero General Public License as
!
! You should have received a copy of the GNU Affero General Public
! License along with this program. If not, see
-! https://gnu.org/licenses/
+! https://gnu.org/licenses/.
!
! In your game file, Include three library files in this order:
! Include "parser";
action = k;
}
- if (item has scenery) return L__M(##Take, 10, item);
if (item has static) return L__M(##Take, 11, item);
+ if (item has scenery) return L__M(##Take, 10, item);
! The item is now known to be available for taking. Is the player
! carrying too much? If so, possibly juggle items into the rucksack
ks = keep_silent; keep_silent = 2; AttemptToTakeObject(obj); keep_silent = ks;
if (obj notin actor) rtrue;
if (res == 0 && ~~keep_silent)
- if (supcon) L__M(##Miscellany, 58, obj, supcon);
- else L__M(##Miscellany, 26, obj);
+ if (supcon) return L__M(##Miscellany, 58, obj, supcon);
+ else return L__M(##Miscellany, 26, obj);
rfalse;
];
! ----------------------------------------------------------------------------
[ TakeSub;
+ if (noun in actor && noun has worn) <<Disrobe noun, actor>>;
if (onotheld_mode == 0 || noun notin actor)
if (AttemptToTakeObject(noun)) return;
if (AfterRoutines()) return;
[ RemoveSub i;
i = parent(noun);
if (i && i has container && i hasnt open && ImplicitOpen(i)) return L__M(##Remove, 1, i);
- if (i ~= second) return L__M(##Remove, 2, noun);
+ if (noun has clothing) {
+ if (noun has worn) <<Disrobe noun, actor>>;
+ if (i && i has container or supporter)
+ jump RSSkip;
+ else
+ if (i == actor) return L__M(##Disrobe, 1, noun);
+ }
+ if (i hasnt container && i hasnt supporter) return L__M(##Remove, 4, noun);
+ if (i ~= second && second ~= nothing) return L__M(##Remove, 2, noun);
if (i has animate) return L__M(##Take, 6, i, noun);
+ .RSSkip;
if (AttemptToTakeObject(noun)) rtrue;
-
action = ##Remove; if (AfterRoutines()) return;
action = ##Take; if (AfterRoutines()) return;
if (keep_silent) return;
[ DropSub;
if (noun == actor) return L__M(##PutOn, 4, noun);
if (noun in parent(actor)) return L__M(##Drop, 1, noun);
- if (noun notin actor && ~~ImplicitTake(noun)) return L__M(##Drop, 2, noun);
if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
+ if (noun notin actor) {
+ if (no_implicit_actions) return L__M(##Drop, 4, noun, parent(noun));
+ L__M(##Miscellany, 58, noun, parent(noun));
+ }
+
move noun to parent(actor);
if (AfterRoutines() || keep_silent) return;
L__M(##Drop, 3, noun);
receive_action = ##PutOn;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##PutOn, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##PutOn, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##PutOn, 2, noun);
action = ##PutOn;
}
if (second hasnt supporter) return L__M(##PutOn, 3, second);
- if (ancestor == actor) return L__M(##PutOn, 4, second);
+
+ if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
receive_action = ##Insert;
if (second == d_obj || actor in second) <<Drop noun, actor>>;
if (parent(noun) == second) return L__M(##Drop, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Insert, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##Insert, 1, noun);
ancestor = CommonAncestor(noun, second);
if (ancestor == noun) return L__M(##Insert, 5, noun);
if (ObjectIsUntouchable(second)) return;
return L__M(##Insert, 3, second);
}
if (second hasnt container) return L__M(##Insert, 2, second);
+ if (noun has worn && no_implicit_actions) return L__M(##Disrobe, 4, noun);
if (noun has worn && ImplicitDisrobe(noun)) return;
if (ObjectDoesNotFit(noun, second) ||
if (ObjectIsUntouchable(noun)) return;
if (noun hasnt lockable) return L__M(##Unlock, 1, noun);
if (noun hasnt locked) return L__M(##Unlock, 2, noun);
- if (noun.with_key ~= second) return L__M(##Unlock, 3, second);
+ if ((noun.with_key ofclass Object && noun.with_key ~= second) ||
+ (noun.with_key ofclass Routine && noun.with_key() ~= second) ||
+ noun.with_key == nothing)
+ return L__M(##Unlock, 3, second);
give noun ~locked;
if (noun hasnt lockable) return L__M(##Lock, 1, noun);
if (noun has locked) return L__M(##Lock, 2 ,noun);
if (noun has open && ImplicitClose(noun)) return L__M(##Lock, 3, noun);
- if (noun.with_key ~= second) return L__M(##Lock, 4, second);
+ if ((noun.with_key ofclass Object && noun.with_key ~= second) ||
+ (noun.with_key ofclass Routine && noun.with_key() ~= second) ||
+ noun.with_key == nothing)
+ return L__M(##Lock, 4, second);
give noun locked;
if (AfterRoutines() || keep_silent) return;
[ DisrobeSub;
if (ObjectIsUntouchable(noun)) return;
- if (noun hasnt worn) return L__M(##Disrobe, 1, noun);
+ if (noun hasnt clothing) return L__M(##Disrobe,1, noun);
+ if (noun hasnt worn && noun has clothing) return L__M(##Disrobe, 1, noun);
give noun ~worn;
if (AfterRoutines() || keep_silent) return;
[ WearSub;
if (ObjectIsUntouchable(noun)) return;
if (noun hasnt clothing) return L__M(##Wear, 1, noun);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Wear, 2, noun);
+
+ if (noun notin actor && noun hasnt worn) {
+ if (IndirectlyContains(actor, noun) || parent(noun) has container or supporter) {
+ if (no_implicit_actions) return L__M(##Wear, 5, noun, parent(noun));
+ L__M(##Miscellany, 58, noun, parent(noun));
+ AttemptToTakeObject(noun);
+ } else
+ return L__M(##Wear, 2, noun, parent(noun));
+ }
if (noun has worn) return L__M(##Wear, 3, noun);
give noun worn;
[ WaveSub;
if (noun == player) return L__M(##Wave, 2 ,noun, second);
if (noun == actor) return L__M(##Wave, 3, noun, second);
- if (noun notin actor && ImplicitTake(noun)) return L__M(##Wave, 1, noun);
+ if (ImplicitTake(noun) && noun notin actor) return L__M(##Wave, 1, noun);
L__M(##Wave, 2, noun, second);
];
System_file;
-Constant LibSerial "200718";
-Constant LibRelease "6.12.4";
+Constant LibSerial "210605";
+Constant LibRelease "6.12.5";
Constant LIBRARY_VERSION 612;
Constant Grammar__Version 2;