Child's Play

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

Chapter 3 - Sizes, Which Have an Effect on Carrying Capacity

[Small things are things that a baby can carry in one hand, or in the mouth. Medium can only be carried in two hands, and restrict motion. Large can't be carried at all.]

A size is a kind of value. The sizes are small, medium and large. A thing has a size. Things are usually large. The specification of a size is "How large something is relative to what a small child can pick up."

[A player can carry a maximum of two small things or one medium thing. Any small item being chewed doesn't count towards the carry capacity. Any item being worn doesn't count towards the carry capacity.]
Definition: a baby person is burdened:
    if it is carrying more than zero medium things then decide yes;
    if it is carrying less than three small things and it is gnawing something that is held by it then decide no;
    if it is carrying more than one small thing then decide yes;
    if it is standing then decide yes;
    decide no.
Definition: a baby person is unburdened:
    if it is standing then decide no;
    if it is carrying exactly one small thing and it is not carrying a medium thing and it is gnawing something that is held by it then decide yes;
    if it is not carrying anything then decide yes;
    decide no.
Definition: a baby person is overburdened:
    if it is carrying more than two small things then decide yes;
    if it is carrying more than zero medium things and more than zero small things then decide yes;
    if it is standing then decide yes;
    decide no.
Definition: a thing is carryable if it is not large.

Instead of taking an Inform library animate object, say "You should only pick up things that are not so wiggly."

Instead of taking something large (this is the can't take large things rule), say "[The noun] [is-are] way big and there is no way you're picking [it-them] up or anything."

Check taking something medium when the player is not unburdened (this is the can't take medium things when burdened rule): instead say "[The noun] is big enough that you will have to drop everything to get [it-them] because it takes two hands[note inventory-limit]."

[This is a check rule so's I can handle the case where a player tries to take something they've already taken.]
Check taking a small thing when the player is burdened (this is the can't take small things when burdened rule):
    if the noun is not carried, instead say "Your hands are all full, maybe if you drop something you could get [the noun][note inventory-limit]."

Report taking a small thing: instead say "You pick [it-them of the noun] up."

Report taking a medium thing: instead say "You pick [it-them of the noun] up and it takes two hands."

[Variations on the above three rules for other people.]
Check someone taking a large thing (this is the other people can't take large items rule):
    if the person asked is a baby, stop the action.

Check someone taking a medium thing (this is the other people can't take medium items if holding anything rule):
    if the person asked is a baby and the person asked is not unburdened, stop the action.

Check someone taking a small thing (this is the other people can't take small items when burdened rule):
    if the person asked is a baby and the noun is not carried and the person asked is burdened, stop the action.

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