SetDamage

From ZDoom Wiki
Jump to: navigation, search

void SetDamage (int dmg)

Note: This feature is for ZScript only.

Usage

Sets the damage of the actor. The value passed to the function is subjected to the same damage randomization the Damage property is subjected to. Note that setting damage through this function overrides DamageFunction, if any.

Examples

This plasma projectile's damage increases as it moves along.

class CustomPlasmaBall : PlasmaBall
{
    int user_dmg;

    Default
    {
        Damage 0;
    }

    States
    {
    Spawn:
        PLSS AB 6 Bright NoDelay SetDamage(++user_dmg);
        Loop;
    }
}