make pulled uncuffing slower & reduce uncuff spam cooldown (#29008)
* prevent people being pulled from uncuffing themselves * block -> modify duration
This commit is contained in:
@@ -105,3 +105,9 @@ public record struct UncuffAttemptEvent(EntityUid User, EntityUid Target)
|
|||||||
public readonly EntityUid Target = Target;
|
public readonly EntityUid Target = Target;
|
||||||
public bool Cancelled = false;
|
public bool Cancelled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event raised on an entity being uncuffed to determine any modifiers to the amount of time it takes to uncuff them.
|
||||||
|
/// </summary>
|
||||||
|
[ByRefEvent]
|
||||||
|
public record struct ModifyUncuffDurationEvent(EntityUid User, EntityUid Target, float Duration);
|
||||||
|
|||||||
@@ -561,7 +561,10 @@ namespace Content.Shared.Cuffs
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
|
|
||||||
|
var ev = new ModifyUncuffDurationEvent(user, target, isOwner ? cuff.BreakoutTime : cuff.UncuffTime);
|
||||||
|
RaiseLocalEvent(user, ref ev);
|
||||||
|
var uncuffTime = ev.Duration;
|
||||||
|
|
||||||
if (isOwner)
|
if (isOwner)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Content.Shared.ActionBlocker;
|
|||||||
using Content.Shared.Administration.Logs;
|
using Content.Shared.Administration.Logs;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
|
using Content.Shared.Cuffs.Components;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
@@ -12,6 +13,7 @@ using Content.Shared.Movement.Events;
|
|||||||
using Content.Shared.Movement.Pulling.Components;
|
using Content.Shared.Movement.Pulling.Components;
|
||||||
using Content.Shared.Movement.Pulling.Events;
|
using Content.Shared.Movement.Pulling.Events;
|
||||||
using Content.Shared.Movement.Systems;
|
using Content.Shared.Movement.Systems;
|
||||||
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Pulling.Events;
|
using Content.Shared.Pulling.Events;
|
||||||
using Content.Shared.Standing;
|
using Content.Shared.Standing;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
@@ -43,6 +45,7 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
|
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
|
||||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||||
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -56,6 +59,7 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<PullableComponent, JointRemovedEvent>(OnJointRemoved);
|
SubscribeLocalEvent<PullableComponent, JointRemovedEvent>(OnJointRemoved);
|
||||||
SubscribeLocalEvent<PullableComponent, GetVerbsEvent<Verb>>(AddPullVerbs);
|
SubscribeLocalEvent<PullableComponent, GetVerbsEvent<Verb>>(AddPullVerbs);
|
||||||
SubscribeLocalEvent<PullableComponent, EntGotInsertedIntoContainerMessage>(OnPullableContainerInsert);
|
SubscribeLocalEvent<PullableComponent, EntGotInsertedIntoContainerMessage>(OnPullableContainerInsert);
|
||||||
|
SubscribeLocalEvent<PullableComponent, ModifyUncuffDurationEvent>(OnModifyUncuffDuration);
|
||||||
|
|
||||||
SubscribeLocalEvent<PullerComponent, EntGotInsertedIntoContainerMessage>(OnPullerContainerInsert);
|
SubscribeLocalEvent<PullerComponent, EntGotInsertedIntoContainerMessage>(OnPullerContainerInsert);
|
||||||
SubscribeLocalEvent<PullerComponent, EntityUnpausedEvent>(OnPullerUnpaused);
|
SubscribeLocalEvent<PullerComponent, EntityUnpausedEvent>(OnPullerUnpaused);
|
||||||
@@ -94,6 +98,18 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
TryStopPull(ent.Owner, ent.Comp);
|
TryStopPull(ent.Owner, ent.Comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModifyUncuffDuration(Entity<PullableComponent> ent, ref ModifyUncuffDurationEvent args)
|
||||||
|
{
|
||||||
|
if (!ent.Comp.BeingPulled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// We don't care if the person is being uncuffed by someone else
|
||||||
|
if (args.User != args.Target)
|
||||||
|
return;
|
||||||
|
|
||||||
|
args.Duration *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
guides:
|
guides:
|
||||||
- Security
|
- Security
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 30
|
delay: 3
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: makeshift handcuffs
|
name: makeshift handcuffs
|
||||||
|
|||||||
Reference in New Issue
Block a user