A_FogSpawn

From ZDoom Wiki
Jump to navigation Jump to search

A_FogSpawn
(no parameters)

Decrements the calling actor's special1 field and does nothing if this value is still positive.

Otherwise, reset this field to the value from the calling actor's args[2] field. This value therefore serves as a frequency control on an inverse scale: the larger the value, the less often will calls to this function spawn anything.

Randomly spawns at the calling actor's position a small, medium or large fog patch.

The patch is given an angle corresponding to the spawner's angle plus a random deviation computed from the spawner's args[1] field: each point of args[1] corresponds to a maximum of about 0.7° of deviation either clockwise or counterclockwise.

In addition, the patch is also given values for its args[] and special2 fields which are meant to influence how the patch moves and how long it lives, see A_FogMove for further information on how fog patches react to these arguments:

Fog patch Set value Note
args[0] randomly between 1 and the spawner's args[0]+1 Controls speed
args[3] spawner's args[3] Controls lifetime
args[4] 1 Flags the fog patch as moving
special2 randomly between 0 and 63 Used for vertical bobbing

This codepointer is restricted to FogSpawner and derived classes.