How to stop default messages...

I have a problem. I want it so that when the player attempts to attack a troll without a weapon, it displays the message “You don’t have a weapon to attack the troll with!” So far I have this:

[code]Weapon is a kind of thing.

A dagger is here. It is weapon. “A rusty dagger lies on the ground.” The description is “The dagger is rusty, but seems like it can still cut.”

Monster is a kind of thing. It is not portable.

A troll is here. It is monster. “A troll glares at you.”

Check attacking troll:
if a weapon is not carried by the player:
say “You don’t have a weapon to attack the troll with!”[/code]

Anyway, when I attack it without a weapon, I get this:

Is there some way I could get rid of this default message? It’s REALLY misleading, seeing as violence IS the answer to this part, just violence with a weapon. :wink:

THANKS IN ADVANCE!

A check rule will allow the normal behavior to go ahead unless you do this:

Check attacking troll: if a weapon is not carried by the player: say "You don't have a weapon to attack the troll with!"; stop the action;
Or, for terser code with an identical effect, you can use an Instead rule:

Instead of attacking the troll when a weapon is not carried by the player: say "You don't have a weapon to attack the troll with!"

If you’re going to allow attacking other things, you might want to flesh out the attacking action more broadly, like:

[code]Check attacking:
if a weapon is not carried by the player:
say “You don’t have a weapon to attack [the noun] with!” instead;
if the noun is not a monster:
say “You only slay denizens of the night.” instead.

After attacking:
say “You stab wildly at [the noun] with [the random weapon carried by the player].”

The block attacking rule is not listed in the check attacking rulebook.
[/code]

It’s worth mentioning an option of intermediate verbosity:

Check attacking troll:
   if a weapon is not carried by the player:
      instead say "You don't have a weapon to attack the troll with!";

This use of “Instead say…” means exactly “say …; stop the action.”

Huh. Somehow I never realized you could prepend “instead” onto a phrase, rather than simply append it.

Also, the if statement should probably be rephrased to “unless the player carries a weapon:” since otherwise it will be true only if A) there are no weapons defined in the source or B) every weapon is carried by the player.

Also, now I think of it, that condition is the wrong way around. ‘A weapon is not carried by the player’ will be true if there exists at least one weapon that the player does not carry. What you need is ‘the player does not carry a weapon’.

(edit – looks as if Chris got to this before I did. Either he edited after posting, or I somehow spaced it.)