diff --git a/Content.Server/Weapon/Melee/Components/MeleeWeaponComponent.cs b/Content.Server/Weapon/Melee/Components/MeleeWeaponComponent.cs index cc71ef2b48..5e62e1d2f7 100644 --- a/Content.Server/Weapon/Melee/Components/MeleeWeaponComponent.cs +++ b/Content.Server/Weapon/Melee/Components/MeleeWeaponComponent.cs @@ -1,5 +1,6 @@ using Content.Shared.Damage; using Robust.Shared.Audio; +using Content.Shared.FixedPoint; namespace Content.Server.Weapon.Melee.Components { @@ -52,5 +53,9 @@ namespace Content.Server.Weapon.Melee.Components [DataField("damage", required:true)] [ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier Damage = default!; + + [DataField("bluntStaminaDamageFactor")] + [ViewVariables(VVAccess.ReadWrite)] + public FixedPoint2 BluntStaminaDamageFactor { get; set; } = 0.5f; } } diff --git a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs index 72ccae1bef..1e118378a3 100644 --- a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs @@ -5,6 +5,8 @@ using Content.Server.Body.Systems; using Content.Server.Chemistry.Components; using Content.Server.Chemistry.EntitySystems; using Content.Server.Cooldown; +using Content.Server.Damage.Components; +using Content.Server.Damage.Systems; using Content.Server.Weapon.Melee.Components; using Content.Shared.Damage; using Content.Shared.Audio; @@ -28,6 +30,7 @@ namespace Content.Server.Weapon.Melee [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly DamageableSystem _damageableSystem = default!; + [Dependency] private readonly StaminaSystem _staminaSystem = default!; [Dependency] private readonly SolutionContainerSystem _solutionsSystem = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!; @@ -101,6 +104,13 @@ namespace Content.Server.Weapon.Melee if (damageResult != null && damageResult.Total > FixedPoint2.Zero) { + FixedPoint2 bluntDamage; + // If the target has stamina and is taking blunt damage, they should also take stamina damage based on their blunt to stamina factor + if (damageResult.DamageDict.TryGetValue("Blunt", out bluntDamage)) + { + _staminaSystem.TakeStaminaDamage(target, (bluntDamage * comp.BluntStaminaDamageFactor).Float()); + } + if (args.Used == args.User) _adminLogger.Add(LogType.MeleeHit, $"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(args.Target.Value):target} using their hands and dealt {damageResult.Total:damage} damage"); diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index 8e46947ac1..9a4616e080 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -16,6 +16,7 @@ damage: types: Blunt: 5 + bluntStaminaDamageFactor: 2.0 range: 1.5 arcwidth: 60 arc: default