SetDamage: Difference between revisions

From ZDoom Wiki
Jump to navigation Jump to search
Content deleted Content added
Blue Shadow (talk | contribs)
Created page
 
Hfc2x (talk | contribs)
No edit summary
Line 1: Line 1:
void '''SeDamage''' (int ''dmg'')
void '''SetDamage''' (int ''dmg'')
{{ZScriptNote}}

== Usage ==
== Usage ==
Sets the {{Property|Damage|damage}} of the actor. The value passed to the function is subjected to the same damage randomization the {{c|Damage}} property is subjected to.
Sets the {{Property|Damage|damage}} of the actor. The value passed to the function is subjected to the same damage randomization the {{c|Damage}} property is subjected to. Note that setting damage through this function overrides {{c|DamageFunction}}, if any.


== Examples ==
== Examples ==

Revision as of 05:48, 25 May 2017

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;
    }
}