As with ordinary numbers, we can choose random units when this is useful:
"rBGH"
The Pharmaceutical Testing Facility is a room. "A [if the player is short]large [end if][if the player is tall]cramped [end if]white space with sterile counters and a[if the player is tall]n uncomfortable little[end if] stool. There is also a mirror, behind which someone must be watching you. But you can't see through to that."
A counter, a one-way mirror, and a stool are scenery in the Facility. The stool is an enterable supporter. The counter supports a plate.
Height is a kind of value. 5 feet 11 inches specifies a height. 5'11 specifies a height. A person has a height.
Definition: a person is tall if its height is 6 feet 0 inches or more.
Definition: a person is short if its height is 5 feet 4 inches or less.
When play begins:
now the height of the player is a random height between 5 feet 2 inches and 6 feet 4 inches;
now the right hand status line is "[height of player]".
Instead of examining the player:
say "You, Test Subject, are [height of the player] tall."
The growth pill is a kind of thing. A growth pill is always edible. The description is usually "It is leaf-green and has a reassuring logo of a curling vine on the side. Nothing to worry about, nothing at all." Two growth pills are on the plate.
After eating the growth pill:
increase the height of the player by 0 feet 6 inches;
say "Your spine does something frightening and painful, and you find yourself looking down on the room from a wholly new angle.";
try looking.
Test me with "examine me / eat pill / examine me / eat pill / examine me".
Suppose we want to let the player explicitly sit, stand, or lie down on different enterable objects. (Normally Inform treats all these actions as entering, but there may be cases where we want to distinguish between the player sitting on a chair and the player standing on it.)
Our implementation gives each kind of enterable a range of allowed postures, and one preferred posture. If the player enters the supporter or container without specifying a posture (as in ENTER CHAIR), he will be put in the preferred posture. If he explicitly says, e.g., STAND ON CHAIR, he will be put in the standing position as long as standing is a posture that suits the chair.
"Slouching"
Section 1 - Posture Rules
A posture is a kind of value. The postures are seated, standing, and reclining.
A person has a posture. The posture of a person is usually standing.
A supporter has a posture. A container has a posture.
Posture-permission relates various things to various postures. The verb to allow means the posture-permission relation.
Understand the commands "stand" and "sit" and "lie" as something new.
Understand "sit on/in [something]" as sitting on.
Understand "lie on/in [something]" as lying on.
Understand "stand on/in [something]" as standing up on.
Sitting on is an action applying to one thing.
Lying on is an action applying to one thing.
Standing up on is an action applying to one thing.
Carry out an actor sitting on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not seated, try the actor taking position seated;
otherwise follow the report taking position rules.
Carry out an actor lying on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not reclining, try the actor taking position reclining;
otherwise follow the report taking position rules.
Carry out an actor standing up on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not standing, try the actor taking position standing;
otherwise follow the report taking position rules.
Understand "lie down" as lying down.
Understand "sit down" or "sit" or "sit up" as sitting down.
Understand "stand" or "stand up" as standing up.
Lying down is an action applying to nothing.
Sitting down is an action applying to nothing.
Standing up is an action applying to nothing.
Taking position is an action applying to one posture.
Instead of an actor lying down:
try the actor taking position reclining; rule succeeds.
Instead of an actor sitting down:
try the actor taking position seated; rule succeeds.
Instead of an actor standing up:
try the actor taking position standing; rule succeeds.
Check an actor taking position:
if the holder of the actor is not a room and the holder of the actor does not allow the posture understood:
if the actor is the player:
say "You can't take that position [in-on the holder of the actor].";
otherwise if the actor is visible:
say "[The actor] can't take that position.";
stop the action.
Check an actor taking position:
if the posture understood is the posture of the actor:
if the actor is the player:
say "You are already [the posture understood].";
otherwise:
if the actor is visible, say "[The actor] is already [the posture understood].";
stop the action.
Carry out an actor taking position:
now the posture of the actor is the posture understood.
Report someone taking position (this is the position-report rule):
say "[The actor] is now [the posture of the actor][if the holder of the actor is not the location of the actor] [in-on the holder of the actor][end if]."
Report taking position:
say "You are now [the posture of the player][if the holder of the player is not the location] [in-on the holder of the player][end if]."
To say in-on (item - a thing):
if the item is a container, say "in [the item]";
otherwise say "on [the item]".
Carry out an actor exiting (this is the departure-posture rule):
let N be the holder of the actor;
if N is a container or N is a supporter,
now the posture of the actor is the posture of N;
otherwise now the posture of the actor is standing.
The departure-posture rule is listed after the standard exiting rule in the carry out exiting rulebook.
The departure-posture rule is listed after the standard getting off rule in the carry out getting off rulebook.
Carry out an actor entering something (this is the arrival-posture rule):
if the noun is a container or the noun is a supporter,
now the posture of the actor is the posture of the noun.
The arrival-posture rule is listed after the standard entering rule in the carry out entering rulebook.
Check an actor going somewhere:
if the actor is in a room and the actor is not standing:
say "([if the actor is not the player][the actor] [end if]first standing up)[command clarification break]";
silently try the actor taking position standing;
if the actor is not standing, stop the action.
Section 2 - Some Generic Kinds
A chair is a kind of supporter. A chair is always enterable. Every chair allows seated and standing. A chair is usually seated.
A sofa is a kind of supporter. A sofa is always enterable. Every sofa allows seated, standing and reclining. A sofa is usually seated.
A hammock is a kind of container. A hammock is always enterable. Every hammock allows seated and reclining. A hammock is usually reclining.
Section 3 - The Scenario
The Resort is a room.
The banana hammock is a hammock in the Resort. The stone bench is a sofa in the resort.
Clark is a man in the Resort. A persuasion rule: persuasion succeeds.
Rule for writing a paragraph about someone (called target):
say "[The target] is [posture] [if the holder of the target is the location]nearby[otherwise][in-on the holder of the target][end if]."
Rule for writing a paragraph about something which encloses an unmentioned person (called target):
carry out the writing a paragraph about activity with the target instead.
Test me with "sit on bench / stand on bench / get up / lie on hammock / sit up / g / clark, sit on bench / look / clark, lie down / g / look / clark, get up / look / clark, lie down / look / enter bench".
Suppose that we're going to give every person in the game a nose, but we want references to a nose always to mean the nose of someone *else*, if the player is with one other person. Moreover, on some occasions we're going to be in sight of Rudolph, so actions directed at an unspecified nose should always prefer his.
This relies on a somewhat advanced technique from the Understanding chapter, but since it may become useful with assemblies and body parts, it is worth mentioning here.
"The Night Before"
The North Pole is a room. "Here it is: the famous Pole. From here you can go south (or south-south, or south-south-by-south); or, alternatively, take refuge inside a red-and-white-striped cabin." The cabin is scenery in the North Pole. Instead of entering the cabin, try going inside.
Santa is a man in the North Pole. "Santa is pacing around in the snow and trying to psych himself up for the big night."
Inside from North Pole is the Candy Cane Cabin. The description of the Cabin is "Striped red and white, but nothing can make this place seem warm and inviting since Mrs. Santa ran off with the Tooth Fairy."
The Ice Shelf is south of North Pole. "The ice here has been smoothed into a kind of runway for easy take-off, and ends in a cliff and cold arctic sea." Donner, Vixen, Blixen, and Rudolph are animals in the Ice Shelf.
A nose is a kind of thing. A nose is part of every person. The description of Santa's nose is "It's a bit ruddy. You don't like to mention it, but Santa's been dipping heavily into the Grey Goose since Mrs. Santa left town." The description of a nose is usually "Not terribly exciting." The description of Rudolph's nose is "See how it glows!"
Next, we'll teach Inform some vocabulary to distinguish between the player and everyone else:
Definition: a person is other if it is not the player.
Definition: a thing is selfish if it is part of the player and the player can see an other person.
Instead of examining a selfish nose:
say "You cross your eyes, but can't get a good look."
Here is the part that actually determines the preferences. "Does the player mean..." can result in five outcomes: "it is very unlikely", "it is unlikely", "it is possible" (the neutral default), "it is likely", and "it is very likely". This is discussed in greater detail in the Understanding chapter. Here, we want to discourage references to the player's own nose and encourage references to the nose of Rudolph, so:
Does the player mean doing something when the noun is a selfish nose or the second noun is a selfish nose: it is very unlikely.
Does the player mean doing something to Rudolph's nose: it is very likely.
And this part is just for decoration:
Rule for writing a paragraph about Rudolph:
say "The reindeer are already harnessed and waiting impatiently. The brilliance of [Rudolph]'s nose casts an eerie red glow over [the list of unmentioned animals in the location]."
Test me with "x nose / x my nose / x santa's nose / in / x nose / out / s / x my nose / x nose / x rudolph's nose / x donner's nose".