Taking a shower

How to make ‘taking a shower’ an action?

1 Like

The simplest solution is something like this:

Bathing is an action applying to nothing. Understand "take a/-- shower/bath" as bathing.

Report an actor bathing (this is the block bathing rule):
	say "Right here? Now? In the middle of a game?"

You can then add check rules and carry out rules to fit whatever you intend the action to do.

2 Likes

I gave an attempt at coding something for this in Inform7, your mileage may vary :slightly_smiling_face:

The scene takes place in a bathroom with a shower. In the bathroom with you is Dr. Doolittle and a small puppy covered in mud. Showering the puppy or taking a shower with the puppy washes the mud off of the puppy. Attempting to shower with the doctor or shower the doctor results in the doctor declining your offer in both cases with slightly differing results. Before and After is used to address pre/post action conditional outcomes.


Toilet Brush is a thing.  The description is "A white toilet brush.".

Doctor Doolittle is a person.  The description is "A local veterinarian dress in a white coat and black pants.".

Brown Puppy is a thing.  The description is "A small brown puppy that is covered with mud.".

Shower is a thing.  The description is "A metal and glass stand-up shower.".
 
Bathroom is a room.  The description is "This is a clean bathroom with a shower.".  The Brown Puppy is in the Bathroom.  The  Doctor Doolittle is in the bathroom.  The Shower is scenery in the Bathroom.  The Toilet Brush is in the Bathroom.

Showering is an action applying to one thing.
Togethershowering is an action applying to one thing.

Understand "Doolittle", "Dr", "Doctor", and "Dr Doolittle" as Doctor Doolittle.
Understand "shower", "give shower to [something]", "take shower", "shower the [something]",  and "shower [something]" as showering.

Understand "take shower with [something]" and "shower with [something]" as togethershowering.

Rule for supplying a missing noun while showering:
    now the noun is the player.

Before showering:
	if the noun is the player:
		say "You change into a bathing suit and get into the shower. [run paragraph on]";
		continue the action;
	otherwise if the noun is a Brown Puppy:
		say "You attempt to carefully help the [noun] get into the shower as it barks and frolicks trying to evade you.  Finally you manage to get the puppy into the shower. [run paragraph on]";
		continue the action;
	otherwise if the noun is a person:
		say "[Noun] looks at you dubiously and declines your offer.";
		stop the action;
	otherwise:
		say "You can't shower that!";
		stop the action.	

Before togethershowering:
	if the noun is a person:
		say "You carefully help [noun] get into the shower.  [noun]  (fully clothed) looks at you confused but goes along with your plan for the time being.  After changing into a bathing suit you enter the shower with [noun]. [run paragraph on]";
		continue the action;
	otherwise if the noun is a Brown Puppy:
		say "You attempt to carefully help the [noun] get into the shower as it barks and frolicks trying to evade you.  Finally you manage to get the puppy into the shower.  After changing into a bathing suit you enter the shower with the [noun]. [run paragraph on]";
		continue the action;
	otherwise:
		say "You can't shower with that!";
		stop the action.
	 
Instead of showering:
	if the noun is the player:
		say "You gently shower [noun]. [run paragraph on]";
	otherwise if the noun is a Brown Puppy:
		say "You gently shower the [noun] washing away the mud.  The puppy looks happy to be clean. [run paragraph on]";
		now the description of Brown Puppy is "A sparkling clean small brown puppy.";
	continue the action.
	
Instead of togethershowering:
	if the noun is a person:
		say "[noun] looks at you, perplexed by your actions.  It is clear that [noun] is not interested in showering with you at this time.  [noun] exits the shower.";
		stop the action;
	otherwise if the noun is a Brown Puppy:
		say "You get in the shower with the [noun] and help to wash away the mud, cleaning yourself up in the process.  The puppy looks happy to be clean. [run paragraph on]";
		now the description of Brown Puppy is "A sparkling clean small brown puppy.";
	continue the action.

After showering:
	if the noun is the player:
		say "You dry off and put on fresh clothes. Now that you are all cleaned up you feel ready to take on the world!";
	otherwise:
		say "Now that the [noun] is all cleaned it appears prepared to take on the world!".
		
After togethershowering:
	say "You dry off the [noun] followed by yourself.  Now that everyone is clean you both feel ready to take on the world!".

Here is an example of how the code plays out:

Bathroom
This is a clean bathroom with a shower.

You can see Toilet Brush, Doctor Doolittle and Brown Puppy here.

>look at puppy
A small brown puppy that is covered with mud.

>shower
You change into a bathing suit and get into the shower. You gently 
shower yourself. You dry off and put on fresh clothes. Now that 
you are all cleaned up you feel ready to take on the world!

>shower puppy
You attempt to carefully help the Brown Puppy get into the shower 
as it barks and frolicks trying to evade you.  Finally you manage to 
get the puppy into the shower. You gently shower the Brown Puppy 
washing away the mud.  The puppy looks happy to be clean. Now 
that the Brown Puppy is all cleaned it appears prepared to take on 
the world!

>shower doolittle
Doctor Doolittle looks at you dubiously and declines your offer.

>shower brush
You can't shower that!

>shower with puppy
You attempt to carefully help the Brown Puppy get into the shower 
as it barks and frolicks trying to evade you.  Finally you manage to 
get the puppy into the shower.  After changing into a bathing suit 
you enter the shower with the Brown Puppy. You get in the shower 
with the Brown Puppy and help to wash away the mud, cleaning 
yourself up in the process.  The puppy looks happy to be clean. 
You dry off the Brown Puppy followed by yourself.  Now that 
everyone is clean you both feel ready to take on the world!

>shower with doolittle
You carefully help Doctor Doolittle get into the shower.  Doctor 
Doolittle (fully clothed) looks at you confused but goes along 
with your plan for the time being.  After changing into a bathing 
suit you enter the shower with Doctor Doolittle. Doctor Doolittle 
looks at you, perplexed by your actions.  It is clear that Doctor 
Doolittle is not interested in showering with you at this time.  
Doctor Doolittle exits the shower.

>shower with brush
You can't shower with that!

>look at puppy
A sparkling clean small brown puppy.
1 Like

Thank you for the response! What would I have to add to the code so that an event happens If the shower is taken?

1 Like

This is a good spot for Instead of taking the shower: try showering. - or whichever action applies.

To debug this, type ACTIONS while play testing the game in the IDE and try all different commands. The IDE will detail what action results from your commands.

1 Like

I updated the code with Before / After cases for showering and together showering in my original post above. This allows you to conditionally specify outcomes before and after a shower is taken. For example:

Before showering:
	if the noun is the player:
		say "You change into a bathing suit and get into the shower. [run paragraph on]".

After showering:
	if the noun is the player:
		say "You dry off and put on fresh clothes. Now that you are all cleaned up you feel ready to take on the world!".
	
1 Like