Smell restrictions (Inform 6 example)
From IFWiki
Constant Story "Smell restrictions example"; Constant Headline "^By David Welbourn for IFWiki^"; Release 1; Constant MAX_SCORE = 0; Constant DIALECT_US = 1; Constant DEATH_MENTION_UNDO; Include "Parser"; Include "VerbLib"; Object Street "Street" with description "You are in a street. The sewer is below you.", d_to Sewer, has light; Object flower "flower" Street with name 'flower', description "It's just a nice flower. You don't know what type.", before [; Smell: "It smells wonderful."; ]; Object spacesuit "spacesuit" Street with name 'spacesuit' 'suit', description "Spacesuits are wonderful things, but they make EVERYONE look fat.", react_before [; Smell: if (self hasnt worn) rfalse; if (noun == player or spacesuit) rfalse; "You can't smell anything while wearing the spacesuit."; ], before [; Smell: "You smell nothing unusual about the spacesuit."; ], has clothing; Object Sewer "Sewer" with description "You are in a sewer. The street is above you.", u_to Street, has light; Object sewage "sewage" Sewer with name 'sewage', article "some", description "Horrible smelly sewage is everywhere in the sewer.", react_before [; Smell: if (spacesuit has worn) rfalse; if (noun == 0 or self) "It reeks."; "The disgusting reek of the sewage overwhelms your nose. You can't smell anything else."; ], has static; [ Initialise; location = Street; score = 0; ]; Include "Grammar";