A_VileChase
From DoomWiki.org
A_VileChase is a code pointer used in the normal animation for the arch-vile.
Each time A_VileChase
is called, it calculates the blockmap area to be searched and calls PIT_VileCheck
for each of the entities inside this area to determine if it is a corpse that can be resurrected. To pass the check, an object must fulfill several conditions: it must have the MT_CORPSE flag set, designating it as a corpse; its current animation frame must have a duration of -1 (meaning it lasts indefinitely); it must have a raise state (arch-viles, lost souls, cyberdemons and spider masterminds lack such a state); it must be no further away than its own radius plus the radius of the monster calling A_VileChase
(meaning their collision boxes must touch); and it must be inert and positioned in a location where it can be resurrected, and that is not also currently occupied by another actor, like the player or a monster. If all these conditions are met, A_VileChase
will set the found corpse as a temporary target and call A_FaceTarget
. After this, it switches back to the previous target (player, monster or none) and jumps the monster performing the resurrection to its S_VILE_HEAL1 state, the first state of the arch-vile's heal sequence. This state (#266) and its associated animation frame (VILE[) are hard-coded to be transitioned to after A_VileChase
initiates A_FaceTarget
. After this, the target emits the gibbing sound (DSSLOP), and its raise state is triggered. The target's health, height, radius and flags are all set to their default values, placing it in its spawn state. In the case of the arch-vile, once it has finished its heal sequence, it will return to the beginning of its walk state, calling A_VileChase
again.
If A_VileChase
fails to find a corpse to resurrect, it will transition to A_Chase
instead.
Uses[edit]
The A_VileChase
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
243 | S_VILE_RUN1 | normal animation for the arch-vile |
244 | S_VILE_RUN2 | normal animation for the arch-vile |
245 | S_VILE_RUN3 | normal animation for the arch-vile |
246 | S_VILE_RUN4 | normal animation for the arch-vile |
247 | S_VILE_RUN5 | normal animation for the arch-vile |
248 | S_VILE_RUN6 | normal animation for the arch-vile |
249 | S_VILE_RUN7 | normal animation for the arch-vile |
250 | S_VILE_RUN8 | normal animation for the arch-vile |
251 | S_VILE_RUN9 | normal animation for the arch-vile |
252 | S_VILE_RUN10 | normal animation for the arch-vile |
253 | S_VILE_RUN11 | normal animation for the arch-vile |
254 | S_VILE_RUN12 | normal animation for the arch-vile |
Example[edit]
The following is an example of how to set the A_VileChase
code pointer in a DeHackEd file:
Pointer 21 (Frame 34) Codep Frame = 254
Or using BEX syntax:
[CODEPTR] Frame 1234 = VileChase
External links[edit]
- A_VileChase in the Doom source code.
- A_VileChase at the ZDoom wiki
- VileChase at the Eternity Engine wiki