Add vent welding (#19759)
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Server.NodeContainer;
|
|||||||
using Content.Server.NodeContainer.EntitySystems;
|
using Content.Server.NodeContainer.EntitySystems;
|
||||||
using Content.Server.NodeContainer.Nodes;
|
using Content.Server.NodeContainer.Nodes;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
|
using Content.Server.Tools.Systems;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Monitor;
|
using Content.Shared.Atmos.Monitor;
|
||||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||||
@@ -46,6 +47,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
SubscribeLocalEvent<GasVentPumpComponent, ExaminedEvent>(OnExamine);
|
SubscribeLocalEvent<GasVentPumpComponent, ExaminedEvent>(OnExamine);
|
||||||
SubscribeLocalEvent<GasVentPumpComponent, SignalReceivedEvent>(OnSignalReceived);
|
SubscribeLocalEvent<GasVentPumpComponent, SignalReceivedEvent>(OnSignalReceived);
|
||||||
SubscribeLocalEvent<GasVentPumpComponent, GasAnalyzerScanEvent>(OnAnalyzed);
|
SubscribeLocalEvent<GasVentPumpComponent, GasAnalyzerScanEvent>(OnAnalyzed);
|
||||||
|
SubscribeLocalEvent<GasVentPumpComponent, WeldableChangedEvent>(OnWeldChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, AtmosDeviceUpdateEvent args)
|
private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, AtmosDeviceUpdateEvent args)
|
||||||
@@ -253,7 +255,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_ambientSoundSystem.SetAmbience(uid, true);
|
_ambientSoundSystem.SetAmbience(uid, true);
|
||||||
if (!vent.Enabled)
|
if (vent.Welded)
|
||||||
|
{
|
||||||
|
_ambientSoundSystem.SetAmbience(uid, false);
|
||||||
|
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance);
|
||||||
|
}
|
||||||
|
else if (!vent.Enabled)
|
||||||
{
|
{
|
||||||
_ambientSoundSystem.SetAmbience(uid, false);
|
_ambientSoundSystem.SetAmbience(uid, false);
|
||||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Off, appearance);
|
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Off, appearance);
|
||||||
@@ -266,11 +273,6 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
{
|
{
|
||||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.In, appearance);
|
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.In, appearance);
|
||||||
}
|
}
|
||||||
else if (vent.Welded)
|
|
||||||
{
|
|
||||||
_ambientSoundSystem.SetAmbience(uid, false);
|
|
||||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnExamine(EntityUid uid, GasVentPumpComponent component, ExaminedEvent args)
|
private void OnExamine(EntityUid uid, GasVentPumpComponent component, ExaminedEvent args)
|
||||||
@@ -308,5 +310,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
|
|
||||||
args.GasMixtures = gasMixDict;
|
args.GasMixtures = gasMixDict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnWeldChanged(EntityUid uid, GasVentPumpComponent component, WeldableChangedEvent args)
|
||||||
|
{
|
||||||
|
var isWelded = args.IsWelded;
|
||||||
|
component.Welded = isWelded;
|
||||||
|
UpdateState(uid, component);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Content.Server.NodeContainer;
|
|||||||
using Content.Server.NodeContainer.EntitySystems;
|
using Content.Server.NodeContainer.EntitySystems;
|
||||||
using Content.Server.NodeContainer.Nodes;
|
using Content.Server.NodeContainer.Nodes;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
|
using Content.Server.Tools.Systems;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Piping.Unary.Visuals;
|
using Content.Shared.Atmos.Piping.Unary.Visuals;
|
||||||
using Content.Shared.Atmos.Monitor;
|
using Content.Shared.Atmos.Monitor;
|
||||||
@@ -40,6 +41,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
SubscribeLocalEvent<GasVentScrubberComponent, AtmosAlarmEvent>(OnAtmosAlarm);
|
SubscribeLocalEvent<GasVentScrubberComponent, AtmosAlarmEvent>(OnAtmosAlarm);
|
||||||
SubscribeLocalEvent<GasVentScrubberComponent, PowerChangedEvent>(OnPowerChanged);
|
SubscribeLocalEvent<GasVentScrubberComponent, PowerChangedEvent>(OnPowerChanged);
|
||||||
SubscribeLocalEvent<GasVentScrubberComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
|
SubscribeLocalEvent<GasVentScrubberComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
|
||||||
|
SubscribeLocalEvent<GasVentScrubberComponent, WeldableChangedEvent>(OnWeldChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args)
|
private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args)
|
||||||
@@ -183,7 +185,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_ambientSoundSystem.SetAmbience(uid, true);
|
_ambientSoundSystem.SetAmbience(uid, true);
|
||||||
if (!scrubber.Enabled)
|
if (scrubber.Welded)
|
||||||
|
{
|
||||||
|
_ambientSoundSystem.SetAmbience(uid, false);
|
||||||
|
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance);
|
||||||
|
}
|
||||||
|
else if (!scrubber.Enabled)
|
||||||
{
|
{
|
||||||
_ambientSoundSystem.SetAmbience(uid, false);
|
_ambientSoundSystem.SetAmbience(uid, false);
|
||||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Off, appearance);
|
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Off, appearance);
|
||||||
@@ -196,11 +203,13 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
{
|
{
|
||||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Siphon, appearance);
|
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Siphon, appearance);
|
||||||
}
|
}
|
||||||
else if (scrubber.Welded)
|
}
|
||||||
|
|
||||||
|
private void OnWeldChanged(EntityUid uid, GasVentScrubberComponent component, WeldableChangedEvent args)
|
||||||
{
|
{
|
||||||
_ambientSoundSystem.SetAmbience(uid, false);
|
var isWelded = args.IsWelded;
|
||||||
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance);
|
component.Welded = isWelded;
|
||||||
}
|
UpdateState(uid, component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
range: 5
|
range: 5
|
||||||
sound:
|
sound:
|
||||||
path: /Audio/Ambience/Objects/gas_vent.ogg
|
path: /Audio/Ambience/Objects/gas_vent.ogg
|
||||||
|
- type: Weldable
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasUnaryBase
|
parent: GasUnaryBase
|
||||||
@@ -173,6 +174,7 @@
|
|||||||
range: 5
|
range: 5
|
||||||
sound:
|
sound:
|
||||||
path: /Audio/Ambience/Objects/gas_vent.ogg
|
path: /Audio/Ambience/Objects/gas_vent.ogg
|
||||||
|
- type: Weldable
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasUnaryBase
|
parent: GasUnaryBase
|
||||||
|
|||||||
Reference in New Issue
Block a user