From: MilenVolf <63782763+MilenVolf@users.noreply.github.com> Date: Thu, 25 Jan 2024 22:04:01 +0000 (+0300) Subject: Add price multiplier for armor component (#24561) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4f3265e950d3dd3446cea8bd41c6709169e071f1;p=space-station-14.git Add price multiplier for armor component (#24561) * Add price multiplier for armor component * Fix datafiled --- diff --git a/Content.Server/Armor/ArmorSystem.cs b/Content.Server/Armor/ArmorSystem.cs index dc4b3c7935..915210419b 100644 --- a/Content.Server/Armor/ArmorSystem.cs +++ b/Content.Server/Armor/ArmorSystem.cs @@ -22,13 +22,13 @@ public sealed class ArmorSystem : SharedArmorSystem foreach (var modifier in component.Modifiers.Coefficients) { var damageType = _protoManager.Index(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(modifier.Key); - args.Price += damageType.ArmorPriceFlat * modifier.Value; + args.Price += component.PriceMultiplier * damageType.ArmorPriceFlat * modifier.Value; } } } diff --git a/Content.Shared/Armor/ArmorComponent.cs b/Content.Shared/Armor/ArmorComponent.cs index a1bb75923f..fd04c5d29c 100644 --- a/Content.Shared/Armor/ArmorComponent.cs +++ b/Content.Shared/Armor/ArmorComponent.cs @@ -15,6 +15,13 @@ public sealed partial class ArmorComponent : Component /// [DataField(required: true)] public DamageModifierSet Modifiers = default!; + + /// + /// A multiplier applied to the calculated point value + /// to determine the monetary value of the armor + /// + [DataField] + public float PriceMultiplier = 1; } ///