Adds barotrauma (pressure damage) (#1605)
* Adds barotrauma, disables it for now * At least show status effect, but don't damage the mobs * Fix switch misuse
This commit is contained in:
committed by
GitHub
parent
079937a9fe
commit
ffc9a24ea0
29
Content.Server/GameObjects/EntitySystems/BarotraumaSystem.cs
Normal file
29
Content.Server/GameObjects/EntitySystems/BarotraumaSystem.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Content.Server.GameObjects.Components.Atmos;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class BarotraumaSystem : EntitySystem
|
||||
{
|
||||
private const float TimePerUpdate = 0.5f;
|
||||
|
||||
private float _timer = 0f;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
_timer += frameTime;
|
||||
|
||||
if (_timer < TimePerUpdate) return;
|
||||
|
||||
_timer = 0f;
|
||||
|
||||
foreach (var barotraumaComp in ComponentManager.EntityQuery<BarotraumaComponent>())
|
||||
{
|
||||
barotraumaComp.Update(frameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user