Child's Play

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

Section 3 - Rocking Chair Room

By the Rocking Chair is east of the North End of Loveseat. "The gliding rocking chair is all tall and wooden. It is where the mom rocks you when she thinks you need a nap even though you do not need naps. The loveseat is west and there is a small open area to the east and a big open area in the middle of the room to the south." The faraway descriptor is "next to the gliding rocking chair".

The smooth rock is a small thing in By the Rocking Chair. The description is "The mom found this one one of your walks, well it wasn't really a walk, more like the mom driving you around in a stroller, anyway she found this rock and gave it to you." Understand "stone" or "pebble" as the smooth rock.

The gliding rocking chair is furniture in the By the Rocking Chair. It is not room-mentioning and scenery. The description is "The dad likes to sit in the chair and rock back and forth and back and forth and back and forth which is okay for napping (not that you need naps) but is not so good when you are trying to pull up on it." Understand "tall" or "wooden" or "rocker" as the gliding rocking chair. The gliding rocking chair is suitable for pulling up on. Rule for printing the name of the gliding rocking chair while constructing the status line: say "chair" instead. Instead of tasting the gliding rocking chair, say "Woody with a hint of smoke." Instead of pushing or pulling the rocking chair, say "You are too small and it is too big for you to push and pull it all that well."

Instead of pushing or pulling the rocking chair during Playtime, say "You stopping Parry from rocking by pushing on the chair is like ants stopping semi trucks from rolling."

[The normal description of distant item location rule will add "It is next to the gliding rocking chair" to the rocking chair's description, thanks to the room's faraway descriptor. Fix that.]
After printing the description of the gliding rocking chair when the gliding rocking chair is within a room which is not the location:
    if the gliding rocking chair and the player are not co-located begin;
        let place be the location of the gliding rocking chair;
        let way be the best route from the location to the place;
        say "It is [if way is a direction]to the [way] [end if]between the small open place and the loveseat. [run paragraph on]";
    end if;
    ignore the description of distant item location rule.

Instead of putting something under the gliding rocking chair, say "That would be a good way to stop the rocking chair from rocking but it is a gliding rocking chair and so even if you put something under there it could keep gliding."

After upstanding using the gliding rocking chair, say "It is hard to pull up on the rocker because it wants to be all wiggly but you do it anyway."

To decide if Parry is rocking: if someone is enclosed by Parry, decide no; decide yes.
To decide if Parry isn't rocking: if someone is enclosed by Parry, decide yes; decide no.

Getting points for J following you is a one-time deal. Mentioning stopped rocking is a one-time deal.

Instead of upstanding using the gliding rocking chair during Playtime:
    abide by the check upstanding using rulebook;
    if a person is held by Parry begin;
        consider the standard upstanding using rule;
        say "You pull up on the gliding rocking chair and Parry looks down at you and says 'Oh, uh, hang on just a second and I'll pick you up, too.'";
    otherwise;
        say "As soon as you have pulled up on the gliding rocking chair Parry looks down and says 'Hey, there, you want to be picked up?' and he lifts you into his lap and stops rocking[if mentioning stopped rocking has not occurred]. If you were on the ground you could get to the backpack now[end if][run paragraph on]";
        move the player to Parry, without printing a room description;
        Parry releases the player in three turns from now;
        if Jemison attempts to follow the player into Parry's lap begin;
            say ". And then Jemison pulls up on the gliding rocking chair and looks up at you and grunts softly.";
            if getting points for J following you has not occurred, record 5 points for "getting Jemison to pull up after you";
        otherwise;
            say ".";
        end if;
    end if.

Instead of someone (called the stander) trying upstanding using the gliding rocking chair during Playtime:
    if a person is held by Parry begin;
        consider the standard upstanding using rule;
        if the stander is present and not running silently, say "[The stander] pulls up on the gliding rocking chair and Parry looks down at [it-them of the stander] and says 'Oh, uh, hang on just a second and I'll pick you up, too.'";
    otherwise;
        let print-flag be 0;
        if the stander is present and not running silently, change print-flag to 1;
        if print-flag is 1, say "[The stander] pulls up on the gliding rocking chair and Parry looks down and says 'Hey, there, [if the stander is male]mister man[otherwise]sweetie[end if], do you want to be picked up?' and he scoops [it-them of the stander] up";
        move the stander to Parry;
        Parry releases in three turns from now;
        if Jemison attempts to follow the stander into Parry's lap and print-flag is 1, say ". Jemison is not going to let [the stander] get away, he pulls up on the gliding rocking chair and stares up at [the stander].";
        otherwise if print-flag is 1, say ".";
    end if.

[The following "at the time when..." rules deal with kids getting put down by Parry. The player can wiggle (by trying to go down or something similar) when held by Parry in order to get down sooner, bypassing these timed rules. If there was only one timed rule, and if Jemison then followed the player into Parry's lap, the single rule would fire and he'd be put down too early for the player to do anything about the backpack under the rocking chair. Since you can't create "at the time when..." rules that include arguments, I have two separate timed rules instead, one for the player, and one for random kids.]

At the time when Parry releases the player:
    if the player is enclosed by Parry, make Parry put the player down.

At the time when Parry releases:
    [In case the kid held by Parry is set down early because Marion gives the backpack to Parry:]
    if no person is enclosed by Parry, rule succeeds;
    make Parry put a random person held by Parry down.

To make Parry put (kid - a person) down:
    let print-flag be 0;
    move the kid to the location of the gliding rocking chair, without printing a room description;
    if kid is the player or kid is present, change print-flag to 1;
    if kid is Jemison begin;
        now Jemison is active;
        if Jemison is fixated on Parry begin;
            let f be a random thing that fascinates Jemison;
            if print-flag is 1, say "Parry says, 'Okay, down you go' to Jemison who scrabbles around and grabs [the f]. Parry gently lowers Jemison to the floor";
            move f to Jemison;
            now f does not fascinate Jemison;
        end if;
    otherwise if print-flag is 1;
        say "Parry says, 'Okay, down you go,' and he gently lowers [name of kid] to the floor";
    end if;
    if someone (called the stander) is pulled up on the gliding rocking chair begin;
        if print-flag is 1, say ". He then is all 'And now it's your turn' and he picks [name of stander] up[if stander is Jemison][note jemison-in-Parrys-lap][end if][run paragraph on]";
        now the stander is not pulled up on anything;
        if the stander is Jemison and Jemison is not fixated on Parry begin;
            if print-flag is 1, say " but Jemison makes a big fuss and Parry is all, 'Whoa! Whoa!' and [if 1 out of 4]Becca laughs and says, 'Jemison gets that way sometimes.' Parry smiles weakly and [end if]puts Jemison back down[if Jemison is fixated] and Jemison looks pointedly at [the random thing that fascinates Jemison][end if]. Then Parry starts rocking again.";
        otherwise;
            move the stander to Parry, without printing a room description;
            Parry releases in three turns from now;
            if Jemison attempts to follow the stander into Parry's lap and print-flag is 1, say " and Jemison is right behind [name of stander] and pulls up on the gliding rocking chair.";
            otherwise if print-flag is 1, say ".";
        end if;
    otherwise if print-flag is 1;
        say " and starts rocking again.";
    end if.

At the time when Marion almost removes the toy:
    if Marion encloses the backpack begin;
        say "There is this rattle rattle and your head snaps up and [if Marion is not present]you look way over at the loveseat and [end if]see Marion start to pull your favorite toy out of the backpack and then she looks at you and then she looks at Zoe and she puts the toy back in the backpack.";
        Marion looses the wild onesie in two turns from now;
    end if.

At the time when Marion looses the wild onesie:
    if Playtime is not happening, rule succeeds;
    if Marion does not enclose the backpack, rule succeeds;
    now the backpack is in the location of the gliding rocking chair;
    now the backpack is not handled;
    now the backpack is closed;
    now the plain white onesie is loose;
    remove the plain white onesie from play;
    remove your favorite toy from play;
    if Marion is present, say "Marion stands up and walks over to the gliding rocking chair and then she is back only now she doesn't have the backpack any more.";
    if Parry is present, say "A shadow falls over you and it is Marion with the backpack. [if Parry is rocking]Parry stops rocking and [end if]Marion shoves the backpack back under the gliding rocking chair."

At the time when Parry looses the wild onesie:
    if Playtime is not happening, rule succeeds;
    now the backpack is in the location of the gliding rocking chair;
    now the backpack is not handled;
    now the backpack is closed;
    now the plain white onesie is loose;
    remove the plain white onesie from play;
    remove your favorite toy from play;
    if Parry is present begin;
        say "Parry finally frees the onesie from the terrible clutches of the backpack and shoves it and your favorite toy back inside and ";
        if the player is held by Parry, say "holds you carefully while he ";
        otherwise if a person (called p) is held by Parry, say "holds [p] carefully while he ";
        say "puts the backpack back under the rocking chair. 'Got it!' he calls to Marion, who says, 'Thanks!' Zoe just looks disguted, it is like that is the only look she practices.";
    end if.

To decide if Jemison attempts to follow (leader - a person) into Parry's lap:
    if Jemison and the leader are not co-located, decide no;
    if Jemison is not fixated on the leader, decide no;
    if Jemison clears all inventory, do nothing;
    now Jemison is pulled up on the gliding rocking chair;
    now Jemison is passive;
    decide yes.

The backpack is an openable closed container in By the Rocking Chair. "A backpack with bears on and your favorite toy in it is shoved behind the rocking chair next to the wall[if open] and is all gaping open[end if][note take-all-from-backpack]." The description is "Zoe's backpack has all these cute bears sewed on it. Clearly her mom Marion picked it out, it does not reek of evil like it would if Zoe had chosen it. It is [if the backpack is open]all gaping open though the only thing you can see in it is this white onesie[otherwise]closed so you can't see what's in it[end if][if your favorite toy is not in play] though you know your toy is in there somewhere[end if]." Understand "bear" or "bears" or "with bears on" or "bag" as the backpack. The printed name is "backpack with bears on".

The zipper is part of the backpack. "The backpack's zipper is [if the backpack is open]down a ways but stuck[otherwise]zipped all the way up." Instead of opening or pulling the zipper, try opening the backpack. Instead of closing the zipper, try closing the backpack.

The faker-toy is part of the backpack. Understand "your" or "favorite" or "toy" as the faker-toy when your favorite toy is not in play and Playtime is happening. The printed name is "favorite toy". The indefinite article of the faker-toy is "your". Before doing something when the faker-toy is acted upon, instead say "You can't really do anything to your toy right now because it is in that backpack." Before examining the faker-toy, instead say "Your toy is inside Zoe's backpack so you cannot really see it."

Instead of doing something other than examining when the backpack is acted upon and Parry is rocking and the backpack is in By the Rocking Chair, say "You would but Parry is rocking, rocking, rocking, and you can't reach under the rocking chair to get to the backpack while he is rocking, rocking, rocking."

Instead of doing something other than examining when the backpack is acted upon and the backpack is held by someone (called the holder), say "[The holder] has the backpack right now."

[I have to trap taking, pushing, and pulling separately because of other rule interactions.]
Instead of taking or pushing or pulling the backpack when Parry is rocking and the backpack is in By the Rocking Chair, try opening the backpack instead. [The open rule gets caught by the above rule.]

Instead of taking or pushing or pulling the backpack when the backpack is held by someone, try opening the backpack.

Instead of pushing or pulling the backpack, say "It is way big and you can't really budge it."

A rule for reaching inside the backpack:
    if Parry is rocking and the backpack is in By the Rocking Chair begin;
        if the person reaching is the player, say "You would but Parry is rocking, rocking, rocking, and you can't reach under the rocking chair to get to the backpack while he is rocking, rocking, rocking.";
        deny access;
    end if.

Getting points for opening the backpack is a one-time deal.

After opening the backpack:
    move the plain white onesie to the backpack;
    say "When you open the backpack all you can see in it is this white onesie that is totally in your way.";
    if Zoe is carrying something (called the distractor) begin;
        silently try Zoe trying dropping the distractor;
        if Zoe is not carrying the distractor, say "Zoe sees you open that backpack and she gets agitated and tosses [the distractor] aside.";
    end if;
    if getting points for opening the backpack has not occurred, record 5 points for "opening the backpack";
    now Zoe is done acting.

After searching the backpack, say "You cannot find anything in the backpack, that stupid onesie is in the way."

Instead of opening the backpack when the backpack is open and the plain white onesie is stuck and the plain white onesie is in the backpack, say "That backpack is as open as it is going to be with that onesie all stuck in there."

Instead of closing the backpack when the backpack is open and the plain white onesie is stuck and the plain white onesie is in the backpack, say "You try and you try but that onesie is stuck in there and so you can't close the backpack."

Instead of removing the plain white onesie from the backpack, try taking the plain white onesie. Instead of pulling or pushing the plain white onesie, try taking the plain white onesie.

Instead of taking the plain white onesie when the plain white onesie is in the backpack:
    if the plain white onesie is loose begin;
        now the plain white onesie is stuck;
        change the act percentage of Zoe to 100;
        now Zoe is done acting;
        say "You pull on the onesie and it comes part of the way out of the backpack and then it gets hung on the backpack zipper. Great. Now it is blocking the backpack and it is also stuck[note stuck-onesie].";
    otherwise;
        say "You tug on that stupid onesie but it is stuck in the stupid backpack's stupid zipper.";
    end if.

Instead of looking under the plain white onesie when the plain white onesie is in the backpack:
    if the plain white onesie is loose, try taking the plain white onesie;
    otherwise say "You cannot see under the onesie, it is in your way and you cannot move it."

Instead of taking something that is in the backpack:
    say "That white onesie is in the way."

[These next two rules allow you to refer to the white onesie in the backpack with ALL but not anything else.]
Rule for deciding whether all includes the plain white onesie: it does.
Rule for deciding whether all includes something that is in the backpack: it does not.

[Zoe's toys from her backpack]

The plain white onesie is a small thing. The plain white onesie can be stuck or loose. The plain white onesie is loose. The description of the plain white onesie is "That onesie is [if loose]totally in the way[otherwise]all stuck in the backpack's zipper[end if]."

Does the player mean taking the plain white onesie when the backpack is open: it is very likely.
Does the player mean pulling the plain white onesie when the backpack is open: it is very likely.
Does the player mean looking under the plain white onesie when the backpack is open: it is very likely.

Table of Stuff Originally In the Backpack
Stuff
a thing
with 6 blank rows

The soft foam block, the plastic cup, the teething ring, the much-loved kangaroo, the teeny squeezy book, and the little doll are small things in the backpack. Understand "roo" as the much-loved kangaroo.

When play begins (this is the filling the table of backpack stuff rule):
    repeat with t running through things in the backpack begin;
        if the number of blank rows in the Table of Stuff Originally In the Backpack is 0 begin;
            report bug "Too few rows in the Table of Stuff Originally In the Backpack";
            stop repeating;
        otherwise;
            choose a blank row in the Table of Stuff Originally In the Backpack;
            change stuff entry to t;
        end if;
    end repeat.

The description of the soft foam block is "Magenta and soft and fun to chew. It is like one hand wide on a side." Understand "magenta" as the soft foam block.

The description of the plastic cup is "This is one cup that originally came with a bunch of other cups and they were all different sizes so you could stack them up into a giant tower of cups. But there is only one cup, that is no good for stacking." Instead of inserting something into the plastic cup, say "It is small and can't really hold all that much, besides the cup is for stacking not holding."

The description of the teething ring is "Ribbed for your chewing pleasure."

The description of the much-loved kangaroo is "This stuffed kangaroo has been loved and chewed and now it has some stuffing showing." Understand "stuffed" or "stuffing" as the much-loved kangaroo. Instead of kissing the much-loved kangaroo, say "You hug and kiss on the kangaroo."

The description of the teeny squeezy book is "This is not really a book, it is more like a very small toy that looks kinda like a book." Instead of opening or closing the teeny squeezy book, try reading the teeny squeezy book.

The description of the little doll is "It has red hair like Zoe but presumably it is not evil like Zoe."

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