AirFilterComponent.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Content.Server.Atmos.EntitySystems;
  2. using Content.Shared.Atmos;
  3. namespace Content.Server.Atmos.Components;
  4. /// <summary>
  5. /// This is basically a reverse scrubber but using <see cref="GetFilterAirEvent"/>.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(AirFilterSystem))]
  8. public sealed partial class AirFilterComponent : Component
  9. {
  10. /// <summary>
  11. /// Gases that will be filtered out of internal air
  12. /// </summary>
  13. [DataField(required: true)]
  14. public HashSet<Gas> Gases = new();
  15. /// <summary>
  16. /// Gases that will be filtered out of internal air to maintain oxygen ratio.
  17. /// When oxygen is below <see cref="TargetOxygen"/>, these gases will be filtered instead of <see cref="Gases"/>.
  18. /// </summary>
  19. [DataField(required: true)]
  20. public HashSet<Gas> OverflowGases = new();
  21. /// <summary>
  22. /// Minimum oxygen fraction before it will start removing <see cref="OverflowGases"/>.
  23. /// </summary>
  24. [DataField, ViewVariables(VVAccess.ReadWrite)]
  25. public float TargetOxygen = 0.21f;
  26. /// <summary>
  27. /// Gas to consider oxygen for <see cref="TargetOxygen"/> and <see cref="OverflowGases"/> logic.
  28. /// </summary>
  29. /// <remarks>
  30. /// For slime you might want to change this to be nitrogen, and overflowgases to remove oxygen.
  31. /// However theres still no real danger since standard atmos is mostly nitrogen so nitrogen tends to 100% anyway.
  32. /// </remarks>
  33. [DataField, ViewVariables(VVAccess.ReadWrite)]
  34. public Gas Oxygen = Gas.Oxygen;
  35. /// <summary>
  36. /// Fraction of target volume to transfer every second.
  37. /// </summary>
  38. [DataField, ViewVariables(VVAccess.ReadWrite)]
  39. public float TransferRate = 0.1f;
  40. }