Barotrauma Client Doc
Barotrauma.Affliction Class Reference
Inheritance diagram for Barotrauma.Affliction:
Barotrauma.ISerializableEntity Barotrauma.AfflictionBleeding Barotrauma.AfflictionHusk Barotrauma.AfflictionPsychosis Barotrauma.AfflictionPsychosis Barotrauma.AfflictionSpaceHerpes Barotrauma.BuffDurationIncrease

Public Member Functions

 Affliction (AfflictionPrefab prefab, float strength)
 
void CopyProperties (Affliction source)
 Copy properties here instead of using SerializableProperties (with reflection). More...
 
void Serialize (XElement element)
 
void Deserialize (XElement element)
 
Affliction CreateMultiplied (float multiplier, Affliction affliction)
 
override string ToString ()
 
LocalizedString GetStrengthText ()
 
AfflictionPrefab.Effect GetActiveEffect ()
 
float GetVitalityDecrease (CharacterHealth characterHealth)
 
float GetVitalityDecrease (CharacterHealth characterHealth, float strength)
 
float GetScreenGrainStrength ()
 
float GetScreenDistortStrength ()
 
float GetRadialDistortStrength ()
 
float GetChromaticAberrationStrength ()
 
float GetAfflictionOverlayMultiplier ()
 
Color GetFaceTint ()
 
Color GetBodyTint ()
 
float GetScreenBlurStrength ()
 
float GetSkillMultiplier ()
 
void CalculateDamagePerSecond (float currentVitalityDecrease)
 
float GetResistance (Identifier afflictionId)
 
float GetSpeedMultiplier ()
 
float GetStatValue (StatTypes statType)
 
bool HasFlag (AbilityFlags flagType)
 
virtual void Update (CharacterHealth characterHealth, Limb targetLimb, float deltaTime)
 
void ApplyStatusEffects (ActionType type, float deltaTime, CharacterHealth characterHealth, Limb targetLimb)
 
void ApplyStatusEffect (ActionType type, StatusEffect statusEffect, float deltaTime, CharacterHealth characterHealth, Limb targetLimb)
 
void SetStrength (float strength)
 Use this method to skip clamping and additional logic of the setters. Ideally we would keep this private, but doing so would require too much refactoring. More...
 
bool ShouldShowIcon (Character afflictedCharacter)
 

Static Public Member Functions

static LocalizedString GetStrengthText (float strength, float maxStrength)
 

Public Attributes

readonly AfflictionPrefab Prefab
 
float DamagePerSecond
 
float DamagePerSecondTimer
 
float PreviousVitalityDecrease
 
float Value
 
readonly Dictionary< AfflictionPrefab.PeriodicEffect, float > PeriodicEffectTimers = new Dictionary<AfflictionPrefab.PeriodicEffect, float>()
 
double AppliedAsSuccessfulTreatmentTime
 
float Duration
 
Character Source
 Which character gave this affliction More...
 

Protected Attributes

bool activeEffectDirty = true
 
float _strength
 

Properties

string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get, set]
 
float PendingGrainEffectStrength [get, set]
 
float GrainEffectStrength [get, set]
 
virtual float Strength [get, set]
 
float NonClampedStrength [get]
 
Identifier Identifier [get]
 
float Probability = 1.0f [get, set]
 
bool DivideByLimbCount [get, set]
 
bool MultiplyByMaxVitality [get]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Detailed Description

Definition at line 10 of file Affliction.cs.

Constructor & Destructor Documentation

◆ Affliction()

Barotrauma.Affliction.Affliction ( AfflictionPrefab  prefab,
float  strength 
)

Definition at line 97 of file Affliction.cs.

Member Function Documentation

◆ ApplyStatusEffect()

void Barotrauma.Affliction.ApplyStatusEffect ( ActionType  type,
StatusEffect  statusEffect,
float  deltaTime,
CharacterHealth  characterHealth,
Limb  targetLimb 
)

Definition at line 469 of file Affliction.cs.

◆ ApplyStatusEffects()

void Barotrauma.Affliction.ApplyStatusEffects ( ActionType  type,
float  deltaTime,
CharacterHealth  characterHealth,
Limb  targetLimb 
)

Definition at line 456 of file Affliction.cs.

◆ CalculateDamagePerSecond()

void Barotrauma.Affliction.CalculateDamagePerSecond ( float  currentVitalityDecrease)

Definition at line 324 of file Affliction.cs.

◆ CopyProperties()

void Barotrauma.Affliction.CopyProperties ( Affliction  source)

Copy properties here instead of using SerializableProperties (with reflection).

Definition at line 118 of file Affliction.cs.

◆ CreateMultiplied()

Affliction Barotrauma.Affliction.CreateMultiplied ( float  multiplier,
Affliction  affliction 
)

Definition at line 135 of file Affliction.cs.

◆ Deserialize()

void Barotrauma.Affliction.Deserialize ( XElement  element)

Definition at line 130 of file Affliction.cs.

◆ GetActiveEffect()

AfflictionPrefab.Effect Barotrauma.Affliction.GetActiveEffect ( )

Definition at line 155 of file Affliction.cs.

◆ GetAfflictionOverlayMultiplier()

float Barotrauma.Affliction.GetAfflictionOverlayMultiplier ( )

Definition at line 252 of file Affliction.cs.

◆ GetBodyTint()

Color Barotrauma.Affliction.GetBodyTint ( )

Definition at line 279 of file Affliction.cs.

◆ GetChromaticAberrationStrength()

float Barotrauma.Affliction.GetChromaticAberrationStrength ( )

Definition at line 239 of file Affliction.cs.

◆ GetFaceTint()

Color Barotrauma.Affliction.GetFaceTint ( )

Definition at line 267 of file Affliction.cs.

◆ GetRadialDistortStrength()

float Barotrauma.Affliction.GetRadialDistortStrength ( )

Definition at line 226 of file Affliction.cs.

◆ GetResistance()

float Barotrauma.Affliction.GetResistance ( Identifier  afflictionId)

Definition at line 335 of file Affliction.cs.

◆ GetScreenBlurStrength()

float Barotrauma.Affliction.GetScreenBlurStrength ( )

Definition at line 291 of file Affliction.cs.

◆ GetScreenDistortStrength()

float Barotrauma.Affliction.GetScreenDistortStrength ( )

Definition at line 213 of file Affliction.cs.

◆ GetScreenGrainStrength()

float Barotrauma.Affliction.GetScreenGrainStrength ( )

Definition at line 193 of file Affliction.cs.

◆ GetSkillMultiplier()

float Barotrauma.Affliction.GetSkillMultiplier ( )

Definition at line 310 of file Affliction.cs.

◆ GetSpeedMultiplier()

float Barotrauma.Affliction.GetSpeedMultiplier ( )

Definition at line 353 of file Affliction.cs.

◆ GetStatValue()

float Barotrauma.Affliction.GetStatValue ( StatTypes  statType)

Definition at line 364 of file Affliction.cs.

◆ GetStrengthText() [1/2]

LocalizedString Barotrauma.Affliction.GetStrengthText ( )

Definition at line 144 of file Affliction.cs.

◆ GetStrengthText() [2/2]

static LocalizedString Barotrauma.Affliction.GetStrengthText ( float  strength,
float  maxStrength 
)
static

Definition at line 149 of file Affliction.cs.

◆ GetVitalityDecrease() [1/2]

float Barotrauma.Affliction.GetVitalityDecrease ( CharacterHealth  characterHealth)

Definition at line 166 of file Affliction.cs.

◆ GetVitalityDecrease() [2/2]

float Barotrauma.Affliction.GetVitalityDecrease ( CharacterHealth  characterHealth,
float  strength 
)

Definition at line 171 of file Affliction.cs.

◆ HasFlag()

bool Barotrauma.Affliction.HasFlag ( AbilityFlags  flagType)

Definition at line 373 of file Affliction.cs.

◆ Serialize()

void Barotrauma.Affliction.Serialize ( XElement  element)

Definition at line 125 of file Affliction.cs.

◆ SetStrength()

void Barotrauma.Affliction.SetStrength ( float  strength)

Use this method to skip clamping and additional logic of the setters. Ideally we would keep this private, but doing so would require too much refactoring.

Definition at line 499 of file Affliction.cs.

◆ ShouldShowIcon()

bool Barotrauma.Affliction.ShouldShowIcon ( Character  afflictedCharacter)

Definition at line 513 of file Affliction.cs.

◆ ToString()

override string Barotrauma.Affliction.ToString ( )

◆ Update()

virtual void Barotrauma.Affliction.Update ( CharacterHealth  characterHealth,
Limb  targetLimb,
float  deltaTime 
)
virtual

Member Data Documentation

◆ _strength

float Barotrauma.Affliction._strength
protected

Definition at line 27 of file Affliction.cs.

◆ activeEffectDirty

bool Barotrauma.Affliction.activeEffectDirty = true
protected

Definition at line 25 of file Affliction.cs.

◆ AppliedAsSuccessfulTreatmentTime

double Barotrauma.Affliction.AppliedAsSuccessfulTreatmentTime

Definition at line 81 of file Affliction.cs.

◆ DamagePerSecond

float Barotrauma.Affliction.DamagePerSecond

Definition at line 73 of file Affliction.cs.

◆ DamagePerSecondTimer

float Barotrauma.Affliction.DamagePerSecondTimer

Definition at line 74 of file Affliction.cs.

◆ Duration

float Barotrauma.Affliction.Duration

Definition at line 83 of file Affliction.cs.

◆ PeriodicEffectTimers

readonly Dictionary<AfflictionPrefab.PeriodicEffect, float> Barotrauma.Affliction.PeriodicEffectTimers = new Dictionary<AfflictionPrefab.PeriodicEffect, float>()

Definition at line 79 of file Affliction.cs.

◆ Prefab

readonly AfflictionPrefab Barotrauma.Affliction.Prefab

Definition at line 12 of file Affliction.cs.

◆ PreviousVitalityDecrease

float Barotrauma.Affliction.PreviousVitalityDecrease

Definition at line 75 of file Affliction.cs.

◆ Source

Character Barotrauma.Affliction.Source

Which character gave this affliction

Definition at line 88 of file Affliction.cs.

◆ Value

float Barotrauma.Affliction.Value

Definition at line 77 of file Affliction.cs.

Property Documentation

◆ DivideByLimbCount

bool Barotrauma.Affliction.DivideByLimbCount
getset

Definition at line 68 of file Affliction.cs.

◆ GrainEffectStrength

float Barotrauma.Affliction.GrainEffectStrength
getset

Definition at line 19 of file Affliction.cs.

◆ Identifier

Identifier Barotrauma.Affliction.Identifier
get

Definition at line 62 of file Affliction.cs.

◆ MultiplyByMaxVitality

bool Barotrauma.Affliction.MultiplyByMaxVitality
get

Definition at line 71 of file Affliction.cs.

◆ Name

string Barotrauma.Affliction.Name
get

Definition at line 14 of file Affliction.cs.

◆ NonClampedStrength

float Barotrauma.Affliction.NonClampedStrength
get

Definition at line 59 of file Affliction.cs.

◆ PendingGrainEffectStrength

float Barotrauma.Affliction.PendingGrainEffectStrength
getset

Definition at line 18 of file Affliction.cs.

◆ Probability

float Barotrauma.Affliction.Probability = 1.0f
getset

Definition at line 65 of file Affliction.cs.

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.Affliction.SerializableProperties
getset

Definition at line 16 of file Affliction.cs.

◆ Strength

virtual float Barotrauma.Affliction.Strength
getset

Definition at line 30 of file Affliction.cs.