Barotrauma Server Doc
Barotrauma.Explosion Class Reference

Explosions are area of effect attacks that can damage characters, items and structures. More...

Public Member Functions

 Explosion (float range, float force, float damage, float structureDamage, float itemDamage, float empStrength=0.0f, float ballastFloraStrength=0.0f)
 
 Explosion (ContentXElement element, string parentDebugName)
 
void DisableParticles ()
 
void Explode (Vector2 worldPosition, Entity damageSource, Character attacker=null)
 

Static Public Member Functions

static Dictionary< Structure, float > RangedStructureDamage (Vector2 worldPosition, float worldRange, float damage, float levelWallDamage, Character attacker=null, IEnumerable< Submarine > ignoredSubmarines=null, bool emitWallDamageParticles=true, bool distanceFalloff=true)
 Returns a dictionary where the keys are the structures that took damage and the values are the amount of damage taken More...
 
static void RangedBallastFloraDamage (Vector2 worldPosition, float worldRange, float damage, Character attacker=null, bool distanceFalloff=true)
 

Public Attributes

readonly Attack Attack
 
IEnumerable< StructureIgnoredCover
 Structures that don't count as "cover" that reduces damage from the explosion. Only relevant if IgnoreCover is set to false. More...
 
bool OnlyInside
 Whether the explosion only affects characters inside a submarine. More...
 
bool OnlyOutside
 Whether the explosion only affects characters outside a submarine. More...
 
readonly HashSet< SubmarineIgnoredSubmarines = new HashSet<Submarine>()
 
readonly HashSet< CharacterIgnoredCharacters = new HashSet<Character>()
 

Properties

bool IgnoreCover [get, set]
 When set to true, the explosion don't deal less damage when the target is behind a solid object. More...
 
bool DistanceFalloff = true [get, set]
 Does the damage from the explosion decrease with distance from the origin of the explosion? More...
 
float EmpStrength [get, set]
 Strength of the EMP effect created by the explosion. More...
 
float BallastFloraDamage [get, set]
 How much damage the explosion does to ballast flora. More...
 

Detailed Description

Explosions are area of effect attacks that can damage characters, items and structures.

<doc> <Field Identifier="showEffects" Type="bool" DefaultValue="true"> Used to enable all particle effects without having to specify them one by one. </Field> </doc>

Definition at line 21 of file Explosion.cs.

Constructor & Destructor Documentation

◆ Explosion() [1/2]

Barotrauma.Explosion.Explosion ( float  range,
float  force,
float  damage,
float  structureDamage,
float  itemDamage,
float  empStrength = 0.0f,
float  ballastFloraStrength = 0.0f 
)

Definition at line 195 of file Explosion.cs.

◆ Explosion() [2/2]

Barotrauma.Explosion.Explosion ( ContentXElement  element,
string  parentDebugName 
)

Definition at line 213 of file Explosion.cs.

Member Function Documentation

◆ DisableParticles()

void Barotrauma.Explosion.DisableParticles ( )

Definition at line 259 of file Explosion.cs.

◆ Explode()

void Barotrauma.Explosion.Explode ( Vector2  worldPosition,
Entity  damageSource,
Character  attacker = null 
)

Definition at line 270 of file Explosion.cs.

◆ RangedBallastFloraDamage()

static void Barotrauma.Explosion.RangedBallastFloraDamage ( Vector2  worldPosition,
float  worldRange,
float  damage,
Character  attacker = null,
bool  distanceFalloff = true 
)
static

Definition at line 706 of file Explosion.cs.

◆ RangedStructureDamage()

static Dictionary<Structure, float> Barotrauma.Explosion.RangedStructureDamage ( Vector2  worldPosition,
float  worldRange,
float  damage,
float  levelWallDamage,
Character  attacker = null,
IEnumerable< Submarine ignoredSubmarines = null,
bool  emitWallDamageParticles = true,
bool  distanceFalloff = true 
)
static

Returns a dictionary where the keys are the structures that took damage and the values are the amount of damage taken

Definition at line 624 of file Explosion.cs.

Member Data Documentation

◆ Attack

readonly Attack Barotrauma.Explosion.Attack

Definition at line 23 of file Explosion.cs.

◆ IgnoredCharacters

readonly HashSet<Character> Barotrauma.Explosion.IgnoredCharacters = new HashSet<Character>()

Definition at line 183 of file Explosion.cs.

◆ IgnoredCover

IEnumerable<Structure> Barotrauma.Explosion.IgnoredCover

Structures that don't count as "cover" that reduces damage from the explosion. Only relevant if IgnoreCover is set to false.

Definition at line 143 of file Explosion.cs.

◆ IgnoredSubmarines

readonly HashSet<Submarine> Barotrauma.Explosion.IgnoredSubmarines = new HashSet<Submarine>()

Definition at line 181 of file Explosion.cs.

◆ OnlyInside

bool Barotrauma.Explosion.OnlyInside

Whether the explosion only affects characters inside a submarine.

Definition at line 169 of file Explosion.cs.

◆ OnlyOutside

bool Barotrauma.Explosion.OnlyOutside

Whether the explosion only affects characters outside a submarine.

Definition at line 174 of file Explosion.cs.

Property Documentation

◆ BallastFloraDamage

float Barotrauma.Explosion.BallastFloraDamage
getset

How much damage the explosion does to ballast flora.

Definition at line 193 of file Explosion.cs.

◆ DistanceFalloff

bool Barotrauma.Explosion.DistanceFalloff = true
getset

Does the damage from the explosion decrease with distance from the origin of the explosion?

Definition at line 138 of file Explosion.cs.

◆ EmpStrength

float Barotrauma.Explosion.EmpStrength
getset

Strength of the EMP effect created by the explosion.

Definition at line 188 of file Explosion.cs.

◆ IgnoreCover

bool Barotrauma.Explosion.IgnoreCover
getset

When set to true, the explosion don't deal less damage when the target is behind a solid object.

Definition at line 133 of file Explosion.cs.