diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index 85d2e4675f..fa5e0b3a90 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -140,6 +140,14 @@ public sealed partial class MeleeWeaponComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("soundNoDamage"), AutoNetworkedField] public SoundSpecifier NoDamageSound { get; set; } = new SoundCollectionSpecifier("WeakHit"); + + /// + /// If true, the weapon must be equipped for it to be used. + /// E.g boxing gloves must be equipped to your gloves, + /// not just held in your hand to be used. + /// + [DataField, AutoNetworkedField] + public bool MustBeEquippedToUse = false; } /// diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index e59b4a13fe..6fa11f87d2 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -277,7 +277,10 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem if (EntityManager.TryGetComponent(entity, out HandsComponent? hands) && hands.ActiveHandEntity is { } held) { - if (EntityManager.TryGetComponent(held, out melee)) + // Make sure the entity is a weapon AND it doesn't need + // to be equipped to be used (E.g boxing gloves). + if (EntityManager.TryGetComponent(held, out melee) && + !melee.MustBeEquippedToUse) { weaponUid = held; return true; diff --git a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml index bf08db78f7..96bdd61f94 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml @@ -20,6 +20,7 @@ soundHit: collection: BoxingHit animation: WeaponArcFist + mustBeEquippedToUse: true - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-red @@ -90,6 +91,7 @@ types: Blunt: 8 bluntStaminaDamageFactor: 0.0 # so blunt doesn't deal stamina damage at all + mustBeEquippedToUse: true - type: entity parent: ClothingHandsBase @@ -362,6 +364,7 @@ soundHit: collection: Punch animation: WeaponArcFist + mustBeEquippedToUse: true - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-blue