From 35eb9feebf1e8d24d1c7c02bad6b8957c1b587ce Mon Sep 17 00:00:00 2001 From: snowythefox811 Date: Thu, 18 Jan 2024 09:04:45 +0000 Subject: [PATCH] Added The ability to have enhancements on armored rigs and helmets. (!200) Added the vest and headwear classes to be eligible for armor enhancement Co-authored-by: Snow Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/200 Co-authored-by: snowythefox811 Co-committed-by: snowythefox811 --- project/assets/configs/repair.json | 66 +++++++++++++++++++++++++++ project/src/services/RepairService.ts | 4 +- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/project/assets/configs/repair.json b/project/assets/configs/repair.json index af1fdd43..35dc1657 100644 --- a/project/assets/configs/repair.json +++ b/project/assets/configs/repair.json @@ -52,6 +52,72 @@ } } }, + "vest": { + "rarityWeight": { + "common": 5, + "rare": 1 + }, + "bonusTypeWeight": { + "DamageReduction": 1 + }, + "common": { + "DamageReduction": { + "valuesMinMax": { + "min": 0.9, + "max": 0.98 + }, + "activeDurabilityPercentMinMax": { + "min": 75, + "max": 90 + } + } + }, + "rare": { + "DamageReduction": { + "valuesMinMax": { + "min": 0.8, + "max": 0.9 + }, + "activeDurabilityPercentMinMax": { + "min": 75, + "max": 90 + } + } + } + }, + "headwear": { + "rarityWeight": { + "common": 5, + "rare": 1 + }, + "bonusTypeWeight": { + "DamageReduction": 1 + }, + "common": { + "DamageReduction": { + "valuesMinMax": { + "min": 0.9, + "max": 0.98 + }, + "activeDurabilityPercentMinMax": { + "min": 75, + "max": 90 + } + } + }, + "rare": { + "DamageReduction": { + "valuesMinMax": { + "min": 0.8, + "max": 0.9 + }, + "activeDurabilityPercentMinMax": { + "min": 75, + "max": 90 + } + } + } + }, "weapon": { "rarityWeight": { "common": 5, diff --git a/project/src/services/RepairService.ts b/project/src/services/RepairService.ts index 7a7e2b11..b708cc95 100644 --- a/project/src/services/RepairService.ts +++ b/project/src/services/RepairService.ts @@ -442,7 +442,7 @@ export class RepairService if (this.shouldBuffItem(repairDetails, pmcData)) { - if (this.itemHelper.isOfBaseclasses(repairDetails.repairedItem._tpl, [BaseClasses.ARMOR, BaseClasses.VEST])) + if (this.itemHelper.isOfBaseclasses(repairDetails.repairedItem._tpl, [BaseClasses.ARMOR, BaseClasses.VEST, BaseClasses.HEADWEAR])) { const armorConfig = this.repairConfig.repairKit.armor; this.addBuff(armorConfig, repairDetails.repairedItem); @@ -541,7 +541,7 @@ export class RepairService */ protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes { - if (this.itemHelper.isOfBaseclass(itemTemplate._id, BaseClasses.ARMOR)) + if (this.itemHelper.isOfBaseclasses(itemTemplate._id, [BaseClasses.ARMOR, BaseClasses.VEST, BaseClasses.HEADWEAR])) { if (itemTemplate._props.ArmorType === "Light") {