diff --git a/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs b/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs index f3befa418a..c17e4b4c01 100644 --- a/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs +++ b/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs @@ -10,6 +10,7 @@ public sealed class ShadowkinPowerSystem : EntitySystem { [Dependency] private readonly IEntityManager _entity = default!; [Dependency] private readonly AlertsSystem _alerts = default!; + [Dependency] private readonly ShadowkinBlackeyeSystem _blackeye = default!; private readonly Dictionary _powerDictionary; @@ -198,15 +199,7 @@ public void SetPowerLevel(EntityUid uid, float newPowerLevel) /// public bool TryBlackeye(EntityUid uid) { - var ent = _entity.GetNetEntity(uid); - // Raise an attempted blackeye event - var ev = new ShadowkinBlackeyeAttemptEvent(ent); - RaiseLocalEvent(ev); - if (ev.Cancelled) - return false; - - Blackeye(uid); - return true; + return _blackeye.TryBlackeye(uid); } /// @@ -214,18 +207,7 @@ public bool TryBlackeye(EntityUid uid) /// public void Blackeye(EntityUid uid) { - var ent = _entity.GetNetEntity(uid); - - // Get shadowkin component - if (!_entity.TryGetComponent(uid, out var component)) - { - DebugTools.Assert("Tried to blackeye entity without shadowkin component."); - return; - } - - component.Blackeye = true; - RaiseNetworkEvent(new ShadowkinBlackeyeEvent(ent)); - RaiseLocalEvent(new ShadowkinBlackeyeEvent(ent)); + _blackeye.Blackeye(uid); } diff --git a/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinSystem.Blackeye.cs b/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinSystem.Blackeye.cs index 434e78f30e..825d526e7e 100644 --- a/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinSystem.Blackeye.cs +++ b/Content.Server/Parkstation/Species/Shadowkin/Systems/ShadowkinSystem.Blackeye.cs @@ -9,6 +9,7 @@ using Content.Shared.Parkstation.Species.Shadowkin.Events; using Content.Shared.Popups; using Robust.Shared.Prototypes; +using Robust.Shared.Utility; namespace Content.Server.Parkstation.Species.Shadowkin.Systems; @@ -92,4 +93,40 @@ private void OnBlackeye(ShadowkinBlackeyeEvent ev) null, null); } + + + /// + /// Tries to blackeye a shadowkin + /// + public bool TryBlackeye(EntityUid uid) + { + var ent = _entity.GetNetEntity(uid); + // Raise an attempted blackeye event + var ev = new ShadowkinBlackeyeAttemptEvent(ent); + RaiseLocalEvent(ev); + if (ev.Cancelled) + return false; + + Blackeye(uid); + return true; + } + + /// + /// Blackeyes a shadowkin + /// + public void Blackeye(EntityUid uid) + { + var ent = _entity.GetNetEntity(uid); + + // Get shadowkin component + if (!_entity.TryGetComponent(uid, out var component)) + { + DebugTools.Assert("Tried to blackeye entity without shadowkin component."); + return; + } + + component.Blackeye = true; + RaiseNetworkEvent(new ShadowkinBlackeyeEvent(ent)); + RaiseLocalEvent(new ShadowkinBlackeyeEvent(ent)); + } }