Add enabled version of atmos pumps, filters, and mixers (#5015)

* Add enabled version of atmos pumps, filters, and mixers

* spaces

* Comment and move entities to _DV

* Update Content.Shared/Atmos/Components/GasPressurePumpComponent.cs

Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com>
Signed-off-by: Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>

* Update Content.Shared/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs

Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com>
Signed-off-by: Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>

---------

Signed-off-by: Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>
Co-authored-by: Velcroboy <velcroboy333@hotmail.com>
Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com>
This commit is contained in:
Velcroboy 2025-12-31 12:35:45 -06:00 committed by GitHub
parent 77328e58e3
commit 810d9616aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 386 additions and 0 deletions

View File

@ -34,6 +34,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
SubscribeLocalEvent<GasVolumePumpComponent, AtmosDeviceDisabledEvent>(OnVolumePumpLeaveAtmosphere);
SubscribeLocalEvent<GasVolumePumpComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
SubscribeLocalEvent<GasVolumePumpComponent, MapInitEvent>(OnMapInit); // Frontier
}
private void OnVolumePumpUpdated(EntityUid uid, GasVolumePumpComponent pump, ref AtmosDeviceUpdateEvent args)
@ -118,5 +119,18 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
return;
}
}
// Frontier - Start: Enable pumps at roundstart
private void OnMapInit(EntityUid uid, GasVolumePumpComponent pump, MapInitEvent args)
{
if (pump.StartOnMapInit)
{
pump.Enabled = true;
Dirty(uid, pump);
UpdateAppearance(uid, pump);
_userInterfaceSystem.CloseUi(uid, GasVolumePumpUiKey.Key);
}
}
// Frontier - End: Enable pumps at roundstart
}
}

View File

@ -25,5 +25,11 @@ namespace Content.Server.Atmos.Piping.Trinary.Components
[DataField]
public Gas? FilteredGas;
/// <summary>
/// Frontier - Start the filter with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}
}

View File

@ -38,5 +38,11 @@ namespace Content.Server.Atmos.Piping.Trinary.Components
[ViewVariables(VVAccess.ReadWrite)]
[DataField("inletTwoConcentration")]
public float InletTwoConcentration = 0.5f;
/// <summary>
/// Frontier - Start the mixer with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}
}

View File

@ -43,6 +43,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
SubscribeLocalEvent<GasFilterComponent, GasFilterChangeRateMessage>(OnTransferRateChangeMessage);
SubscribeLocalEvent<GasFilterComponent, GasFilterSelectGasMessage>(OnSelectGasMessage);
SubscribeLocalEvent<GasFilterComponent, GasFilterToggleStatusMessage>(OnToggleStatusMessage);
SubscribeLocalEvent<GasFilterComponent, MapInitEvent>(OnMapInit); // Frontier
}
@ -211,5 +212,19 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
args.DeviceFlipped = inlet != null && filterNode != null && inlet.CurrentPipeDirection.ToDirection() == filterNode.CurrentPipeDirection.ToDirection().GetClockwise90Degrees();
}
// Frontier - Start: Enable filters at roundstart
private void OnMapInit(EntityUid uid, GasFilterComponent filter, MapInitEvent args) // Frontier - Init on map
{
if (filter.StartOnMapInit)
{
filter.Enabled = true;
DirtyUI(uid, filter);
UpdateAppearance(uid, filter);
_userInterfaceSystem.CloseUi(uid, GasFilterUiKey.Key);
}
}
// Frontier - End: Enable filters at roundstart
}
}

View File

@ -44,6 +44,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
SubscribeLocalEvent<GasMixerComponent, GasMixerToggleStatusMessage>(OnToggleStatusMessage);
SubscribeLocalEvent<GasMixerComponent, AtmosDeviceDisabledEvent>(OnMixerLeaveAtmosphere);
SubscribeLocalEvent<GasMixerComponent, MapInitEvent>(OnMapInit); // Frontier
}
private void OnInit(EntityUid uid, GasMixerComponent mixer, ComponentInit args)
@ -236,5 +237,19 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
args.DeviceFlipped = inletOne != null && inletTwo != null && inletOne.CurrentPipeDirection.ToDirection() == inletTwo.CurrentPipeDirection.ToDirection().GetClockwise90Degrees();
}
// Frontier - Start: Enable mixers at roundstart
private void OnMapInit(EntityUid uid, GasMixerComponent mixer, MapInitEvent args)
{
if (mixer.StartOnMapInit)
{
mixer.Enabled = true;
DirtyUI(uid, mixer);
UpdateAppearance(uid, mixer);
_userInterfaceSystem.CloseUi(uid, GasMixerUiKey.Key);
}
}
// Frontier - End: Enable mixers at roundstart
}
}

View File

@ -24,4 +24,10 @@ public sealed partial class GasPressurePumpComponent : Component
[DataField]
[GuidebookData]
public float MaxTargetPressure = Atmospherics.MaxOutputPressure;
/// <summary>
/// Frontier - Start the pump with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}

View File

@ -31,6 +31,7 @@ public abstract class SharedGasPressurePumpSystem : EntitySystem
SubscribeLocalEvent<GasPressurePumpComponent, AtmosDeviceDisabledEvent>(OnPumpLeaveAtmosphere);
SubscribeLocalEvent<GasPressurePumpComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<GasPressurePumpComponent, MapInitEvent>(OnMapInit); // Frontier
}
private void OnExamined(Entity<GasPressurePumpComponent> ent, ref ExaminedEvent args)
@ -48,6 +49,19 @@ public abstract class SharedGasPressurePumpSystem : EntitySystem
}
}
// Frontier - Start: Enable pumps at roundstart
private void OnMapInit(Entity<GasPressurePumpComponent> ent, ref MapInitEvent args)
{
if (ent.Comp.StartOnMapInit)
{
ent.Comp.Enabled = true;
Dirty(ent); // Delta V - Updates on/off in UI after mapinit
UpdateAppearance(ent);
UpdateUi(ent); // Delta V - Updates on/off in UI after mapinit
}
}
// Frontier - End: Enable pumps at roundstart
private void OnInit(Entity<GasPressurePumpComponent> ent, ref ComponentInit args)
{
UpdateAppearance(ent);

View File

@ -42,4 +42,10 @@ public sealed partial class GasVolumePumpComponent : Component
[DataField]
public float LastMolesTransferred;
/// <summary>
/// Frontier - Start the pump with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}

View File

@ -0,0 +1,97 @@
# Pressure Pumps
- type: entity
parent: GasPipeLayerAlt1
id: GasPressurePumpLayerAlt1
abstract: true
components:
- type: Sprite
sprite: Structures/Piping/Atmospherics/pump_alt1.rsi
layers:
- sprite: Structures/Piping/Atmospherics/pipe_alt1.rsi
state: pipeStraight
map: [ "enum.PipeVisualLayers.Pipe" ]
- state: pumpPressure
map: [ "enum.SubfloorLayers.FirstLayer", "enabled" ]
- type: entity
parent: GasPipeLayerAlt2
id: GasPressurePumpLayerAlt2
abstract: true
components:
- type: Sprite
sprite: Structures/Piping/Atmospherics/pump_alt2.rsi
layers:
- sprite: Structures/Piping/Atmospherics/pipe_alt2.rsi
state: pipeStraight
map: [ "enum.PipeVisualLayers.Pipe" ]
- state: pumpPressure
map: [ "enum.SubfloorLayers.FirstLayer", "enabled" ]
- type: entity
parent: [GasPressurePumpLayerAlt1, GasPressurePumpEnabled]
id: GasPressurePumpEnabledAlt1
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasPressurePumpLayerAlt2, GasPressurePumpEnabled]
id: GasPressurePumpEnabledAlt2
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasPressurePumpLayerAlt1, GasPressurePumpEnabledStandard]
id: GasPressurePumpEnabledStandardAlt1
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasPressurePumpLayerAlt2, GasPressurePumpEnabledStandard]
id: GasPressurePumpEnabledStandardAlt2
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasPressurePumpLayerAlt1, GasPressurePumpEnabledMax]
id: GasPressurePumpEnabledMaxAlt1
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasPressurePumpLayerAlt2, GasPressurePumpEnabledMax]
id: GasPressurePumpEnabledMaxAlt2
categories: [ HideSpawnMenu ]
# Volume Pumps
- type: entity
parent: GasPipeLayerAlt1
id: GasVolumePumpLayerAlt1
abstract: true
components:
- type: Sprite
sprite: Structures/Piping/Atmospherics/pump_alt1.rsi
layers:
- sprite: Structures/Piping/Atmospherics/pipe_alt1.rsi
state: pipeStraight
map: [ "enum.PipeVisualLayers.Pipe" ]
- state: pumpVolume
map: [ "enum.SubfloorLayers.FirstLayer", "enabled" ]
- type: entity
parent: GasPipeLayerAlt2
id: GasVolumePumpLayerAlt2
abstract: true
components:
- type: Sprite
sprite: Structures/Piping/Atmospherics/pump_alt2.rsi
layers:
- sprite: Structures/Piping/Atmospherics/pipe_alt2.rsi
state: pipeStraight
map: [ "enum.PipeVisualLayers.Pipe" ]
- state: pumpVolume
map: [ "enum.SubfloorLayers.FirstLayer", "enabled" ]
- type: entity
parent: [GasVolumePumpLayerAlt1, GasVolumePumpEnabled]
id: GasVolumePumpEnabledAlt1
categories: [ HideSpawnMenu ]
- type: entity
parent: [GasVolumePumpLayerAlt2, GasVolumePumpEnabled]
id: GasVolumePumpEnabledAlt2
categories: [ HideSpawnMenu ]

View File

@ -0,0 +1,53 @@
# Pressure Pumps
- type: entity
parent: GasPressurePump
id: GasPressurePumpEnabled
suffix: Enabled
components:
- type: GasPressurePump
startOnMapInit: true
- type: AtmosPipeLayers
alternativePrototypes:
Primary: GasPressurePumpEnabled
Secondary: GasPressurePumpEnabledAlt1
Tertiary: GasPressurePumpEnabledAlt2
- type: entity
parent: GasPressurePumpEnabled
id: GasPressurePumpEnabledStandard
suffix: Enabled, 310 kPa
components:
- type: GasPressurePump
targetPressure: 310
- type: AtmosPipeLayers
alternativePrototypes:
Primary: GasPressurePumpEnabledStandard
Secondary: GasPressurePumpEnabledStandardAlt1
Tertiary: GasPressurePumpEnabledStandardAlt2
- type: entity
parent: GasPressurePumpEnabled
id: GasPressurePumpEnabledMax
suffix: Enabled, Max
components:
- type: GasPressurePump
targetPressure: 4500
- type: AtmosPipeLayers
alternativePrototypes:
Primary: GasPressurePumpEnabledMax
Secondary: GasPressurePumpEnabledMaxAlt1
Tertiary: GasPressurePumpEnabledMaxAlt2
# Volume Pumps
- type: entity
parent: GasVolumePump
id: GasVolumePumpEnabled
suffix: Enabled
components:
- type: GasVolumePump
startOnMapInit: true
- type: AtmosPipeLayers
alternativePrototypes:
Primary: GasVolumePumpEnabled
Secondary: GasVolumePumpEnabledAlt1
Tertiary: GasVolumePumpEnabledAlt2

View File

@ -0,0 +1,154 @@
# Gas Mixers
- type: entity
parent: GasMixer
id: GasMixerEnabled
suffix: Enabled
components:
- type: GasMixer
targetPressure: 310
startOnMapInit: true
- type: entity
parent: [GasMixerFlipped, GasMixerEnabled]
id: GasMixerEnabledFlipped
suffix: Enabled, Flipped
# Gas Filters
- type: entity
parent: GasFilter
id: GasFilterEnabled
suffix: Enabled
components:
- type: GasFilter
startOnMapInit: true
- type: entity
parent: [GasFilterFlipped, GasFilterEnabled]
id: GasFilterEnabledFlipped
suffix: Enabled, Flipped
# Oxygen
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledOxygen
suffix: Enabled, Oxygen
components:
- type: GasFilter
filteredGas: Oxygen
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledOxygen]
id: GasFilterEnabledOxygenFlipped
suffix: Enabled, Oxygen, Flipped
# Nitrogen
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledNitrogen
suffix: Enabled, Nitrogen
components:
- type: GasFilter
filteredGas: Nitrogen
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledNitrogen]
id: GasFilterEnabledNitrogenFlipped
suffix: Enabled, Nitrogen, Flipped
# Plasma
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledPlasma
suffix: Enabled, Plasma
components:
- type: GasFilter
filteredGas: Plasma
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledPlasma]
id: GasFilterEnabledPlasmaFlipped
suffix: Enabled, Plasma, Flipped
# Carbon Dioxide
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledCarbonDioxide
suffix: Enabled, CarbonDioxide
components:
- type: GasFilter
filteredGas: CarbonDioxide
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledCarbonDioxide]
id: GasFilterEnabledCarbonDioxideFlipped
suffix: Enabled, CarbonDioxide, Flipped
# Tritium
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledTritium
suffix: Enabled, Tritium
components:
- type: GasFilter
filteredGas: Tritium
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledTritium]
id: GasFilterEnabledTritiumFlipped
suffix: Enabled, Tritium, Flipped
# Water Vapor
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledWaterVapor
suffix: Enabled, Water Vapor
components:
- type: GasFilter
filteredGas: WaterVapor
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledWaterVapor]
id: GasFilterEnabledWaterVaporFlipped
suffix: Enabled, Water Vapor, Flipped
# Miasma
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledMiasma
suffix: Enabled, Miasma
components:
- type: GasFilter
filteredGas: Ammonia
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledMiasma]
id: GasFilterEnabledMiasmaFlipped
suffix: Enabled, Miasma, Flipped
# Nitrous Oxide
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledNitrousOxide
suffix: Enabled, Nitrous Oxide
components:
- type: GasFilter
filteredGas: NitrousOxide
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledNitrousOxide]
id: GasFilterEnabledNitrousOxideFlipped
suffix: Enabled, Nitrous Oxide, Flipped
# Frezon
- type: entity
parent: GasFilterEnabled
id: GasFilterEnabledFrezon
suffix: Enabled, Frezon
components:
- type: GasFilter
filteredGas: Frezon
- type: entity
parent: [GasFilterFlipped, GasFilterEnabledFrezon]
id: GasFilterEnabledFrezonFlipped
suffix: Enabled, Frezon, Flipped