Those can all be done. One thing to note is that there’s a built-in action called “attacking,” invoked by the command “attack foo” (or “hit foo,” “kill foo,” and several other things), whose default behavior is to print “Violence isn’t the answer to this one.” Which we don’t want to say, because violence usually is the answer.
[rant]"“This violence doesn’t solve anything!” “But that’s what violence does best!”[/rant]
So we find the rule that does this and remove it, thus:
The block attacking rule is not listed in the check attacking rulebook.
(You can do this by looking under the “commands” index for the command “attack”; it tells you that it translates to the attacking action, and if you look up that action, you can see that one of the rules governing it is the block attacking rule. Clicking on the little block next to “unlist” automatically drops the above text into your source.)
Now we have to make “attack foo” redirect to attacking it with a weapon, if you have one:
Instead of attacking something:
if the player does not carry the revolver:
say "You don't have anything to attack [the noun] with!";
otherwise:
try attacking the noun with the revolver.
If you implement more than one weapon, you’ll have to change this code so that it checks if the player holds any weapon at all, and you’ll have to figure out a way for this to pick a weapon for you. Also, if you’ve got any timed challenges in here, it’ll be polite to make sure that things like the “if the player does not carry the revolver” case don’t make the timer click down – if the player is supposed to “attack dero with revolver” or die, and “attack dero” kills them, they won’t be pleased.
This automatically takes care of “attack,” because Inform asks “what do you want to attack?”
To take care of “attack with revolver,” we can define another action, and have that action redirect to attacking a random dero with whatever was specified:
[code]Attacking blindly with is an action applying to one thing. Understand “attack with [something]” as attacking blindly with.
Check attacking blindly with when no dero is in the location:
say “There’s nothing to attack here.” instead.
Check attacking blindly with when the noun is not a revolver:
say “[The noun] is not a weapon!” instead.
Carry out attacking blindly with:
if a dero is in the location:
try attacking a random dero in the location with the noun;
otherwise:
say “There’s nothing to attack here.” [This should never happen, because the check rule should already have stopped this case.][/code]
I think you’ll find that all the ways of attacking the dero increment Juhana’s counter the way you want – you’ll get the messages in order – because every successful attempt ultimately redirects to the action “attacking the dero with the revolver.” (BTW, we didn’t include anything that specifies that you have to be holding the weapon! As it stands, you can attack the dero with the revolver even when the revolver is on the floor. You’d want to include a check for that.)
UPDATE: Whoops, you want different dummy responses. That should be possible – just don’t say “try attacking a random dero in the location with the noun,” but instead make the rules for these actions print your dummy responses.