The Four-Eyed Guide to TADS 3 by David Welbourn index

ATTACK singleDobj (WITH singleIobj)


Related actions: BREAK dobjList; STRIKE dobjList.

Default minimal behavior

What do you want to attack?

>attack floor
You cannot attack that.

>attack floor with book
You can't attack anything with the book.

attack matches VerbRule(Attack) which invokes AttackAction. [TODO]

Summary of library references to attacking


Short description


Defines class AttackAction: TAction


Defines class AttackWithAction: TIAction
When "ALL" is used as the indirect object, it is limited to what is in the actor's inventory.

Note: DefineTAction(name) and DefineTIAction(name) are macros defined in adv3.h.

Note: TAction and TIAction are classes defined in action.t.


Short description

objHeld: PreCondition The object must be held. A recursive TAKE command is implied.
touchObj: TouchObjCondition Pre-condition: actor must be able to touch the object.


Short description

Thing.dobjFor(Attack) By default, one can only attack things that one can touch. Also, it makes as much sense to attack an object as any other. Furthermore, most attacks are considered to be pointless or useless, e.g.: 'You cannot attack that.'
Thing.dobjFor(AttackWith) Defined the same as Thing.dobjFor(Attack)
Thing.iobjFor(AttackWith) When attacking with something, it must be held by the actor. Further, it is illogical to attack with most things since they aren't weapons, e.g.: 'You can't attack anything with the book.'


Short description


Does the same as Thing.dobjFor(Attack).


Associates the grammars "attack singleDobj", "kill singleDobj", etc. with AttackAction.


Associates the grammars "attack singleDobj with singleIobj", "kill singleDobj with singleIobj", etc. with AttackWithAction.

Note: VerbRule(tag) is a macro defined in en_us.h.

Note: AttackAction and AttackWithAction are defined in actions.t (see above).


Short description

playerActionMessages.notAWeapon '{You/he} can\'t attack anything with {the iobj/him}. '
playerActionMessages.uselessToAttack '{You/he} cannot attack {that dobj/him}. '