Another way is:
A thing can be flammable.
A thing can be used.
That just allows you to assign that adjective to certain things instead of every object in the game. That can become important in a large story with hundreds of objects.
This is close to the exact opening I wrote for Psychomanteum (in darkness holding matches and needing to light a candle). Here’s an example implementation for you:
[rant=code][code]Cave is a room. “Oooh, spooky cave. Shadows of stalactites and stalagmites like sharp teeth waver in the flickery glow.” It is dark.
a thing can be flammable.
a thing can be used.
a match is a kind of thing.
a match is usually flammable.
a safety match is a kind of match. The player carries three safety matches.
a lamp is a thing held by the player.
striking is an action applying to one thing.
understand “strike [something]” as striking.
Check striking:
if the noun is not flammable:
say “[The noun] won’t ignite on its own.” instead.
Instead of burning a flammable thing:
try striking the noun.
Check striking:
if the noun is used:
say “[The noun] [have] already been burnt.” instead.
Carry out striking:
now the noun is lit.
Report striking:
say “[The noun] ignites with a bright flame.”
Every turn when a match is lit:
repeat with flame running through lit matches:
if a random chance of 1 in 2 succeeds:
now flame is not lit;
now flame is used;
move flame to the location;
say “[The flame] goes out.”
The block burning rule does nothing when the noun is the lamp.
Check burning the lamp:
if the player cannot touch a lit match:
say “You’ll need a lit match to light the lamp.” instead.
Check burning the lamp:
if lamp is lit:
say “You’ve already lit the lamp.” instead.
Carry out burning the lamp:
now the lamp is lit;
now a random touchable lit match is off-stage;
say “You carefully light the lamp with the lit match. After doing so, you shake out the used match and throw it away.”
Report burning the lamp:
say “Your lamp now glows steadily as a light source!”
Carry out looking (this is the oops out of matches rule):
if every match is used:
if in darkness:
say “Ah shucks…you’ve used all your matches. You pat yourself down looking for that extra matchbook you keep for emergencies… Aha!”;
now the player carries every match;
now every match is not used.[/code][/rant]