Implemented getExplicitRewardStackSize() for getExplicitRewards()

This commit is contained in:
Dev 2024-09-13 09:58:07 +01:00
parent 94e990cedb
commit a5679140aa
3 changed files with 14 additions and 1 deletions

View File

@ -32,6 +32,9 @@
"5e2aedd986f7746d404f3aa4" "5e2aedd986f7746d404f3aa4"
] ]
}, },
"directRewardStackSize": {
"exampleTpl": {"min": 1000, "max": 50000}
},
"rewardItemBlacklist": [], "rewardItemBlacklist": [],
"additionalRewardItemPool": [], "additionalRewardItemPool": [],
"currencyRewards": { "currencyRewards": {

View File

@ -22,6 +22,7 @@ export interface ICultistCircleSettings {
rewardPriceMultiplerMinMax: MinMax; rewardPriceMultiplerMinMax: MinMax;
/** 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>;
/** Item tpls to exclude from the reward pool */ /** Item tpls to exclude from the reward pool */
rewardItemBlacklist: string[]; rewardItemBlacklist: string[];
/** Item tpls to include in the reward pool */ /** Item tpls to include in the reward pool */

View File

@ -295,7 +295,7 @@ export class CircleOfCultistService {
} }
// Some items can have variable stack size, e.g. ammo // Some items can have variable stack size, e.g. ammo
const stackSize = this.getRewardStackSize(rewardTpl, 20000); const stackSize = this.getExplicitRewardStackSize(rewardTpl);
// Not a weapon/armor, standard single item // Not a weapon/armor, standard single item
const rewardItem: Item = { const rewardItem: Item = {
@ -315,6 +315,15 @@ export class CircleOfCultistService {
return rewards; return rewards;
} }
protected getExplicitRewardStackSize(rewardTpl: string) {
const settings = this.hideoutConfig.cultistCircle.directRewardStackSize[rewardTpl];
if (!settings) {
return 1;
}
return this.randomUtil.getInt(settings.min, settings.max);
}
/** /**
* Get the size of a reward items stack * Get the size of a reward items stack
* 1 for everything except ammo, ammo can be between min stack and max stack * 1 for everything except ammo, ammo can be between min stack and max stack