Celadon
Example 224
★By default, Inform only lets the player drop those things which he is carrying -- that is, those directly in his possession. Things inside satchels or on portable trays have to be taken first.
If we want to change this behavior, we might add a dropping rule that distinguishes between carrying and mere enclosure (introduced back in "The location of something" in the chapter on Things):
"Celadon"
The Tea Room is a room. The player carries a black lacquer tray. The lacquer tray is portable. On the lacquer tray are a celadon teapot and a napkin.
Before dropping something:
if the player does not carry the noun and the player encloses the noun:
say "(first taking [the noun] from [the holder of the noun])[command clarification break]";
silently try taking the noun;
if the player does not carry the noun, stop the action.
Instead of taking the napkin:
say "It seems to be stuck to the tray, possibly by an underlying wad of gum."
Test me with "i / drop teapot / i / look / drop teapot / drop napkin / i / drop tray".
Test me with "i / drop teapot / i / look / drop teapot / drop napkin / i / drop tray".
Tea Room
>(Testing.)
>[1] i
You are carrying:
a black lacquer tray
a celadon teapot
a napkin
>[2] drop teapot
(first taking the celadon teapot from the black lacquer tray)
Dropped.
>[3] i
You are carrying:
a black lacquer tray
a napkin
>[4] look
Tea Room
You can see a celadon teapot here.
>[5] drop teapot
The celadon teapot is already here.
>[6] drop napkin
(first taking the napkin from the black lacquer tray)
It seems to be stuck to the tray, possibly by an underlying wad of gum.
>[7] i
You are carrying:
a black lacquer tray
a napkin
>[8] drop tray
Dropped.
>(Testing.)
>[1] i
You are carrying:
a black lacquer tray
a celadon teapot
a napkin
>[2] drop teapot
(first taking the celadon teapot from the black lacquer tray)
Dropped.
>[3] i
You are carrying:
a black lacquer tray
a napkin
>[4] look
Tea Room
You can see a celadon teapot here.
>[5] drop teapot
The celadon teapot is already here.
>[6] drop napkin
(first taking the napkin from the black lacquer tray)
It seems to be stuck to the tray, possibly by an underlying wad of gum.
>[7] i
You are carrying:
a black lacquer tray
a napkin
>[8] drop tray
Dropped.