Remove self-uncuff spam suicide, damage changes (#25161)

* Initial commit

* Remove damage from cuffs entirely

* Changed from Action uncuffing cooldown to UseDelay cooldown

* Minor merge conflict fix

* Edit the actual correct line

* Submodule fix
This commit is contained in:
SlamBamActionman
2024-02-26 03:41:20 +01:00
committed by GitHub
parent b7be6932f3
commit 485fb4cb65
3 changed files with 18 additions and 20 deletions

View File

@@ -52,15 +52,6 @@ public sealed partial class HandcuffComponent : Component
[DataField] [DataField]
public bool Removing; public bool Removing;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageOnResist = new()
{
DamageDict = new()
{
{ "Blunt", 3.0 },
}
};
/// <summary> /// <summary>
/// The path of the RSI file used for the player cuffed overlay. /// The path of the RSI file used for the player cuffed overlay.
/// </summary> /// </summary>

View File

@@ -6,7 +6,6 @@ using Content.Shared.Alert;
using Content.Shared.Atmos.Piping.Unary.Components; using Content.Shared.Atmos.Piping.Unary.Components;
using Content.Shared.Buckle.Components; using Content.Shared.Buckle.Components;
using Content.Shared.Cuffs.Components; using Content.Shared.Cuffs.Components;
using Content.Shared.Damage;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Content.Shared.Effects; using Content.Shared.Effects;
@@ -28,6 +27,7 @@ using Content.Shared.Pulling.Components;
using Content.Shared.Pulling.Events; using Content.Shared.Pulling.Events;
using Content.Shared.Rejuvenate; using Content.Shared.Rejuvenate;
using Content.Shared.Stunnable; using Content.Shared.Stunnable;
using Content.Shared.Timing;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee.Events; using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio; using Robust.Shared.Audio;
@@ -48,7 +48,6 @@ namespace Content.Shared.Cuffs
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly AlertsSystem _alerts = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!; [Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly DamageableSystem _damageSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly SharedContainerSystem _container = default!;
@@ -58,6 +57,7 @@ namespace Content.Shared.Cuffs
[Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly UseDelaySystem _delay = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -560,6 +560,18 @@ namespace Content.Shared.Cuffs
} }
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime; var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
if (isOwner)
{
if (!TryComp(cuffsToRemove.Value, out UseDelayComponent? useDelay))
return;
if (!_delay.TryResetDelay((cuffsToRemove.Value, useDelay), true))
{
return;
}
}
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, uncuffTime, new UnCuffDoAfterEvent(), target, target, cuffsToRemove) var doAfterEventArgs = new DoAfterArgs(EntityManager, user, uncuffTime, new UnCuffDoAfterEvent(), target, target, cuffsToRemove)
{ {
BreakOnUserMove = true, BreakOnUserMove = true,
@@ -574,11 +586,6 @@ namespace Content.Shared.Cuffs
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}"); _adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}");
if (isOwner)
{
_damageSystem.TryChangeDamage(target, cuff.DamageOnResist, true, false);
}
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer", _popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",
("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))), ("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))),
target, Filter.Pvs(target, entityManager: EntityManager) target, Filter.Pvs(target, entityManager: EntityManager)
@@ -586,7 +593,6 @@ namespace Content.Shared.Cuffs
if (target == user) if (target == user)
{ {
_color.RaiseEffect(Color.Red, new List<EntityUid>() { user }, Filter.Pvs(user, entityManager: EntityManager));
_popup.PopupClient(Loc.GetString("cuffable-component-start-uncuffing-self"), user, user); _popup.PopupClient(Loc.GetString("cuffable-component-start-uncuffing-self"), user, user);
} }
else else
@@ -619,6 +625,8 @@ namespace Content.Shared.Cuffs
cuff.Removing = true; cuff.Removing = true;
_audio.PlayPredicted(cuff.EndUncuffSound, target, user); _audio.PlayPredicted(cuff.EndUncuffSound, target, user);
var isOwner = user == target;
_container.Remove(cuffsToRemove, cuffable.Container); _container.Remove(cuffsToRemove, cuffable.Container);
if (_net.IsServer) if (_net.IsServer)

View File

@@ -25,6 +25,8 @@
- type: GuideHelp - type: GuideHelp
guides: guides:
- Security - Security
- type: UseDelay
delay: 6
- type: entity - type: entity
name: makeshift handcuffs name: makeshift handcuffs
@@ -148,9 +150,6 @@
- type: Handcuff - type: Handcuff
cuffedRSI: Clothing/OuterClothing/Misc/straight_jacket.rsi cuffedRSI: Clothing/OuterClothing/Misc/straight_jacket.rsi
breakoutTime: 100 breakoutTime: 100
damageOnResist:
types:
Blunt: 0
cuffTime: 10 cuffTime: 10
uncuffTime: 10 uncuffTime: 10
stunBonus: 4 stunBonus: 4