Portable scrubbers (#9417)

This commit is contained in:
Rane
2022-07-15 08:46:30 -04:00
committed by GitHub
parent f16de2186e
commit 188934a748
23 changed files with 481 additions and 24 deletions

View File

@@ -0,0 +1,48 @@
using Content.Shared.Atmos;
namespace Content.Server.Atmos.Portable
{
[RegisterComponent]
public sealed class PortableScrubberComponent : Component
{
/// <summary>
/// The air inside this machine.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("gasMixture")]
public GasMixture Air { get; } = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("port")]
public string PortName { get; set; } = "port";
/// <summary>
/// Which gases this machine will scrub out.
/// Unlike fixed scrubbers controlled by an air alarm,
/// this can't be changed in game.
/// </summary>
[DataField("filterGases")]
public HashSet<Gas> FilterGases = new()
{
Gas.CarbonDioxide,
Gas.Plasma,
Gas.Tritium,
Gas.WaterVapor,
Gas.Miasma
};
/// <summary>
/// Can this scrubber hold more gas?
/// </summary>
public bool Full => Air.Pressure >= MaxPressure;
/// <summary>
/// Maximum internal pressure before it refuses to take more.
/// </summary>
[DataField("maxPressure")]
public float MaxPressure = 3000f;
[DataField("transferRate")]
public float TransferRate = 1000f;
public bool Enabled = true;
}
}