Lung tweaks (#6634)

This commit is contained in:
mirrorcult
2022-02-10 14:58:41 -07:00
committed by GitHub
parent a8f3e56bc4
commit 2738b46362
8 changed files with 10 additions and 25 deletions

View File

@@ -11,7 +11,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Body.Components;
[RegisterComponent, Friend(typeof(LungSystem))]
public class LungComponent : Component
public sealed class LungComponent : Component
{
[DataField("air")]
public GasMixture Air { get; set; } = new()
@@ -20,9 +20,6 @@ public class LungComponent : Component
Temperature = Atmospherics.NormalBodyTemperature
};
[DataField("validReagentGases", required: true)]
public HashSet<Gas> ValidGases = default!;
[ViewVariables]
public Solution LungSolution = default!;
}

View File

@@ -9,7 +9,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Body.Components
{
[RegisterComponent, Friend(typeof(RespiratorSystem))]
public class RespiratorComponent : Component
public sealed class RespiratorComponent : Component
{
/// <summary>
/// Saturation level. Reduced by CycleDelay each tick.
@@ -28,7 +28,7 @@ namespace Content.Server.Body.Components
public float MaxSaturation = 5.0f;
[DataField("minSaturation")]
public float MinSaturation = -5.0f;
public float MinSaturation = -2.0f;
// TODO HYPEROXIA?

View File

@@ -54,7 +54,7 @@ public class LungSystem : EntitySystem
public void GasToReagent(EntityUid uid, LungComponent lung)
{
foreach (var gas in lung.ValidGases)
foreach (var gas in Enum.GetValues<Gas>())
{
var i = (int) gas;
var moles = lung.Air.Moles[i];