Add price multiplier for armor component (#24561)
* Add price multiplier for armor component * Fix datafiled
This commit is contained in:
@@ -22,13 +22,13 @@ public sealed class ArmorSystem : SharedArmorSystem
|
|||||||
foreach (var modifier in component.Modifiers.Coefficients)
|
foreach (var modifier in component.Modifiers.Coefficients)
|
||||||
{
|
{
|
||||||
var damageType = _protoManager.Index<DamageTypePrototype>(modifier.Key);
|
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)
|
foreach (var modifier in component.Modifiers.FlatReduction)
|
||||||
{
|
{
|
||||||
var damageType = _protoManager.Index<DamageTypePrototype>(modifier.Key);
|
var damageType = _protoManager.Index<DamageTypePrototype>(modifier.Key);
|
||||||
args.Price += damageType.ArmorPriceFlat * modifier.Value;
|
args.Price += component.PriceMultiplier * damageType.ArmorPriceFlat * modifier.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ public sealed partial class ArmorComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField(required: true)]
|
[DataField(required: true)]
|
||||||
public DamageModifierSet Modifiers = default!;
|
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>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user