mech nitrogen filtering 2 (#19868)
* target oxygen logic * filter out nitrogen when low on oxygen * vvrw and datafield for everything * :trollface: * bruh does work * tagless chicken * move into atmos, make it not depend on mech * update mech prototype --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
46
Content.Server/Atmos/Components/AirFilterComponent.cs
Normal file
46
Content.Server/Atmos/Components/AirFilterComponent.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
/// <summary>
|
||||
/// This is basically a reverse scrubber but using <see cref="GetFilterAirEvent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(AirFilterSystem))]
|
||||
public sealed partial class AirFilterComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Gases that will be filtered out of internal air
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public HashSet<Gas> Gases = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gases that will be filtered out of internal air to maintain oxygen ratio.
|
||||
/// When oxygen is below <see cref="TargetOxygen"/>, these gases will be filtered instead of <see cref="Gases"/>.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public HashSet<Gas> OverflowGases = new();
|
||||
|
||||
/// <summary>
|
||||
/// Minimum oxygen fraction before it will start removing <see cref="OverflowGases"/>.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TargetOxygen = 0.21f;
|
||||
|
||||
/// <summary>
|
||||
/// Gas to consider oxygen for <see cref="TargetOxygen"/> and <see cref="OverflowGases"/> logic.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For slime you might want to change this to be nitrogen, and overflowgases to remove oxygen.
|
||||
/// However theres still no real danger since standard atmos is mostly nitrogen so nitrogen tends to 100% anyway.
|
||||
/// </remarks>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public Gas Oxygen = Gas.Oxygen;
|
||||
|
||||
/// <summary>
|
||||
/// Fraction of target volume to transfer every second.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TransferRate = 0.1f;
|
||||
}
|
||||
29
Content.Server/Atmos/Components/AirIntakeComponent.cs
Normal file
29
Content.Server/Atmos/Components/AirIntakeComponent.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
/// <summary>
|
||||
/// This is basically a siphon vent for <see cref="GetFilterAirEvent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(AirFilterSystem))]
|
||||
public sealed partial class AirIntakeComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Target pressure change for a single atmos tick
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TargetPressureChange = 5f;
|
||||
|
||||
/// <summary>
|
||||
/// How strong the intake pump is, it will be able to replenish air from lower pressure areas.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float PumpPower = 2f;
|
||||
|
||||
/// <summary>
|
||||
/// Pressure to intake gases up to, maintains pressure of the air volume.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Pressure = Atmospherics.OneAtmosphere;
|
||||
}
|
||||
Reference in New Issue
Block a user