Files
Delta-v/Content.Server/_DV/DeviceLinking/Systems/DeadMansSignallerSystem.cs
T
Emily c1a23e1a97 Dead Man's Signaller (#2775)
* Sorta working

* Made it able to be activated and deactivated

* Moved everything to Delta V folders

* Adds to research and protolathe

* Added signaller to uplink

* Sprites

* Range

* Fixes and moving things.

* yaml fix

* Fixes and clarified descriptions

* More code fixes

* please i beg

* i hate
2025-01-22 20:58:26 +00:00

28 lines
820 B
C#

using Content.Server._DV.DeviceLinking.Components;
using Content.Server.DeviceLinking.Systems;
using Content.Shared.Hands;
using Content.Shared.Item.ItemToggle;
namespace Content.Server._DV.DeviceLinking.Systems;
public sealed class DeadMansSignallerSystem : EntitySystem
{
[Dependency] private readonly DeviceLinkSystem _link = default!;
[Dependency] private readonly ItemToggleSystem _toggle = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DeadMansSignallerComponent, GotUnequippedHandEvent>(DeadMans);
}
private void DeadMans(Entity<DeadMansSignallerComponent> ent, ref GotUnequippedHandEvent args)
{
if (_toggle.IsActivated(ent.Owner))
{
_link.InvokePort(ent.Owner, ent.Comp.Port);
}
}
}