+++ /dev/null
-using Content.Shared.DragDrop;
-using Content.Shared.Medical.Cryogenics;
-
-namespace Content.Client.Medical.Cryogenics;
-
-[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))]
-public sealed class CryoPodComponent : SharedCryoPodComponent { }
-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;
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<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component)
- || !_appearance.TryGetData<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component))
+ if (!_appearance.TryGetData<bool>(uid, CryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component)
+ || !_appearance.TryGetData<bool>(uid, CryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component))
{
return;
}
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
{
/// <summary>
/// Local air buffer that will be mixed with the pipenet, if one exists, per tick.
}
}
- public override void EjectBody(EntityUid uid, SharedCryoPodComponent? cryoPodComponent)
+ public override void EjectBody(EntityUid uid, CryoPodComponent? cryoPodComponent)
{
if (!Resolve(uid, ref cryoPodComponent))
return;
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<string, GasMixture?> { { Name(uid), component.Air } };
+ if (!TryComp(uid, out CryoPodAirComponent? cryoPodAir))
+ return;
+
+ var gasMixDict = new Dictionary<string, GasMixture?> { { Name(uid), cryoPodAir.Air } };
// If it's connected to a port, include the port side
if (TryComp(uid, out NodeContainerComponent? nodeContainer))
{
private void OnGetAir(EntityUid uid, InsideCryoPodComponent component, ref AtmosExposedGetAirEvent args)
{
- if (TryComp<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
+ if (TryComp<CryoPodAirComponent>(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<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
+ if (TryComp<CryoPodAirComponent>(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<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
+ if (TryComp<CryoPodAirComponent>(Transform(uid).ParentUid, out var cryoPodAir))
{
- args.Gas = cryoPodComponent.Air;
+ args.Gas = cryoPodAir.Air;
}
}
-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
{
/// <summary>
/// Specifies the name of the atmospherics port to draw gas from.
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;
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;
{
base.Initialize();
- SubscribeLocalEvent<SharedCryoPodComponent, CanDropTargetEvent>(OnCryoPodCanDropOn);
+ SubscribeLocalEvent<CryoPodComponent, CanDropTargetEvent>(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;
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<ContainerSlot>(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;
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;
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))
{
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;
UpdateAppearance(uid, cryoPodComponent);
}
- protected void AddAlternativeVerbs(EntityUid uid, SharedCryoPodComponent cryoPodComponent, GetVerbsEvent<AlternativeVerb> args)
+ protected void AddAlternativeVerbs(EntityUid uid, CryoPodComponent cryoPodComponent, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract)
return;
}
}
- 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))
{
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;
containers:
- scanner-body
- type: CryoPod
+ - type: CryoPodAir
- type: ContainerTemperatureDamageThresholds
coldDamageThreshold: 10