A_RadiusThrust

From ZDoom Wiki
Jump to navigation Jump to search

void A_RadiusThrust [(int force [, int distance [, int flags [, int fullthrustdistance [, name species]]]])]

Usage

Makes the calling actor thrust away actors nearby from it. This is similar to A_Explode but without the damage. Although, affected actors could take damage if they collide with a wall or each other, akin to A_Blast.

Parameters

  • force: how powerful the blast is. The velocity of the blast is determined as: force / (2 * mass), so a force of 40000 pushes away an actor of 1000 mass (the mass of a baron of hell) with a velocity of 20 units/tic (the speed of a rocket) at the very center of the blast. Negative values push actors towards the center of the source. Default is 128.
  • distance: how far the blast extends. At the center, actors take the full force of the blast. At the outer edge, this many units away, actors are not pushed at all. The value passed to force is used to determine the distance if this parameter is 0 or less. Default is -1.
  • flags: the following flags can be combined by using the | character between the constant names:
    • RTF_AFFECTSOURCE — Affect source: if this flag is set, the shooter of the projectile is affected. This is set by default.
    • RTF_NOIMPACTDAMAGE — No impact damage: if this flag is set, actors thrust away do not cause melee damage on impact.
    • RTF_NOTMISSILE — Not a missile: if set, the calling actor is considered to be the source. By default, the calling actor is assumed to be a projectile, and the source is therefore considered to be the calling actor's target.
    • RTF_THRUSTZ — Apply thrust to vertical velocity as well as horizontal. By default, the function does not apply Z velocity at all. This flag overrides the compat_explode1 compatibility flag.
  • fullthrustdistance: the radius that actors will be subject to the full force of the blast. Default is 0.
  • species: the actor species to thrust. Only actors whose species matches this are thrust. Default is "None".

Examples

The following example shows a projectile that blows objects away with a force of 500 within a 64 unit radius affecting the shooter:

class WindyProjectile : Actor
{
    Default
    {
        Height 4;
        Radius 2;
        Projectile;
    }

    States
    {
    Spawn:
        WIND ABCDEFGHIJK 2 A_RadiusThrust(500, 64, RTF_AFFECTSOURCE);
        WIND LMNO 2;
        Stop;
    }
}