Barotrauma Client
Loading...
Searching...
No Matches
Barotrauma.AfflictionPrefab Class Reference

AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character. There are multiple sub-types of afflictions such as AfflictionPrefabHusk, AfflictionPsychosis and AfflictionBleeding that can be used for additional functionality. More...

Inheritance diagram for Barotrauma.AfflictionPrefab:
Barotrauma.PrefabWithUintIdentifier Barotrauma.Prefab Barotrauma.AfflictionPrefabHusk

Classes

class  Description
 The description element can be used to define descriptions for the affliction which are shown under specific conditions; for example a description that only shows to other players or only at certain strength levels. More...
 
class  Effect
 Effects are the primary way to add functionality to afflictions. More...
 
class  PeriodicEffect
 PeriodicEffect applies StatusEffects to the character periodically. More...
 

Public Member Functions

override void Dispose ()
 
 AfflictionPrefab (ContentXElement element, AfflictionsFile file, Type type)
 
LocalizedString GetDescription (float strength, Description.TargetType targetType)
 
override string ToString ()
 
Affliction Instantiate (float strength, Character source=null)
 
Effect GetActiveEffect (float currentStrength)
 
float GetTreatmentSuitability (Item item)
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 
void Dispose ()
 

Static Public Member Functions

static void LoadAllEffectsAndTreatmentSuitabilities ()
 Should be called before each round: loads all StatusEffects and refreshes treatment suitabilities.
 
static void ClearAllEffects ()
 Removes all the effects of the prefab (including the sounds and other assets defined in them). Note that you need to call LoadAllEffectsAndTreatmentSuitabilities before trying to use the affliction again!
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly LocalizedString Name
 
readonly LocalizedString CauseOfDeathDescription
 
readonly LocalizedString SelfCauseOfDeathDescription
 
readonly ImmutableList< DescriptionDescriptions
 
readonly Identifier AfflictionType
 Arbitrary string that is used to identify the type of the affliction.
 
readonly bool LimbSpecific
 If set to true, the affliction affects individual limbs. Otherwise, it affects the whole character.
 
readonly LimbType IndicatorLimb
 If the affliction doesn't affect individual limbs, this attribute determines where the game will render the affliction's indicator when viewed in the in-game health UI.
 
readonly Identifier TranslationIdentifier
 Can be set to the identifier of another affliction to make this affliction reuse the same name and description.
 
readonly bool IsBuff
 If set to true, the game will recognize this affliction as a buff. This means, among other things, that bots won't attempt to treat it, and the health UI will render the affected limb in green rather than red.
 
readonly bool AffectMachines
 If set to true, this affliction can affect characters that are marked as machines, such as the Fractal Guardian.
 
readonly bool HealableInMedicalClinic
 If set to true, this affliction can be healed at the medical clinic.
 
readonly float HealCostMultiplier
 How much each unit of this affliction's strength will add to the cost of healing at the medical clinic.
 
readonly int BaseHealCost
 The minimum cost of healing this affliction at the medical clinic.
 
readonly bool ShowBarInHealthMenu
 If set to false, the health UI will not show the strength of the affliction as a bar under its indicator.
 
readonly bool HideIconAfterDelay
 If set to true, this affliction's icon will be hidden from the HUD after 5 seconds.
 
readonly float ActivationThreshold = 0.0f
 How high the strength has to be for the affliction to take effect.
 
readonly float ShowIconThreshold = 0.05f
 How high the strength has to be for the affliction icon to be shown in the UI.
 
readonly float ShowIconToOthersThreshold = 0.05f
 How high the strength has to be for the affliction icon to be shown to others with a health scanner or via the health interface.
 
readonly float MaxStrength = 100.0f
 The maximum strength this affliction can have.
 
readonly float GrainBurst
 The strength of the radiation grain effect to apply when the strength of this affliction increases.
 
readonly float ShowInHealthScannerThreshold
 How high the strength has to be for the affliction icon to be shown with a health scanner.
 
readonly float TreatmentThreshold
 How strong the affliction needs to be before bots attempt to treat it. Also effects when the affliction is shown in the suitable treatments list.
 
ImmutableHashSet< IdentifierIgnoreTreatmentIfAfflictedBy
 Bots will not try to treat the affliction if the character has any of these afflictions.
 
readonly float Duration
 The duration of the affliction, in seconds. If set to 0, the affliction does not expire.
 
float KarmaChangeOnApplied
 How much karma changes when a player applies this affliction to someone (per strength of the affliction)
 
readonly float BurnOverlayAlpha
 Opacity of the burn effect (darker tint) on limbs affected by this affliction. 1 = full strength.
 
readonly float DamageOverlayAlpha
 Opacity of the bloody damage overlay on limbs affected by this affliction. 1 = full strength.
 
readonly Identifier AchievementOnReceived
 
readonly Identifier AchievementOnRemoved
 Steam achievement given when the affliction is removed from the controlled character.
 
readonly Color[] IconColors
 A gradient that defines which color to render this affliction's icon with, based on the affliction's current strength.
 
readonly bool AfflictionOverlayAlphaIsLinear
 If set to true and the affliction has an AfflictionOverlay element, the overlay's opacity will be strictly proportional to its strength. Otherwise, the overlay's opacity will be determined based on its activation threshold and effects.
 
readonly bool ResetBetweenRounds
 If set to true, this affliction will not persist between rounds.
 
readonly bool DamageParticles
 Should damage particles be emitted when a character receives this affliction? Only relevant if the affliction is of the type "bleeding" or "damage".
 
readonly float MedicalSkillGain
 An arbitrary modifier that affects how much medical skill is increased when you apply the affliction on a target. If the affliction causes damage or is of the 'poison' or 'paralysis' type, the skill is increased only when the target is hostile. If the affliction is of the 'buff' type, the skill is increased only when the target is friendly.
 
readonly float WeaponsSkillGain
 An arbitrary modifier that affects how much weapons skill is increased when you apply the affliction on a target. The skill is increased only when the target is hostile.
 
readonly Sprite Icon
 An icon that’s used in the UI to represent this affliction.
 
readonly Sprite AfflictionOverlay
 A sprite that covers the affected player's entire screen when this affliction is active. Its opacity is controlled by the active effect's MinAfflictionOverlayAlphaMultiplier and MaxAfflictionOverlayAlphaMultiplier.
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly Identifier DamageType = "damage".ToIdentifier()
 
static readonly Identifier BurnType = "burn".ToIdentifier()
 
static readonly Identifier BleedingType = "bleeding".ToIdentifier()
 
static readonly Identifier ParalysisType = "paralysis".ToIdentifier()
 
static readonly Identifier PoisonType = "poison".ToIdentifier()
 
static readonly Identifier StunType = "stun".ToIdentifier()
 
static readonly Identifier EMPType = "emp".ToIdentifier()
 
static readonly Identifier SpaceHerpesType = "spaceherpes".ToIdentifier()
 
static readonly Identifier AlienInfectedType = "alieninfected".ToIdentifier()
 
static readonly Identifier InvertControlsType = "invertcontrols".ToIdentifier()
 
static readonly PrefabCollection< AfflictionPrefabPrefabs = new PrefabCollection<AfflictionPrefab>()
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Properties

static AfflictionPrefab InternalDamage [get]
 
static AfflictionPrefab BiteWounds [get]
 
static AfflictionPrefab ImpactDamage [get]
 
static AfflictionPrefab Bleeding [get]
 
static AfflictionPrefab Burn [get]
 
static AfflictionPrefab OxygenLow [get]
 
static AfflictionPrefab Bloodloss [get]
 
static AfflictionPrefab Pressure [get]
 
static AfflictionPrefab OrganDamage [get]
 
static AfflictionPrefab Stun [get]
 
static AfflictionPrefab RadiationSickness [get]
 
static IEnumerable< AfflictionPrefabList [get]
 
Identifier[] TargetSpecies [get, protected set]
 A list of species this affliction is allowed to affect.
 
IEnumerable< EffectEffects [get]
 
IList< PeriodicEffectPeriodicEffects [get]
 
ImmutableDictionary< Identifier, float > TreatmentSuitabilities = new Dictionary<Identifier, float>().ToImmutableDictionary() [get]
 
bool HasTreatments [get]
 Can this affliction be treated with some item?
 
- Properties inherited from Barotrauma.PrefabWithUintIdentifier
UInt32 UintIdentifier [get, set]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.PrefabWithUintIdentifier
 PrefabWithUintIdentifier (ContentFile file, Identifier identifier)
 
 PrefabWithUintIdentifier (ContentFile file, ContentXElement element)
 
- Protected Member Functions inherited from Barotrauma.Prefab
virtual Identifier DetermineIdentifier (XElement element)
 

Detailed Description

AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character. There are multiple sub-types of afflictions such as AfflictionPrefabHusk, AfflictionPsychosis and AfflictionBleeding that can be used for additional functionality.

When defining a new affliction, the type will be determined by the element name.

<Afflictions>
<Affliction identifier="mycoolaffliction1" />
<AfflictionPrefabHusk identifier="mycoolaffliction2"/>
<AfflictionBleeding identifier="mycoolaffliction3"/>
</Afflictions>
A special affliction type that increases the character's Bloodloss affliction with a rate relative to...
Definition AfflictionBleeding.cs:7
AfflictionPrefabHusk is a special type of affliction that has added functionality for husk infection.
Definition AfflictionPrefab.cs:65
Definition Affliction.cs:11

Constructor & Destructor Documentation

◆ AfflictionPrefab()

Barotrauma.AfflictionPrefab.AfflictionPrefab ( ContentXElement element,
AfflictionsFile file,
Type type )

Member Function Documentation

◆ ClearAllEffects()

static void Barotrauma.AfflictionPrefab.ClearAllEffects ( )
static

Removes all the effects of the prefab (including the sounds and other assets defined in them). Note that you need to call LoadAllEffectsAndTreatmentSuitabilities before trying to use the affliction again!

◆ Dispose()

override void Barotrauma.AfflictionPrefab.Dispose ( )

◆ GetActiveEffect()

Effect Barotrauma.AfflictionPrefab.GetActiveEffect ( float currentStrength)

◆ GetDescription()

LocalizedString Barotrauma.AfflictionPrefab.GetDescription ( float strength,
Description.TargetType targetType )

◆ GetTreatmentSuitability()

float Barotrauma.AfflictionPrefab.GetTreatmentSuitability ( Item item)

◆ Instantiate()

Affliction Barotrauma.AfflictionPrefab.Instantiate ( float strength,
Character source = null )

◆ LoadAllEffectsAndTreatmentSuitabilities()

static void Barotrauma.AfflictionPrefab.LoadAllEffectsAndTreatmentSuitabilities ( )
static

Should be called before each round: loads all StatusEffects and refreshes treatment suitabilities.

◆ ToString()

override string Barotrauma.AfflictionPrefab.ToString ( )

Member Data Documentation

◆ AchievementOnReceived

readonly Identifier Barotrauma.AfflictionPrefab.AchievementOnReceived

Steam achievement given when the controlled character receives the affliction.

◆ AchievementOnRemoved

readonly Identifier Barotrauma.AfflictionPrefab.AchievementOnRemoved

Steam achievement given when the affliction is removed from the controlled character.

◆ ActivationThreshold

readonly float Barotrauma.AfflictionPrefab.ActivationThreshold = 0.0f

How high the strength has to be for the affliction to take effect.

◆ AffectMachines

readonly bool Barotrauma.AfflictionPrefab.AffectMachines

If set to true, this affliction can affect characters that are marked as machines, such as the Fractal Guardian.

◆ AfflictionOverlay

readonly Sprite Barotrauma.AfflictionPrefab.AfflictionOverlay

A sprite that covers the affected player's entire screen when this affliction is active. Its opacity is controlled by the active effect's MinAfflictionOverlayAlphaMultiplier and MaxAfflictionOverlayAlphaMultiplier.

◆ AfflictionOverlayAlphaIsLinear

readonly bool Barotrauma.AfflictionPrefab.AfflictionOverlayAlphaIsLinear

If set to true and the affliction has an AfflictionOverlay element, the overlay's opacity will be strictly proportional to its strength. Otherwise, the overlay's opacity will be determined based on its activation threshold and effects.

◆ AfflictionType

readonly Identifier Barotrauma.AfflictionPrefab.AfflictionType

Arbitrary string that is used to identify the type of the affliction.

◆ AlienInfectedType

readonly Identifier Barotrauma.AfflictionPrefab.AlienInfectedType = "alieninfected".ToIdentifier()
static

◆ BaseHealCost

readonly int Barotrauma.AfflictionPrefab.BaseHealCost

The minimum cost of healing this affliction at the medical clinic.

◆ BleedingType

readonly Identifier Barotrauma.AfflictionPrefab.BleedingType = "bleeding".ToIdentifier()
static

◆ BurnOverlayAlpha

readonly float Barotrauma.AfflictionPrefab.BurnOverlayAlpha

Opacity of the burn effect (darker tint) on limbs affected by this affliction. 1 = full strength.

◆ BurnType

readonly Identifier Barotrauma.AfflictionPrefab.BurnType = "burn".ToIdentifier()
static

◆ CauseOfDeathDescription

readonly LocalizedString Barotrauma.AfflictionPrefab.CauseOfDeathDescription

◆ DamageOverlayAlpha

readonly float Barotrauma.AfflictionPrefab.DamageOverlayAlpha

Opacity of the bloody damage overlay on limbs affected by this affliction. 1 = full strength.

◆ DamageParticles

readonly bool Barotrauma.AfflictionPrefab.DamageParticles

Should damage particles be emitted when a character receives this affliction? Only relevant if the affliction is of the type "bleeding" or "damage".

◆ DamageType

readonly Identifier Barotrauma.AfflictionPrefab.DamageType = "damage".ToIdentifier()
static

◆ Descriptions

readonly ImmutableList<Description> Barotrauma.AfflictionPrefab.Descriptions

◆ Duration

readonly float Barotrauma.AfflictionPrefab.Duration

The duration of the affliction, in seconds. If set to 0, the affliction does not expire.

◆ EMPType

readonly Identifier Barotrauma.AfflictionPrefab.EMPType = "emp".ToIdentifier()
static

◆ GrainBurst

readonly float Barotrauma.AfflictionPrefab.GrainBurst

The strength of the radiation grain effect to apply when the strength of this affliction increases.

◆ HealableInMedicalClinic

readonly bool Barotrauma.AfflictionPrefab.HealableInMedicalClinic

If set to true, this affliction can be healed at the medical clinic.

<doc> <override type="DefaultValue"> false if the affliction is a buff or has the type "geneticmaterialbuff" or "geneticmaterialdebuff", true otherwise. </override> </doc>

◆ HealCostMultiplier

readonly float Barotrauma.AfflictionPrefab.HealCostMultiplier

How much each unit of this affliction's strength will add to the cost of healing at the medical clinic.

◆ HideIconAfterDelay

readonly bool Barotrauma.AfflictionPrefab.HideIconAfterDelay

If set to true, this affliction's icon will be hidden from the HUD after 5 seconds.

◆ Icon

readonly Sprite Barotrauma.AfflictionPrefab.Icon

An icon that’s used in the UI to represent this affliction.

◆ IconColors

readonly Color [] Barotrauma.AfflictionPrefab.IconColors

A gradient that defines which color to render this affliction's icon with, based on the affliction's current strength.

◆ IgnoreTreatmentIfAfflictedBy

ImmutableHashSet<Identifier> Barotrauma.AfflictionPrefab.IgnoreTreatmentIfAfflictedBy

Bots will not try to treat the affliction if the character has any of these afflictions.

◆ IndicatorLimb

readonly LimbType Barotrauma.AfflictionPrefab.IndicatorLimb

If the affliction doesn't affect individual limbs, this attribute determines where the game will render the affliction's indicator when viewed in the in-game health UI.

For example, the psychosis indicator is rendered on the head, and low oxygen is rendered on the torso.

◆ InvertControlsType

readonly Identifier Barotrauma.AfflictionPrefab.InvertControlsType = "invertcontrols".ToIdentifier()
static

◆ IsBuff

readonly bool Barotrauma.AfflictionPrefab.IsBuff

If set to true, the game will recognize this affliction as a buff. This means, among other things, that bots won't attempt to treat it, and the health UI will render the affected limb in green rather than red.

◆ KarmaChangeOnApplied

float Barotrauma.AfflictionPrefab.KarmaChangeOnApplied

How much karma changes when a player applies this affliction to someone (per strength of the affliction)

◆ LimbSpecific

readonly bool Barotrauma.AfflictionPrefab.LimbSpecific

If set to true, the affliction affects individual limbs. Otherwise, it affects the whole character.

◆ MaxStrength

readonly float Barotrauma.AfflictionPrefab.MaxStrength = 100.0f

The maximum strength this affliction can have.

◆ MedicalSkillGain

readonly float Barotrauma.AfflictionPrefab.MedicalSkillGain

An arbitrary modifier that affects how much medical skill is increased when you apply the affliction on a target. If the affliction causes damage or is of the 'poison' or 'paralysis' type, the skill is increased only when the target is hostile. If the affliction is of the 'buff' type, the skill is increased only when the target is friendly.

◆ Name

readonly LocalizedString Barotrauma.AfflictionPrefab.Name

◆ ParalysisType

readonly Identifier Barotrauma.AfflictionPrefab.ParalysisType = "paralysis".ToIdentifier()
static

◆ PoisonType

readonly Identifier Barotrauma.AfflictionPrefab.PoisonType = "poison".ToIdentifier()
static

◆ Prefabs

readonly PrefabCollection<AfflictionPrefab> Barotrauma.AfflictionPrefab.Prefabs = new PrefabCollection<AfflictionPrefab>()
static

◆ ResetBetweenRounds

readonly bool Barotrauma.AfflictionPrefab.ResetBetweenRounds

If set to true, this affliction will not persist between rounds.

◆ SelfCauseOfDeathDescription

readonly LocalizedString Barotrauma.AfflictionPrefab.SelfCauseOfDeathDescription

◆ ShowBarInHealthMenu

readonly bool Barotrauma.AfflictionPrefab.ShowBarInHealthMenu

If set to false, the health UI will not show the strength of the affliction as a bar under its indicator.

◆ ShowIconThreshold

readonly float Barotrauma.AfflictionPrefab.ShowIconThreshold = 0.05f

How high the strength has to be for the affliction icon to be shown in the UI.

◆ ShowIconToOthersThreshold

readonly float Barotrauma.AfflictionPrefab.ShowIconToOthersThreshold = 0.05f

How high the strength has to be for the affliction icon to be shown to others with a health scanner or via the health interface.

◆ ShowInHealthScannerThreshold

readonly float Barotrauma.AfflictionPrefab.ShowInHealthScannerThreshold

How high the strength has to be for the affliction icon to be shown with a health scanner.

◆ SpaceHerpesType

readonly Identifier Barotrauma.AfflictionPrefab.SpaceHerpesType = "spaceherpes".ToIdentifier()
static

◆ StunType

readonly Identifier Barotrauma.AfflictionPrefab.StunType = "stun".ToIdentifier()
static

◆ TranslationIdentifier

readonly Identifier Barotrauma.AfflictionPrefab.TranslationIdentifier

Can be set to the identifier of another affliction to make this affliction reuse the same name and description.

◆ TreatmentThreshold

readonly float Barotrauma.AfflictionPrefab.TreatmentThreshold

How strong the affliction needs to be before bots attempt to treat it. Also effects when the affliction is shown in the suitable treatments list.

◆ WeaponsSkillGain

readonly float Barotrauma.AfflictionPrefab.WeaponsSkillGain

An arbitrary modifier that affects how much weapons skill is increased when you apply the affliction on a target. The skill is increased only when the target is hostile.

Property Documentation

◆ BiteWounds

AfflictionPrefab Barotrauma.AfflictionPrefab.BiteWounds
staticget

◆ Bleeding

AfflictionPrefab Barotrauma.AfflictionPrefab.Bleeding
staticget

◆ Bloodloss

AfflictionPrefab Barotrauma.AfflictionPrefab.Bloodloss
staticget

◆ Burn

AfflictionPrefab Barotrauma.AfflictionPrefab.Burn
staticget

◆ Effects

IEnumerable<Effect> Barotrauma.AfflictionPrefab.Effects
get

◆ HasTreatments

bool Barotrauma.AfflictionPrefab.HasTreatments
get

Can this affliction be treated with some item?

◆ ImpactDamage

AfflictionPrefab Barotrauma.AfflictionPrefab.ImpactDamage
staticget

◆ InternalDamage

AfflictionPrefab Barotrauma.AfflictionPrefab.InternalDamage
staticget

◆ List

IEnumerable<AfflictionPrefab> Barotrauma.AfflictionPrefab.List
staticget

◆ OrganDamage

AfflictionPrefab Barotrauma.AfflictionPrefab.OrganDamage
staticget

◆ OxygenLow

AfflictionPrefab Barotrauma.AfflictionPrefab.OxygenLow
staticget

◆ PeriodicEffects

IList<PeriodicEffect> Barotrauma.AfflictionPrefab.PeriodicEffects
get

◆ Pressure

AfflictionPrefab Barotrauma.AfflictionPrefab.Pressure
staticget

◆ RadiationSickness

AfflictionPrefab Barotrauma.AfflictionPrefab.RadiationSickness
staticget

◆ Stun

AfflictionPrefab Barotrauma.AfflictionPrefab.Stun
staticget

◆ TargetSpecies

Identifier [] Barotrauma.AfflictionPrefab.TargetSpecies
getprotected set

A list of species this affliction is allowed to affect.

◆ TreatmentSuitabilities

ImmutableDictionary<Identifier, float> Barotrauma.AfflictionPrefab.TreatmentSuitabilities = new Dictionary<Identifier, float>().ToImmutableDictionary()
get

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