Barotrauma Server 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)
 

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

Definition at line 13 of file LevelTrigger.cs.

Member Enumeration Documentation

◆ TriggererType

Enumerator
None 
Human 
Creature 
Character 
Submarine 
Item 
OtherTrigger 

Definition at line 16 of file LevelTrigger.cs.

◆ TriggerForceMode

Enumerator
Force 
Acceleration 
Impulse 
LimitVelocity 

Definition at line 27 of file LevelTrigger.cs.

Constructor & Destructor Documentation

◆ LevelTrigger()

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

Definition at line 202 of file LevelTrigger.cs.

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 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 LevelTrigger.cs.

◆ ApplyStatusEffects()

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

Definition at line 645 of file LevelTrigger.cs.

◆ 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 LevelTrigger.cs.

◆ CheckContactsForOtherFixtures()

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

Definition at line 408 of file LevelTrigger.cs.

◆ GetCollisionCategories()

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

Definition at line 301 of file LevelTrigger.cs.

◆ GetDistanceFactor()

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

Definition at line 754 of file LevelTrigger.cs.

◆ GetEntity()

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

Definition at line 462 of file LevelTrigger.cs.

◆ GetWaterFlowVelocity() [1/2]

Vector2 Barotrauma.LevelTrigger.GetWaterFlowVelocity ( )

Definition at line 771 of file LevelTrigger.cs.

◆ GetWaterFlowVelocity() [2/2]

Vector2 Barotrauma.LevelTrigger.GetWaterFlowVelocity ( Vector2  viewPosition)

Definition at line 759 of file LevelTrigger.cs.

◆ IsTriggeredByEntity()

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

Definition at line 357 of file LevelTrigger.cs.

◆ LoadAttack()

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

Definition at line 325 of file LevelTrigger.cs.

◆ LoadStatusEffect()

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

Definition at line 320 of file LevelTrigger.cs.

◆ 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 LevelTrigger.cs.

◆ RemoveInActiveTriggerers()

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

Definition at line 623 of file LevelTrigger.cs.

◆ ServerWrite()

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

Definition at line 787 of file LevelTrigger.cs.

◆ Update()

void Barotrauma.LevelTrigger.Update ( float  deltaTime)

Definition at line 506 of file LevelTrigger.cs.

Member Data Documentation

◆ OnTriggered

Action<LevelTrigger, Entity> Barotrauma.LevelTrigger.OnTriggered

Definition at line 35 of file LevelTrigger.cs.

◆ ParentTrigger

LevelTrigger Barotrauma.LevelTrigger.ParentTrigger

Definition at line 74 of file LevelTrigger.cs.

Property Documentation

◆ ColliderRadius

float Barotrauma.LevelTrigger.ColliderRadius
get

Definition at line 168 of file LevelTrigger.cs.

◆ Force

Vector2 Barotrauma.LevelTrigger.Force
get

Definition at line 122 of file LevelTrigger.cs.

◆ ForceFalloff

bool Barotrauma.LevelTrigger.ForceFalloff
get

does the force diminish by distance

Definition at line 131 of file LevelTrigger.cs.

◆ ForceFluctuationInterval

float Barotrauma.LevelTrigger.ForceFluctuationInterval
get

Definition at line 137 of file LevelTrigger.cs.

◆ ForceFluctuationStrength

float Barotrauma.LevelTrigger.ForceFluctuationStrength
get

Definition at line 142 of file LevelTrigger.cs.

◆ ForceMode

TriggerForceMode Barotrauma.LevelTrigger.ForceMode
get

Definition at line 154 of file LevelTrigger.cs.

◆ ForceVelocityLimit

float Barotrauma.LevelTrigger.ForceVelocityLimit
get

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

Definition at line 162 of file LevelTrigger.cs.

◆ GlobalForceDecreaseInterval

float Barotrauma.LevelTrigger.GlobalForceDecreaseInterval
get

Definition at line 147 of file LevelTrigger.cs.

◆ InfectIdentifier

Identifier Barotrauma.LevelTrigger.InfectIdentifier
getset

Definition at line 187 of file LevelTrigger.cs.

◆ InfectionChance

float Barotrauma.LevelTrigger.InfectionChance
getset

Definition at line 193 of file LevelTrigger.cs.

◆ IsTriggered

bool Barotrauma.LevelTrigger.IsTriggered
get

Definition at line 113 of file LevelTrigger.cs.

◆ NeedsNetworkSyncing

bool Barotrauma.LevelTrigger.NeedsNetworkSyncing
getset

Definition at line 181 of file LevelTrigger.cs.

◆ PhysicsBody

PhysicsBody Barotrauma.LevelTrigger.PhysicsBody
get

Definition at line 104 of file LevelTrigger.cs.

◆ Rotation

float? Barotrauma.LevelTrigger.Rotation
getset

Definition at line 93 of file LevelTrigger.cs.

◆ StatusEffects

IEnumerable<StatusEffect> Barotrauma.LevelTrigger.StatusEffects
get

Definition at line 41 of file LevelTrigger.cs.

◆ TriggererPosition

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

Definition at line 76 of file LevelTrigger.cs.

◆ Triggerers

IEnumerable<Entity> Barotrauma.LevelTrigger.Triggerers
get

Definition at line 108 of file LevelTrigger.cs.

◆ TriggerOthersDistance

float Barotrauma.LevelTrigger.TriggerOthersDistance
get

Definition at line 106 of file LevelTrigger.cs.

◆ UseNetworkSyncing

bool Barotrauma.LevelTrigger.UseNetworkSyncing
get

Definition at line 175 of file LevelTrigger.cs.

◆ WorldPosition

Vector2? Barotrauma.LevelTrigger.WorldPosition
getset

Definition at line 83 of file LevelTrigger.cs.