]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Blunt damage will do stamina damage on wide attacks (#32422)
authorCalecute <34964590+Calecute@users.noreply.github.com>
Sun, 20 Oct 2024 03:41:44 +0000 (00:41 -0300)
committerGitHub <noreply@github.com>
Sun, 20 Oct 2024 03:41:44 +0000 (14:41 +1100)
Fix: blunt damage will now do stamina damage on wide attacks.

Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs

index 9b15e5f8a086424da60577367f98a09769ac5f92..767b5c4ef6253b8c9ea18a9a29d9116e13bba26a 100644 (file)
@@ -670,6 +670,12 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
 
             if (damageResult != null && damageResult.GetTotal() > FixedPoint2.Zero)
             {
+                // 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 var bluntDamage))
+                {
+                    _stamina.TakeStaminaDamage(entity, (bluntDamage * component.BluntStaminaDamageFactor).Float(), visual: false, source: user, with: meleeUid == user ? null : meleeUid);
+                }
+
                 appliedDamage += damageResult;
 
                 if (meleeUid == user)