Child's Play

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

Chapter 8 - Climaxtime
Climaxtime is a scene. Climaxtime begins when Costumetime ends. Climaxtime ends when your favorite toy is not in play.
When Climaxtime begins:
   change (report rulename corresponding to a baby name of Zoe in the Table of Going Report Rules) to ZK fleeing report rule;
   change (machine corresponding to a baby name of Zoe in the Table of Baby State Machines) to ZK Toy-Grabbing Rules;
   now fuss count is 0;
   Parry munches Cheerios in one turn from now.
When Climaxtime ends:
   say "Zoe screws up her face and bursts into these loud wails, they are so terribly loud. She shoves at [a random not-Zoe-baby playmate in the location] who also starts crying and soon just about everyone is crying except you, ha ha, they are such babies.
Marion says, 'I was afraid we were staying too late past Zoe's naptime. Farina, everyone, it's been fun, and glad you could come, Parry. See everyone next week.' Hands come down and the squalling Zoe zips up into the air and into Marion's arms. Soon all of the babies are going skywards, parentwards, and out-the-doorwards.
With them all gone the air kinda leaks out of you, it has been a long playdate. The mom gathers you and your favorite toy up. 'C'mon, kid, let's get you to bed before you completely pass out.' But you do not need naps, does she not understand that?
Though your crib is nice and soft and your favorite toy chimes a bit as you curl around it and your teeny eyelids are so heavy.
So...heavy....";
   end the game in victory.
The cup of Cheerios is a thing. "It is a little plastic cup full of Cheerios." The description is "Cheerios! In a cup! What a totally portable idea."
To spill the Cheerios:
   say "It is as if the oxygen in the room goes foom like there was a flash fire and suddenly there are all of these babies headed your way[note babies-love-cheerios].";
   remove the cup of Cheerios from play;
   move the pile of Cheerios to the location;
   change (machine corresponding to a baby name of Cassie in the Table of Baby State Machines) to Baby Attraction Rules;
   change (machine corresponding to a baby name of Watson in the Table of Baby State Machines) to Baby Attraction Rules;
   change (machine corresponding to a baby name of Jemison in the Table of Baby State Machines) to Baby Attraction Rules;
   change the base act percentage of Cassie to 100;
   change the act percentage of Cassie to 100;
   change the base act percentage of Jemison to 100;
   change the act percentage of Jemison to 100;
   change the base act percentage of Watson to 100;
   change the act percentage of Watson to 100.
At the time when Parry munches Cheerios:
   say "Lisa suddenly says, 'Parry! Are you eating Cheerios?'
Parry sounds all sheepish, 'Yeah.'
Becca is all 'I hope you don't mind crumbs all over your loveseat, Farina,' and everyone laughs but Parry.";
   move the cup of Cheerios to the north pink striped loveseat.
A height reachability rule when the reaching object is the cup of Cheerios and Climaxtime is happening:
   if the reaching actor is quarter-height-or-higher, continue action processing;
   if the poosh stick is carried by the reaching actor and the current action is pushing the cup of Cheerios with, continue action processing;
   if the reaching actor is the player, say out-of-reach message for the cup of Cheerios;
   stop action processing.
Instead of pushing the cup of Cheerios with the poosh stick:
   say "You reach up with the stick and whack the cup and all of these Cheerios shower down around you in a big pile.[paragraph break]";
   spill the Cheerios.
Instead of pushing or attacking or taking the cup of Cheerios when the player is quarter-height-or-higher:
   if the player is standing, continue the action;
   say "You carefully reach over and bat at the cup and all of these Cheerios shower down onto the floor in a big pile.[paragraph break]";
   spill the Cheerios.
Baby Attraction Rules is a rulebook.
The current actor is a person that varies.
The first baby attraction rule (this is the decide what baby is acting rule):
   change the current actor to a random busy acting playmate.
A baby attraction rule when the current actor is standing (this is the babies let go of stuff to head for the Cheerios rule):
   try Cassie sitting down;
   rule succeeds.
A baby attraction rule when the current actor is carrying something (this is the babies stop carrying things to head for the Cheerios rule):
   if the current actor clears all inventory begin;
   if the current actor is present and some thing is marked for special listing, say "[The current actor] drops [a list of things that are marked for special listing].";
   rule succeeds;
   end if.
A baby attraction rule when the current actor and the pile of Cheerios are not co-located (this is the babies crawl towards Cheerios rule):
   let way be the best route from the location of the current actor to the location of the pile of Cheerios;
   if way is a direction, try the current actor going way;
   rule succeeds.
A baby attraction rule (this is the babies scarf down Cheerios rule):
   if 1 out of 5 and the current actor is present begin;
   if the current actor is Cassie, say "Cassie [takes] [one of]some[or]a handful of[purely at random] Cheerios and [one of]eats them[or]inhales them[or]shoves them in her mouth[purely at random][if 1 out of 4] and grins around the mushy oatiness of them[end if].";
   if the current actor is Watson, say "Watson [one of]gingerly[or]carefully[purely at random] [one of]picks up[or]takes[purely at random] a single Cheerio and [one of]sniffs at it cautiously before finally eating[or]then he eats[purely at random] it.";
   if the current actor is Jemison, say "Jemison [if 1 out of 4]considers the pile of Cheerios and then he [end if][one of]takes[or]picks up[purely at random] [one of]a few[or]some[purely at random] Cheerios and munches on them.";
   rule succeeds;
   end if.

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