In the following example, containers can have contents that are substances such as liquids and powders. The line “Understand the substance property as describing a fluid container” handily allows commands such as “take sulphur” to be interpreted as referring to the container.
The trick is that you should also be able to refer to a container by the properties of its substance, eg, “take yellow powder.” I can’t figure out how to do that.
[code]The laboratory is a room.
Colour is a kind of value. The colours are normal, white, clear, silver, yellow, red, and black.
Substance is a kind of value. The substances are defined by the Table of Substances.
Table of Substances
Substance Smell Colour Type
water “nothing” clear “liquid”
mercury “nothing” silver “liquid”
sulphur “a faint rotten-egg smell” yellow “powder”
albumen “nothing” clear “thick liquid”
none “nothing” clear “nothing”
A fluid container is a kind of container. A fluid container has a substance. The substance of a fluid container is usually none.
The description of a fluid container is “[if the item described is filled]A container filled with [the colour corresponding to a substance of the substance of the noun in the Table of Substances] [the type corresponding to a substance of the substance of the noun in the Table of Substances].[otherwise]An empty container.[end if]”.
Definition: a fluid container (called the current container) is unfilled rather than filled if the substance of the current container is none.
After printing the name of a fluid container (called the current container):
If the current container is filled:
say " of [substance]".
Understand the substance property as describing a fluid container.
Understand “of” or “full of” as a fluid container.
Rule for printing room description details of a fluid container:
stop.
In the laboratory is a fluid container called a bowl. The substance of the bowl is water.
In the laboratory is a fluid container called a bottle. The substance of the bottle is sulphur.[/code]