diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index c3e17130b3..4936cc2e26 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -29,6 +29,12 @@ public sealed class MeleeWeaponComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("nextAttack", customTypeSerializer:typeof(TimeOffsetSerializer))] public TimeSpan NextAttack; + /// + /// Starts attack cooldown when equipped if true. + /// + [ViewVariables(VVAccess.ReadWrite), DataField("resetOnHandSelected")] + public bool ResetOnHandSelected = true; + /* * Melee combat works based around 2 types of attacks: * 1. Click attacks with left-click. This attacks whatever is under your mnouse diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index 4db68335d9..9c609394a6 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -75,6 +75,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem if (component.AttackRate.Equals(0f)) return; + if (!component.ResetOnHandSelected) + return; + // If someone swaps to this weapon then reset its cd. var curTime = Timing.CurTime; var minimum = curTime + TimeSpan.FromSeconds(1 / component.AttackRate); diff --git a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml index 5a2eaa3ef9..83109c28f4 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml @@ -16,6 +16,7 @@ tags: - Handcuffs - type: MeleeWeapon + resetOnHandSelected: false animation: WeaponArcDisarm damage: types: