Home
Explore games
Help
Log in
Playfic is now in read-only mode.
You can still play existing games, but new signups and game editing is disabled.
Read the announcement.
Log in
Username
Password (
Forgot it?
)
Login
Liquid Handling Demo
by
Psuedonym
Played 1,694 times
View game source
(spoilers!)
Download the
.z8 file
Source Code
"Liquids" Include Plurality by Emily Short. When play begins: say "This is a quick showcase of some code I made for handling liquids in-game. It's far from perfect, but it's decent enough. Feel free to use it yourself, or borrow from the code. [paragraph break]Have fun!" Section 1 – Mechanics Section 1.1 – Water Receptacles and Handling A container can be waterbearing or unfillable. Definition: a container (called X) is waterbearing if it is open and the number of things in X is less than the carrying capacity of X. Definition: a container (called X) is unfillable unless it is waterbearing. A liquid is a kind of thing. A liquid is usually singular-named. The indefinite article of a liquid is usually “someâ€. Before taking a liquid (called L): if L is in a portable container (called C): say “(you decide to just take the [C], with the [L] in it)â€; instead try taking C; otherwise if the player carries a waterbearing container: continue the action; let Y be a random waterbearing container carried by the player; now L is in Y; otherwise: say “[one of]You have nothing to carry the [L] in, so that would just make a big mess.[or]You're not interesting in spilling [L] everywhere, so no.[stopping]â€; stop the action. Every turn when the player carries a liquid (called L): if the player carries a waterbearing container: let W be a random waterbearing container carried by the player; now L is in W; say “(you put the [L] in the [W])â€; otherwise: water-spill. To water-spill: if the player carries a liquid (called L): try the player dropping L; say “Since you have no container for it, the [L] splashes onto the floor.â€; otherwise if the player can see L: say “The [L] puddles on the floor of [the location of L].â€; otherwise: say “You hear some splashing noises in the distance.†[Understand “pour [something] into [something]†as inserting it into when the noun is a liquid.] Understand “fill [something] with [something]†as inserting it into (with nouns reversed). Before inserting a liquid (called L) into a waterbearing container (called C): if the player carries C: continue the action; otherwise: try the player taking C; continue the action. A container can be wet, dry, or dryet. Definition: a container is wet if there is a liquid in it. Definition: a container is dryet if there is nothing in it. Definition: a container is dry if there is something that is not a liquid in it. Instead of inserting a thing (called T) into a wet container (called C): if T is a liquid: say “You don't think those liquids would mix very well.â€; otherwise: say “You'd rather not get the [T] wet.†Instead of pouring a thing (called T) into a wet container (called C): if T is a liquid: say “You don't think those liquids would mix very well.â€; otherwise if T contains a liquid: say “You don't think those liquids would mix very well.â€; otherwise: say “You'd rather not get the [T] wet.†Instead of inserting a liquid (called L) into a dry container (called C): say “You'd rather not get [the list of things in C] wet.†Instead of taking a liquid that is not inside a container: say “You don't have any way of scooping up that puddle, so it's not really an option.†Instead of inserting a thing (called T) into a liquid (called L): if L is in a container: try inserting T into the location of L; otherwise: try dropping T. Section 1.2 – Emptying it into Emptying it into is an action applying to two things. Understand “empty [something] into [something]†and “pour contents of [something] into [something]†as emptying it into. Check emptying it into: if the noun is not a container: say “That's not a container.â€; stop the action; try the actor inserting the noun into the second noun; otherwise if the noun is closed: try opening the noun; if the noun is closed: say “You can't empty what you can't open.â€; stop the action; otherwise if the number of things in the noun is 0: say “There's nothing to dump.â€; stop the action; otherwise: continue the action; otherwise if the number of things in the noun is 0: say “There's nothing to empty.â€; otherwise if the second noun is closed: try opening the second noun; if the second noun is closed: say “You can't seem to open [the second noun], so your choices are to stop now, or just dump the contents of [the noun] somewhere else instead.[if the number of things in the noun is 0] Unfortunately, you can't even do that, since [the noun] is empty.[otherwise][end if]â€; stop the action; otherwise if the number of things in the second noun is the carrying capacity of the second noun: say “There's no room in [the second noun].â€; stop the action; otherwise: continue the action; otherwise if the number of things in the noun is 0: say “There's nothing to dump.â€; stop the action; otherwise: continue the action. Carry out emptying it into: now the dumptext is “the contents of [the noun]â€; if the second noun is a container: now all the things in the noun are in the second noun; otherwise: try dropping the noun instead. The dumptext is a text that varies. The dumptext is usually “stuffâ€. Report emptying it into: say “[if the second noun is a container]You dump the [dumptext] into [the second noun].[otherwise]You... you just sorta dump everything on the floor instead.[end if]â€. Emptying is an action applying to one thing. Understand “dump out [something]†and “empty [something]†and “drop contents of [something]†as emptying. To open-it: if the noun is openable: try opening the noun; if the noun is closed: say “You can't seem to open it, so that'll have to wait.â€; stop the action; otherwise: continue the action; otherwise: say “That's not something you can open.â€; stop the action. Check emptying: if the noun is a container: if the number of things inside the noun is 0: say “There's nothing in [the noun] to dump.â€; stop the action; otherwise if the noun is closed: open-it; otherwise: continue the action; otherwise: say “That's not a container, so you try the next best thing.â€; try dropping the noun instead. Carry out emptying: now all things that are in the noun are in the location of the actor. Report emptying: say “You [first time]unceremoniously[only] dump the contents of the [noun] onto the floor.†Emptying it onto is an action applying to two things. Understand “empty [something] onto [something]†and “dump the contents of [something] onto [something]†as emptying it onto. Check emptying it onto: if the noun is a container: if the number of things inside the noun is 0: say “There's nothing in [the noun] to dump.â€; stop the action; otherwise if the noun is closed: open-it; otherwise: if the second noun is a supporter: continue the action; otherwise: say “That won't support the [list of things inside the noun].â€; stop the action; otherwise: say “That's not a container, so you try the next best thing.â€; try putting the noun on the second noun instead. [Understand “dump [something] onto [something]†as putting.] Dumping is an action applying to one thing. Understand “empty [something]†and “dump [something]†and “pour out [something]†as dumping. Check dumping: if the noun is a liquid: if the noun is inside a container carried by the player: continue the action; otherwise if the noun is inside a portable container (called C): try taking C; if the player carries C: continue the action; otherwise: say “You'll need to be carrying the [C] first.â€; stop the action; otherwise if the noun is a container: try emptying the noun instead; otherwise: try dropping the noun instead. Carry out the player dumping: let LOCAT be the location of the player; now the noun is in LOCAT. Report dumping: say “You dump [the noun] out onto the floor.†Pouring it into is an action applying to two things. Understand “pour [something] into [something]†as pouring it into. Check pouring it into: if the noun is a liquid: if the second noun is a container: if the second noun is waterbearing: continue the action; otherwise: say “That's no place for [the noun].â€; stop the action; otherwise: let C be the location of the noun; stop the action; try emptying C onto the second noun; otherwise if the noun is a closed container: try opening the noun; if the noun is closed: say “You can't seem to open the container.â€; stop the action; otherwise: stop the action; try emptying the noun into the second noun; otherwise if the noun is a container: try emptying the noun into the second noun; otherwise: say “[if the noun is singular-named]That's not [otherwise]Those aren't[end if]something you can pour.â€; stop the action. Carry out pouring it into: now the noun is in the second noun. Report pouring it into: say “You pour [the noun] into [the second noun].†Section 2.5 – Drinks, Anyone? A liquid can be drinkable or undrinkable. Truedrinking is an action applying to one thing. Instead of drinking something: try truedrinking the noun. Check truedrinking: if the noun is a drinkable liquid: if the noun is in a container carried by the player: continue the action; otherwise if the noun is in a container (called C): try taking C; if the player carries C: continue the action; otherwise: say “You'll need to be carrying it first.â€; stop the action; otherwise: say “You have no intention of drinking anything off of the floor.â€; stop the action; otherwise if the noun is an undrinkable liquid: say “[i-wont-drink-it]â€; stop the action; otherwise: say “That's not something you can drink.â€; stop the action. To say i-wont-drink-it: say “[one of]Ugh, no![or]There's no way you're drinking that.[or]Yeah, how about no.[or]You dip one finger in it and taste. A drop touches your tongue, and you recoil in disgust.[paragraph break]Nope.[or]You'd really rather not.[or]You have no intention of ever getting this stuff anywhere near your mouth if you can help it.[purely at random]â€. A liquid has a text called a drink-description. The drink-description of a liquid is usually “It's unimaginably foul.†Carry out truedrinking a liquid (called the drink): remove the drink from play. Report truedrinking a liquid (called the drink): say “You drink [the drink]. [drink-description of the drink][line break]â€. Instead of drinking a container (called C) when there is a liquid in the container: let L be a random liquid in C; try drinking L. Section 2 – The Setting Section 2.1 – Liquids The Cottage is a room. “You stand in a little white-walled cottage, with a single exit to the east.†The Yard is a room. “The yard is grassy and green, with a cottage to the west.†The world is a region. The Cottage and the Yard are in the world. There is a missing detail. “You don't think that's a terribly relevant thing to be looking at. Focus on the point!†The missing detail is a backdrop. The missing detail is in the world. Understand “sky/up/floor/ground/grass/walls/wall/tree/trees/cloud/clouds/cottage/yard/exit/door†as the missing detail. The Yard is east of the Cottage. There is a wooden table. “You see a wooden table in the middle of the room.†The table is in the cottage. There is a jar on the table. There is some pond water in the jar. The jar has carrying capacity 3. The jar is closed and openable. There is a bottle on the table. There is some soda in the bottle. The bottle has carrying capacity 2. The bottle is closed and openable. There is a milk-carton on the table. There is some milk in the milk-carton. The milk-carton has carrying capacity 6. There is a jug in the yard. There is some liquid fertilizer in the jug. The jug is closed and openable. The liquid fertilizer is an undrinkable liquid. The milk-carton is closed and openable. There is a glass on the table. The glass is an open container. The glass has carrying capacity 2. There is a blue china mug on the table. The mug is an open container. The mug has carrying capacity 2. The pond water, soda, and milk are singular-named drinkable liquids. The drink-description of the pond water is “It's a little funky-tasting, but it's okay.†The drink-description of the soda is “It's fizzy and sweet, and you sort of wish you had more.†The drink-description of the milk is “It tastes like milk. But in a good way. You're not really sure how to describe milk, but it's good.†Instead of drinking the milk when the milk is in the milk-carton: say “Not straight out of the carton, you barbarian! Pour it into a glass or something first.†After truedrinking a liquid (called the drink): increase the score by 1; say “You drink [the drink]. [drink-description of the drink][line break]â€. Every turn when the score is 3: end the game saying “You drank everything, so there's nothing left to do! Good job!†Section 3.2 – Clarification The printed name of the milk-carton is “milk cartonâ€. Understand “milk/carton†and “milk carton†as the milk-carton. Does the player mean closing the milk: it is very unlikely. Does the player mean drinking the milk-carton: it is very unlikely. Understand “fizzy/bubbly/pop/coke/pepsi/sodawater†and “fizzy drink†and “bubbly drink†and “soda pop†as the soda. Understand “lactose†as the milk. Understand “pondwater†as the pond water. Does the player mean pouring the milk-carton into something: it is very unlikely. Understand "cup" as the glass. The maximum score is 3. Section 3 -- Not For Release -- Tests test me with "open jar/open bottle/pour water into mug/pour soda into mug/drink soda/open carton/drink milk/pour milk into glass/drink glass/drink milk"