GetRadiusDamage

int GetRadiusDamage (Actor thing, int damage, int distance [, int fulldmgdistance [, bool oldradiusdmg]])

Usage

Performs a non-damaging explosive (radius) attack, originating from the calling actor, on thing for the purpose of calculating the raw radius damage it would receive. Since no actual damage is inflicted, damage modifiers, such as damage factors and protection powerups, are excluded from damage calculation. Splash and radius damage factors are also excluded.

Parameters

  • thing: a pointer to the actor on which to perform the attack.
  • damage: how much damage would be inflicted at the center of the explosion.
  • distance: the coverage area of the attack. This is the same as damage if it is set to 0 or less.
  • fulldmgdistance: the area within which full damage would be inflicted. Default is 0.
  • oldradiusdmg: the method of calculating the damage. If true, the function uses the old method which is utilized by actors such us explosive barrels, otherwise if false, the standard method is used, which takes z-height into account. Default is false.

Return value

The amount of raw radius damage that thing would receive. The damage amount which is passed to the function is returned as is if the calling actor performs the attack on itself, since it is at the center of the explosion. If thing is out of the coverage area, the function returns negative damage values. In all other cases, the function returns 0.

Examples

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.
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.