Child's Play

An interactive fiction by Stephen Granade (2007) - the Inform 7 source text

Section 2 - Standing, Standing Using and Sitting Down

[I don't want "stand" or "stand up" to map to exiting, so I can give gentle guidance messages regarding being pulled up]
Understand the command "stand" or "stand up" as something new. Standing alone is an action applying to nothing. Understand "stand" or "stand up" as standing alone.

Check standing alone:
    if the player is standing, instead say "You know you are not any good at standing by yourself so you don't let go and instead you stay pulled up.";
    if the player is inside something, instead try exiting;
    instead say "You try that standing thing but you are still no good at it without holding onto something so you will have to pull up on something to stand up.";

[Ideally I'd do this next bit by saying "Understand 'stand down' or 'climb down' as going down." but the going action is weird and won't let me do that.]
Going-down-mapping is an action applying to nothing. Understand "stand down" or "climb down" as going-down-mapping. Instead of going-down-mapping, try going down.

[Defined actions for standing using and sitting down]
Understand "pull up" as a mistake ("You'll have to say what you want to pull up on.").

[5G67 introduced a bug where this "standing using" action clashed with the "standing" definition above. Whoops. Accordingly, I've jiggered the name of this action.]
Upstanding using is an action applying to one thing. Understand "pull up [something]" or "pull up on [something]" or "stand using [something]" or "stand on [something]" or "climb on [something]" or "pull up with [something]" or "lift me with [something]" or "lift myself with [something]" or "pull me with [something]" or "pull me on [something]" or "pull me up with [something]" or "pull me up on [something]" or "pull on [something]" as upstanding using.

Sitting down is an action applying to nothing. Understand "sit" or "sit down" or "let go" as sitting down.

[A command that sometimes maps to sitting down.]
Lying down is an action applying to nothing. Understand "lie" or "lie down" as lying down.

[Adding to the ambulatory definition.]
Standing alone is being ambulatory. Upstanding using is being ambulatory. Sitting down is being ambulatory. Lying down is being ambulatory.

[Mapping some commands to upstanding using and sitting down]
Instead of entering something that is suitable for pulling up on, try upstanding using the noun.
Instead of climbing something that is suitable for pulling up on, try upstanding using the noun.
Instead of rubbing a parent person, try upstanding using the noun.

Before dropping a suitable for pulling up on thing:
    if the player is pulled up on the noun, instead try sitting down.

[Action-handling rules for standing using and sitting down]
Check upstanding using:
    if the noun is the player, instead say "Pulling yourself up by your bootstraps is a metaphor, you can't really pull yourself up using yourself.";
    if the noun is not suitable for pulling up on, instead say "You can't pull up on [the noun] to stand.";
    if the player is on the noun, instead say "You are already on [the noun] and that is just as good if not better than pulling up on it.";
    if the player is on a supporter (called the platform) begin;
        if the platform is the noun, instead say "You cannot both pull up on something and be sitting on it at the same time.";
        if the noun is furniture, instead say "Even this high you would have a very hard time stepping from [the platform] to [the noun] without falling on your face so it is best that you not do that.";
        say "(first getting off of [the platform] and plopping on the ground)[line break]";
        silently try getting off the platform;
        if the player is on the platform, stop the action;
    otherwise if the player is pulled up on something (called the support);
        if the support is the noun, instead say "You are already all pulled up on [the support] and you can't go any higher.";
        say "(first letting go of [the support] and plopping on the ground)[line break]";
        let go of the support;
    otherwise;
        if the player is not unburdened begin;
            if the player is gnawing a medium thing (called g), instead say "Even though you are chewing on [the g] it is big enough that you still have to keep it in your hands and so you can't pull up while you have it, if only [the g] were smaller you would have your hands free.";
            instead say "You have stuff in your hands and you will need those hands to pull yourself up so drop something I guess.";
        end if;
    end if;

Check someone upstanding using:
    if the noun is not suitable for pulling up on, stop the action;
    if the person asked is pulled up on something (called the support) begin;
        if the support is the noun, stop the action;
        seat the person asked;
    otherwise;
        if the person asked is not unburdened, stop the action;
    end if;

Carry out an actor upstanding using (this is the standard upstanding using rule): now the actor is pulled up on the noun.

Report upstanding using:
    if a playmate is pulled up on the noun, say "You wriggle your way next to [the list of playmates pulled up on the noun] and pull up on [the noun] and get to your feet.";
    otherwise say "You pull up on [the noun] and get to your feet and you are all steady except for the occasional sway."

Report someone upstanding using:
    if the person asked is present, say "[The person asked] pulls up on [the noun]."

Check an actor sitting down:
    if the actor is not standing begin;
        if the actor is the player, say "Since you are already sitting you can't sit again or maybe it's like you've already succeeded at sitting.";
        stop the action;
    end if.

Carry out an actor sitting down: seat the actor.

Report sitting down (this is the standard report sitting down rule):
    say "You sit down on your diaper and it is good that it is all padded and stuff."

Report someone sitting down: if the person asked is present, say "[The person asked] lets go and sits down."

Before an actor lying down when the actor is standing: instead try the actor sitting down.

Check lying down: instead say "You pretty much alternate between lying down and sitting down and crawling, it is your natural state, so there is no need to specifically ask to lie down if you're not standing."

[Side effects of standing using]

[A global variable to hold an item on which a player was recently pulled up -- for one turn only.]
The just-released item is a thing that varies. An every turn rule (this is the clear the just-released item rule): Now the just-released item is nothing.

Before going down or exiting when the player is pulled up on something:
    try sitting down instead;

Instead of going up when the player is pulled up on something:
    say "This is as high as you are going to go, you can pull up but not really climb."

Before going a direction (called goal) when the player is pulled up on something (called support) (this is the sit down before moving in a non-cruising direction rule):
    if going goal while holding onto support involves cruising begin;
        do nothing;
    otherwise if goal is not up; [The previous rule handles going up]
        say "(first letting go of [the support] and plopping on the ground)[command clarification break]";
        let go of the support;
    end if.

Before pushing something to a direction when the player is pulled up on something (called support):
    say "(first letting go of [the support] and plopping on the ground)[command clarification break]";
    let go of support.

Before entering something when the player is pulled up on something (called support):
    say "(first letting go of [the support] and plopping on the ground)[command clarification break]";
    let go of support.

Before someone going down when the person asked is pulled up on something:
    try the person asked trying sitting down instead;

Check someone going a direction (called goal) when the person asked is pulled up on something (called support) (this is the others must sit before moving rule):
    if going goal while holding onto support involves cruising begin;
        do nothing;
    otherwise;
        seat the person asked;
        change the just-released item to support;
    end if.

[We should only reach these rules if the direction in which a character is going is a cruise direction.]

[The cruise the player rule is in part duplicated by the third Zoe stalks the player rule. Keep them synchronized.]
Instead of going a direction (called goal) when the player is pulled up on something (called support) (this is the cruise the player rule):
    let furnishing be the other end of support to the goal;
    cruise the player to the goal and hold the furnishing;

Carry out someone going a direction (called goal) when the person asked is pulled up on something (called support) (this is the others cruising rule):
    let furnishing be the other end of support to the goal;
    cruise the person asked to the goal and hold the furnishing;

A height reachability rule when the reaching actor is standing:
    if the current action is taking or pushing or attacking, continue action processing.

Instead of taking or pushing or attacking something when the player is standing:
    if the player is pulled up on the noun, say "Your hands are full of [the noun] since you are pulled up on it, but you cannot really take [the noun].";
    otherwise say "You cannot reach [the noun] because you are standing and if you let go with one hand you would just plop down before you could get it."

Instead of someone taking something when the person asked is standing, stop the action.

Instead of chewing something when the player is standing, say "You do not have enough hands and eyes and coordination to chew something new when you are all pulled up."

Instead of someone chewing something when the person asked is standing, stop the action.

The source code to Child's Play is licensed under a Creative Commons NonCommercial Sampling Plus 1.0 License.