]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add no damage phrase and logic
authorPreston Smith <Blackfoot03@outlook.com>
Wed, 30 Oct 2024 03:25:42 +0000 (22:25 -0500)
committerPreston Smith <Blackfoot03@outlook.com>
Wed, 30 Oct 2024 03:25:42 +0000 (22:25 -0500)
Content.Shared/Damage/Systems/DamageExamineSystem.cs
Resources/Locale/en-US/damage/damage-examine.ftl

index 53436a920aa56648e7649c80c55a5e19dd2c6544..72c1af29b22d9b6a2c4a84c2a4d4b82996b00072 100644 (file)
@@ -61,6 +61,15 @@ public sealed class DamageExamineSystem : EntitySystem
         }
         else
         {
+            if (damageSpecifier.DamageDict.Count == 1)
+            {
+                // May be simplified to using a foreach(Var x) despite being only one item
+                if(damageSpecifier.DamageDict.Values.GetEnumerator().Current == FixedPoint2.Zero)
+                {
+                    msg.AddMarkupOrThrow(Loc.GetString("damage-none"));
+                    return msg;
+                }
+            }
             msg.AddMarkupOrThrow(Loc.GetString("damage-examine-type", ("type", type)));
         }
 
index 974b8fa96506465a9843cd0124d3130292ad382c..848adeb31a0de0dee45692ba8d437be3dad4dc6b 100644 (file)
@@ -10,3 +10,4 @@ damage-throw = throw
 damage-examine = It does the following damage:
 damage-examine-type = It does the following [color=cyan]{$type}[/color] damage:
 damage-value = - [color=red]{$amount}[/color] units of [color=yellow]{$type}[/color].
+damage-none = It does no damage.