I scanned through similar problems and found them to be much more complicated than what I am trying to do. I want to allow the player to blow out any or all of three lanterns, but using a generalized rule. I read through the Zorn of Zorna (#347) example in the documentation and couldn’t make heads or tails of it. Multiple candles can be lit or unlit, but they are treated like one candle? I want to light or blow out lanterns without specifying them exactly. The following code works but is egregious:
A lantern is a kind of thing. A lantern is either lit or unlit.
Description of generic lantern is "A glass-enclosed wick on a metal reservoir of some kind. On the reservoir is a hand-written note in large block letters: [line break]DANGER: DO NOT EXTINGUISH.[line break]".
The south lantern is in the embalming room. "[if lit]A lantern shines on a cabinet along the south wall.[else]The south lantern sits in darkness.".
The north lantern is in the embalming room. "[if lit]A lantern shines on a cabinet along the north wall.[else]The north lantern sits in darkness.".
The west lantern is in the embalming room. "[if lit]A lantern shines on a cabinet along the south wall.[else]The west lantern sits in darkness.".
The south lantern is lit.
The north lantern is lit.
The west lantern is lit.
Instead of looking when embalming room is dark:
say "Without the lanterns, it is too dark to see anything. [line break]Do you smell something?".
Description of south lantern is "[description of generic lantern][if lit]A flame flickers within the glass[else]The charred wick sheds no light.".
Description of north lantern is "[description of generic lantern][if lit]A flame flickers within the glass[else]The charred wick sheds no light.".
Description of west lantern is "[description of generic lantern][if lit]A flame flickers within the glass[else]The charred wick sheds no light.".
Definition: Embalming room is dark if north lantern is unlit and south lantern is unlit and west lantern are unlit.
[Instead of blowing out something:
if [the noun] is unlit:
say "That lantern is already out.";
stop the action;
otherwise:
now [the noun] is unlit;
say "You put out [the noun]. A small thread of smoke rises as the wick cools.";
]
Blowing out is an action applying to one thing.
Understand "blow out [something]" or "extinguish [something]" or "put out [something]" as blowing out.
Instead of blowing out west lantern:
if the west lantern is unlit:
say "That lantern is already out.";
stop the action;
otherwise:
now the west lantern is unlit;
say "You put out [the noun]. A small thread of smoke rises as the wick cools.";
Instead of blowing out north lantern:
if the north lantern is unlit:
say "That lantern is already out.";
stop the action;
otherwise:
now the north lantern is unlit;
say "You put out [the noun]. A small thread of smoke rises as the wick cools.";
Instead of blowing out south lantern:
if the south lantern is unlit:
say "That lantern is already out.";
stop the action;
otherwise:
now the south lantern is unlit;
say "You put out [the noun]. A small thread of smoke rises as the wick cools.";
Isn’t there something simpler?
Note the commented code block about "Instead of blowing out something…] which does not work.