I came up with a couple of ways and wrote a demo using each one.
In this demo, you’re in a room with a bomb. When you jump, the bomb is set and you have 1 turn to type ‘sing’ to disarm it. Whether you disarm it or get blown up, you can keep playing and testing.
The first demo uses an event but will allow the player extra turns to type the right thing if they invoke parser errors. The second demo is more aggressive and will blow them up next turn if they do anything at all but type ‘sing’. The method I use in the 2nd demo may not be applicable if the command needed to get out of the sticky situation is very complicated or needs lots of variations, as it’s kind of raw. But you can see how these work and if they suit.
Method 1: (Allows another turn for parser errors.)
[code]“Dude Ranch Bomb” by Wade Clarke.
There is a room called Dude Ranch.
defuser is a number variable.
a bomb is a thing. it is in dude ranch. it is fixed in place.
When play begins:
say “HOW TO PLAY: Type JUMP to set off the bomb.”
Instead of jumping when defuser is 0:
the world ends in 1 turn from now;
say “Type SING right now to defuse the bomb, or you’ll die.”;
now defuser is 1.
At the time when the world ends:
if defuser is 1:
say “KABOOM! You died! Fortunately I have brought you back to life. JUMP again to reawaken the bomb.”;
now defuser is 0;
try looking.
Instead of singing:
say “La la la!”;
if defuser is 1:
now defuser is 0;
say “Your singing disarmed the bomb.”[/code]
Method 2: (doesn’t allow for parser errors)
[code]“Dude Ranch Bomb” by Wade Clarke.
There is a room called Dude Ranch.
defuser is a number variable.
a bomb is a thing. it is in dude ranch. it is fixed in place.
When play begins:
say “HOW TO PLAY: Type JUMP to set off the bomb.”
Instead of jumping when defuser is 0:
say “Type SING right now to defuse the bomb, or you’ll die.”;
now defuser is 1.
Instead of singing:
say “La la la!”;
if defuser is 1:
now defuser is 0;
say “Your singing disarmed the bomb.”
After reading a command:
if defuser is 1 and the player’s command does not match “sing”:
say “KABOOM! You died! Fortunately I have brought you back to life. JUMP again to reawaken the bomb.”;
now defuser is 0;
try looking;
reject the player’s command. [if we don’t reject the player’s command, whatever they did type will be tried right now.][/code]