Barotrauma Client Doc
Barotrauma.DelayedEffect Class Reference
Inheritance diagram for Barotrauma.DelayedEffect:
Barotrauma.StatusEffect

Public Member Functions

 DelayedEffect (ContentXElement element, string parentDebugName)
 
override void Apply (ActionType type, float deltaTime, Entity entity, ISerializableEntity target, Vector2? worldPosition=null)
 
override void Apply (ActionType type, float deltaTime, Entity entity, IReadOnlyList< ISerializableEntity > targets, Vector2? worldPosition=null)
 
- Public Member Functions inherited from Barotrauma.StatusEffect
bool HasTargetType (TargetType targetType)
 
bool ReducesItemCondition ()
 
bool IncreasesItemCondition ()
 
bool MatchesTagConditionals (ItemPrefab itemPrefab)
 
bool HasRequiredAfflictions (AttackResult attackResult)
 
virtual bool HasRequiredItems (Entity entity)
 
void AddNearbyTargets (Vector2 worldPosition, List< ISerializableEntity > targets)
 
bool HasRequiredConditions (IReadOnlyList< ISerializableEntity > targets)
 
void SetUser (Character user)
 
bool ShouldWaitForInterval (Entity entity, float deltaTime)
 
void AddTag (Identifier tag)
 
bool HasTag (Identifier tag)
 

Static Public Member Functions

static void Update (float deltaTime)
 
- Static Public Member Functions inherited from Barotrauma.StatusEffect
static StatusEffect Load (ContentXElement element, string parentDebugName)
 
static void UpdateAll (float deltaTime)
 
static void StopAll ()
 

Static Public Attributes

static readonly List< DelayedListElementDelayList = new List<DelayedListElement>()
 
- Static Public Attributes inherited from Barotrauma.StatusEffect
static readonly List< DurationListElementDurationList = new List<DurationListElement>()
 

Additional Inherited Members

- Public Types inherited from Barotrauma.StatusEffect
enum class  TargetType {
  This = 1 , Parent = 2 , Character = 4 , Contained = 8 ,
  NearbyCharacters = 16 , NearbyItems = 32 , UseTarget = 64 , Hull = 128 ,
  Limb = 256 , AllLimbs = 512 , LastLimb = 1024
}
 
- Public Attributes inherited from Barotrauma.StatusEffect
int TargetSlot = -1
 Index of the slot the target must be in. Only valid when targeting a Contained item. More...
 
readonly ImmutableArray<(Identifier propertyName, object value)> PropertyEffects
 
readonly bool CheckConditionalAlways
 Only applicable for StatusEffects with a duration or delay. Should the conditional checks only be done when the effect triggers, or for the whole duration it executes / when the delay runs out and the effect executes? In other words, if false, the conditionals are only checked once when the effect triggers, but after that it can keep running for the whole duration, or is guaranteed to execute after the delay. More...
 
readonly bool Stackable = true
 Only valid if the effect has a duration or delay. Can the effect be applied on the same target(s) if the effect is already being applied? More...
 
readonly float Interval
 The interval at which the effect is executed. The difference between delay and interval is that effects with a delay find the targets, check the conditions, etc immediately when Apply is called, but don't apply the effects until the delay has passed. Effects with an interval check if the interval has passed when Apply is called and apply the effects if it has, otherwise they do nothing. More...
 
readonly ActionType type = ActionType.OnActive
 
readonly List< GiveTalentInfogiveTalentInfos
 
readonly float FireSize
 
readonly LimbType[] targetLimbs
 Which types of limbs this effect can target? Only valid when targeting characters or limbs. More...
 
readonly float SeverLimbsProbability
 The probability of severing a limb damaged by this status effect. Only valid when targeting characters or limbs. More...
 
PhysicsBody sourceBody
 
readonly bool OnlyInside
 If enabled, this effect can only execute inside a hull. More...
 
readonly bool OnlyOutside
 If enabled, this effect can only execute outside hulls. More...
 
readonly bool OnlyWhenDamagedByPlayer
 If enabled, the effect only executes when the entity receives damage from a player character (a character controlled by a human player). Only valid for characters, and effects of the type OnDamaged. More...
 
readonly bool AllowWhenBroken = false
 Can the StatusEffect be applied when the item applying it is broken? More...
 
readonly ImmutableHashSet< IdentifierTargetIdentifiers
 Identifier(s), tag(s) or species name(s) of the entity the effect can target. Null if there's no identifiers. More...
 
readonly string TargetItemComponent
 If set to the name of one of the target's ItemComponents, the effect is only applied on that component. Only works on items. More...
 
float AfflictionMultiplier = 1.0f
 
readonly List<(Identifier AfflictionIdentifier, float ReduceAmount)> ReduceAffliction = new List<(Identifier affliction, float amount)>()
 
readonly float Duration
 How long the effect runs (in seconds). Note that if Stackable is true, there can be multiple instances of the effect running at a time. In other words, if the effect has a duration and executes every frame, you probably want to make it non-stackable or it'll lead to a large number of overlapping effects running at the same time. More...
 
- Protected Member Functions inherited from Barotrauma.StatusEffect
 StatusEffect (ContentXElement element, string parentDebugName)
 
bool IsValidTarget (ISerializableEntity entity)
 
bool IsValidTarget (ItemComponent itemComponent)
 
bool IsValidTarget (Item item)
 
bool IsValidTarget (Character character)
 
void Apply (float deltaTime, Entity entity, IReadOnlyList< ISerializableEntity > targets, Vector2? worldPosition=null)
 
- Protected Attributes inherited from Barotrauma.StatusEffect
readonly List< ISerializableEntitycurrentTargets = new List<ISerializableEntity>()
 
- Properties inherited from Barotrauma.StatusEffect
bool HasConditions [get]
 
IEnumerable< Explosion >?? Explosions [get]
 
List< AfflictionAfflictions = new List<Affliction>() [get]
 
IEnumerable< CharacterSpawnInfo >?? SpawnCharacters [get]
 
float Range [get]
 How close to the entity executing the effect the targets must be. Only applicable if targeting NearbyCharacters or NearbyItems. More...
 
Vector2 Offset [get]
 An offset added to the position of the effect is executed at. Only relevant if the effect does something where position matters, for example emitting particles or explosions, spawning something or playing sounds. More...
 
string Tags [get, set]
 
bool Disabled [get]
 
IEnumerable< RoundSoundSounds [get]
 

Detailed Description

Definition at line 30 of file DelayedEffect.cs.

Constructor & Destructor Documentation

◆ DelayedEffect()

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

Definition at line 39 of file DelayedEffect.cs.

Member Function Documentation

◆ Apply() [1/2]

override void Barotrauma.DelayedEffect.Apply ( ActionType  type,
float  deltaTime,
Entity  entity,
IReadOnlyList< ISerializableEntity targets,
Vector2?  worldPosition = null 
)
virtual

Reimplemented from Barotrauma.StatusEffect.

Definition at line 89 of file DelayedEffect.cs.

◆ Apply() [2/2]

override void Barotrauma.DelayedEffect.Apply ( ActionType  type,
float  deltaTime,
Entity  entity,
ISerializableEntity  target,
Vector2?  worldPosition = null 
)
virtual

Reimplemented from Barotrauma.StatusEffect.

Definition at line 49 of file DelayedEffect.cs.

◆ Update()

static void Barotrauma.DelayedEffect.Update ( float  deltaTime)
static

Definition at line 140 of file DelayedEffect.cs.

Member Data Documentation

◆ DelayList

readonly List<DelayedListElement> Barotrauma.DelayedEffect.DelayList = new List<DelayedListElement>()
static

Definition at line 32 of file DelayedEffect.cs.