Damage types

From ZDoom Wiki
Jump to navigation Jump to search

A damage type is a text string that can link a specific source of damage (like a projectile or a puff) to specific behaviors.

While some damage types are predefined, when it comes to creating new ones, there are practically no limitations on how many damage types an author can define or how they should be named.

For details on creating custom damage types, see Custom damage types.

Defining damage types

Damage types can be defined as follows:

  • In actors, using their DamageType property. This is normally done in projectiles or puffs. For example, DamageType 'Fire' will define the actor's damage type.
  • They can also be defined globally in MAPINFO.

Simply defining damage types doesn't create any behaviors on its own. However, damage types can be bound to damage factors. Damage factors can modify the amount of damage a specific actor receives from a specific damage source.

Defining damage factors

Damage factors can be defined as follows:

  • In actors, using their DamageFactor property. This is normally done in monsters. For example, DamageFactor 'Fire', 2.0 will make the actor receive 200% damage from any source that has DamageType 'Fire' attached to it.
  • They can also be defined globally in MAPINFO.

In addition to that, custom Pain and Death Actor states can be defined that will be used by the actor if it's damaged by a specific damage type (note, the actor's DamageFactor does not have to be defined for this to work, as long as it's not 0 for this specific damage type). For example, if you add a Pain.Fire state sequence to your actor, it will be used instead of the default Pain when it's hit by an actor with DamageType 'Fire'.

See also