ApplyDamageFactors

From ZDoom Wiki
Jump to navigation Jump to search
Note: This should not be confused with ApplyDamageFactor.


Actor

clearscope static int ApplyDamageFactors (class<Inventory> itemcls, Name damagetype, int damage, int defdamage)

Usage

Returns the value passed to damage after adjustment, which is done by multiplying it with the chosen damage factor from the specified item class. If the chosen damage factor does not exist among the item's damage factors, damage is returned as is. If the item does not define any damage factors, the function returns the value passed to defdamage without any adjustments.

This function is generally used as part of set ups to adjust the damage an actor receives or inflicts.

Parameters

  • class<Inventory> itemcls
The item class from which to get the damage factors.
  • Name damagetype
The desired damage factor, referenced by its damage type.
  • int damage
The value to multiply the damage factor with.
  • int defdamage
The fall-back value to return if the item does not define any damage factors.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.


See also