Revert "epic Respiration Rework" (#6524)

This commit is contained in:
Leon Friedrich
2022-02-07 20:13:14 +13:00
committed by GitHub
parent 35eb6f8576
commit 6e8c92d13e
32 changed files with 585 additions and 595 deletions

View File

@@ -11,7 +11,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Body.Components
{
[RegisterComponent, Friend(typeof(BloodstreamSystem))]
public class BloodstreamComponent : Component
public class BloodstreamComponent : Component, IGasMixtureHolder
{
/// <summary>
/// Max volume of internal solution storage
@@ -24,5 +24,9 @@ namespace Content.Server.Body.Components
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public Solution Solution = default!;
[ViewVariables]
public GasMixture Air { get; set; } = new(6)
{ Temperature = Atmospherics.NormalBodyTemperature };
}
}

View File

@@ -1,8 +1,7 @@
using System.Collections.Generic;
using System;
using Content.Server.Atmos;
using Content.Server.Body.Systems;
using Content.Shared.Atmos;
using Content.Shared.Chemistry.Components;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -13,6 +12,11 @@ namespace Content.Server.Body.Components;
[RegisterComponent, Friend(typeof(LungSystem))]
public class LungComponent : Component
{
public float AccumulatedFrametime;
[ViewVariables]
public TimeSpan LastGaspPopupTime;
[DataField("air")]
public GasMixture Air { get; set; } = new()
{
@@ -20,9 +24,19 @@ public class LungComponent : Component
Temperature = Atmospherics.NormalBodyTemperature
};
[DataField("validReagentGases", required: true)]
public HashSet<Gas> ValidGases = default!;
[DataField("gaspPopupCooldown")]
public TimeSpan GaspPopupCooldown { get; private set; } = TimeSpan.FromSeconds(8);
[ViewVariables]
public Solution LungSolution = default!;
public LungStatus Status { get; set; }
[DataField("cycleDelay")]
public float CycleDelay { get; set; } = 2;
}
public enum LungStatus
{
None = 0,
Inhaling,
Exhaling
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Content.Server.Body.Systems;
using Content.Shared.Atmos;
using Content.Shared.Damage;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
@@ -11,26 +12,19 @@ namespace Content.Server.Body.Components
[RegisterComponent, Friend(typeof(RespiratorSystem))]
public class RespiratorComponent : Component
{
/// <summary>
/// Saturation level. Reduced by CycleDelay each tick.
/// Can be thought of as 'how many seconds you have until you start suffocating' in this configuration.
/// </summary>
[DataField("saturation")]
public float Saturation = 5.0f;
[ViewVariables]
[DataField("needsGases")]
public Dictionary<Gas, float> NeedsGases { get; set; } = new();
/// <summary>
/// At what level of saturation will you begin to suffocate?
/// </summary>
[DataField("suffocationThreshold")]
public float SuffocationThreshold;
[ViewVariables]
[DataField("producesGases")]
public Dictionary<Gas, float> ProducesGases { get; set; } = new();
[DataField("maxSaturation")]
public float MaxSaturation = 5.0f;
[ViewVariables]
[DataField("deficitGases")]
public Dictionary<Gas, float> DeficitGases { get; set; } = new();
[DataField("minSaturation")]
public float MinSaturation = -5.0f;
// TODO HYPEROXIA?
[ViewVariables] public bool Suffocating { get; set; }
[DataField("damage", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
@@ -40,36 +34,6 @@ namespace Content.Server.Body.Components
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageRecovery = default!;
[DataField("gaspPopupCooldown")]
public TimeSpan GaspPopupCooldown { get; private set; } = TimeSpan.FromSeconds(8);
[ViewVariables]
public TimeSpan LastGaspPopupTime;
/// <summary>
/// How many cycles in a row has the mob been under-saturated?
/// </summary>
[ViewVariables]
public int SuffocationCycles = 0;
/// <summary>
/// How many cycles in a row does it take for the suffocation alert to pop up?
/// </summary>
[ViewVariables]
public int SuffocationCycleThreshold = 3;
[ViewVariables]
public RespiratorStatus Status = RespiratorStatus.Inhaling;
[DataField("cycleDelay")]
public float CycleDelay = 2.0f;
public float AccumulatedFrametime;
}
}
public enum RespiratorStatus
{
Inhaling,
Exhaling
}