]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Dehardcode zombie damage values (#36494)
authorUpAndLeaves <92269094+Alpha-Two@users.noreply.github.com>
Sat, 12 Apr 2025 20:43:31 +0000 (21:43 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Apr 2025 20:43:31 +0000 (13:43 -0700)
* Quick, send it!

* no spaces, no fun

* Noooo I have to adhere to good code standards

Content.Server/Zombies/ZombieSystem.Transform.cs
Content.Shared/Zombies/ZombieComponent.cs

index 48954db4f178f8bcc4042b8bde8d1fd8c0e304bb..a7a22c417528463118806b4a6e9f314b250068fd 100644 (file)
@@ -178,17 +178,7 @@ public sealed partial class ZombieSystem
             _humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Snout, zombiecomp.BaseLayerExternal, humanoid: huApComp);
 
             //This is done here because non-humanoids shouldn't get baller damage
-            //lord forgive me for the hardcoded damage
-            DamageSpecifier dspec = new()
-            {
-                DamageDict = new()
-                {
-                    { "Slash", 13 },
-                    { "Piercing", 7 },
-                    { "Structural", 10 }
-                }
-            };
-            melee.Damage = dspec;
+            melee.Damage = zombiecomp.DamageOnBite;
 
             // humanoid zombies get to pry open doors and shit
             var pryComp = EnsureComp<PryingComponent>(target);
index 94e1e5afec4425fc406e700cabc73630d2b17321..f9576dd3aa15da1e481bcc5fbfa1455ba824e8ae 100644 (file)
@@ -127,6 +127,20 @@ public sealed partial class ZombieComponent : Component
         }
     };
 
+    /// <summary>
+    /// The damage dealt on bite, dehardcoded for your enjoyment
+    /// </summary>
+    [DataField]
+    public DamageSpecifier DamageOnBite = new()
+    {
+        DamageDict = new()
+        {
+            { "Slash", 13 },
+            { "Piercing", 7 },
+            { "Structural", 10 }
+        }
+    };
+
     /// <summary>
     ///     Path to antagonist alert sound.
     /// </summary>