From da2f5e488a8047b3c41e4097acfc51f98d678710 Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Sun, 1 Dec 2024 19:21:43 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=91=D0=B0=D1=84=D1=84=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=B9=D1=80=D0=BE=D1=81=D1=82=D0=B0=D0=B1=D0=B8=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implants/NeuroControl/NeuroStabilizationSystem.cs | 2 +- .../Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs b/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs index 411a82ab3f..51f3e23318 100644 --- a/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs +++ b/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs @@ -18,7 +18,7 @@ public sealed class NeuroStabilizationSystem : EntitySystem private void BeforeStaminaDamage(Entity ent, ref BeforeStaminaDamageEvent args) { args.Cancelled = true; - Electrocute(ent, (int) MathF.Round(args.Value * 2f / 3f)); + Electrocute(ent, (int) MathF.Round(args.Value * 2f / 4f)); } public void Electrocute(EntityUid uid, int damage, StatusEffectsComponent? status = null) diff --git a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs index aeab3a49f4..bf6f1cdbb7 100644 --- a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs +++ b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs @@ -4,6 +4,8 @@ using Content.Shared.Speech.EntitySystems; using Content.Shared.Standing; using Content.Shared.StatusEffect; using Content.Shared.Stunnable; +using Content.Shared._White.Implants.NeuroControl; +using Content.Shared.Electrocution; using Robust.Shared.Timing; namespace Content.Shared._White.Item.DelayedKnockdown; @@ -14,6 +16,7 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem [Dependency] private readonly SharedJitteringSystem _jitter = default!; [Dependency] private readonly SharedStutteringSystem _stutter = default!; [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly SharedElectrocutionSystem _electrocution = default!; public override void Initialize() { @@ -36,6 +39,12 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem if (!TryComp(uid, out StandingStateComponent? standingState) || !standingState.CanLieDown) continue; + if (HasComp(uid)) + { + _electrocution.TryDoElectrocution(uid, null, 5, TimeSpan.FromSeconds(1), false, 0.5f, null, true); + continue; + } + if (jitterTime > TimeSpan.Zero) _jitter.DoJitter(uid, jitterTime, true, status: statusEffects); if (stutterTime > TimeSpan.Zero) From ef28e7398a74f0ae13f679cd07895e4286050ba0 Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Sun, 1 Dec 2024 20:39:26 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=91=D0=B0=D1=84=D1=84=20=D1=81=D0=B2?= =?UTF-8?q?=D0=BE=D0=B1=D0=BE=D0=B4=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ensnaring/EnsnareableSystem.Ensnaring.cs | 5 +++- .../Implants/SubdermalImplantSystem.cs | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs index 105a8f9720..4ba60e9c3d 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs @@ -11,6 +11,7 @@ using Content.Shared.Ensnaring.Components; using Content.Shared.IdentityManagement; using Content.Shared.StepTrigger.Systems; using Content.Shared.Throwing; +using Content.Shared.Popups; namespace Content.Server.Ensnaring; @@ -151,9 +152,11 @@ public sealed partial class EnsnareableSystem Dirty(component.Ensnared.Value, ensnareable); component.Ensnared = null; + _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", ensnare)), target, target, PopupType.Medium); // WD + UpdateAlert(target, ensnareable); var ev = new EnsnareRemoveEvent(component.WalkSpeed, component.SprintSpeed); - RaiseLocalEvent(ensnare, ev); + RaiseLocalEvent(target, ev); // WD fix from ensnare to target } /// diff --git a/Content.Server/Implants/SubdermalImplantSystem.cs b/Content.Server/Implants/SubdermalImplantSystem.cs index c25cf86c34..f50ec8f826 100644 --- a/Content.Server/Implants/SubdermalImplantSystem.cs +++ b/Content.Server/Implants/SubdermalImplantSystem.cs @@ -23,6 +23,9 @@ using Content.Shared.Movement.Pulling.Components; using Content.Shared.Movement.Pulling.Systems; using Robust.Shared.Collections; using Robust.Shared.Map.Components; +using Content.Server.Ensnaring; +using Content.Shared.Ensnaring.Components; +using System.Linq; namespace Content.Server.Implants; @@ -41,6 +44,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem [Dependency] private readonly EntityLookupSystem _lookupSystem = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly IdentitySystem _identity = default!; // WD + [Dependency] private readonly EnsnareableSystem _ensnareable = default!; // WD private EntityQuery _physicsQuery; private HashSet> _targetGrids = []; @@ -84,11 +88,26 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem private void OnFreedomImplant(EntityUid uid, SubdermalImplantComponent component, UseFreedomImplantEvent args) { - if (!TryComp(component.ImplantedEntity, out var cuffs) || cuffs.Container.ContainedEntities.Count < 1) - return; + // WD EDIT START + var ensnareCheck = TryComp(component.ImplantedEntity, out var ensnareable) && ensnareable.Container.ContainedEntities.Count > 0; + if (ensnareCheck && ensnareable != null) + { + var ensnaringUid = ensnareable.Container.ContainedEntities.First(); + if (TryComp(ensnaringUid, out var ensnaringComp)) + _ensnareable.ForceFree(ensnaringUid, ensnaringComp); + } - _cuffable.Uncuff(component.ImplantedEntity.Value, cuffs.LastAddedCuffs, cuffs.LastAddedCuffs); - args.Handled = true; + var cuffCheck = TryComp(component.ImplantedEntity, out var cuffs) && cuffs.Container.ContainedEntities.Count > 0; + if (cuffCheck && cuffs != null && component.ImplantedEntity != null) + { + _cuffable.Uncuff(component.ImplantedEntity.Value, cuffs.LastAddedCuffs, cuffs.LastAddedCuffs); + } + + if (ensnareCheck || cuffCheck) + { + args.Handled = true; + } + // WD EDIT END } private void OnActivateImplantEvent(EntityUid uid, SubdermalImplantComponent component, ActivateImplantEvent args)