Fix repairing Buffs and botgen buffs
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
namespace SPTarkov.Server.Core.Models.Enums;
|
||||
|
||||
public enum BuffType
|
||||
{
|
||||
WeaponSpread,
|
||||
DamageReduction,
|
||||
MalfunctionProtections,
|
||||
WeaponDamage,
|
||||
ArmorEfficiency,
|
||||
DurabilityImprovement
|
||||
}
|
||||
@@ -109,9 +109,9 @@ public class RagfairTaxService(
|
||||
_databaseService.GetGlobals().Configuration.RepairSettings.ItemEnhancementSettings;
|
||||
var priceModiferValue = buffType switch
|
||||
{
|
||||
"DamageReduction" => itemEnhancementSettings.DamageReduction.PriceModifierValue.Value,
|
||||
"MalfunctionProtections" => itemEnhancementSettings.MalfunctionProtections.PriceModifierValue.Value,
|
||||
"WeaponSpread" => itemEnhancementSettings.WeaponSpread.PriceModifierValue.Value,
|
||||
BuffType.DamageReduction => itemEnhancementSettings.DamageReduction.PriceModifierValue.Value,
|
||||
BuffType.MalfunctionProtections => itemEnhancementSettings.MalfunctionProtections.PriceModifierValue.Value,
|
||||
BuffType.WeaponSpread => itemEnhancementSettings.WeaponSpread.PriceModifierValue.Value,
|
||||
_ => 1d
|
||||
};
|
||||
discountedTax *= 1.0 + Math.Abs(item.Upd.Buff.Value.Value - 1.0) * priceModiferValue;
|
||||
|
||||
@@ -551,7 +551,7 @@ public class RepairService(
|
||||
item.Upd.Buff = new UpdBuff
|
||||
{
|
||||
Rarity = bonusRarityName,
|
||||
BuffType = bonusTypeName,
|
||||
BuffType = Enum.Parse<BuffType>(bonusTypeName),
|
||||
Value = bonusValue,
|
||||
ThresholdDurability = _randomUtil.GetPercentOfValue(bonusThresholdPercent, item.Upd.Repairable.Durability.Value, 0)
|
||||
};
|
||||
|
||||
@@ -50,6 +50,7 @@ public class JsonUtil
|
||||
new EftEnumConverter<RequirementState>(),
|
||||
new EftEnumConverter<ExfiltrationType>(),
|
||||
new EftEnumConverter<EquipmentSlots>(),
|
||||
new EftEnumConverter<BuffType>(),
|
||||
new EftListEnumConverter<EquipmentSlots>(),
|
||||
new EftListEnumConverter<PlayerSide>(),
|
||||
new EftListEnumConverter<DamageType>(),
|
||||
|
||||
Reference in New Issue
Block a user