Gas tank internals alerts (#9567)

This commit is contained in:
metalgearsloth
2022-07-25 14:42:25 +10:00
committed by GitHub
parent dad26db137
commit 40a7584c2f
25 changed files with 570 additions and 354 deletions

View File

@@ -1,5 +1,4 @@
using Content.Server.Body.Components;
using Content.Shared.Inventory;
using Content.Shared.Inventory;
namespace Content.Server.Atmos.Components
{
@@ -10,33 +9,12 @@ namespace Content.Server.Atmos.Components
[ComponentProtoName("BreathMask")]
public sealed class BreathToolComponent : Component
{
[Dependency] private readonly IEntityManager _entities = default!;
/// <summary>
/// Tool is functional only in allowed slots
/// </summary>
[DataField("allowedSlots")]
public SlotFlags AllowedSlots = SlotFlags.MASK;
public bool IsFunctional;
public EntityUid ConnectedInternalsEntity;
protected override void Shutdown()
{
base.Shutdown();
DisconnectInternals();
}
public void DisconnectInternals()
{
var old = ConnectedInternalsEntity;
ConnectedInternalsEntity = default;
if (old != default && _entities.TryGetComponent<InternalsComponent?>(old, out var internalsComponent))
{
internalsComponent.DisconnectBreathTool();
}
IsFunctional = false;
}
public EntityUid? ConnectedInternalsEntity;
}
}