Hit; attack

I defined a hatch as a doorway and a clasp as part of the hatch. I defined a cricket bat as a thing.

A cricket bat is a thing.

The clasp is part of the hatch.

Instead of attacking clasp with cricket bat:
say “You hit the clasp with the bat, knocking it off. The hatch swings open.”;
now hatch is open.

Problem message:

Problem. You wrote ‘Instead of attacking hatch with cricket bat’ , which seems to introduce a rule taking effect only if the action is ‘attacking hatch with cricket bat’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.

As far as I know, attacking is defined by Inform as a verb that only takes a noun: “attack A” rather than “attack A with B”.

That worked. Many thanks.

If you want to use the cricket bat, you need to set up a new action. I’m almost certain there’s an example in the recipe book specifically about “attacking with”.