Move weapon skill check into shouldBuffItem() + do similar check for armor

This commit is contained in:
Dev 2024-03-14 23:08:06 +00:00
parent 9bc08fbd26
commit 0c404cbcba
2 changed files with 19 additions and 5 deletions

View File

@ -100,11 +100,7 @@ export class RepairController
output,
);
// Bonuses only get applied when players weapon maintenance skill is over level 10
if (this.profileHelper.getSkillFromProfile(pmcData, SkillTypes.WEAPON_TREATMENT)?.Progress >= 1000)
{
this.repairService.addBuffToItem(repairDetails, pmcData);
}
this.repairService.addBuffToItem(repairDetails, pmcData);
// add repaired item to send to client
output.profileChanges[sessionID].items.change.push(repairDetails.repairedItem);

View File

@ -510,6 +510,24 @@ export class RepairService
return false;
}
// Skill < level 10 + repairing weapon
if (
itemSkillType === SkillTypes.WEAPON_TREATMENT
&& this.profileHelper.getSkillFromProfile(pmcData, SkillTypes.WEAPON_TREATMENT)?.Progress < 1000
)
{
return false;
}
// Skill < level 10 + repairing armor
if (
([SkillTypes.LIGHT_VESTS, SkillTypes.HEAVY_VESTS].includes(itemSkillType))
&& this.profileHelper.getSkillFromProfile(pmcData, itemSkillType)?.Progress < 1000
)
{
return false;
}
const commonBuffMinChanceValue =
globals.config.SkillsSettings[itemSkillType as string].BuffSettings.CommonBuffMinChanceValue;
const commonBuffChanceLevelBonus =