Child's Play

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

Section 4 - Small Open Area

[This was the "Small Open Area" but that then obliterates the value "small".]
[Also, there is undoubtedly a more clever way of mentioning your favorite toy when it's on the bookcase than how I'm doing it in the room description, but I never can figure out how the printing activities of I7 work.]
The TKBUG Open Area is east of By the Rocking Chair. "You are east of the gliding rocking chair that is fun to ride on and north of the big TV that Sesame Street comes from. On the wall is a big bookcase full of chewy books. There is a way into the kitchen to the north but one of those baby gates is there, that is no fair[if your favorite toy is in the bookcase].[paragraph break]About half a parent high in the bookcase is your favorite toy[end if]." The printed name is "Small Open Area". The faraway descriptor is "in that small open area".

[Handle taking your favorite toy when it's above your head]
Before taking or attacking your favorite toy when your favorite toy is in the bookcase and the TKBUG Open Area encloses the player:
    if the player is half-height-or-higher begin;
        now your favorite toy is handled;
        if your favorite toy is not Parry-touched, instead say "You stretch for the toy but it is just barely out of reach[if 1 out of 5], grf, that is very frustrating[end if].";
        now your favorite toy is in the northeast-playpen;
        say "You stretch your arms but they are still too much like teeny T. Rex arms so then you scrunch down in your swing and stretch out a leg and as you swoop up again you just are able to kick the toy! It flies into the air and onto your lap! But as you swing back ";
        if Zoe is on the tall plastic block, say "Zoe leans over from the tall block and swats at the toy and you swat at her and the upshot is the toy goes flying again";
        otherwise say "the toy starts to slide out of your lap and you try to grab it but you have the reflexes of a sloth on methamphetamines or something, your arm just jerks and sends the toy flying again";
        say " and it goes kerplunk into the playpen.

This is the worst playdate ever.";
        now the baby-swing is temporarily muffled;
        now Zoe is passive;
        Zoe reactivates in zero turns from now;
        instead record 5 points for "accidentally getting your toy in the playpen";
    otherwise if the player is in the baby-swing;
        instead say "The swing gets you close to the toy but even [if your favorite toy is Parry-touched]though Parry got the toy a little closer to you, [end if]at the top of the swing arc you are not close enough to grab it, you need the swing to go higher.";
    otherwise if the player is eighth-height-or-higher;
        instead say nearly-in-reach message for your favorite toy;
    otherwise;
        instead say "You have short arms, you can't reach your favorite toy from down here.";
    end if.

Before pushing your favorite toy with the poosh stick when your favorite toy is in the bookcase:
    if the player holds the poosh stick, instead say "[If the player is quarter-height-or-higher]You are much closer to the toy but t[otherwise]T[end if]he long stick is hard to control and the shelves keep getting in the way."

At the time when Zoe reactivates:
    now Zoe is active.

The bookcase is a scenery container in the TKBUG Open Area. The description is "Books sleep here when they are not being read by the parents. The books do not really taste all that good and besides you cannot reach any of them [if the player is in the baby-swing]strapped into the swing[otherwise]now that the bottom bookcase shelves are all empty[end if][if the player is not quarter-height-or-higher]. From down here it is even hard to see the books, they are way up there[end if][if your favorite toy is in the bookcase]. Your favorite toy is up next to the books about a half a parent high[end if]." Instead of tasting the bookcase, say "The parents must have cleaned it recently because it has an oil taste." Instead of upstanding using the bookcase, say "You would think there would be good handholds but there aren't, and the wood is all slick."

Some out-of-reach books are scenery in the TKBUG Open Area. The description is "These are books but boring and with no pictures. They are all probably post-modern stories of longing and loss and existential angst and whatever because books about Maisy totally are better." Instead of doing something other than examining when the noun is the out-of-reach books or the second noun is the out-of-reach books, say "They are completely out of reach even though there used to be ones in reach before the parents moved them. Whatever. They don't even taste good anyway. They are all like musty with metaphor." Understand "book" as the out-of-reach books. The printed name is "books".

Instead of an actor going north in the TKBUG Open Area when the plastic gate is in the TKBUG Open Area:
    if the actor is the player, say "That baby gate is completely in your way.";
    stop the action.

The plastic gate is a backdrop. The description is "Plastic and it is wedged in there so you cannot go anywhere which is totally not right." It is in the TKBUG Open Area, the Behind the Loveseat, and the North End of Loveseat. Understand "baby" as the plastic gate. It is suitable for pulling up on. Instead of taking the plastic gate, say "It is stuck in place possibly by magic." Instead of tasting the plastic gate, say "Chewy under your new teeth."

[The playpen is large enough to go across two rooms, and is represented by two different objects. I have a single routine to describe the playpens, in order to save on string space. This will end up being a Glulx game, so that's silly, but oh well.]

A playpen is a kind of container. Playpens are transparent and enterable.

A rule for reaching inside a playpen when the top oval is closed:
    say "The playpen opening is [if the top oval is nearly in reach]still [end if]way too high for you to reach inside.";
    deny access.

A height reachability rule when the reaching object is a playpen (this is the playpen can be reached from all of the blocks rule):
    if the reaching actor is on a pushable between rooms supporter, continue action processing.

Instead of upstanding using a playpen when the top oval is closed, say "The mesh gives too much for you to pull yourself up on it."

Instead of upstanding using a playpen when the top oval is open, say "Now that the playpen is open there is really nothing to pull up on."

Instead of inserting something into a playpen when the top oval is closed, say "The opening is way too high for you to put anything in the playpen, it's a shame you can't throw things with any accuracy or anything."

Instead of inserting something into a playpen when the top oval is closed and the top oval is nearly in reach, say "Putting [the noun] into the playpen won't do you much good and you won't be able to get at it again so you should hold onto [it-them of the noun]."

Instead of inserting something into a playpen when the top oval is open, say "You have been working hard to get things out of the playpen, don't spend time putting things back in."

Instead of entering a playpen when the top oval is closed, say "The mesh is all in the way and besides it is no fun being in the playpen so why would you go in there voluntarily?"

Instead of entering a playpen when the top oval is closed and the top oval is nearly in reach, say "You might be able to tip yourself over the top oval and into the playpen but the fall would be baby-crushing so no thank you."

Instead of opening a playpen, try opening the top oval. Instead of closing a playpen, try closing the top oval.

Instead of pushing a playpen with the poosh stick, try pushing the top oval with the poosh stick. Instead of unlocking a playpen with the poosh stick, try pushing the top oval with the poosh stick.

Rule for reaching outside a playpen:
    say "You will have to get out of the playpen.";
    deny access.

Rule for writing a paragraph about a playpen (called p):
    say "[the initial appearance of p][if the top oval is open] The playpen is all open.[run paragraph on][end if]";
    if something is in p, say " [if the top oval is open]In the playpen[otherwise]Through the mesh[end if] you can see [a list of things in p].";
    otherwise say line break.

Mentioning deathtrapness is a one-time deal.

To say playpen-description about (p - a playpen):
    say "This portable playpen is all old, probably it should be recalled except that the parents are way cheap. It is this frame made of metal bars and it has mesh sides and a floor for babies to play on. The bars go around in ovals at the top and bottom. [if the top oval is open]The hinged half of the top oval is down so the playpen is all open[otherwise]It should be recalled because the top oval is hinged and you can lower one side of the playpen by pushing the top bar up and then letting go so that the mesh comes down[end if][if mentioning deathtrapness has not occurred], that is a total deathtrap[end if]";
    if something is in p, say ". [if the top oval is open]In the playpen[otherwise]Through the mesh[end if] you can see [a list of things in p]";
    say ". "

The top oval is a backdrop. It is in the TKBUG Open Area and the Middle of the Living Room. The description is "The top oval is [if the top oval is open]half hanging down so that the playpen is all open[otherwise]way up there on the playpen. It must be like two or three babies high above you[end if]." Understand "metal", "bar", "bars", "hinge", "hinges", "opening", or "ovals" as the top oval. The top oval can be open or closed. The top oval is closed and not chewable. The top oval is not noticeable by playmates.

To decide if the top oval is nearly in reach:
    if the player is eighth-height-or-higher, decide yes;
    decide no.

To decide if the top oval is too high:
    if the player is quarter-height-or-higher, decide no;
    if the second noun is the poosh stick, decide no;
    decide yes.

A height reachability rule when the reaching object is the top oval and the top oval is open (this is the no use doing anything to the open top oval rule):
    if the reaching actor is the player, say "Now that you have lowered the oval there is no need to do anything more with it.";
    stop action processing.

A height reachability rule when the reaching object is the top oval and the top oval is too high (this is the top oval is too far away rule):
    if the reaching actor is the player begin;
        if the top oval is nearly in reach, say nearly-in-reach message for the top oval;
        otherwise say "You have short arms, you can't reach the top oval from down here.";
    end if;
    stop action processing.

A height reachability rule when the reaching object is the top oval and the reaching actor is in the baby-swing (this is the top oval is unreachable from the baby swing rule):
    abide by the baby-swing specific noun reachability rule.

A height reachability rule when the reaching object is the top oval (this is the top oval is now in reach rule): continue action processing.

Before pushing the top oval to up, instead try pushing the top oval.

Before inserting something into the top oval when the top oval is closed:
    let target be a random playpen in the location;
    instead try inserting the noun into target.

Instead of opening the top oval when the top oval is open, say "You have already opened the playpen."

Instead of opening the top oval when the top oval is closed, try pushing the top oval.

Instead of closing the top oval when the top oval is closed, say "It is already all closed."

Instead of closing the top oval when the top oval is open, say "It was too much work to open in the first place!"

Instead of unlocking the top oval with the poosh stick, try pushing the top oval with the poosh stick.

Instead of pushing the top oval with the poosh stick when the poosh stick is carried by the player:
    say "You get the poosh stick into position under the oval and push the oval up with it and it goes up a bit and clicks but when you let go it drops back into place. I guess you need to push up the oval at both ends of the playpen at the same time.";
    see if Zoe gets excited again.

Instead of pushing the top oval:
    say "You push on the side of the oval closest to you and it goes up a bit and clicks but when you let go it drops back into place. I guess you need to push up the oval at both ends of the playpen at the same time.";
    see if Zoe gets excited again.

To see if Zoe gets excited again:
    if Dejectiontime is happening begin;
        say "[line break]Zoe coughs and you look at her and she looks at you and you both look at the top oval of the playpen. It is like you are communicating telepathically and that communication is 'I may despise you and all that you stand for but I will work with you in order to lift the oval and free the toy but after that it is every baby for him or herself.' So you nod and she nods and it is a deal[note Zoe-cooperates].

Becca says, 'That's a bad cough Zoe has. Is she getting sick?' but Marion says, 'No, she coughs like that sometimes to get attention.'";
        change (machine corresponding to a baby name of Zoe in the Table of Baby State Machines) to ZK Cooperating Rules;
    end if.

Instead of pushing the top oval with the poosh stick when Cooperationtime is happening and Zoe is on the tall plastic block and the location is the Middle of the Living Room:
    if the poosh stick is not held by the player, abide by the pick up objects before pushing with them rule;
    say "You push on the oval with the poosh stick and at the same time Zoe pushes her end of the oval and it clicks up and then half of it falls down. That leaves the playpen all gaping open!";
    now the top oval is open;
    record 5 points for "opening the playpen".

Instead of pushing the top oval with the poosh stick when Cooperationtime is happening and the location is the Middle of the Living Room:
    if the poosh stick is not held by the player, abide by the pick up objects before pushing with them rule;
    say "You push the oval up with the poosh stick and it goes up a bit and clicks but Zoe is not yet in place to push the other side as well so nothing much happens."

Instead of pushing the top oval with the poosh stick when Cooperationtime is happening and the location is the TKBUG Open Area:
    if the poosh stick is not held by the player, abide by the pick up objects before pushing with them rule;
    say "You move the stick into position to push the top oval and ";
    if Zoe is on the tall plastic block, say "nearly hit Zoe on the nose, she looks down at you as if you are an idiot both for nearly hitting her and for pushing the oval up on the side where she already is.";
    otherwise say "Zoe just looks at you as if to say 'this is the side of the oval I will be pushing, get your own side.'"

The northeast-playpen is a playpen in the TKBUG Open Area. "Part of your playpen is here, there is more of it to the southwest." The description is "[playpen-description about northeast-playpen]". The printed name is "northeast part of the playpen". Understand "northeast", "part", "playpen", "frame", or "mesh" as the northeast-playpen.

Instead of going southwest when the player is in the northeast-playpen:
    say "You move to the other part of the playpen.";
    move the player to the southwest-playpen.

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