A VileChase

A_VileChase is a code pointer used in the normal animation for the arch-vile.

Each time  is called, it searches the blockmap area for inert objects and calls   for each of these entities 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 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   (meaning their collision boxes must touch); and it must be 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,  will set the found corpse as a temporary target and call. After this, it will jump to the resurrecting monster's state, the first state of the arch-vile's heal sequence. This state (frame 266) and its associated sprite are hard-coded to be transitioned to after   initiates. After this, the target emits the gibbing sound, and its raise state is triggered. The targets health, height, radius and flags are all set to their default values, placing it in its spawn state. Once the resurrecting monster has finished its heal sequence, it switches back to its previous target (either the player or another monster it was infighting).

If  fails to find a corpse to resurrect, it will transition to   instead.

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

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

Pointer 21 (Frame 34) Codep Frame = 254

Or using BEX syntax:

[CODEPTR] Frame 1234 = VileChase