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

Public Types

enum  TriggererType {
  None = 0 , Human = 1 , Creature = 2 , Character = Human | Creature ,
  Submarine = 4 , Item = 8 , OtherTrigger = 16
}
 
enum  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.
 
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 separatingFixture, Entity separatingEntity)
 Checks whether any fixture of the trigger body is in contact with any fixture belonging to the physics bodies of separatingEntity.
 
static bool CheckContactsForEntity (PhysicsBody triggerBody, Entity targetEntity)
 Are there any active contacts between the physics body and the target entity.
 
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.
 
static void ApplyAttacks (List< Attack > attacks, Vector2 worldPosition, float deltaTime)
 Applies attacks to structures.
 
static float GetDistanceFactor (PhysicsBody triggererBody, PhysicsBody triggerBody, float colliderRadius)
 

Public Attributes

Action< LevelTrigger, EntityOnTriggered
 
LevelTrigger ParentTrigger
 

Properties

IEnumerable< StatusEffectStatusEffects [get]
 
Dictionary< Entity, Vector2TriggererPosition [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
 
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.
 
float ColliderRadius [get]
 
bool UseNetworkSyncing [get]
 
bool NeedsNetworkSyncing [get, set]
 
Identifier InfectIdentifier [get, set]
 
float InfectionChance [get, set]
 

Member Enumeration Documentation

◆ TriggererType

Enumerator
None 
Human 
Creature 
Character 
Submarine 
Item 
OtherTrigger 

◆ TriggerForceMode

Enumerator
Force 
Acceleration 
Impulse 
LimitVelocity 

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.

◆ ApplyAttacks() [2/2]

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

Applies attacks to structures.

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

◆ CheckContactsForOtherFixtures()

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

Checks whether any fixture of the trigger body is in contact with any fixture belonging to the physics bodies of separatingEntity.

Parameters
triggerBodyPhysics body of the trigger
separatingFixtureFixture that got separated from the trigger
separatingEntityEntity that got separated from the trigger
Returns

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

◆ 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

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

◆ 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

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