Fix scav case timer not taking crafting skill into account (!252)
The assembly calculation for scav case timer first applies the player's crafting skill reduction, then multiplies by the resulting time by the Fence modifier: ``` return base.ReductionCoefficient * this.fenceTraderInfo_0.FenceLoyalty.ScavCaseTimeModifier; ``` This change makes the server calculation match this expected value Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/252 Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com> Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
77bc22f27e
commit
56c0007caf
@ -675,9 +675,11 @@ export class HideoutController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Important: Here we need to be very exact:
|
// @Important: Here we need to be very exact:
|
||||||
// - normal recipe: Production time value is stored in attribute "productionType" with small "p"
|
// - normal recipe: Production time value is stored in attribute "productionTime" with small "p"
|
||||||
// - scav case recipe: Production time value is stored in attribute "ProductionType" with capital "P"
|
// - scav case recipe: Production time value is stored in attribute "ProductionTime" with capital "P"
|
||||||
const modifiedScavCaseTime = this.getScavCaseTime(pmcData, recipe.ProductionTime);
|
const adjustedCraftTime = recipe.ProductionTime
|
||||||
|
- this.hideoutHelper.getCraftingSkillProductionTimeReduction(pmcData, recipe.ProductionTime);
|
||||||
|
const modifiedScavCaseTime = this.getScavCaseTime(pmcData, adjustedCraftTime);
|
||||||
|
|
||||||
pmcData.Hideout.Production[body.recipeId] = this.hideoutHelper.initProduction(
|
pmcData.Hideout.Production[body.recipeId] = this.hideoutHelper.initProduction(
|
||||||
body.recipeId,
|
body.recipeId,
|
||||||
|
@ -999,7 +999,7 @@ export class HideoutHelper
|
|||||||
* @param productionTime Time to complete hideout craft in seconds
|
* @param productionTime Time to complete hideout craft in seconds
|
||||||
* @returns Adjusted craft time in seconds
|
* @returns Adjusted craft time in seconds
|
||||||
*/
|
*/
|
||||||
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number
|
public getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number
|
||||||
{
|
{
|
||||||
const craftingSkill = pmcData.Skills.Common.find((skill) => skill.Id === SkillTypes.CRAFTING);
|
const craftingSkill = pmcData.Skills.Common.find((skill) => skill.Id === SkillTypes.CRAFTING);
|
||||||
if (!craftingSkill)
|
if (!craftingSkill)
|
||||||
|
Loading…
Reference in New Issue
Block a user