Well, you’re could just recombine elements you’ve already used before.
There are a lot of different ways to do this. For example, you could have an automatic win.
Instead of attacking the zombie while the player holds the gun:
say "BLAM! The zombie's head disappears in a fine mist of blood.";
move the zombie to the Graveyard;
More specific instead rules trump less specific rules, so you could have a yet-more-specific rule if the player is holding the gun and has no ammunition.
This works fine - great, even - for fairly small, isolated scenarios. But what if you want a flamethrower and a gun and a poker, and the player might be carrying some or all of them at any given time? Writing out all the permutations gets confusing pretty fast. So let’s introduce a new kind: weapons.
A weapon is a kind of thing.
Using a new kind allows us to give weapons overall characteristics. For example, all weapons are going to be better at killing something than just punching it. How much more dangerous? Well, there’s a bunch of different ways, again. I’m going to say, though, that the difference is a number out of 100, with 1 being the least lethal (kills 1% of the time) and 100 being the most lethal (kills 100% of the time).
A weapon has a number called lethality.
Okay, so clearly I didn’t tell Inform all that stuff about percentages; that’s for later. Still, though. The other thing I’m going to do is give each weapon its own word. Different weapons attack different ways, and this is a flexible way to personalize messages later on.
A weapon has some text called action_verb.
Now let’s define some weapons. We could do this in a table - I like tables - but I’ll let you do that later if you want.
The fireplace poker is a weapon carried by the player. The lethality of the poker is usually 10. The action_verb of the poker is "poke".
The gun is a weapon in the Basement. The lethality of the gun is usually 50. The action_verb of the gun is "shoot".
The flamethrower is a weapon in the Basement. The lethality of the flamethrower is 100. The action_verb of the flamethrower is "toast".
You can always add/take out weapons as you want.
Let’s decide if the player gets to pick which weapon to kill with. I’m going to say no, although the scenario is expandable if you want it to be. The player character will automatically choose the most dangerous thing s/he is carrying or has stashed in a backpack. How does the game know what that is?
Definition: a weapon is lethal if its lethality is 25 or more.
Definitions dealing with numbers allow you to use some new words to describe things. (See 14.7 in my documentation - Making the Verb “to weigh”.) The awesome thing? Now we can talk about the lethalest weapon. My inner grammarian is not pleased, but now the game can choose the most dangerous weapon with no problem. Now we can easily figure out how lethal the player is, based on what’s being carried. But first, one more definition.
Definition: a person is unarmed rather than armed if it does not enclose a weapon.
This just tidies up the code a bit.
To decide what number is the player lethality:
if the player is unarmed:
decide on 1;
decide on the lethality of the lethalest weapon enclosed by the player;
This is basically the player’s odds, out of 100, of killing something.
Now we’re going to modify the text I gave you before just a little bit.
Instead of attacking zombie:
say "You attack the zombie with [if the player is unarmed]your fists[otherwise][the lethalest weapon enclosed by the player][end if].[paragraph break]";
if a random chance of player lethality in 100 succeeds:
say "You [if the player is unarmed]punch out[otherwise][action_verb of the lethalest weapon enclosed by the player][end if] the zombie!";
move zombie to Graveyard;
say "You miss, and the zombie tears out your throat.";
move player to Graveyard;
We start by saying what the player attacks with. (I used this for testing purposes.) Note the use of the “lethalest weapon enclosed by the player”.
Now remember earlier, when we wrote that phrase to figure out how dangerous the player was? That’s what “a random chance of player lethality in 100” is: out of 100, what’s the percent odds that the player will kill? This is just like “a random chance of 1 in 2” except one of the numbers is determined based on the game state.
This is just an initial stab, since I have no idea what you’re looking for, but it introduces some chance of success in any scenario, and complete success with a flamethrower. Just like real life.
This could be way less or way more complicated, depending on what you want done.