Barotrauma Client
|
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...
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) |
![]() | |
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 void | DisallowCallFromConstructor () |
Public Attributes | |
readonly LocalizedString | Name |
readonly LocalizedString | CauseOfDeathDescription |
readonly LocalizedString | SelfCauseOfDeathDescription |
readonly ImmutableList< Description > | Descriptions |
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< Identifier > | IgnoreTreatmentIfAfflictedBy |
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. | |
![]() | |
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< AfflictionPrefab > | Prefabs = new PrefabCollection<AfflictionPrefab>() |
![]() | |
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< AfflictionPrefab > | List [get] |
Identifier[] | TargetSpecies [get, protected set] |
A list of species this affliction is allowed to affect. | |
IEnumerable< Effect > | Effects [get] |
IList< PeriodicEffect > | PeriodicEffects [get] |
ImmutableDictionary< Identifier, float > | TreatmentSuitabilities = new Dictionary<Identifier, float>().ToImmutableDictionary() [get] |
bool | HasTreatments [get] |
Can this affliction be treated with some item? | |
![]() | |
UInt32 | UintIdentifier [get, set] |
![]() | |
ContentPackage? | ContentPackage [get] |
ContentPath | FilePath [get] |
Additional Inherited Members | |
![]() | |
PrefabWithUintIdentifier (ContentFile file, Identifier identifier) | |
PrefabWithUintIdentifier (ContentFile file, ContentXElement element) | |
![]() | |
virtual Identifier | DetermineIdentifier (XElement element) |
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.
Barotrauma.AfflictionPrefab.AfflictionPrefab | ( | ContentXElement | element, |
AfflictionsFile | file, | ||
Type | type ) |
|
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!
override void Barotrauma.AfflictionPrefab.Dispose | ( | ) |
Effect Barotrauma.AfflictionPrefab.GetActiveEffect | ( | float | currentStrength | ) |
LocalizedString Barotrauma.AfflictionPrefab.GetDescription | ( | float | strength, |
Description.TargetType | targetType ) |
float Barotrauma.AfflictionPrefab.GetTreatmentSuitability | ( | Item | item | ) |
Affliction Barotrauma.AfflictionPrefab.Instantiate | ( | float | strength, |
Character | source = null ) |
|
static |
Should be called before each round: loads all StatusEffects and refreshes treatment suitabilities.
override string Barotrauma.AfflictionPrefab.ToString | ( | ) |
readonly Identifier Barotrauma.AfflictionPrefab.AchievementOnReceived |
Steam achievement given when the controlled character receives the affliction.
readonly Identifier Barotrauma.AfflictionPrefab.AchievementOnRemoved |
Steam achievement given when the affliction is removed from the controlled character.
readonly float Barotrauma.AfflictionPrefab.ActivationThreshold = 0.0f |
How high the strength has to be for the affliction to take effect.
readonly bool Barotrauma.AfflictionPrefab.AffectMachines |
If set to true, this affliction can affect characters that are marked as machines, such as the Fractal Guardian.
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.
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.
readonly Identifier Barotrauma.AfflictionPrefab.AfflictionType |
Arbitrary string that is used to identify the type of the affliction.
|
static |
readonly int Barotrauma.AfflictionPrefab.BaseHealCost |
The minimum cost of healing this affliction at the medical clinic.
|
static |
readonly float Barotrauma.AfflictionPrefab.BurnOverlayAlpha |
Opacity of the burn effect (darker tint) on limbs affected by this affliction. 1 = full strength.
|
static |
readonly LocalizedString Barotrauma.AfflictionPrefab.CauseOfDeathDescription |
readonly float Barotrauma.AfflictionPrefab.DamageOverlayAlpha |
Opacity of the bloody damage overlay on limbs affected by this affliction. 1 = full strength.
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".
|
static |
readonly ImmutableList<Description> Barotrauma.AfflictionPrefab.Descriptions |
readonly float Barotrauma.AfflictionPrefab.Duration |
The duration of the affliction, in seconds. If set to 0, the affliction does not expire.
|
static |
readonly float Barotrauma.AfflictionPrefab.GrainBurst |
The strength of the radiation grain effect to apply when the strength of this affliction increases.
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>
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.
readonly bool Barotrauma.AfflictionPrefab.HideIconAfterDelay |
If set to true, this affliction's icon will be hidden from the HUD after 5 seconds.
readonly Sprite Barotrauma.AfflictionPrefab.Icon |
An icon that’s used in the UI to represent this affliction.
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.
ImmutableHashSet<Identifier> Barotrauma.AfflictionPrefab.IgnoreTreatmentIfAfflictedBy |
Bots will not try to treat the affliction if the character has any of these afflictions.
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.
|
static |
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.
float Barotrauma.AfflictionPrefab.KarmaChangeOnApplied |
How much karma changes when a player applies this affliction to someone (per strength of the affliction)
readonly bool Barotrauma.AfflictionPrefab.LimbSpecific |
If set to true, the affliction affects individual limbs. Otherwise, it affects the whole character.
readonly float Barotrauma.AfflictionPrefab.MaxStrength = 100.0f |
The maximum strength this affliction can have.
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.
readonly LocalizedString Barotrauma.AfflictionPrefab.Name |
|
static |
|
static |
|
static |
readonly bool Barotrauma.AfflictionPrefab.ResetBetweenRounds |
If set to true, this affliction will not persist between rounds.
readonly LocalizedString Barotrauma.AfflictionPrefab.SelfCauseOfDeathDescription |
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.
readonly float Barotrauma.AfflictionPrefab.ShowIconThreshold = 0.05f |
How high the strength has to be for the affliction icon to be shown in the UI.
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.
readonly float Barotrauma.AfflictionPrefab.ShowInHealthScannerThreshold |
How high the strength has to be for the affliction icon to be shown with a health scanner.
|
static |
|
static |
readonly Identifier Barotrauma.AfflictionPrefab.TranslationIdentifier |
Can be set to the identifier of another affliction to make this affliction reuse the same name and description.
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.
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.
|
staticget |
|
staticget |
|
staticget |
|
staticget |
|
get |
|
get |
Can this affliction be treated with some item?
|
staticget |
|
staticget |
|
staticget |
|
staticget |
|
staticget |
|
get |
|
staticget |
|
staticget |
|
staticget |
|
getprotected set |
A list of species this affliction is allowed to affect.
|
get |