GetModifiedDamage

From ZDoom Wiki
Jump to navigation Jump to search

Actor

native int GetModifiedDamage (Name damagetype, int damage, bool passive, Actor inflictor = null, Actor source = null, int flags = 0)

Usage

Returns the amount of damage the calling actor would receive or deal as modified by items in their inventory, with the specified conditions. To perform the check, it retrieves the damage value as it would be modified by the ModifyDamage calls of every item in the calling actor's inventory.

Note: this function does NOT deal or modify damage, it only retrieves what the damage value would be after all modifications have taken place.

Parameters

  • Name damagetype
The damage type to test for.
  • int damage
The amount of damage to test for.
  • bool passive
If true, tests for the damage the calling actor would receive. Otherwise, test for the damage the calling actor would deal.
  • Actor inflictor
The actor dealing the damage (a projectile or puff, if present; if neither is used, it's the same as source)
  • Actor source
The actor responsible for the damage (the shooter).
  • int flags
Same as the ones used by DamageMobj.

Example

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