I needed a challenge, so I whipped this up. My code may have a bug or two, but I think it will do what you have in mind. BTW, this is not a simple puzzle at all to implement, as there are several objects that have to be in specific states. I didn’t add comments, but studying the code will probably give you a few insights.
[code]“Mopping” by Jim Aikin.
Include Plurality by Emily Short.
Use the serial comma.
The Scullery is a room. “Surprisingly, there are no skulls in the scullery. Protruding from the wall is a faucet, and a large cupboard stands in one corner. The floor is [if the floor is dirty]filthy[else]sparkling clean[end if].”
Section 1 - The Faucet and Water
The rusty iron faucet is scenery in the Scullery. The faucet can be flowing. “The faucet protrudes from the wall. [if flowing]Water is gushing from it, and flowing down the drain.” Understand “tap”, “spigot”, “spout”, and “pipe” as the faucet.
The drain is scenery in the Scullery. “The drain is conveniently positioned below the faucet. [if the faucet is flowing]Water is gushing from the faucet and flowing down the drain.”
Instead of switching on the faucet:
if the faucet is flowing:
say “Water is already coming out of the faucet.”;
else:
try turning the faucet.
Instead of switching off the faucet:
if the faucet is not flowing:
say “The faucet is already turned off.”;
else:
try turning the faucet.
Instead of turning the faucet:
if the faucet is flowing:
now the faucet is not flowing;
say “You twist the tap, and the flow of water halts.”;
now the gushing water is off-stage;
else:
now the faucet is flowing;
now the gushing water is in the Scullery;
say “You twist the tap, and water gushes from the faucet and flows down the drain.”
The gushing water is scenery. “The water is emerging from the faucet and flowing down the drain.” Understand “flowing” and “gushing” as the water.
Instead of taking the gushing water:
say “You dabble your hand in the water, but it simply flows on down the drain.”
Instead of switching off the gushing water:
try turning the faucet.
Section 2 - The Cupboard and Implements
The large cupboard is a closed openable scenery container in the Scullery. “You know the cupboard well, because you’re always being told to clean things.”
The old iron bucket is an open container in the cupboard. The description of the bucket is “The old iron bucket is your trusted friend. [bucket-contents]”. The bucket can be full or empty. The bucket is empty. Understand “full” as the bucket when the bucket is full. Understand “empty” as the bucket when the bucket is empty.
To say bucket-contents:
if the bucket-water is in the bucket:
say “In the bucket is a quantity of [if the bucket-water is soapy]sudsy[end if] water.”
The soap bottle is in the cupboard. The description of the soap bottle is “The handy plastic squeeze-bottle says ‘CLEANSER’ on the label.” Understand “handy”, “plastic”, “squeeze-bottle”, and “cleanser” as the soap bottle.
The mop is in the cupboard. The description of the mop is “The only weapon with which you’re entrusted by your wicked stepmother is the long-handled mop. [mop-state]”. Understand “long”, “handled”, and “long-handled” as the mop. The mop can be wet or dry. The mop is dry. The mop can be soapy. The mop is not soapy. Understand “wet” as the mop when the mop is wet. Understand “dry” as the mop when the mop is dry. Understand “soapy” as the mop when the mop is soapy.
To say mop-state:
if the mop is wet:
say “The mop is wet[if the mop is soapy] and soapy[end if].”
The bucket-water is scenery. The indefinite article of the bucket-water is “some”. The printed name of the bucket-water is “water in the bucket”. Understand “water” and “bucket water” as the bucket-water. The bucket-water can be soapy. The bucket-water is not soapy. Understand “soapy”, “suds”, and “sudsy” as the bucket-water when the bucket-water is soapy. The description of the bucket-water is “The [if soapy]soapy[end if] water is sloshing around in the bucket.”
Filling is an action applying to one thing. Understand “fill [something]” as filling.
Check filling something:
say “[The noun] [is-are] not something you can fill.”
Instead of filling the bucket:
if the bucket-water is in the bucket:
say “You have already filled the bucket.”;
else if the gushing water is not in the Scullery:
say “There’s nothing here to fill the bucket with.”;
else if the player does not carry the bucket:
say “You need to be holding the bucket in order to fill it.”;
else:
now the bucket-water is in the bucket;
now the bucket is full;
now the faucet is not flowing;
now the gushing water is off-stage;
say “You fill the bucket with water from the faucet, and turn off the faucet.”
Filling it with is an action applying to two things. Understand “fill [something] with [something]” as filling it with.
Check filling something with something:
say “There seems to be no compelling reason for you to do that.”
Instead of filling the bucket with the gushing water:
try filling the bucket.
Instead of inserting something into the bucket:
if the noun is the soap bottle:
if the bucket is empty:
say “The soap will do no good in a dry bucket.”;
else if the bucket-water is soapy:
say “You have already added soap to the water in the bucket.”;
else if the player does not carry the soap bottle:
say “You need to be holding the soap bottle in order to do that.”;
else:
now the bucket-water is soapy;
say “You squirt soap into the water in the bucket, producing a quantity of suds.”;
else if the noun is the bucket-water:
say “You already did that.”;
else if the noun is the gushing water:
try filling the bucket;
else if the noun is the mop:
if the bucket is empty:
say “There would be no point in doing that, as the bucket is empty.”;
else:
now the mop is wet;
if the bucket-water is soapy:
now the mop is soapy;
say “You dip the mop in the bucket.”;
else:
say “There would be no point in doing that.”
Instead of inserting something into the bucket-water:
try inserting the noun into the bucket.
Dipping it into is an action applying to two things. Understand “dip [something] in/into [something]” as dipping it into.
Check dipping it into:
say “There seems to be no compelling reason for you to do that.”
Instead of dipping the mop into the bucket-water:
try inserting the mop into the bucket.
Instead of dipping the mop into the bucket:
try inserting the mop into the bucket.
Section 3 - Carrying Out the Chore
The floor is a scenery supporter in the Scullery. The floor can be dirty. The floor is dirty. “The floor is [if dirty]filthy[else]sparkling clean[end if].” Understand “dirt” and “dirty” as the floor when the floor is dirty. Understand “sparkling” and “clean” as the floor when the floor is not dirty.
Mopping is an action applying to one thing. Understand “mop [something]”, “clean [something]”, and “scrub [something]” as mopping.
Check mopping:
if the player does not carry the mop:
say “To do that, you would need to be holding a mop.” instead;
else:
say “That is not one of the chores your wicked stepmother has ordered you to do.”
Instead of mopping the floor:
if the floor is not dirty:
say “You have already mopped the floor. It fairly sparkles!”;
else if the player does not carry the mop:
say “To do that, you would need to be holding a mop (preferably wet and soapy).”;
else if the mop is dry:
say “You push the dry mop around on the floor, accomplishing exactly nothing.”;
else if the mop is not soapy:
say “You push the wet mop around on the floor, turning some of the filth into mud but accomplishing very little.”;
else:
now the floor is not dirty;
say “You industriously mop the floor. In a few minutes it’s sparkling clean!”
Mopping it with is an action applying to two things. Understand “mop [something] with [something]”, “clean [something] with [something]”, and “scrub [something] with [something]” as mopping it with.
Check mopping it with:
if the second noun is not the mop:
say “A mop would be a better choice.” instead;
else:
say “[The noun] [is-are] not in need of a scrubbing.” instead.
Instead of mopping the floor with the mop:
try mopping the floor.
Section 4 - The Wicked Stepmother
The wicked stepmother is a person in the Scullery. “Your wicked stepmother is standing here, glaring at you.” The description of the wicked stepmother is “Your wicked stepmother is standing here, her arms folded as she scowls sternly at you.” The indefinite article of the stepmother is “your”. Understand “step”, “ma”, “mom”, and “mother” as the wicked stepmother.
Every turn:
if a random chance of 1 in 4 succeeds:
say “Your wicked stepmother [one of]says, ‘Lazy girl!’[or]growls at you.[or]snorts contemptuously.[or]chuckles nastily.[or]says, ‘Well? What are you waiting for?’[or]picks her teeth with a hatpin.[at random]”.
The stepmother carries a ticket. The description of the ticket is “The ticket is a large rectangle of cardboard on which is printed ‘ADMIT ONE TO THE BALL.’” Understand “large”, “rectangle”, “cardboard”, and “ball” as the ticket. The printed name of the ticket is “ticket to the ball”.
Instead of asking the stepmother for the ticket:
if the floor is dirty:
say “‘Not until you’ve finished your chores, lazy girl!’ your stepmother snaps.”;
else:
now the player carries the ticket;
say “Your stepmother inspects the floor with great care, as if searching in vain for a speck of dirt. ‘Very well,’ she concedes at last, reluctantly handing you the ticket. As your heart bumps for joy, she adds nastily, ‘Not that anyone at the ball will want to dance with you. You reek of onions!’”
Instead of kissing the stepmother:
say “You’d rather kiss a toad.”[/code]