diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs index c6c660614a..a14074909f 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs @@ -34,6 +34,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems SubscribeLocalEvent(OnVolumePumpLeaveAtmosphere); SubscribeLocalEvent(OnPacketRecv); + SubscribeLocalEvent(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 } } diff --git a/Content.Server/Atmos/Piping/Trinary/Components/GasFilterComponent.cs b/Content.Server/Atmos/Piping/Trinary/Components/GasFilterComponent.cs index 4400387dc8..f561485767 100644 --- a/Content.Server/Atmos/Piping/Trinary/Components/GasFilterComponent.cs +++ b/Content.Server/Atmos/Piping/Trinary/Components/GasFilterComponent.cs @@ -25,5 +25,11 @@ namespace Content.Server.Atmos.Piping.Trinary.Components [DataField] public Gas? FilteredGas; + + /// + /// Frontier - Start the filter with the map. + /// + [DataField] + public bool StartOnMapInit { get; set; } = false; } } diff --git a/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs b/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs index fc219923c1..a68591f07e 100644 --- a/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs +++ b/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs @@ -38,5 +38,11 @@ namespace Content.Server.Atmos.Piping.Trinary.Components [ViewVariables(VVAccess.ReadWrite)] [DataField("inletTwoConcentration")] public float InletTwoConcentration = 0.5f; + + /// + /// Frontier - Start the mixer with the map. + /// + [DataField] + public bool StartOnMapInit { get; set; } = false; } } diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs index 8d0fb8ad2c..2f74b56844 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs @@ -43,6 +43,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems SubscribeLocalEvent(OnTransferRateChangeMessage); SubscribeLocalEvent(OnSelectGasMessage); SubscribeLocalEvent(OnToggleStatusMessage); + SubscribeLocalEvent(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 } } diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs index 84abede066..bcfeb65871 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs @@ -44,6 +44,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems SubscribeLocalEvent(OnToggleStatusMessage); SubscribeLocalEvent(OnMixerLeaveAtmosphere); + SubscribeLocalEvent(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 } } diff --git a/Content.Shared/Atmos/Components/GasPressurePumpComponent.cs b/Content.Shared/Atmos/Components/GasPressurePumpComponent.cs index f0ffad0b0e..d7a71c55ed 100644 --- a/Content.Shared/Atmos/Components/GasPressurePumpComponent.cs +++ b/Content.Shared/Atmos/Components/GasPressurePumpComponent.cs @@ -24,4 +24,10 @@ public sealed partial class GasPressurePumpComponent : Component [DataField] [GuidebookData] public float MaxTargetPressure = Atmospherics.MaxOutputPressure; + + /// + /// Frontier - Start the pump with the map. + /// + [DataField] + public bool StartOnMapInit { get; set; } = false; } diff --git a/Content.Shared/Atmos/EntitySystems/SharedGasPressurePumpSystem.cs b/Content.Shared/Atmos/EntitySystems/SharedGasPressurePumpSystem.cs index 140597971d..9d585c0a00 100644 --- a/Content.Shared/Atmos/EntitySystems/SharedGasPressurePumpSystem.cs +++ b/Content.Shared/Atmos/EntitySystems/SharedGasPressurePumpSystem.cs @@ -31,6 +31,7 @@ public abstract class SharedGasPressurePumpSystem : EntitySystem SubscribeLocalEvent(OnPumpLeaveAtmosphere); SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent(OnMapInit); // Frontier } private void OnExamined(Entity ent, ref ExaminedEvent args) @@ -48,6 +49,19 @@ public abstract class SharedGasPressurePumpSystem : EntitySystem } } + // Frontier - Start: Enable pumps at roundstart + private void OnMapInit(Entity 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 ent, ref ComponentInit args) { UpdateAppearance(ent); diff --git a/Content.Shared/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs b/Content.Shared/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs index 653f68ce6b..7f29a1c3db 100644 --- a/Content.Shared/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs +++ b/Content.Shared/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs @@ -42,4 +42,10 @@ public sealed partial class GasVolumePumpComponent : Component [DataField] public float LastMolesTransferred; + + /// + /// Frontier - Start the pump with the map. + /// + [DataField] + public bool StartOnMapInit { get; set; } = false; } diff --git a/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/alt_layers.yml b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/alt_layers.yml new file mode 100644 index 0000000000..d5dcd1e4cd --- /dev/null +++ b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/alt_layers.yml @@ -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 ] diff --git a/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/binary.yml b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/binary.yml new file mode 100644 index 0000000000..0b3f96d3ba --- /dev/null +++ b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/binary.yml @@ -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 diff --git a/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/trinary.yml b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/trinary.yml new file mode 100644 index 0000000000..d7536a1360 --- /dev/null +++ b/Resources/Prototypes/_DV/Entities/Structures/Piping/Atmospherics/trinary.yml @@ -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