]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add price multiplier for armor component (#24561)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Thu, 25 Jan 2024 22:04:01 +0000 (01:04 +0300)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2024 22:04:01 +0000 (17:04 -0500)
* Add price multiplier for armor component

* Fix datafiled

Content.Server/Armor/ArmorSystem.cs
Content.Shared/Armor/ArmorComponent.cs

index dc4b3c7935f06f6c9f1f6b11ed09a74cdf12bb03..915210419bbd032730633b979079a097546301cd 100644 (file)
@@ -22,13 +22,13 @@ public sealed class ArmorSystem : SharedArmorSystem
         foreach (var modifier in component.Modifiers.Coefficients)
         {
             var damageType = _protoManager.Index<DamageTypePrototype>(modifier.Key);
-            args.Price += damageType.ArmorPriceCoefficient * 100 * (1 - modifier.Value);
+            args.Price += component.PriceMultiplier * damageType.ArmorPriceCoefficient * 100 * (1 - modifier.Value);
         }
 
         foreach (var modifier in component.Modifiers.FlatReduction)
         {
             var damageType = _protoManager.Index<DamageTypePrototype>(modifier.Key);
-            args.Price += damageType.ArmorPriceFlat * modifier.Value;
+            args.Price += component.PriceMultiplier * damageType.ArmorPriceFlat * modifier.Value;
         }
     }
 }
index a1bb75923f75245d0c2e6ca117291c1857f3cf26..fd04c5d29c862dd3ed4a95887d50fb2f19161b4a 100644 (file)
@@ -15,6 +15,13 @@ public sealed partial class ArmorComponent : Component
     /// </summary>
     [DataField(required: true)]
     public DamageModifierSet Modifiers = default!;
+
+    /// <summary>
+    /// A multiplier applied to the calculated point value
+    /// to determine the monetary value of the armor
+    /// </summary>
+    [DataField]
+    public float PriceMultiplier = 1;
 }
 
 /// <summary>