1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-16 22:14:23 +03:00
inform7/resources/Documentation/Examples/FinishingSchool.txt

28 lines
1.2 KiB
Plaintext
Raw Normal View History

Example: * Finishing School
Location: Defining new adjectives
RecipeLocation: Characterization
Index: Another, distinct from the player
Description: The "another" adjective for rules such as "in the presence of another person".
For: Z-Machine
2019-02-05 02:44:07 +02:00
It is often useful to write action rules which apply only when the player is observed by a third party. "In the presence of a person", however, will react even if only the player is in the room, because the player is, of course, a person as well.
A convenient way around this problem is to define an "other" adjective:
2019-02-05 02:44:07 +02:00
{*}"Finishing School"
2019-02-05 02:44:07 +02:00
The apple is an edible thing carried by the player.
The Hall is a room. Miss Wicket is a woman in the Hall.
The Dormitory is south of the Hall.
Definition: a person is another if it is not the player.
Instead of eating something in the presence of another person:
say "Your mannerly upbringing prevents you from eating without a fork or knife in front of someone."
2019-02-05 02:44:07 +02:00
Test me with "eat apple / south / eat apple".
If we did not have "another" here, Inform would interpret even the player as a possible schoolmarm, leading to such lines as "yourself stares at you coldly...". Clearly not quite the thing.