]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
localize damage type in armor examine description (#21807)
authorChronophylos <nikolai@chronophylos.com>
Mon, 4 Dec 2023 12:57:29 +0000 (13:57 +0100)
committerGitHub <noreply@github.com>
Mon, 4 Dec 2023 12:57:29 +0000 (07:57 -0500)
* localize damage type in armor examine description

* format

* change translation

* add missing strings

Content.Shared/Armor/SharedArmorSystem.cs
Resources/Locale/en-US/armor/armor-examine.ftl

index 89141fcbd3d2df069ed6d8d5c074f9ad2fce2354..73cb6da2c2700bc0d2dc1d199c5895cbbc501949 100644 (file)
@@ -8,13 +8,13 @@ using Robust.Shared.Utility;
 namespace Content.Shared.Armor;
 
 /// <summary>
-/// This handles logic relating to <see cref="ArmorComponent"/>
+///     This handles logic relating to <see cref="ArmorComponent" />
 /// </summary>
 public abstract class SharedArmorSystem : EntitySystem
 {
     [Dependency] private readonly ExamineSystemShared _examine = default!;
 
-    /// <inheritdoc/>
+    /// <inheritdoc />
     public override void Initialize()
     {
         base.Initialize();
@@ -29,7 +29,8 @@ public abstract class SharedArmorSystem : EntitySystem
         args.Args.Damage = DamageSpecifier.ApplyModifierSet(args.Args.Damage, component.Modifiers);
     }
 
-    private void OnBorgDamageModify(EntityUid uid, ArmorComponent component, ref BorgModuleRelayedEvent<DamageModifyEvent> args)
+    private void OnBorgDamageModify(EntityUid uid, ArmorComponent component,
+        ref BorgModuleRelayedEvent<DamageModifyEvent> args)
     {
         args.Args.Damage = DamageSpecifier.ApplyModifierSet(args.Args.Damage, component.Modifiers);
     }
@@ -58,19 +59,23 @@ public abstract class SharedArmorSystem : EntitySystem
         foreach (var coefficientArmor in armorModifiers.Coefficients)
         {
             msg.PushNewline();
+
+            var armorType = Loc.GetString("armor-damage-type-" + coefficientArmor.Key.ToLower());
             msg.AddMarkup(Loc.GetString("armor-coefficient-value",
-                ("type", coefficientArmor.Key),
-                ("value", MathF.Round((1f - coefficientArmor.Value) * 100,1))
-                ));
+                ("type", armorType),
+                ("value", MathF.Round((1f - coefficientArmor.Value) * 100, 1))
+            ));
         }
 
         foreach (var flatArmor in armorModifiers.FlatReduction)
         {
             msg.PushNewline();
+
+            var armorType = Loc.GetString("armor-damage-type-" + flatArmor.Key.ToLower());
             msg.AddMarkup(Loc.GetString("armor-reduction-value",
-                ("type", flatArmor.Key),
+                ("type", armorType),
                 ("value", flatArmor.Value)
-                ));
+            ));
         }
 
         return msg;
index 376871fd81e3afa602ff0abc1d498cf520eaa2e6..d49a1373f28f496368b93e3ad3bb3c691e06c6be 100644 (file)
@@ -4,3 +4,16 @@ armor-examinable-verb-message = Examine the armor values.
 armor-examine = It provides the following protection:
 armor-coefficient-value = - [color=yellow]{$type}[/color] damage reduced by [color=lightblue]{$value}%[/color].
 armor-reduction-value = - [color=yellow]{$type}[/color] damage reduced by [color=lightblue]{$value}[/color].
+armor-damage-type-blunt = Blunt
+armor-damage-type-slash = Slash
+armor-damage-type-piercing = Piercing
+armor-damage-type-heat = Heat
+armor-damage-type-radiation = Radiation
+armor-damage-type-caustic = Caustic
+armor-damage-type-bloodloss = Bloodloss
+armor-damage-type-asphyxiation = Asphyxiation
+armor-damage-type-cellular = Cellular
+armor-damage-type-cold = Cold
+armor-damage-type-poison = Poison
+armor-damage-type-shock = Shock
+armor-damage-type-structural = Structural