Added hideout_management skill into cultist circle reward calculation

This commit is contained in:
Dev 2024-08-31 14:14:23 +01:00
parent 0b2e723fc3
commit 184c81b912

View File

@ -2,6 +2,7 @@ import { HideoutHelper } from "@spt/helpers/HideoutHelper";
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea";
@ -12,6 +13,7 @@ import { BaseClasses } from "@spt/models/enums/BaseClasses";
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { HideoutAreas } from "@spt/models/enums/HideoutAreas";
import { ItemTpl } from "@spt/models/enums/ItemTpl";
import { SkillTypes } from "@spt/models/enums/SkillTypes";
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
@ -35,6 +37,7 @@ export class CircleOfCultistService {
@inject("HashUtil") protected hashUtil: HashUtil,
@inject("ItemHelper") protected itemHelper: ItemHelper,
@inject("PresetHelper") protected presetHelper: PresetHelper,
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("InventoryHelper") protected inventoryHelper: InventoryHelper,
@inject("HideoutHelper") protected hideoutHelper: HideoutHelper,
@inject("DatabaseService") protected databaseService: DatabaseService,
@ -67,11 +70,19 @@ export class CircleOfCultistService {
0,
);
// TODO - include hideout management skill to bonus
const rewardAmountMultiplier = this.randomUtil.getFloat(
// Get a randomised value to multiply the sacrificed rouble cost by
let rewardAmountMultiplier = this.randomUtil.getFloat(
this.hideoutConfig.cultistCircle.rewardPriceMultiplerMinMax.min,
this.hideoutConfig.cultistCircle.rewardPriceMultiplerMinMax.max,
);
// Adjust the above value generated by the players hideout mgmt skill
const hideoutManagementSkill = this.profileHelper.getSkillFromProfile(pmcData, SkillTypes.HIDEOUT_MANAGEMENT);
if (hideoutManagementSkill) {
rewardAmountMultiplier *= 1 + hideoutManagementSkill.Progress / 10000; // 5100 becomes 0.51, add 1 to it, 1.51, multiply the bonus by it (e.g. 1.2 x 1.51)
}
// Get the rouble amount we generate rewards with from cost of sacrified items * above multipler
const rewardAmountRoubles = sacrificedItemCostRoubles * rewardAmountMultiplier;
// Create production in pmc profile