SectorDamage

From ZDoom Wiki

Jump to: navigation, search

void SectorDamage (int tag, int amount, str type, str protection_item, int flags)

Contents

Usage

Does the damage only when the function is called, and damages everything in the tagged sector.

Damage Types

Currently, the following damage types can be used with this function:

  • "" (Generic damage)
  • "Fire"
  • "Ice"
  • "Disintegrate"

It has also been tested with some of the internal named damage types, such as "Slime" (nukage); indeed, any of the built-in names defined in the source code file namedef.h under "Damage Types" should work. The list currently includes: None (the internal name for generic damage, as in "no special reason"), Fire, Ice, Disintegrate, Drowning, Slime (nukage), Crush, Telefrag, Falling, Suicide, Exit (leaving a multiplayer game when disallowed), Railgun, Poison (only affects players), Electric, BFGSplash, DrainLife (like Strife's Sigil), Massacre (the cheat), Melee, InstantDeath (Strife's "instant death" sector type) and Extreme (causes extreme death).

Flags

The following flags are supported for this function and can be combined using the logical or operator | :

  • DAMAGE_PLAYERS
    Players in the sector are damaged.
  • DAMAGE_NONPLAYERS
    Shootable non-players in the sector are damaged.
  • DAMAGE_IN_AIR
    Damage actors in the air as well as those on the ground or in the water.
  • DAMAGE_SUBCLASSES_PROTECT
    If an actor is carrying an item derived from the specified protection item, they will be immune to damage. Otherwise, they are only offered protection if they have that exact kind of item.

At a minimum, you must specify DAMAGE_PLAYERS and/or DAMAGE_NONPLAYERS, or nothing will actually receive damage.

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 contibutions are greatly appreciated.
Personal tools