Remove cryo pod component references (#15247)
This commit is contained in:
@@ -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 { }
|
|
||||||
@@ -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.Medical.Cryogenics;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
@@ -46,15 +45,15 @@ public sealed class CryoPodSystem: SharedCryoPodSystem
|
|||||||
spriteComponent.Offset = component.PreviousOffset;
|
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)
|
if (args.Sprite == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_appearance.TryGetData<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component)
|
if (!_appearance.TryGetData<bool>(uid, CryoPodComponent.CryoPodVisuals.ContainsEntity, out var isOpen, args.Component)
|
||||||
|| !_appearance.TryGetData<bool>(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component))
|
|| !_appearance.TryGetData<bool>(uid, CryoPodComponent.CryoPodVisuals.IsOn, out var isOn, args.Component))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Medical.Cryogenics;
|
|
||||||
|
|
||||||
namespace Content.Server.Medical.Components;
|
namespace Content.Server.Medical.Components;
|
||||||
|
|
||||||
[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))]
|
[RegisterComponent]
|
||||||
public sealed class CryoPodComponent: SharedCryoPodComponent
|
public sealed class CryoPodAirComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Local air buffer that will be mixed with the pipenet, if one exists, per tick.
|
/// Local air buffer that will be mixed with the pipenet, if one exists, per tick.
|
||||||
@@ -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))
|
if (!Resolve(uid, ref cryoPodComponent))
|
||||||
return;
|
return;
|
||||||
@@ -221,17 +221,24 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
|||||||
|
|
||||||
if (!nodeContainer.TryGetNode(cryoPod.PortName, out PortablePipeNode? portNode))
|
if (!nodeContainer.TryGetNode(cryoPod.PortName, out PortablePipeNode? portNode))
|
||||||
return;
|
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)
|
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)
|
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 it's connected to a port, include the port side
|
||||||
if (TryComp(uid, out NodeContainerComponent? nodeContainer))
|
if (TryComp(uid, out NodeContainerComponent? nodeContainer))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,26 +19,26 @@ namespace Content.Server.Medical
|
|||||||
|
|
||||||
private void OnGetAir(EntityUid uid, InsideCryoPodComponent component, ref AtmosExposedGetAirEvent args)
|
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;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInhaleLocation(EntityUid uid, InsideCryoPodComponent component, InhaleLocationEvent args)
|
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)
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
using Content.Shared.Body.Components;
|
using Robust.Shared.Containers;
|
||||||
using Content.Shared.DragDrop;
|
|
||||||
using Robust.Shared.Containers;
|
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||||
|
|
||||||
namespace Content.Shared.Medical.Cryogenics;
|
namespace Content.Shared.Medical.Cryogenics;
|
||||||
|
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public abstract class SharedCryoPodComponent: Component
|
public sealed class CryoPodComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Specifies the name of the atmospherics port to draw gas from.
|
/// Specifies the name of the atmospherics port to draw gas from.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.Medical.Components;
|
using Content.Server.Medical.Components;
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
using Content.Shared.Emag.Systems;
|
using Content.Shared.Emag.Systems;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
@@ -10,7 +10,6 @@ using Content.Shared.Standing;
|
|||||||
using Content.Shared.Stunnable;
|
using Content.Shared.Stunnable;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Medical.Cryogenics;
|
namespace Content.Shared.Medical.Cryogenics;
|
||||||
@@ -27,11 +26,11 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedCryoPodComponent, CanDropTargetEvent>(OnCryoPodCanDropOn);
|
SubscribeLocalEvent<CryoPodComponent, CanDropTargetEvent>(OnCryoPodCanDropOn);
|
||||||
InitializeInsideCryoPod();
|
InitializeInsideCryoPod();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCryoPodCanDropOn(EntityUid uid, SharedCryoPodComponent component, ref CanDropTargetEvent args)
|
private void OnCryoPodCanDropOn(EntityUid uid, CryoPodComponent component, ref CanDropTargetEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
return;
|
return;
|
||||||
@@ -40,12 +39,12 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
args.Handled = true;
|
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");
|
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))
|
if (!Resolve(uid, ref cryoPod))
|
||||||
return;
|
return;
|
||||||
@@ -57,11 +56,11 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
|
|
||||||
if (!Resolve(uid, ref appearance))
|
if (!Resolve(uid, ref appearance))
|
||||||
return;
|
return;
|
||||||
_appearanceSystem.SetData(uid, SharedCryoPodComponent.CryoPodVisuals.ContainsEntity, cryoPod.BodyContainer.ContainedEntity == null, appearance);
|
_appearanceSystem.SetData(uid, CryoPodComponent.CryoPodVisuals.ContainsEntity, cryoPod.BodyContainer.ContainedEntity == null, appearance);
|
||||||
_appearanceSystem.SetData(uid, SharedCryoPodComponent.CryoPodVisuals.IsOn, cryoPodEnabled, 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)
|
if (cryoPodComponent.BodyContainer.ContainedEntity != null)
|
||||||
return;
|
return;
|
||||||
@@ -78,7 +77,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
UpdateAppearance(uid, cryoPodComponent);
|
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))
|
if (!Resolve(uid, ref cryoPodComponent))
|
||||||
{
|
{
|
||||||
@@ -94,7 +93,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
EjectBody(uid, 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))
|
if (!Resolve(uid, ref cryoPodComponent))
|
||||||
return;
|
return;
|
||||||
@@ -119,7 +118,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
UpdateAppearance(uid, cryoPodComponent);
|
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)
|
if (!args.CanAccess || !args.CanInteract)
|
||||||
return;
|
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))
|
if (!Resolve(uid, ref cryoPodComponent))
|
||||||
{
|
{
|
||||||
@@ -149,7 +148,7 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
|||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnCryoPodPryFinished(EntityUid uid, SharedCryoPodComponent cryoPodComponent, CryoPodPryFinished args)
|
protected void OnCryoPodPryFinished(EntityUid uid, CryoPodComponent cryoPodComponent, CryoPodPryFinished args)
|
||||||
{
|
{
|
||||||
if (args.Cancelled)
|
if (args.Cancelled)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -100,5 +100,6 @@
|
|||||||
containers:
|
containers:
|
||||||
- scanner-body
|
- scanner-body
|
||||||
- type: CryoPod
|
- type: CryoPod
|
||||||
|
- type: CryoPodAir
|
||||||
- type: ContainerTemperatureDamageThresholds
|
- type: ContainerTemperatureDamageThresholds
|
||||||
coldDamageThreshold: 10
|
coldDamageThreshold: 10
|
||||||
|
|||||||
Reference in New Issue
Block a user