mirror of
https://github.com/ganelson/inform.git
synced 2024-07-02 23:14:57 +03:00
commit
89fbb6c6ec
|
@ -347,6 +347,26 @@ account.
|
||||||
rfalse;
|
rfalse;
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@h Having Evident Content
|
||||||
|
This is true when something has at least one unconcealed thing in it.
|
||||||
|
It's false when something is truly empty or when all the things in
|
||||||
|
it are concealed or undescribed, and is used to ensure that output
|
||||||
|
is consistent in both those cases. The player shouldn't count for
|
||||||
|
these purposes, but since the player is undescribed, they're excluded
|
||||||
|
anyway.
|
||||||
|
|
||||||
|
=
|
||||||
|
[ ObviouslyOccupied o x;
|
||||||
|
if (~~((o ofclass K5_container) || (o ofclass K6_supporter))) rfalse;
|
||||||
|
if (o has container && o hasnt open && o hasnt transparent) rfalse; ! opaque closed container's status can never be obvious
|
||||||
|
x = child(o);
|
||||||
|
while (x) {
|
||||||
|
if ((x hasnt concealed) && (~~TestConcealment(o, x))) rtrue;
|
||||||
|
x = sibling(x);
|
||||||
|
}
|
||||||
|
rfalse;
|
||||||
|
];
|
||||||
|
|
||||||
@h Coalesce Marked List.
|
@h Coalesce Marked List.
|
||||||
The return value is the new first entry in the raw list.
|
The return value is the new first entry in the raw list.
|
||||||
|
|
||||||
|
@ -588,21 +608,16 @@ by Inform. But this seems to be sound.
|
||||||
|
|
||||||
=
|
=
|
||||||
[ ListEqual o1 o2;
|
[ ListEqual o1 o2;
|
||||||
if ((o1.plural == 0) || (o2.plural == 0)) rfalse;
|
if (o1.KD_Count ~= o2.KD_Count) rfalse;
|
||||||
if (child(o1) ~= 0 && WillRecurs(o1) ~= 0) rfalse;
|
if ((o1.plural == 0) || (o2.plural == 0)) rfalse;
|
||||||
if (child(o2) ~= 0 && WillRecurs(o2) ~= 0) rfalse;
|
if (ObviouslyOccupied(o1) && WillRecurs(o1)) rfalse;
|
||||||
if (c_style & (FULLINV_BIT + PARTINV_BIT) ~= 0) {
|
if (ObviouslyOccupied(o2) && WillRecurs(o2)) rfalse;
|
||||||
if ((o1 hasnt worn && o2 has worn) || (o2 hasnt worn && o1 has worn)) rfalse;
|
if (c_style & (FULLINV_BIT + PARTINV_BIT) ~= 0) {
|
||||||
if ((o1 hasnt light && o2 has light) || (o2 hasnt light && o1 has light)) rfalse;
|
if ((o1 hasnt worn && o2 has worn) || (o2 hasnt worn && o1 has worn)) rfalse;
|
||||||
if (o1 has container) {
|
if ((o1 hasnt light && o2 has light) || (o2 hasnt light && o1 has light)) rfalse;
|
||||||
if (o2 hasnt container) rfalse;
|
if ((o1 has open && o2 hasnt open) || (o2 has open && o1 hasnt open)) rfalse;
|
||||||
if ((o1 has open && o2 hasnt open) || (o2 has open && o1 hasnt open))
|
}
|
||||||
rfalse;
|
return Identical(o1, o2);
|
||||||
}
|
|
||||||
else if (o2 has container)
|
|
||||||
rfalse;
|
|
||||||
}
|
|
||||||
return Identical(o1, o2);
|
|
||||||
];
|
];
|
||||||
|
|
||||||
[ WillRecurs o;
|
[ WillRecurs o;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
Bar
|
Bar
|
||||||
Welcome
|
Welcome
|
||||||
An Interactive Fiction
|
An Interactive Fiction
|
||||||
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
|
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
|
||||||
|
|
||||||
Bar
|
Bar
|
||||||
You can see a counter (on which is a glass jar) and an obvious item here.
|
You can see a counter (on which is a glass jar (empty)) and an obvious item here.
|
||||||
|
|
||||||
> > Bar
|
> > Bar
|
||||||
(Testing.)
|
(Testing.)
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
>[3] look
|
>[3] look
|
||||||
Bar
|
Bar
|
||||||
You can see a counter (on which is a glass jar) and an obvious item here.
|
You can see a counter (on which is a glass jar (empty)) and an obvious item here.
|
||||||
|
|
||||||
>[4] take all
|
>[4] take all
|
||||||
obvious item: Taken.
|
obvious item: Taken.
|
||||||
|
|
|
@ -65,8 +65,9 @@ Carry out taking inventory (this is the print empty inventory rule):
|
||||||
|
|
||||||
Carry out taking inventory (this is the print standard inventory rule):
|
Carry out taking inventory (this is the print standard inventory rule):
|
||||||
say "[We] [are] carrying:[line break]" (A);
|
say "[We] [are] carrying:[line break]" (A);
|
||||||
list the contents of the player, with newlines, indented, including contents,
|
now all things enclosed by the player are unmarked for listing;
|
||||||
giving inventory information, with extra indentation.
|
now all things held by the player are marked for listing;
|
||||||
|
list the contents of the player, with newlines, indented, giving inventory information, with extra indentation, listing marked items only, not listing concealed items, including contents.
|
||||||
|
|
||||||
@ Report.
|
@ Report.
|
||||||
|
|
||||||
|
@ -1183,22 +1184,22 @@ Carry out examining (this is the examine directions rule):
|
||||||
|
|
||||||
Carry out examining (this is the examine containers rule):
|
Carry out examining (this is the examine containers rule):
|
||||||
if the noun is a container:
|
if the noun is a container:
|
||||||
if the noun is open or the noun is transparent:
|
if the noun is closed and the noun is opaque, make no decision;
|
||||||
if something described which is not scenery is in the noun and something which
|
if something described which is not scenery is in the noun and something which
|
||||||
is not the player is in the noun:
|
is not the player is in the noun and the noun is not falsely-unoccupied:
|
||||||
say "In [the noun] " (A);
|
say "In [the noun] " (A);
|
||||||
list the contents of the noun, as a sentence, tersely, not listing
|
list the contents of the noun, as a sentence, tersely, not listing
|
||||||
concealed items, prefacing with is/are;
|
concealed items, prefacing with is/are;
|
||||||
say ".";
|
say ".";
|
||||||
now examine text printed is true;
|
now examine text printed is true;
|
||||||
otherwise if examine text printed is false:
|
otherwise if examine text printed is false:
|
||||||
if the player is in the noun:
|
if the player is in the noun:
|
||||||
make no decision;
|
make no decision;
|
||||||
say "[The noun] [are] empty." (B);
|
say "[The noun] [are] empty." (B);
|
||||||
now examine text printed is true;
|
now examine text printed is true;
|
||||||
|
|
||||||
Carry out examining (this is the examine supporters rule):
|
Carry out examining (this is the examine supporters rule):
|
||||||
if the noun is a supporter:
|
if the noun is a supporter and the noun is not falsely-unoccupied:
|
||||||
if something described which is not scenery is on the noun and something which is
|
if something described which is not scenery is on the noun and something which is
|
||||||
not the player is on the noun:
|
not the player is on the noun:
|
||||||
say "On [the noun] " (A);
|
say "On [the noun] " (A);
|
||||||
|
@ -1657,7 +1658,7 @@ Carry out an actor opening (this is the standard opening rule):
|
||||||
Report an actor opening (this is the reveal any newly visible interior rule):
|
Report an actor opening (this is the reveal any newly visible interior rule):
|
||||||
if the actor is the player and
|
if the actor is the player and
|
||||||
the noun is an opaque container and
|
the noun is an opaque container and
|
||||||
the first thing held by the noun is not nothing and
|
the noun is obviously-occupied and
|
||||||
the noun does not enclose the actor:
|
the noun does not enclose the actor:
|
||||||
if the action is not silent:
|
if the action is not silent:
|
||||||
if the actor is the player:
|
if the actor is the player:
|
||||||
|
|
|
@ -65,9 +65,60 @@ supplemented by details:
|
||||||
=
|
=
|
||||||
Printing room description details of something (documented at act_details) is an activity.
|
Printing room description details of something (documented at act_details) is an activity.
|
||||||
The printing room description details activity is accessible to Inter as "PRINTING_ROOM_DESC_DETAILS_ACT".
|
The printing room description details activity is accessible to Inter as "PRINTING_ROOM_DESC_DETAILS_ACT".
|
||||||
|
|
||||||
|
For printing room description details of a container (called the box) when the box is falsely-unoccupied (this is the falsely-unoccupied container room description details rule):
|
||||||
|
say text of list writer internal rule response (A); [ " (" ]
|
||||||
|
if the box is lit and the location is unlit begin;
|
||||||
|
if the box is closed, say text of list writer internal rule response (J); [ "closed, empty[if serial comma option is active],[end if] and providing light" ]
|
||||||
|
else say text of list writer internal rule response (I); [ "empty and providing light" ]
|
||||||
|
else;
|
||||||
|
if the box is closed, say text of list writer internal rule response (E); [ "closed" ]
|
||||||
|
else say text of list writer internal rule response (F); [ "empty" ]
|
||||||
|
end if;
|
||||||
|
say text of list writer internal rule response (B); [ ")" ]
|
||||||
|
|
||||||
Printing inventory details of something (documented at act_idetails) is an activity.
|
Printing inventory details of something (documented at act_idetails) is an activity.
|
||||||
The printing inventory details activity is accessible to Inter as "PRINTING_INVENTORY_DETAILS_ACT".
|
The printing inventory details activity is accessible to Inter as "PRINTING_INVENTORY_DETAILS_ACT".
|
||||||
|
|
||||||
|
|
||||||
|
To say the deceitfully empty inventory details of (box - a container):
|
||||||
|
let inventory text printed be false;
|
||||||
|
if the box is lit begin;
|
||||||
|
if the box is worn, say text of list writer internal rule response (K); [ "providing light and being worn" ]
|
||||||
|
else say text of list writer internal rule response (D); [ "providing light" ]
|
||||||
|
now inventory text printed is true;
|
||||||
|
else if the box is worn;
|
||||||
|
say text of list writer internal rule response (L); [ "being worn" ]
|
||||||
|
now inventory text printed is true;
|
||||||
|
end if;
|
||||||
|
if the box is openable begin;
|
||||||
|
if inventory text printed is true begin;
|
||||||
|
if the serial comma option is active, say ",";
|
||||||
|
say text of list writer internal rule response (C); [ "and" ]
|
||||||
|
end if;
|
||||||
|
if the box is open begin;
|
||||||
|
say text of list writer internal rule response (N); [ "open but empty" ]
|
||||||
|
else; [ it's closed ]
|
||||||
|
if the box is locked, say text of list writer internal rule response (P); [ "closed and locked" ]
|
||||||
|
else say text of list writer internal rule response (O); [ "closed" ]
|
||||||
|
now inventory text printed is true;
|
||||||
|
end if;
|
||||||
|
else; [ it's not openable ]
|
||||||
|
if the box is transparent begin;
|
||||||
|
if inventory text printed is true, say text of list writer internal rule response (C); [ "and" ]
|
||||||
|
say text of list writer internal rule response (F); [ "empty" ]
|
||||||
|
now inventory text printed is true; [ not relevant unless code is added ]
|
||||||
|
end if;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
For printing inventory details of a container (called the box) when the box is falsely-unoccupied (this is the falsely-unoccupied container inventory details rule):
|
||||||
|
let the tag be "[the deceitfully empty inventory details of box]";
|
||||||
|
if tag is not empty begin;
|
||||||
|
say text of list writer internal rule response (A); [ "(" ]
|
||||||
|
say tag;
|
||||||
|
say text of list writer internal rule response (B); [ ")" ]
|
||||||
|
end if;
|
||||||
|
|
||||||
@ Names of things are often formed up into lists, in which they are sometimes
|
@ Names of things are often formed up into lists, in which they are sometimes
|
||||||
grouped together:
|
grouped together:
|
||||||
|
|
||||||
|
@ -79,6 +130,7 @@ The standard contents listing rule is defined by Inter as "STANDARD_CONTENTS_LIS
|
||||||
Grouping together something (documented at act_gt) is an activity.
|
Grouping together something (documented at act_gt) is an activity.
|
||||||
The grouping together activity is accessible to Inter as "GROUPING_TOGETHER_ACT".
|
The grouping together activity is accessible to Inter as "GROUPING_TOGETHER_ACT".
|
||||||
|
|
||||||
|
|
||||||
@ And such lists of names are formed up in turn into room descriptions.
|
@ And such lists of names are formed up in turn into room descriptions.
|
||||||
Something which is visible in a room can either have a paragraph of its own
|
Something which is visible in a room can either have a paragraph of its own
|
||||||
or can be relegated to the list of "nondescript" items at the end.
|
or can be relegated to the list of "nondescript" items at the end.
|
||||||
|
@ -511,6 +563,7 @@ For printing the locale description (this is the interesting locale paragraphs r
|
||||||
For printing the locale description (this is the you-can-also-see rule):
|
For printing the locale description (this is the you-can-also-see rule):
|
||||||
let the domain be the parameter-object;
|
let the domain be the parameter-object;
|
||||||
let the mentionable count be 0;
|
let the mentionable count be 0;
|
||||||
|
if the domain is a thing and the domain holds the player and the domain is falsely-unoccupied, continue the activity;
|
||||||
repeat with item running through things:
|
repeat with item running through things:
|
||||||
now the item is not marked for listing;
|
now the item is not marked for listing;
|
||||||
repeat through the Table of Locale Priorities:
|
repeat through the Table of Locale Priorities:
|
||||||
|
@ -711,22 +764,32 @@ For printing a locale paragraph about a supporter (called the tabletop)
|
||||||
Definition: a thing (called the item) is locale-supportable if the item is not
|
Definition: a thing (called the item) is locale-supportable if the item is not
|
||||||
scenery and the item is not mentioned and the item is not undescribed.
|
scenery and the item is not mentioned and the item is not undescribed.
|
||||||
|
|
||||||
For printing a locale paragraph about a thing (called the item)
|
For printing a locale paragraph about a thing (called the platform)
|
||||||
(this is the describe what's on scenery supporters in room descriptions rule):
|
(this is the describe what's on scenery supporters in room descriptions rule):
|
||||||
if the item is scenery and the item does not enclose the player:
|
if the platform is not a scenery supporter that does not enclose the player, continue the activity;
|
||||||
if a locale-supportable thing is on the item:
|
let print a paragraph be false;
|
||||||
set pronouns from the item;
|
let item be the first thing held by the platform;
|
||||||
repeat with possibility running through things on the item:
|
while item is not nothing begin;
|
||||||
now the possibility is marked for listing;
|
if the item is not scenery and the item is described and the platform does not conceal the item begin;
|
||||||
if the possibility is mentioned:
|
if the item is mentioned begin;
|
||||||
now the possibility is not marked for listing;
|
now the item is not marked for listing;
|
||||||
increase the locale paragraph count by 1;
|
else;
|
||||||
say "On [the item] " (A);
|
now the item is marked for listing;
|
||||||
list the contents of the item, as a sentence, including contents,
|
now print a paragraph is true;
|
||||||
giving brief inventory information, tersely, not listing
|
end if;
|
||||||
concealed items, prefacing with is/are, listing marked items only;
|
end if;
|
||||||
say ".[paragraph break]";
|
now the item is the next thing held after the item;
|
||||||
continue the activity.
|
end while;
|
||||||
|
if print a paragraph is true begin;
|
||||||
|
set pronouns from the platform;
|
||||||
|
increase the locale paragraph count by 1;
|
||||||
|
say "On [the platform] " (A);
|
||||||
|
list the contents of the platform, as a sentence, including contents,
|
||||||
|
giving brief inventory information, tersely, not listing
|
||||||
|
concealed items, prefacing with is/are, listing marked items only;
|
||||||
|
say ".[paragraph break]";
|
||||||
|
end if;
|
||||||
|
continue the activity
|
||||||
|
|
||||||
For printing a locale paragraph about a thing (called the item)
|
For printing a locale paragraph about a thing (called the item)
|
||||||
(this is the describe what's on mentioned supporters in room descriptions rule):
|
(this is the describe what's on mentioned supporters in room descriptions rule):
|
||||||
|
|
|
@ -92,6 +92,54 @@ The verb to conceal (he conceals, they conceal, he concealed, it is concealed,
|
||||||
he is concealing) means the concealment relation.
|
he is concealing) means the concealment relation.
|
||||||
Definition: Something is concealed rather than unconcealed if the holder of it conceals it.
|
Definition: Something is concealed rather than unconcealed if the holder of it conceals it.
|
||||||
|
|
||||||
|
@ If a supporter or container has something on/in it, but all the contents are concealed or
|
||||||
|
undescribed, default behavior should be the same to what it would be if it were empty. The
|
||||||
|
following adjectives assist the maintenance of the deceit.
|
||||||
|
|
||||||
|
Something is obviously-occupied if it has at least one obvious (neither concealed nor
|
||||||
|
undescribed) thing in it, but closed opaque containers the player is outside of aren't
|
||||||
|
obviously-occupied because their status isn't obvious. The player is undescribed and so
|
||||||
|
the player's own presence in an enterable supporter or container doesn't count toward it
|
||||||
|
being considered occupied. The opposite of obviously-occupied is possibly-unoccupied.
|
||||||
|
Something is possibly-unoccupied if it's truly empty, or the only things in it are concealed
|
||||||
|
or undescribed (or both), or it's a closed opaque container the player is outside of.
|
||||||
|
|
||||||
|
Something is falsely-unoccupied if it's not a closed opaque continer the player is outside
|
||||||
|
of and it's not truly empty but everything in it is concealed or undescribed. Note that
|
||||||
|
falsely-unoccupied is not the opposite of obviously-occupied. Possibly-occupied is the
|
||||||
|
opposite of obviously-occupied; falsely-occupied is something different.
|
||||||
|
|
||||||
|
None of this considers visibility per se and they behave the same way in light or
|
||||||
|
darkness. The presumption is that if the game is evaluating whether the player can perceive
|
||||||
|
the contents of a thing, it has already been determined that they can perceive that
|
||||||
|
thing.
|
||||||
|
|
||||||
|
These tests only consider what's directly contained or supported. If there's an obvious
|
||||||
|
thing its contents can't make it any less obvious; if something is undescribed or
|
||||||
|
concealed, it's assumed that the game shouldn't be calling attention to their contents.
|
||||||
|
|
||||||
|
These adjectives are not defined for people. Things directly held by the player are always
|
||||||
|
perceptible by the player. Things possessed by other people aren't mentioned by default
|
||||||
|
in room descriptions or when searching or examining them, but only through whatever rules
|
||||||
|
an author adds to do so, so the details are left to the author.
|
||||||
|
|
||||||
|
=
|
||||||
|
Definition: a container is obviously-occupied rather than possibly-unoccupied if
|
||||||
|
I6 routine "ObviouslyOccupied" says so (it contains at least one obvious thing).
|
||||||
|
|
||||||
|
Definition: a supporter is obviously-occupied rather than possibly-unoccupied if
|
||||||
|
I6 routine "ObviouslyOccupied" says so (it supports at least one obvious thing).
|
||||||
|
|
||||||
|
Definition: a container (called c) is falsely-unoccupied:
|
||||||
|
if the first thing held by it is nothing, no;
|
||||||
|
if it is closed and it is opaque and it does not enclose the player, no;
|
||||||
|
decide on whether or not it is possibly-unoccupied;
|
||||||
|
|
||||||
|
Definition: a supporter is falsely-unoccupied:
|
||||||
|
if the first thing held by it is nothing, no;
|
||||||
|
if the first thing held by it is the player and the next thing held after the player is nothing, no;
|
||||||
|
decide on whether or not it is possibly-unoccupied;
|
||||||
|
|
||||||
@ A final sort of pseudo-containment: does the entire world contain
|
@ A final sort of pseudo-containment: does the entire world contain
|
||||||
something, or not? (For things destroyed during play, or not yet created, the
|
something, or not? (For things destroyed during play, or not yet created, the
|
||||||
answer would be no.)
|
answer would be no.)
|
||||||
|
|
|
@ -259,6 +259,8 @@ When the story compiles the list of nondescript items, it adds tags such as "(op
|
||||||
|
|
||||||
Rule for printing room description details: stop.
|
Rule for printing room description details: stop.
|
||||||
|
|
||||||
|
The "(empty)" tag can appear when something is <i>not</i> truly empty if everything within is concealed or undescribed.
|
||||||
|
|
||||||
And we can suppress the "(open)" and "(on which is...)" sorts of tags with the "omit the contents in listing" phrase, as in
|
And we can suppress the "(open)" and "(on which is...)" sorts of tags with the "omit the contents in listing" phrase, as in
|
||||||
|
|
||||||
Rule for printing the name of the bottle while not inserting or removing:
|
Rule for printing the name of the bottle while not inserting or removing:
|
||||||
|
|
Loading…
Reference in a new issue