diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs index 0edab3b9c1..12daf50ec7 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs @@ -202,8 +202,11 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem if (!base.DoDisarm(user, ev, component)) return false; - if (!HasComp(user)) + if (!TryComp(user, out var combatMode) || + combatMode.CanDisarm != true) + { return false; + } // If target doesn't have hands then we can't disarm so will let the player know it's pointless. if (!HasComp(ev.Target!.Value)) diff --git a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs index c955d1c891..7cb349d28d 100644 --- a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs @@ -121,7 +121,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem { return; } - + if (!_interaction.InRangeUnobstructed(user, ev.Target.Value, component.Range)) return; @@ -308,8 +308,11 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem if (!base.DoDisarm(user, ev, component)) return false; - if (!TryComp(user, out var combatMode)) + if (!TryComp(user, out var combatMode) || + combatMode.CanDisarm != true) + { return false; + } var target = ev.Target!.Value; diff --git a/Content.Shared/CombatMode/SharedCombatModeComponent.cs b/Content.Shared/CombatMode/SharedCombatModeComponent.cs index 62e3ab53fb..b1fe9b926a 100644 --- a/Content.Shared/CombatMode/SharedCombatModeComponent.cs +++ b/Content.Shared/CombatMode/SharedCombatModeComponent.cs @@ -22,9 +22,6 @@ namespace Content.Shared.CombatMode [ViewVariables(VVAccess.ReadWrite), DataField("disarm")] public bool? CanDisarm; - [DataField("disarmFailSound")] - public readonly SoundSpecifier DisarmFailSound = new SoundPathSpecifier("/Audio/Weapons/punchmiss.ogg"); - [DataField("disarmSuccessSound")] public readonly SoundSpecifier DisarmSuccessSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg"); diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index ab5627991f..3dd034aa5b 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -243,8 +243,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem weapon.NextAttack += TimeSpan.FromSeconds(1f / weapon.AttackRate); // Attack confirmed - // Play a sound to give instant feedback; same with playing the animations - Audio.PlayPredicted(weapon.SwingSound, weapon.Owner, user); switch (attack) { @@ -252,7 +250,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem DoLightAttack(user, light, weapon); break; case DisarmAttackEvent disarm: - DoDisarm(user, disarm, weapon); + if (!DoDisarm(user, disarm, weapon)) + return; + break; case HeavyAttackEvent heavy: DoHeavyAttack(user, heavy, weapon); @@ -261,6 +261,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem throw new NotImplementedException(); } + // Play a sound to give instant feedback; same with playing the animations + Audio.PlayPredicted(weapon.SwingSound, weapon.Owner, user); + DoLungeAnimation(user, weapon.Angle, attack.Coordinates.ToMap(EntityManager), weapon.Animation); weapon.Attacking = true; Dirty(weapon); diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index f2a9afa2c6..09ae684d82 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -234,7 +234,7 @@ fireStackAlternateState: 3 - type: EnsnareableVisualizer - type: CombatMode - disarm: true + canDisarm: true - type: Climbing - type: Cuffable - type: Ensnareable