Child's Play

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

Section 2 - Chewing and Stopping Chewing

[Defined actions for chewing and stopping chewing]
Chewing is an action applying to one thing. Understand "chew on [something]" or "chew [something]" or "gnaw on [something]" or "gnaw [something]" or "bite [something]" or "put [something] in mouth" as chewing.

Stopping chewing is an action applying to one thing. Understand "stop chewing on [something]" or "stop chewing [something]" or "stop gnawing on [something]" or "stop gnawing [something]" or "take [something] out of mouth" or "spit [something]" or "spit [something] out" or "spit out [something]" as stopping chewing.

[Changes to inventory due to chewing]
After printing the name of something (called the chewed-upon) which is gnawed by someone (called the chewer) while taking inventory:
    say " (being chewed)".

Instead of eating something that is not edible, try chewing the noun.
Instead of taking off something that is gnawed by someone, try stopping chewing the noun.
Instead of an actor taking something that is gnawed by the actor (this is the taking a chewed thing means not chewing it any more rule), try stopping chewing the noun.

[Action-handling rules for chewing and stopping chewing]
Before chewing something carryable that is not held:
    say "(first taking [the noun])[command clarification break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

[This one rule is a Before rule because of all of the Instead overrides I use, and I want to make sure the player's mouth isn't full before any other checks are carried out.]
Check chewing:
    if the noun is the player begin;
        if not running silently, say "You do not need to chew yourself, you are not some baby version of a cutter.";
        stop the action;
    otherwise if the player is gnawing the noun;
        if not running silently, say "You are already chewing on [the noun] so good news, it is like you've pre-succeeded.";
        stop the action;
    otherwise if the player is gnawing something;
        if not running silently, say player has a full mouth;
        stop the action;
    otherwise if the noun is a person;
        if not running silently, say "You have tried to chew on other babies and people before and it totally does not work.";
        stop the action;
    otherwise if the noun is not chewable;
        if not running silently, say "[The noun] is not chewable, which is weird, most everything is chewable.";
        stop the action;
    otherwise if the noun is not carryable;
        if not running silently, say "You give [the noun] a chew or two but you cannot carry [it-them] so you give up chewing it pretty soon.";
        stop the action;
    end if.

Check someone chewing something carryable that is not held by the person asked (this is the other people must hold small items to chew rule):
    silently try the person asked taking the noun;
    if the person asked is not holding the noun, stop the action.

Check someone chewing (this is the other people can't chew two things rule):
    if the person asked is gnawing something, stop the action.

Check someone chewing (this is the other people can't chew people or unchewable things rule):
    if the noun is not chewable or the noun is a person, stop the action.

Carry out an actor chewing:
    if the noun is carryable, now the actor is gnawing the noun;
    if the noun is small or the noun is medium, now the noun is damp.

Report chewing: say "You [if the noun is carryable]shove [the noun] in your mouth[otherwise]put your mouth on [the noun][end if] and start chewing on [it-them] and that [if the player is unburdened]leaves your hands free[note chewing-stuff][otherwise]feels good[end if]."

Report someone chewing: if the person asked is present, say "[The person asked] [if the noun is carryable]shoves [the noun] in [its-their of the person asked] mouth[otherwise]puts their mouth on [the noun][end if] and chews on [it-them of the noun]."

Check an actor stopping chewing:
    if the actor is not gnawing the noun begin;
        if the actor is the player, say "You are not chewing on that.";
        stop the action;
    end if.

Carry out an actor stopping chewing:
    now the noun is not gnawed by anything;
    if the actor is overburdened,
        silently try the actor dropping the noun;

Report stopping chewing:
    say "You pop [the noun] out of your mouth[if the noun is not held] and onto the floor[end if]."

Report someone trying stopping chewing:
    if the person asked is present, say "[The person asked] pops [the noun] out of [its-their of the person asked] mouth[if the noun is not held by the person asked] and onto the floor[end if].";
    stop the action.

[Side effects of chewing]
To pop (item - a thing that is gnawed by anything) out:
    if the item is gnawed by the player, say "(popping [the item] out of your mouth first)";
    now the item is not gnawed by anything;

Carry out an actor dropping something that is gnawed by anything: pop the noun out.

Carry out an actor putting something that is gnawed by anything on something: pop the noun out.

Carry out an actor inserting something that is gnawed by anything into something: pop the noun out.

To say player has a full mouth: say "You would but your mouth is all full."

Instead of an actor drinking when the actor is gnawing something:
    if the actor is the player, say player has a full mouth.

Instead of an actor spitting up when the actor is gnawing something:
    if the actor is the player, say player has a full mouth.

Instead of an actor spitting up on when the actor is gnawing something:
    if the actor is the player, say player has a full mouth.

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