Add configurable craft time of cultist circle
This commit is contained in:
parent
a5679140aa
commit
d18ef883da
@ -16,6 +16,18 @@
|
|||||||
"min": 0.7,
|
"min": 0.7,
|
||||||
"max": 1.4
|
"max": 1.4
|
||||||
},
|
},
|
||||||
|
"craftTimeThreshholds": [
|
||||||
|
{
|
||||||
|
"min": 1,
|
||||||
|
"max": 25000,
|
||||||
|
"timeSeconds": 21600
|
||||||
|
},{
|
||||||
|
"min": 25001,
|
||||||
|
"max": 99999999,
|
||||||
|
"timeSeconds": 43200
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"craftTimeOverride": 40,
|
||||||
"directRewards": {
|
"directRewards": {
|
||||||
"66572c82ad599021091c6118": ["5c0e874186f7745dc7616606"],
|
"66572c82ad599021091c6118": ["5c0e874186f7745dc7616606"],
|
||||||
"66572be36a723f7f005a066e": ["5b3b713c5acfc4330140bd8d"],
|
"66572be36a723f7f005a066e": ["5b3b713c5acfc4330140bd8d"],
|
||||||
|
@ -122,15 +122,44 @@ export class HideoutHelper {
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
recipeId: string,
|
recipeId: string,
|
||||||
sacrificedItems: Item[],
|
sacrificedItems: Item[],
|
||||||
|
rewardAmountRoubles: number,
|
||||||
): void {
|
): void {
|
||||||
// TODO: hard coded 5 hour (18000) craft + no fuel use, where can we get this data
|
// TODO: hard coded 5 hour (18000) craft + no fuel use, where can we get this data
|
||||||
const cultistProduction = this.initProduction(recipeId, 30, false, true);
|
const cultistProduction = this.initProduction(
|
||||||
|
recipeId,
|
||||||
|
this.getCircleCraftTime(rewardAmountRoubles),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
);
|
||||||
cultistProduction.GivenItemsInStart = sacrificedItems;
|
cultistProduction.GivenItemsInStart = sacrificedItems;
|
||||||
|
|
||||||
// Add circle production to profile
|
// Add circle production to profile
|
||||||
pmcData.Hideout.Production[recipeId] = cultistProduction;
|
pmcData.Hideout.Production[recipeId] = cultistProduction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the circle craft time as seconds, value is based on reward item value
|
||||||
|
* @param rewardAmountRoubles Value of rewards in roubles
|
||||||
|
* @returns craft time seconds
|
||||||
|
*/
|
||||||
|
protected getCircleCraftTime(rewardAmountRoubles: number): number {
|
||||||
|
// Edge case, check if override exists
|
||||||
|
if (this.hideoutConfig.cultistCircle.craftTimeOverride !== -1) {
|
||||||
|
return this.hideoutConfig.cultistCircle.craftTimeOverride;
|
||||||
|
}
|
||||||
|
|
||||||
|
const thresholds = this.hideoutConfig.cultistCircle.craftTimeThreshholds;
|
||||||
|
const matchingThreshold = thresholds.find(
|
||||||
|
(craftThreshold) => craftThreshold.min <= rewardAmountRoubles && craftThreshold.max >= rewardAmountRoubles,
|
||||||
|
);
|
||||||
|
if (!matchingThreshold) {
|
||||||
|
// No craft time found, default to 12 hours
|
||||||
|
return this.timeUtil.getHoursAsSeconds(12);
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchingThreshold.timeSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This convenience function initializes new Production Object
|
* This convenience function initializes new Production Object
|
||||||
* with all the constants.
|
* with all the constants.
|
||||||
|
@ -20,6 +20,9 @@ export interface ICultistCircleSettings {
|
|||||||
maxRewardItemCount: number;
|
maxRewardItemCount: number;
|
||||||
maxAttemptsToPickRewardsWithinBudget: number;
|
maxAttemptsToPickRewardsWithinBudget: number;
|
||||||
rewardPriceMultiplerMinMax: MinMax;
|
rewardPriceMultiplerMinMax: MinMax;
|
||||||
|
craftTimeThreshholds: CraftTimeThreshhold[];
|
||||||
|
/** -1 means no override */
|
||||||
|
craftTimeOverride: number;
|
||||||
/** Specific reward pool when player sacrificed one specific item */
|
/** Specific reward pool when player sacrificed one specific item */
|
||||||
directRewards: Record<string, string[]>;
|
directRewards: Record<string, string[]>;
|
||||||
directRewardStackSize: Record<string, MinMax>;
|
directRewardStackSize: Record<string, MinMax>;
|
||||||
@ -29,3 +32,7 @@ export interface ICultistCircleSettings {
|
|||||||
additionalRewardItemPool: string[];
|
additionalRewardItemPool: string[];
|
||||||
currencyRewards: Record<string, MinMax>;
|
currencyRewards: Record<string, MinMax>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CraftTimeThreshhold extends MinMax {
|
||||||
|
timeSeconds: number;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user