Fix bitcoin production time being incorrect (!284)
- Don't apply crafting skill cooldown reduction to bitcoin farm - Adjust profile bitcoin production time on login to be the correct production time (takes into account dev profile) Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/284 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
64ddca4124
commit
db6ef9bddb
@ -203,6 +203,7 @@ export class GameController
|
|||||||
this.hideoutHelper.setHideoutImprovementsToCompleted(pmcProfile);
|
this.hideoutHelper.setHideoutImprovementsToCompleted(pmcProfile);
|
||||||
this.hideoutHelper.unlockHideoutWallInProfile(pmcProfile);
|
this.hideoutHelper.unlockHideoutWallInProfile(pmcProfile);
|
||||||
this.profileFixerService.addMissingIdsToBonuses(pmcProfile);
|
this.profileFixerService.addMissingIdsToBonuses(pmcProfile);
|
||||||
|
this.profileFixerService.fixBitcoinProductionTime(pmcProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logProfileDetails(fullProfile);
|
this.logProfileDetails(fullProfile);
|
||||||
|
@ -595,7 +595,7 @@ export class HideoutHelper
|
|||||||
* @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation
|
* @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation
|
||||||
* @returns Items craft time with bonuses subtracted
|
* @returns Items craft time with bonuses subtracted
|
||||||
*/
|
*/
|
||||||
protected getAdjustedCraftTimeWithSkills(
|
public getAdjustedCraftTimeWithSkills(
|
||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
recipeId: string,
|
recipeId: string,
|
||||||
applyHideoutManagementBonus = false,
|
applyHideoutManagementBonus = false,
|
||||||
@ -613,13 +613,19 @@ export class HideoutHelper
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seconds to deduct from crafts total time
|
let timeReductionSeconds = 0;
|
||||||
let timeReductionSeconds = this.getSkillProductionTimeReduction(
|
|
||||||
pmcData,
|
// Bitcoin farm is excluded from crafting skill cooldown reduction
|
||||||
recipe.productionTime,
|
if (recipeId !== HideoutHelper.bitcoinFarm)
|
||||||
SkillTypes.CRAFTING,
|
{
|
||||||
globalSkillsDb.Crafting.ProductionTimeReductionPerLevel,
|
// Seconds to deduct from crafts total time
|
||||||
);
|
timeReductionSeconds += this.getSkillProductionTimeReduction(
|
||||||
|
pmcData,
|
||||||
|
recipe.productionTime,
|
||||||
|
SkillTypes.CRAFTING,
|
||||||
|
globalSkillsDb.Crafting.ProductionTimeReductionPerLevel,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Some crafts take into account hideout management, e.g. fuel, water/air filters
|
// Some crafts take into account hideout management, e.g. fuel, water/air filters
|
||||||
if (applyHideoutManagementBonus)
|
if (applyHideoutManagementBonus)
|
||||||
|
@ -1311,6 +1311,21 @@ export class ProfileFixerService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found
|
||||||
|
*/
|
||||||
|
public fixBitcoinProductionTime(pmcProfile: IPmcData): void
|
||||||
|
{
|
||||||
|
const btcProd = pmcProfile.Hideout?.Production[HideoutHelper.bitcoinFarm];
|
||||||
|
if (btcProd)
|
||||||
|
{
|
||||||
|
btcProd.ProductionTime = this.hideoutHelper.getAdjustedCraftTimeWithSkills(
|
||||||
|
pmcProfile,
|
||||||
|
HideoutHelper.bitcoinProductionId,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* At some point the property name was changed,migrate data across to new name
|
* At some point the property name was changed,migrate data across to new name
|
||||||
* @param pmcProfile Profile to migrate improvements in
|
* @param pmcProfile Profile to migrate improvements in
|
||||||
|
Loading…
Reference in New Issue
Block a user