Barotrauma Client
Loading...
Searching...
No Matches
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 createWallDamageProjectiles=false, bool distanceFalloff=true)
 Returns a dictionary where the keys are the structures that took damage and the values are the amount of damage taken.
 
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.
 
bool OnlyInside
 Whether the explosion only affects characters inside a submarine.
 
bool OnlyOutside
 Whether the explosion only affects characters outside a submarine.
 
bool PlayDamageSounds
 Should the normal damage sounds be played when the explosion damages something. Usually disabled.
 
readonly HashSet< SubmarineIgnoredSubmarines = new HashSet<Submarine>()
 
readonly HashSet< CharacterIgnoredCharacters = new HashSet<Character>()
 

Properties

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

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>

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 )

◆ Explosion() [2/2]

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

Member Function Documentation

◆ DisableParticles()

void Barotrauma.Explosion.DisableParticles ( )

◆ Explode()

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

◆ RangedBallastFloraDamage()

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

◆ 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 createWallDamageProjectiles = false,
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.

Member Data Documentation

◆ Attack

readonly Attack Barotrauma.Explosion.Attack

◆ IgnoredCharacters

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

◆ 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.

◆ IgnoredSubmarines

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

◆ OnlyInside

bool Barotrauma.Explosion.OnlyInside

Whether the explosion only affects characters inside a submarine.

◆ OnlyOutside

bool Barotrauma.Explosion.OnlyOutside

Whether the explosion only affects characters outside a submarine.

◆ PlayDamageSounds

bool Barotrauma.Explosion.PlayDamageSounds

Should the normal damage sounds be played when the explosion damages something. Usually disabled.

Property Documentation

◆ BallastFloraDamage

float Barotrauma.Explosion.BallastFloraDamage
getset

How much damage the explosion does to ballast flora.

◆ CameraShake

float Barotrauma.Explosion.CameraShake
getset

Intensity of the screen shake effect.

<doc> <override type="DefaultValue"> 10% of the range if showEffects is true, 0 otherwise. </override> </doc>

◆ CameraShakeRange

float Barotrauma.Explosion.CameraShakeRange
getset

How far away does the camera shake effect reach.

<doc> <override type="DefaultValue"> Same as attack range if showEffects is true, 0 otherwise. </override> </doc>

◆ DistanceFalloff

bool Barotrauma.Explosion.DistanceFalloff = true
getset

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

◆ EmpStrength

float Barotrauma.Explosion.EmpStrength
getset

Strength of the EMP effect created by the explosion.

◆ 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.


The documentation for this class was generated from the following file: