Client LuaCsForBarotrauma
Vent.cs
1
using
System;
2
using
System.Xml.Linq;
3
4
namespace
Barotrauma.Items.Components
5
{
6
class
Vent
:
ItemComponent
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
}
Barotrauma.Camera
Definition:
Camera.cs:10
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.Hull.Oxygen
float Oxygen
Definition:
BarotraumaShared/SharedSource/Map/Hull.cs:316
Barotrauma.Item
Definition:
BarotraumaShared/SharedSource/Items/Item.cs:26
Barotrauma.Item.CurrentHull
Hull CurrentHull
Definition:
BarotraumaShared/SharedSource/Items/Item.cs:71
Barotrauma.Item.InWater
bool InWater
Definition:
BarotraumaShared/SharedSource/Items/Item.cs:883
Barotrauma.Items.Components.ItemComponent
The base class for components holding the different functionalities of the item
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:35
Barotrauma.Items.Components.ItemComponent.ApplyStatusEffects
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)
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:920
Barotrauma.Items.Components.ItemComponent.item
Item item
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:36
Barotrauma.Items.Components.Vent
Definition:
Vent.cs:7
Barotrauma.Items.Components.Vent.Vent
Vent(Item item, ContentXElement element)
Definition:
Vent.cs:16
Barotrauma.Items.Components.Vent.Update
override void Update(float deltaTime, Camera cam)
Definition:
Vent.cs:18
Barotrauma.Items.Components.Vent.OxygenFlow
float OxygenFlow
Definition:
Vent.cs:11
Barotrauma.Items.Components
Definition:
BarotraumaShared/SharedSource/Items/Components/DockingPort.cs:15
Barotrauma.ActionType
ActionType
ActionTypes define when a StatusEffect is executed.
Definition:
Enums.cs:26
Barotrauma
BarotraumaShared
SharedSource
Items
Components
Machines
Vent.cs
Generated by
1.9.1