Barotrauma Client Doc
Barotrauma.LevelTrigger Class Reference

Public Types

enum class  TriggererType {
  None = 0 , Human = 1 , Creature = 2 , Character = Human | Creature ,
  Submarine = 4 , Item = 8 , OtherTrigger = 16
}
 
enum class  TriggerForceMode { Force , Acceleration , Impulse , LimitVelocity }
 

Public Member Functions

 LevelTrigger (ContentXElement element, Vector2 position, float rotation, float scale=1.0f, string parentDebugName="")
 
void OtherTriggered (LevelTrigger otherTrigger, Entity triggerer)
 Another trigger was triggered, check if this one should react to it More...
 
void Update (float deltaTime)
 
Vector2 GetWaterFlowVelocity (Vector2 viewPosition)
 
Vector2 GetWaterFlowVelocity ()
 
void ServerWrite (IWriteMessage msg, Client c)
 
void ClientRead (IReadMessage msg)
 

Static Public Member Functions

static Category GetCollisionCategories (TriggererType triggeredBy)
 
static void LoadStatusEffect (List< StatusEffect > statusEffects, ContentXElement element, string parentDebugName)
 
static void LoadAttack (ContentXElement element, string parentDebugName, bool triggerOnce, List< Attack > attacks)
 
static bool IsTriggeredByEntity (Entity entity, TriggererType triggeredBy, bool mustBeOutside=false,(bool mustBe, Submarine sub) mustBeOnSpecificSub=default)
 
static bool CheckContactsForOtherFixtures (PhysicsBody triggerBody, Fixture otherFixture, Entity separatingEntity)
 
static bool CheckContactsForEntity (PhysicsBody triggerBody, Entity targetEntity)
 Are there any active contacts between the physics body and the target entity More...
 
static Entity GetEntity (Fixture fixture)
 
static void RemoveInActiveTriggerers (PhysicsBody physicsBody, HashSet< Entity > triggerers)
 
static void ApplyStatusEffects (List< StatusEffect > statusEffects, Vector2 worldPosition, Entity triggerer, float deltaTime, List< ISerializableEntity > targets)
 
static void ApplyAttacks (List< Attack > attacks, IDamageable damageable, Vector2 worldPosition, float deltaTime)
 Applies attacks to a damageable. More...
 
static void ApplyAttacks (List< Attack > attacks, Vector2 worldPosition, float deltaTime)
 Applies attacks to structures. More...
 
static float GetDistanceFactor (PhysicsBody triggererBody, PhysicsBody triggerBody, float colliderRadius)
 

Public Attributes

Action< LevelTrigger, EntityOnTriggered
 
LevelTrigger ParentTrigger
 

Properties

IEnumerable< StatusEffectStatusEffects [get]
 
Dictionary< Entity, Vector2 > TriggererPosition [get]
 
Vector2? WorldPosition [get, set]
 
float? Rotation [get, set]
 
PhysicsBody PhysicsBody [get]
 
float TriggerOthersDistance [get]
 
IEnumerable< EntityTriggerers [get]
 
bool IsTriggered [get]
 
Vector2 Force [get]
 
bool ForceFalloff [get]
 does the force diminish by distance More...
 
float ForceFluctuationInterval [get]
 
float ForceFluctuationStrength [get]
 
float GlobalForceDecreaseInterval [get]
 
TriggerForceMode ForceMode [get]
 
float ForceVelocityLimit [get]
 Stop applying forces to objects if they're moving faster than this More...
 
float ColliderRadius [get]
 
bool UseNetworkSyncing [get]
 
bool NeedsNetworkSyncing [get, set]
 
Identifier InfectIdentifier [get, set]
 
float InfectionChance [get, set]
 

Detailed Description

Member Enumeration Documentation

◆ TriggererType

Enumerator
None 
Human 
Creature 
Character 
Submarine 
Item 
OtherTrigger 

Definition at line 16 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ TriggerForceMode

Enumerator
Force 
Acceleration 
Impulse 
LimitVelocity 

Definition at line 27 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

Constructor & Destructor Documentation

◆ LevelTrigger()

Barotrauma.LevelTrigger.LevelTrigger ( ContentXElement  element,
Vector2  position,
float  rotation,
float  scale = 1.0f,
string  parentDebugName = "" 
)

Member Function Documentation

◆ ApplyAttacks() [1/2]

static void Barotrauma.LevelTrigger.ApplyAttacks ( List< Attack attacks,
IDamageable  damageable,
Vector2  worldPosition,
float  deltaTime 
)
static

Applies attacks to a damageable.

Definition at line 687 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ ApplyAttacks() [2/2]

static void Barotrauma.LevelTrigger.ApplyAttacks ( List< Attack attacks,
Vector2  worldPosition,
float  deltaTime 
)
static

Applies attacks to structures.

Definition at line 698 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ ApplyStatusEffects()

static void Barotrauma.LevelTrigger.ApplyStatusEffects ( List< StatusEffect statusEffects,
Vector2  worldPosition,
Entity  triggerer,
float  deltaTime,
List< ISerializableEntity targets 
)
static

◆ CheckContactsForEntity()

static bool Barotrauma.LevelTrigger.CheckContactsForEntity ( PhysicsBody  triggerBody,
Entity  targetEntity 
)
static

Are there any active contacts between the physics body and the target entity

Definition at line 439 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ CheckContactsForOtherFixtures()

static bool Barotrauma.LevelTrigger.CheckContactsForOtherFixtures ( PhysicsBody  triggerBody,
Fixture  otherFixture,
Entity  separatingEntity 
)
static

◆ ClientRead()

void Barotrauma.LevelTrigger.ClientRead ( IReadMessage  msg)

◆ GetCollisionCategories()

static Category Barotrauma.LevelTrigger.GetCollisionCategories ( TriggererType  triggeredBy)
static

◆ GetDistanceFactor()

static float Barotrauma.LevelTrigger.GetDistanceFactor ( PhysicsBody  triggererBody,
PhysicsBody  triggerBody,
float  colliderRadius 
)
static

◆ GetEntity()

static Entity Barotrauma.LevelTrigger.GetEntity ( Fixture  fixture)
static

◆ GetWaterFlowVelocity() [1/2]

Vector2 Barotrauma.LevelTrigger.GetWaterFlowVelocity ( )

◆ GetWaterFlowVelocity() [2/2]

Vector2 Barotrauma.LevelTrigger.GetWaterFlowVelocity ( Vector2  viewPosition)

◆ IsTriggeredByEntity()

static bool Barotrauma.LevelTrigger.IsTriggeredByEntity ( Entity  entity,
TriggererType  triggeredBy,
bool  mustBeOutside = false,
(bool mustBe, Submarine sub)  mustBeOnSpecificSub = default 
)
static

◆ LoadAttack()

static void Barotrauma.LevelTrigger.LoadAttack ( ContentXElement  element,
string  parentDebugName,
bool  triggerOnce,
List< Attack attacks 
)
static

◆ LoadStatusEffect()

static void Barotrauma.LevelTrigger.LoadStatusEffect ( List< StatusEffect statusEffects,
ContentXElement  element,
string  parentDebugName 
)
static

◆ OtherTriggered()

void Barotrauma.LevelTrigger.OtherTriggered ( LevelTrigger  otherTrigger,
Entity  triggerer 
)

Another trigger was triggered, check if this one should react to it

Definition at line 474 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ RemoveInActiveTriggerers()

static void Barotrauma.LevelTrigger.RemoveInActiveTriggerers ( PhysicsBody  physicsBody,
HashSet< Entity triggerers 
)
static

◆ ServerWrite()

void Barotrauma.LevelTrigger.ServerWrite ( IWriteMessage  msg,
Client  c 
)

◆ Update()

void Barotrauma.LevelTrigger.Update ( float  deltaTime)

Member Data Documentation

◆ OnTriggered

Action<LevelTrigger, Entity> Barotrauma.LevelTrigger.OnTriggered

◆ ParentTrigger

LevelTrigger Barotrauma.LevelTrigger.ParentTrigger

Property Documentation

◆ ColliderRadius

float Barotrauma.LevelTrigger.ColliderRadius
get

◆ Force

Vector2 Barotrauma.LevelTrigger.Force
get

◆ ForceFalloff

bool Barotrauma.LevelTrigger.ForceFalloff
get

does the force diminish by distance

Definition at line 131 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ ForceFluctuationInterval

float Barotrauma.LevelTrigger.ForceFluctuationInterval
get

◆ ForceFluctuationStrength

float Barotrauma.LevelTrigger.ForceFluctuationStrength
get

◆ ForceMode

TriggerForceMode Barotrauma.LevelTrigger.ForceMode
get

◆ ForceVelocityLimit

float Barotrauma.LevelTrigger.ForceVelocityLimit
get

Stop applying forces to objects if they're moving faster than this

Definition at line 162 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs.

◆ GlobalForceDecreaseInterval

float Barotrauma.LevelTrigger.GlobalForceDecreaseInterval
get

◆ InfectIdentifier

Identifier Barotrauma.LevelTrigger.InfectIdentifier
getset

◆ InfectionChance

float Barotrauma.LevelTrigger.InfectionChance
getset

◆ IsTriggered

bool Barotrauma.LevelTrigger.IsTriggered
get

◆ NeedsNetworkSyncing

bool Barotrauma.LevelTrigger.NeedsNetworkSyncing
getset

◆ PhysicsBody

PhysicsBody Barotrauma.LevelTrigger.PhysicsBody
get

◆ Rotation

float? Barotrauma.LevelTrigger.Rotation
getset

◆ StatusEffects

IEnumerable<StatusEffect> Barotrauma.LevelTrigger.StatusEffects
get

◆ TriggererPosition

Dictionary<Entity, Vector2> Barotrauma.LevelTrigger.TriggererPosition
get

◆ Triggerers

IEnumerable<Entity> Barotrauma.LevelTrigger.Triggerers
get

◆ TriggerOthersDistance

float Barotrauma.LevelTrigger.TriggerOthersDistance
get

◆ UseNetworkSyncing

bool Barotrauma.LevelTrigger.UseNetworkSyncing
get

◆ WorldPosition

Vector2? Barotrauma.LevelTrigger.WorldPosition
getset