Бафф свободы
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Ensnaring.Components;
|
|||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.StepTrigger.Systems;
|
using Content.Shared.StepTrigger.Systems;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
|
using Content.Shared.Popups;
|
||||||
|
|
||||||
namespace Content.Server.Ensnaring;
|
namespace Content.Server.Ensnaring;
|
||||||
|
|
||||||
@@ -151,9 +152,11 @@ public sealed partial class EnsnareableSystem
|
|||||||
Dirty(component.Ensnared.Value, ensnareable);
|
Dirty(component.Ensnared.Value, ensnareable);
|
||||||
component.Ensnared = null;
|
component.Ensnared = null;
|
||||||
|
|
||||||
|
_popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", ensnare)), target, target, PopupType.Medium); // WD
|
||||||
|
|
||||||
UpdateAlert(target, ensnareable);
|
UpdateAlert(target, ensnareable);
|
||||||
var ev = new EnsnareRemoveEvent(component.WalkSpeed, component.SprintSpeed);
|
var ev = new EnsnareRemoveEvent(component.WalkSpeed, component.SprintSpeed);
|
||||||
RaiseLocalEvent(ensnare, ev);
|
RaiseLocalEvent(target, ev); // WD fix from ensnare to target
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ using Content.Shared.Movement.Pulling.Components;
|
|||||||
using Content.Shared.Movement.Pulling.Systems;
|
using Content.Shared.Movement.Pulling.Systems;
|
||||||
using Robust.Shared.Collections;
|
using Robust.Shared.Collections;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
|
using Content.Server.Ensnaring;
|
||||||
|
using Content.Shared.Ensnaring.Components;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Content.Server.Implants;
|
namespace Content.Server.Implants;
|
||||||
|
|
||||||
@@ -41,6 +44,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
|||||||
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
|
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
|
||||||
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||||
[Dependency] private readonly IdentitySystem _identity = default!; // WD
|
[Dependency] private readonly IdentitySystem _identity = default!; // WD
|
||||||
|
[Dependency] private readonly EnsnareableSystem _ensnareable = default!; // WD
|
||||||
|
|
||||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||||
private HashSet<Entity<MapGridComponent>> _targetGrids = [];
|
private HashSet<Entity<MapGridComponent>> _targetGrids = [];
|
||||||
@@ -84,11 +88,26 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
|||||||
|
|
||||||
private void OnFreedomImplant(EntityUid uid, SubdermalImplantComponent component, UseFreedomImplantEvent args)
|
private void OnFreedomImplant(EntityUid uid, SubdermalImplantComponent component, UseFreedomImplantEvent args)
|
||||||
{
|
{
|
||||||
if (!TryComp<CuffableComponent>(component.ImplantedEntity, out var cuffs) || cuffs.Container.ContainedEntities.Count < 1)
|
// WD EDIT START
|
||||||
return;
|
var ensnareCheck = TryComp<EnsnareableComponent>(component.ImplantedEntity, out var ensnareable) && ensnareable.Container.ContainedEntities.Count > 0;
|
||||||
|
if (ensnareCheck && ensnareable != null)
|
||||||
|
{
|
||||||
|
var ensnaringUid = ensnareable.Container.ContainedEntities.First();
|
||||||
|
if (TryComp<EnsnaringComponent>(ensnaringUid, out var ensnaringComp))
|
||||||
|
_ensnareable.ForceFree(ensnaringUid, ensnaringComp);
|
||||||
|
}
|
||||||
|
|
||||||
_cuffable.Uncuff(component.ImplantedEntity.Value, cuffs.LastAddedCuffs, cuffs.LastAddedCuffs);
|
var cuffCheck = TryComp<CuffableComponent>(component.ImplantedEntity, out var cuffs) && cuffs.Container.ContainedEntities.Count > 0;
|
||||||
args.Handled = true;
|
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)
|
private void OnActivateImplantEvent(EntityUid uid, SubdermalImplantComponent component, ActivateImplantEvent args)
|
||||||
|
|||||||
Reference in New Issue
Block a user