Barotrauma Server Doc
|
Classes | |
class | LimbHealth |
Public Member Functions | |
CharacterHealth (Character character) | |
CharacterHealth (ContentXElement element, Character character, ContentXElement limbHealthElement=null) | |
IReadOnlyCollection< Affliction > | GetAllAfflictions () |
IEnumerable< Affliction > | GetAllAfflictions (Func< Affliction, bool > limbHealthFilter) |
Affliction | GetAffliction (string identifier, bool allowLimbAfflictions=true) |
Affliction | GetAffliction (Identifier identifier, bool allowLimbAfflictions=true) |
Affliction | GetAfflictionOfType (Identifier afflictionType, bool allowLimbAfflictions=true) |
T | GetAffliction< T > (Identifier identifier, bool allowLimbAfflictions=true) |
Affliction | GetAffliction (Identifier identifier, Limb limb) |
Limb | GetAfflictionLimb (Affliction affliction) |
float | GetAfflictionStrength (Identifier afflictionType, Limb limb, bool requireLimbSpecific) |
Get the total strength of the afflictions of a specific type attached to a specific limb More... | |
float | GetAfflictionStrengthByType (Identifier afflictionType, bool allowLimbAfflictions=true) |
float | GetAfflictionStrengthByIdentifier (Identifier afflictionIdentifier, bool allowLimbAfflictions=true) |
float | GetAfflictionStrength (Identifier afflictionType, Identifier afflictionidentifier, bool allowLimbAfflictions=true) |
void | ApplyAffliction (Limb targetLimb, Affliction affliction, bool allowStacking=true, bool ignoreUnkillability=false) |
float | GetResistance (AfflictionPrefab afflictionPrefab) |
float | GetStatValue (StatTypes statType) |
bool | HasFlag (AbilityFlags flagType) |
void | ReduceAllAfflictionsOnAllLimbs (float amount, ActionType? treatmentAction=null) |
void | ReduceAfflictionOnAllLimbs (Identifier afflictionIdOrType, float amount, ActionType? treatmentAction=null) |
void | ReduceAllAfflictionsOnLimb (Limb targetLimb, float amount, ActionType? treatmentAction=null) |
void | ReduceAfflictionOnLimb (Limb targetLimb, Identifier afflictionIdOrType, float amount, ActionType? treatmentAction=null) |
void | ApplyDamage (Limb hitLimb, AttackResult attackResult, bool allowStacking=true) |
void | SetAllDamage (float damageAmount, float bleedingDamageAmount, float burnDamageAmount) |
float | GetLimbDamage (Limb limb, Identifier afflictionType) |
void | RemoveAllAfflictions () |
void | RemoveNegativeAfflictions () |
void | Update (float deltaTime) |
void | ForceUpdateVisuals () |
void | SetVitality (float newVitality) |
void | CalculateVitality () |
void | ApplyAfflictionStatusEffects (ActionType type) |
void | GetSuitableTreatments (Dictionary< Identifier, float > treatmentSuitability, bool normalize, Character user, Limb limb=null, bool ignoreHiddenAfflictions=false, float predictFutureDuration=0.0f) |
Get the identifiers of the items that can be used to treat the character. Takes into account all the afflictions the character has, and negative treatment suitabilities (e.g. a medicine that causes oxygen loss may not be suitable if the character is already suffocating) More... | |
float | GetTotalAdjustedAfflictionStrength (Affliction affliction, float otherAfflictionMultiplier=0.3f, bool includeSameAffliction=true) |
Returns the total strength of instances of the same affliction on all the characters limbs, with a smaller weight given to the other afflictions on other limbs More... | |
IEnumerable< Identifier > | GetActiveAfflictionTags () |
float | GetPredictedStrength (Affliction affliction, float predictFutureDuration, Limb limb=null) |
void | ServerWrite (IWriteMessage msg) |
void | Remove () |
void | Save (XElement healthElement) |
void | Load (XElement element, Func< AfflictionPrefab, bool > afflictionPredicate=null) |
Static Public Member Functions | |
static IEnumerable< Affliction > | SortAfflictionsBySeverity (IEnumerable< Affliction > afflictions, bool excludeBuffs=true) |
Automatically filters out buffs. More... | |
Public Attributes | |
bool | Unkillable |
readonly Character | Character |
CauseOfDeathType | type |
Static Public Attributes | |
const float | InsufficientOxygenThreshold = 30.0f |
const float | LowOxygenThreshold = 50.0f |
static readonly Color | DefaultFaceTint = Color.TransparentBlack |
Protected Attributes | |
float | minVitality |
Properties | |
float | UnmodifiedMaxVitality [get, set] |
Maximum vitality without talent- or job-based modifiers More... | |
bool | DoesBleed [get] |
bool | UseHealthWindow [get, set] |
float | CrushDepth [get] |
Affliction | BloodlossAffliction [get] |
bool | IsUnconscious [get] |
float | PressureKillDelay = 5.0f [get] |
float | Vitality [get] |
float | VitalityDisregardingDeath [get] |
How much vitality the character would have if it was alive? E.g. a character killed by disconnection or with console commands may not have any vitality-reducing afflictions despite being dead More... | |
float | HealthPercentage [get] |
float??? | MaxVitality [get] |
float??? | MinVitality [get] |
Color | FaceTint [get] |
Color | BodyTint [get] |
float | OxygenAmount [get, set] |
float | BloodlossAmount [get, set] |
float | Stun [get, set] |
bool | IsParalyzed [get] |
float | StunTimer [get] |
bool | WasInFullHealth [get] |
Was the character in full health at the beginning of the frame? More... | |
Affliction | PressureAffliction [get] |
float | OxygenLowResistance [get] |
0-1. More... | |
Definition at line 18 of file CharacterHealth.cs.
Barotrauma.CharacterHealth.CharacterHealth | ( | Character | character | ) |
Definition at line 258 of file CharacterHealth.cs.
Barotrauma.CharacterHealth.CharacterHealth | ( | ContentXElement | element, |
Character | character, | ||
ContentXElement | limbHealthElement = null |
||
) |
Definition at line 273 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ApplyAffliction | ( | Limb | targetLimb, |
Affliction | affliction, | ||
bool | allowStacking = true , |
||
bool | ignoreUnkillability = false |
||
) |
Definition at line 444 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ApplyAfflictionStatusEffects | ( | ActionType | type | ) |
Definition at line 1065 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ApplyDamage | ( | Limb | hitLimb, |
AttackResult | attackResult, | ||
bool | allowStacking = true |
||
) |
Definition at line 601 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.CalculateVitality | ( | ) |
Definition at line 987 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ForceUpdateVisuals | ( | ) |
Definition at line 909 of file CharacterHealth.cs.
IEnumerable<Identifier> Barotrauma.CharacterHealth.GetActiveAfflictionTags | ( | ) |
Definition at line 1234 of file CharacterHealth.cs.
Affliction Barotrauma.CharacterHealth.GetAffliction | ( | Identifier | identifier, |
bool | allowLimbAfflictions = true |
||
) |
Affliction Barotrauma.CharacterHealth.GetAffliction | ( | Identifier | identifier, |
Limb | limb | ||
) |
Definition at line 360 of file CharacterHealth.cs.
Affliction Barotrauma.CharacterHealth.GetAffliction | ( | string | identifier, |
bool | allowLimbAfflictions = true |
||
) |
T Barotrauma.CharacterHealth.GetAffliction< T > | ( | Identifier | identifier, |
bool | allowLimbAfflictions = true |
||
) |
T | : | Affliction |
Definition at line 355 of file CharacterHealth.cs.
Limb Barotrauma.CharacterHealth.GetAfflictionLimb | ( | Affliction | affliction | ) |
Definition at line 375 of file CharacterHealth.cs.
Affliction Barotrauma.CharacterHealth.GetAfflictionOfType | ( | Identifier | afflictionType, |
bool | allowLimbAfflictions = true |
||
) |
float Barotrauma.CharacterHealth.GetAfflictionStrength | ( | Identifier | afflictionType, |
Identifier | afflictionidentifier, | ||
bool | allowLimbAfflictions = true |
||
) |
Definition at line 427 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetAfflictionStrength | ( | Identifier | afflictionType, |
Limb | limb, | ||
bool | requireLimbSpecific | ||
) |
Get the total strength of the afflictions of a specific type attached to a specific limb
afflictionType | Type of the affliction |
limb | The limb the affliction is attached to |
requireLimbSpecific | Does the affliction have to be attached to only the specific limb. Most monsters for example don't have separate healths for different limbs, essentially meaning that every affliction is applied to every limb. |
Definition at line 396 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetAfflictionStrengthByIdentifier | ( | Identifier | afflictionIdentifier, |
bool | allowLimbAfflictions = true |
||
) |
Definition at line 422 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetAfflictionStrengthByType | ( | Identifier | afflictionType, |
bool | allowLimbAfflictions = true |
||
) |
Definition at line 417 of file CharacterHealth.cs.
IReadOnlyCollection<Affliction> Barotrauma.CharacterHealth.GetAllAfflictions | ( | ) |
Definition at line 311 of file CharacterHealth.cs.
IEnumerable<Affliction> Barotrauma.CharacterHealth.GetAllAfflictions | ( | Func< Affliction, bool > | limbHealthFilter | ) |
Definition at line 316 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetLimbDamage | ( | Limb | limb, |
Identifier | afflictionType | ||
) |
Definition at line 665 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetPredictedStrength | ( | Affliction | affliction, |
float | predictFutureDuration, | ||
Limb | limb = null |
||
) |
Definition at line 1248 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetResistance | ( | AfflictionPrefab | afflictionPrefab | ) |
Definition at line 473 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetStatValue | ( | StatTypes | statType | ) |
Definition at line 484 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.GetSuitableTreatments | ( | Dictionary< Identifier, float > | treatmentSuitability, |
bool | normalize, | ||
Character | user, | ||
Limb | limb = null , |
||
bool | ignoreHiddenAfflictions = false , |
||
float | predictFutureDuration = 0.0f |
||
) |
Get the identifiers of the items that can be used to treat the character. Takes into account all the afflictions the character has, and negative treatment suitabilities (e.g. a medicine that causes oxygen loss may not be suitable if the character is already suffocating)
treatmentSuitability | A dictionary where the key is the identifier of the item and the value the suitability |
normalize | If true, the suitability values are normalized between 0 and 1. If not, they're arbitrary values defined in the medical item XML, where negative values are unsuitable, and positive ones suitable. |
predictFutureDuration | If above 0, the method will take into account how much currently active status effects while affect the afflictions in the next x seconds. |
Definition at line 1138 of file CharacterHealth.cs.
float Barotrauma.CharacterHealth.GetTotalAdjustedAfflictionStrength | ( | Affliction | affliction, |
float | otherAfflictionMultiplier = 0.3f , |
||
bool | includeSameAffliction = true |
||
) |
Returns the total strength of instances of the same affliction on all the characters limbs, with a smaller weight given to the other afflictions on other limbs
otherAfflictionMultiplier | Multiplier on the strengths of the afflictions on other limbs. |
includeSameAffliction | Should the strength of the provided affliction be included too? |
Definition at line 1217 of file CharacterHealth.cs.
bool Barotrauma.CharacterHealth.HasFlag | ( | AbilityFlags | flagType | ) |
Definition at line 495 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.Load | ( | XElement | element, |
Func< AfflictionPrefab, bool > | afflictionPredicate = null |
||
) |
Definition at line 1373 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ReduceAfflictionOnAllLimbs | ( | Identifier | afflictionIdOrType, |
float | amount, | ||
ActionType? | treatmentAction = null |
||
) |
Definition at line 515 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ReduceAfflictionOnLimb | ( | Limb | targetLimb, |
Identifier | afflictionIdOrType, | ||
float | amount, | ||
ActionType? | treatmentAction = null |
||
) |
Definition at line 544 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ReduceAllAfflictionsOnAllLimbs | ( | float | amount, |
ActionType? | treatmentAction = null |
||
) |
Definition at line 507 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ReduceAllAfflictionsOnLimb | ( | Limb | targetLimb, |
float | amount, | ||
ActionType? | treatmentAction = null |
||
) |
Definition at line 534 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.Remove | ( | ) |
Definition at line 1329 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.RemoveAllAfflictions | ( | ) |
Definition at line 693 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.RemoveNegativeAfflictions | ( | ) |
Definition at line 708 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.Save | ( | XElement | healthElement | ) |
Definition at line 1344 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.ServerWrite | ( | IWriteMessage | msg | ) |
Definition at line 1276 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.SetAllDamage | ( | float | damageAmount, |
float | bleedingDamageAmount, | ||
float | burnDamageAmount | ||
) |
Definition at line 640 of file CharacterHealth.cs.
void Barotrauma.CharacterHealth.SetVitality | ( | float | newVitality | ) |
Definition at line 981 of file CharacterHealth.cs.
|
static |
Automatically filters out buffs.
void Barotrauma.CharacterHealth.Update | ( | float | deltaTime | ) |
Definition at line 820 of file CharacterHealth.cs.
readonly Character Barotrauma.CharacterHealth.Character |
Definition at line 256 of file CharacterHealth.cs.
|
static |
Definition at line 198 of file CharacterHealth.cs.
|
static |
Definition at line 100 of file CharacterHealth.cs.
|
static |
Definition at line 101 of file CharacterHealth.cs.
|
protected |
Definition at line 102 of file CharacterHealth.cs.
CauseOfDeathType Barotrauma.CharacterHealth.type |
Definition at line 1075 of file CharacterHealth.cs.
bool Barotrauma.CharacterHealth.Unkillable |
Definition at line 113 of file CharacterHealth.cs.
|
get |
Definition at line 141 of file CharacterHealth.cs.
|
getset |
Definition at line 226 of file CharacterHealth.cs.
|
get |
Definition at line 206 of file CharacterHealth.cs.
|
get |
Definition at line 127 of file CharacterHealth.cs.
|
get |
Definition at line 115 of file CharacterHealth.cs.
|
get |
Definition at line 200 of file CharacterHealth.cs.
|
get |
Definition at line 169 of file CharacterHealth.cs.
|
get |
Definition at line 242 of file CharacterHealth.cs.
|
get |
Definition at line 143 of file CharacterHealth.cs.
|
get |
Definition at line 171 of file CharacterHealth.cs.
|
get |
Definition at line 186 of file CharacterHealth.cs.
|
getset |
Definition at line 212 of file CharacterHealth.cs.
|
get |
0-1.
Definition at line 937 of file CharacterHealth.cs.
|
get |
Definition at line 251 of file CharacterHealth.cs.
|
get |
Definition at line 148 of file CharacterHealth.cs.
|
getset |
Definition at line 232 of file CharacterHealth.cs.
|
get |
Definition at line 244 of file CharacterHealth.cs.
|
getsetprotected |
Maximum vitality without talent- or job-based modifiers
Definition at line 107 of file CharacterHealth.cs.
|
getset |
Definition at line 121 of file CharacterHealth.cs.
|
get |
Definition at line 151 of file CharacterHealth.cs.
|
get |
How much vitality the character would have if it was alive? E.g. a character killed by disconnection or with console commands may not have any vitality-reducing afflictions despite being dead
Definition at line 167 of file CharacterHealth.cs.
|
get |
Was the character in full health at the beginning of the frame?
Definition at line 249 of file CharacterHealth.cs.