Hello, all:
I’ve been using Inform 7 on and off for a couple of years now and this is something I’ve thought for a long time but have never written it – the documentation for how to code Inform is horrible.
That being said, can someone help me with the coding for a scene? The circumstances are:
when dynamite is lit, scene begins
scene ends after four turns
scene can end multiple ways: one, the character blows his hand off (ending the game); two, the character blows up the fish (which is the desired ending), third, the character blows nothing up, it just explodes harmlessly on the ground.
The code below doesn’t work, it’s a mixture of different iterations. I can’t get the compiler to like it:
bangbang is a scene.
bangbang begins when dynalit is 4.
Every turn during bangbang:
decrease dynalit by 1.
bangbang ends in failure:
if dynalit is 0:
if player is carrying litdyanamite;
end if;
end if.
when bangbang ends in failure:
say “The dynamite blows up in your hand! You are started when you see fragments of bones and flesh scatter around you until a split second you feel the pain of getting your hand blown off. I think that…yes, I was afraid of that…[paragraph break]* * * * * YOU HAVE DIED * * * * *”;
end the game finally.
bangbang ends in success when fishies is 1.
when bangbang ends in success:
now litdynamite is nowhere;
now matchflag is 0;
now fishies is 4;
say “There is a brief moment of hush followed by a huge explosion! Water sprays up into the air, reddened by fish blood and chunks of trout like buckshot. There is the sickening pitter-patter of fish flesh as it lands on the wooden bridge.”;
increase score by 1;
when bangbang ends:
now litdynamite is nowhere;
say “The dynamite explodes, shockingly loud in the silence of your subconscious. Instinctively, you shield your eyes and when you recover from the shock of the noise you discover with some measure of satisfaction that you have managed to blow a hole in some part of the world. I suppose now you can die feeling fulfilled.”