Thing_Damage

From ZDoom Wiki
Jump to navigation Jump to search

119:Thing_Damage (tid, amount, mod)


Usage

Damages the specified actor.

Parameters

  • tid: TID of the thing you want to damage.
  • amount: The amount of damage the thing will receive.
  • mod: Means of death. Determines the obituary message that will appear if a player is killed. Relevant damage types for the means of death are found on the Damage_types page.

Similar to DamageThing, but it hurts actors by TID rather than whoever activates it. Note that if TID is 0, this behaves similarly to DamageThing, but using 0 as the amount will not force death.

There are some newer built-in damage types for which no MOD code exists and custom damage types are identified by names; neither can be used with this special. If you want to attach this special outside a script, e.g. to a line or a thing, but need to use a damage type that is recognized by the game by name, but is not listed above, set the line/thing special to run a script instead and use the Thing_Damage2 ACS function in the script.

See Damage types for a list of means-of-death.

Examples

Script 1 ENTER
{
   Thing_Damage(0, 20, MOD_RAILGUN);
}