Client LuaCsForBarotrauma
Vent.cs
1 using System;
2 using System.Xml.Linq;
3 
5 {
7  {
8  private float oxygenFlow;
9 
10  public float OxygenFlow
11  {
12  get { return oxygenFlow; }
13  set { oxygenFlow = Math.Max(value, 0.0f); }
14  }
15 
16  public Vent (Item item, ContentXElement element) : base(item, element) { }
17 
18  public override void Update(float deltaTime, Camera cam)
19  {
20  if (item.CurrentHull == null || item.InWater) { return; }
21 
22  if (oxygenFlow > 0.0f)
23  {
24  ApplyStatusEffects(ActionType.OnActive, deltaTime);
25  }
26 
27  item.CurrentHull.Oxygen += oxygenFlow * deltaTime;
28  OxygenFlow -= deltaTime * 1000.0f;
29  }
30  }
31 }
The base class for components holding the different functionalities of the item
void ApplyStatusEffects(ActionType type, float deltaTime, Character character=null, Limb targetLimb=null, Entity useTarget=null, Character user=null, Vector2? worldPosition=null, float afflictionMultiplier=1.0f)
Vent(Item item, ContentXElement element)
Definition: Vent.cs:16
override void Update(float deltaTime, Camera cam)
Definition: Vent.cs:18
ActionType
ActionTypes define when a StatusEffect is executed.
Definition: Enums.cs:26