Smell restrictions (Inform 7 example)
"Smell example" by David Welbourn
Street is a room. "You are in a street. The sewer is below you."
A flower is here. The description of the flower is "It's just a nice flower. You don't know what type." Instead of smelling the flower, say "It smells wonderful."
A spacesuit is here. It is wearable. Understand "space suit" and "suit" as the spacesuit. The description of the spacesuit is "Spacesuits are wonderful things, but they make EVERYONE look fat."
Before smelling when the player is wearing the spacesuit:
if noun is yourself or the spacesuit, continue the action;
say "You can't smell anything while wearing the spacesuit."; stop the action.
Sewer is below Street. "You are in a sewer. The street is above you."
The sewage is here. It is fixed in place. The indefinite article of the sewage is "some". [see 3.18 about mass noun] The description of the sewage is "Horrible smelly sewage is everywhere in the sewer." Instead of smelling the sewage, say "It reeks."
Before smelling in the presence of the sewage:
if player is wearing the spacesuit, continue the action;
if the noun is the sewage, continue the action;
say "The disgusting reek of the sewage overwhelms your nose. You can't smell anything else."; stop the action.
Test me with "smell / take flower / smell it / take suit / smell it / d / smell / smell sewage / smell flower / wear suit / smell / smell sewage / smell flower / smell suit"