A_SargAttack
From DoomWiki.org
A_SargAttack is a code pointer used in the melee attack animation for the spectre and demon.
A_SargAttack
implements the demon's bite attack where the monster does a random amount of damage to its target provided that it is within melee range of the target. If it is not, or if it has no target, nothing happens. Internally A_FaceTarget is also called.
The naming of this function is a somewhat confusing artifact of Doom's development where the demons were initially known as "demon sergeants" before the addition of the shotgun guy (a.k.a. former human sergeant). A similar situation exists with A_TroopAttack.
Contents
Uses[edit]
The A_SargAttack
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
487 | S_SARG_ATK3 | melee attack animation for the spectre and demon |
Example[edit]
The following is an example of how to set the A_SargAttack
code pointer in a DeHackEd file:
Pointer 21 (Frame 34) Codep Frame = 487
Or using BEX syntax:
[CODEPTR] Frame 1234 = SargAttack
Code structure[edit]
The following call graph shows the code structure of the A_SargAttack
function. Compare with the structure of A_TroopAttack which has both a melee and a ranged attack; the functions in common are the P_CheckMeleeRange
and P_DamageMobj
functions.
External links[edit]
- A_SargAttack in the Doom source code.
- A_SargAttack at the ZDoom wiki
- SargAttack at the Eternity Engine wiki