Measured Liquid
version 4 by Emily Short
Part 6 - Drinking
The block drinking rule is not listed in any rulebook.
The drinking action has a liquid called the liquid drunk.
Setting action variables for drinking something (this is the setting liquid drunk rule):
if the noun is a fluid container:
now the liquid drunk is the liquid of the noun.
A fluid container can be preferred for drinking. A fluid container is usually not preferred for drinking.
Does the player mean drinking a preferred for drinking fluid container (this is the preferential drinking rule):
it is very likely.
Does the player mean asking someone to try drinking a preferred for drinking fluid container (this is the preferential asking to drink rule):
it is very likely.
Understand "drink from [fluid container]" as drinking.
Check an actor drinking a closed fluid container (this is the can't drink from closed sources rule):
if the player is the actor:
say "(first opening [the noun])[command clarification break]";
silently try opening the noun;
if the noun is closed:
stop the action.
Check an actor drinking something which is not carried by the actor (this is the prefer to carry drink sources rule):
if the noun is fixed in place or the noun is scenery or the noun is part of something:
make no decision;
otherwise:
if the player is the actor:
say "(first taking [the noun])[command clarification break]";
silently try the actor taking the noun.
Check an actor drinking something which is not a fluid container (this is the can't drink things that aren't fluids rule):
if the player is the actor:
say "[The noun] [is-are]n't suitable to drink." instead;
stop the action.
Check an actor drinking an empty fluid container (this is the can't drink from empty containers rule):
if the player is the actor:
if the liquid of the noun is nonliquid:
say "[The noun] [is-are] completely empty." instead;
otherwise:
say "There is no more [liquid drunk] in [the noun]." instead;
stop the action.
Definition: a fluid container is undrinkable:
if the liquid of it can be drunk:
no;
yes.
Check an actor drinking an undrinkable fluid container (this is the can't drink noxious containers rule):
if the actor is the player:
say "The [liquid drunk] [is-are]n't something you can drink." instead;
stop the action.
Use variable sip size translates as (- Constant VARIABLE_SIP; -).
Carry out an actor drinking a fluid container (this is the standard drinking fluids rule):
let swallowed amount be the sip size;
if the variable sip size option is active:
let max variation be ( sip size * 2) / 3;
let variation be a random volume between null volume and max variation;
if a random chance of 1 in 2 succeeds:
increase swallowed amount by variation;
otherwise:
decrease swallowed amount by variation;
if the noun is emptyable:
decrease the fluid content of the noun by the swallowed amount;
if the fluid content of the noun is less than null volume:
now the fluid content of the noun is null volume;
if the noun is empty and the no trace amounts option is active:
now the liquid of the noun is nonliquid.
Report drinking a fluid container (this is the standard report drinking rule):
say "You take a sip of [the liquid drunk][if the noun is empty], leaving [the noun] empty[end if]";
if the flavor of the liquid of the noun is not "":
say ". [flavor of the liquid drunk][paragraph break]";
otherwise:
say "."
Report someone drinking a fluid container (this is the standard report someone drinking rule):
say "[The actor] take[s] a sip of [the liquid drunk][if the noun is empty], leaving [the noun] empty[end if]."
Check an actor tasting an undrinkable fluid container (this is the can't taste noxious containers rule):
if the actor is the player:
say "The [liquid drunk] [is-are]n't something you can drink." instead;
stop the action.
Check tasting a closed fluid container (this is the can't drink from shut containers rule):
if the actor is the player:
say "(first opening [the noun])[command clarification break]";
silently try opening the noun;
if the noun is closed:
stop the action.
Check tasting a fluid container (this is the report flavors of drinks rule):
if the flavor of the liquid of the noun is not "":
say "[flavor of the liquid of the noun][paragraph break]" instead;
[And to deal with the case where there might be multiple empty containers lying around: ]
Does the player mean drinking an empty fluid container (this is the discourage pointless drinks rule):
it is very unlikely.