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 (aka. Sergeant). A similar situation exists with A_TroopAttack.
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|
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