A_TroopAttack

From ZDoom Wiki
Jump to navigation Jump to search
Ktip.png This page describes a function made for one of the natively supported games. These functions are made with very specific purpose and provide no flexibility, so using them in custom projects is not recommended. Authors are encouraged to use one of the more generalized functions in custom projects. For example: A_CustomComboAttack.
DoomWiki.org
For more information on this article, visit the A_TroopAttack page on the Doom Wiki.

A_TroopAttack

(no parameters)


The attack of Doom's imp. This either shoots a DoomImpBall or, if the target is sufficiently close, it plays the sound "imp/melee" and performs a melee attack with a base damage of 3 multiplied by a random value between 1 and 8.


The behavior of this function can be replicated by the use of A_CustomComboAttack in the following manner:

A_CustomComboAttack("DoomImpBall", 32, 3 * random(1, 8), "imp/melee")

Examples

This example is taken straight from Doom's Imp.

 Missile:
   TROO EF 8 A_FaceTarget;
   TROO G 6 A_TroopAttack; // See DoomImpBall
   goto See;