A_VileAttack

From DoomWiki.org

Revision as of 23:44, 12 January 2024 by Gregor (talk | contribs) (further tweak)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

An arch-vile attacking an imp, displaying the animation frame on which it calls the A_VileAttack code pointer, VILEO. The dying imp is thrust upwards and away from the arch-vile.

A_VileAttack is a code pointer used in the attack animation for the arch-vile.

If the target of the arch-vile is in its line of sight at the moment A_VileAttack is executed, the arch-vile emits the DSBAREXP sound (the same sound that is used for barrel and rocket explosions), while its target has 20 damage applied to it as well as a vertical thrust that results in an upward velocity of (1000 divided by the mass of the target) map units per tic. However, since the Doom engine also applies a downward acceleration of one map unit per tic per tic (one map unit per tic2) to every object that has a vertical momentum and is affected by gravity, the maximum height the target will be lifted off the floor is limited by how many tics it takes gravity to decrease the target's upward velocity back to zero. (For example, the player has a mass of 100, which results in an upward velocity of ten map units per tic on the first tic of the upwards thrust, which gravity then reduces to a velocity of nine map units per tic on the second tic, eight map units per tic on the third tic, and so on; this limits the maximum height the player is lifted off the floor by the vertical thrust to 55 map units, since gravity will have decreased the player's upward velocity to zero after ten tics (10+9+8+7+6+5+4+3+2+1=55).)

If the target also has the arch-vile's flame object attached to them (first set through the A_VileTarget code pointer and then continuously updated in its position by the A_Fire code pointer the flame object calls on each of its states), an explosion will be triggered at the position of the flame object—which is always positioned between the target and the arch-vile at 24 map units away from the target's origin—imparting horizontal momentum and 70 blast damage.

Uses[edit]

The A_VileAttack code pointer appears in the following states in Doom's state table:

Example[edit]

The following is an example of how to set the A_VileAttack code pointer in a DeHackEd file:

Pointer 21 (Frame 34)
Codep Frame = 264

Or using BEX syntax:

[CODEPTR]
Frame 1234 = VileAttack

External links[edit]