diff --git a/Content.Client/Medical/Cryogenics/CryoPodComponent.cs b/Content.Client/Medical/Cryogenics/CryoPodComponent.cs deleted file mode 100644 index e07d69ea71..0000000000 --- a/Content.Client/Medical/Cryogenics/CryoPodComponent.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Content.Shared.DragDrop; -using Content.Shared.Medical.Cryogenics; - -namespace Content.Client.Medical.Cryogenics; - -[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))] -public sealed class CryoPodComponent : SharedCryoPodComponent { } diff --git a/Content.Client/Medical/Cryogenics/CryoPodSystem.cs b/Content.Client/Medical/Cryogenics/CryoPodSystem.cs index d1918d75fb..bb6c1f0fae 100644 --- a/Content.Client/Medical/Cryogenics/CryoPodSystem.cs +++ b/Content.Client/Medical/Cryogenics/CryoPodSystem.cs @@ -1,5 +1,4 @@ -using Content.Shared.Destructible; -using Content.Shared.Emag.Systems; +using Content.Shared.Emag.Systems; using Content.Shared.Medical.Cryogenics; using Content.Shared.Verbs; using Robust.Client.GameObjects; @@ -46,15 +45,15 @@ public sealed class CryoPodSystem: SharedCryoPodSystem spriteComponent.Offset = component.PreviousOffset; } - private void OnAppearanceChange(EntityUid uid, SharedCryoPodComponent component, ref AppearanceChangeEvent args) + private void OnAppearanceChange(EntityUid uid, CryoPodComponent component, ref AppearanceChangeEvent args) { if (args.Sprite == null) { return; } - if (!_appearance.TryGetData(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component) - || !_appearance.TryGetData(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component)) + if (!_appearance.TryGetData(uid, CryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component) + || !_appearance.TryGetData(uid, CryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component)) { return; } diff --git a/Content.Server/Medical/Components/CryoPodComponent.cs b/Content.Server/Medical/Components/CryoPodAirComponent.cs similarity index 68% rename from Content.Server/Medical/Components/CryoPodComponent.cs rename to Content.Server/Medical/Components/CryoPodAirComponent.cs index 362576e10c..cc5416a4d2 100644 --- a/Content.Server/Medical/Components/CryoPodComponent.cs +++ b/Content.Server/Medical/Components/CryoPodAirComponent.cs @@ -1,11 +1,10 @@ using Content.Server.Atmos; using Content.Shared.Atmos; -using Content.Shared.Medical.Cryogenics; namespace Content.Server.Medical.Components; -[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))] -public sealed class CryoPodComponent: SharedCryoPodComponent +[RegisterComponent] +public sealed class CryoPodAirComponent : Component { /// /// Local air buffer that will be mixed with the pipenet, if one exists, per tick. diff --git a/Content.Server/Medical/CryoPodSystem.cs b/Content.Server/Medical/CryoPodSystem.cs index 62c168c3e7..e45f2f920f 100644 --- a/Content.Server/Medical/CryoPodSystem.cs +++ b/Content.Server/Medical/CryoPodSystem.cs @@ -110,7 +110,7 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem } } - public override void EjectBody(EntityUid uid, SharedCryoPodComponent? cryoPodComponent) + public override void EjectBody(EntityUid uid, CryoPodComponent? cryoPodComponent) { if (!Resolve(uid, ref cryoPodComponent)) return; @@ -221,17 +221,24 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem if (!nodeContainer.TryGetNode(cryoPod.PortName, out PortablePipeNode? portNode)) return; - _atmosphereSystem.React(cryoPod.Air, portNode); + + if (!TryComp(uid, out CryoPodAirComponent? cryoPodAir)) + return; + + _atmosphereSystem.React(cryoPodAir.Air, portNode); if (portNode.NodeGroup is PipeNet {NodeCount: > 1} net) { - _gasCanisterSystem.MixContainerWithPipeNet(cryoPod.Air, net.Air); + _gasCanisterSystem.MixContainerWithPipeNet(cryoPodAir.Air, net.Air); } } private void OnGasAnalyzed(EntityUid uid, CryoPodComponent component, GasAnalyzerScanEvent args) { - var gasMixDict = new Dictionary { { Name(uid), component.Air } }; + if (!TryComp(uid, out CryoPodAirComponent? cryoPodAir)) + return; + + var gasMixDict = new Dictionary { { Name(uid), cryoPodAir.Air } }; // If it's connected to a port, include the port side if (TryComp(uid, out NodeContainerComponent? nodeContainer)) { diff --git a/Content.Server/Medical/InsideCryoPodSystem.cs b/Content.Server/Medical/InsideCryoPodSystem.cs index a41896b726..a2252fa395 100644 --- a/Content.Server/Medical/InsideCryoPodSystem.cs +++ b/Content.Server/Medical/InsideCryoPodSystem.cs @@ -19,26 +19,26 @@ namespace Content.Server.Medical private void OnGetAir(EntityUid uid, InsideCryoPodComponent component, ref AtmosExposedGetAirEvent args) { - if (TryComp(Transform(uid).ParentUid, out var cryoPodComponent)) + if (TryComp(Transform(uid).ParentUid, out var cryoPodAir)) { - args.Gas = cryoPodComponent.Air; + args.Gas = cryoPodAir.Air; args.Handled = true; } } private void OnInhaleLocation(EntityUid uid, InsideCryoPodComponent component, InhaleLocationEvent args) { - if (TryComp(Transform(uid).ParentUid, out var cryoPodComponent)) + if (TryComp(Transform(uid).ParentUid, out var cryoPodAir)) { - args.Gas = cryoPodComponent.Air; + args.Gas = cryoPodAir.Air; } } private void OnExhaleLocation(EntityUid uid, InsideCryoPodComponent component, ExhaleLocationEvent args) { - if (TryComp(Transform(uid).ParentUid, out var cryoPodComponent)) + if (TryComp(Transform(uid).ParentUid, out var cryoPodAir)) { - args.Gas = cryoPodComponent.Air; + args.Gas = cryoPodAir.Air; } } diff --git a/Content.Shared/Medical/Cryogenics/SharedCryoPodComponent.cs b/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs similarity index 93% rename from Content.Shared/Medical/Cryogenics/SharedCryoPodComponent.cs rename to Content.Shared/Medical/Cryogenics/CryoPodComponent.cs index 752d4ce72e..d317d49546 100644 --- a/Content.Shared/Medical/Cryogenics/SharedCryoPodComponent.cs +++ b/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs @@ -1,14 +1,12 @@ -using Content.Shared.Body.Components; -using Content.Shared.DragDrop; -using Robust.Shared.Containers; +using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Medical.Cryogenics; -[NetworkedComponent] -public abstract class SharedCryoPodComponent: Component +[RegisterComponent, NetworkedComponent] +public sealed class CryoPodComponent : Component { /// /// Specifies the name of the atmospherics port to draw gas from. diff --git a/Content.Shared/Medical/Cryogenics/SharedCryoPodSystem.cs b/Content.Shared/Medical/Cryogenics/SharedCryoPodSystem.cs index 4b82b8388a..c1eeb34202 100644 --- a/Content.Shared/Medical/Cryogenics/SharedCryoPodSystem.cs +++ b/Content.Shared/Medical/Cryogenics/SharedCryoPodSystem.cs @@ -1,6 +1,6 @@ using Content.Server.Medical.Components; -using Content.Shared.DoAfter; using Content.Shared.Body.Components; +using Content.Shared.DoAfter; using Content.Shared.DragDrop; using Content.Shared.Emag.Systems; using Content.Shared.Mobs.Components; @@ -10,7 +10,6 @@ using Content.Shared.Standing; using Content.Shared.Stunnable; using Content.Shared.Verbs; using Robust.Shared.Containers; -using Robust.Shared.Player; using Robust.Shared.Serialization; namespace Content.Shared.Medical.Cryogenics; @@ -27,11 +26,11 @@ public abstract partial class SharedCryoPodSystem: EntitySystem { base.Initialize(); - SubscribeLocalEvent(OnCryoPodCanDropOn); + SubscribeLocalEvent(OnCryoPodCanDropOn); InitializeInsideCryoPod(); } - private void OnCryoPodCanDropOn(EntityUid uid, SharedCryoPodComponent component, ref CanDropTargetEvent args) + private void OnCryoPodCanDropOn(EntityUid uid, CryoPodComponent component, ref CanDropTargetEvent args) { if (args.Handled) return; @@ -40,12 +39,12 @@ public abstract partial class SharedCryoPodSystem: EntitySystem args.Handled = true; } - protected void OnComponentInit(EntityUid uid, SharedCryoPodComponent cryoPodComponent, ComponentInit args) + protected void OnComponentInit(EntityUid uid, CryoPodComponent cryoPodComponent, ComponentInit args) { cryoPodComponent.BodyContainer = _containerSystem.EnsureContainer(uid, "scanner-body"); } - protected void UpdateAppearance(EntityUid uid, SharedCryoPodComponent? cryoPod = null, AppearanceComponent? appearance = null) + protected void UpdateAppearance(EntityUid uid, CryoPodComponent? cryoPod = null, AppearanceComponent? appearance = null) { if (!Resolve(uid, ref cryoPod)) return; @@ -57,11 +56,11 @@ public abstract partial class SharedCryoPodSystem: EntitySystem if (!Resolve(uid, ref appearance)) return; - _appearanceSystem.SetData(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, cryoPod.BodyContainer.ContainedEntity == null, appearance); - _appearanceSystem.SetData(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, cryoPodEnabled, appearance); + _appearanceSystem.SetData(uid, CryoPodComponent.CryoPodVisuals.ContainsEntity, cryoPod.BodyContainer.ContainedEntity == null, appearance); + _appearanceSystem.SetData(uid, CryoPodComponent.CryoPodVisuals.IsOn, cryoPodEnabled, appearance); } - public void InsertBody(EntityUid uid, EntityUid target, SharedCryoPodComponent cryoPodComponent) + public void InsertBody(EntityUid uid, EntityUid target, CryoPodComponent cryoPodComponent) { if (cryoPodComponent.BodyContainer.ContainedEntity != null) return; @@ -78,7 +77,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem UpdateAppearance(uid, cryoPodComponent); } - public void TryEjectBody(EntityUid uid, EntityUid userId, SharedCryoPodComponent? cryoPodComponent) + public void TryEjectBody(EntityUid uid, EntityUid userId, CryoPodComponent? cryoPodComponent) { if (!Resolve(uid, ref cryoPodComponent)) { @@ -94,7 +93,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem EjectBody(uid, cryoPodComponent); } - public virtual void EjectBody(EntityUid uid, SharedCryoPodComponent? cryoPodComponent) + public virtual void EjectBody(EntityUid uid, CryoPodComponent? cryoPodComponent) { if (!Resolve(uid, ref cryoPodComponent)) return; @@ -119,7 +118,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem UpdateAppearance(uid, cryoPodComponent); } - protected void AddAlternativeVerbs(EntityUid uid, SharedCryoPodComponent cryoPodComponent, GetVerbsEvent args) + protected void AddAlternativeVerbs(EntityUid uid, CryoPodComponent cryoPodComponent, GetVerbsEvent args) { if (!args.CanAccess || !args.CanInteract) return; @@ -137,7 +136,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem } } - protected void OnEmagged(EntityUid uid, SharedCryoPodComponent? cryoPodComponent, ref GotEmaggedEvent args) + protected void OnEmagged(EntityUid uid, CryoPodComponent? cryoPodComponent, ref GotEmaggedEvent args) { if (!Resolve(uid, ref cryoPodComponent)) { @@ -149,7 +148,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem args.Handled = true; } - protected void OnCryoPodPryFinished(EntityUid uid, SharedCryoPodComponent cryoPodComponent, CryoPodPryFinished args) + protected void OnCryoPodPryFinished(EntityUid uid, CryoPodComponent cryoPodComponent, CryoPodPryFinished args) { if (args.Cancelled) return; diff --git a/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml index ed4c967df4..9248b4c8d9 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml @@ -100,5 +100,6 @@ containers: - scanner-body - type: CryoPod + - type: CryoPodAir - type: ContainerTemperatureDamageThresholds coldDamageThreshold: 10