From 1aac4a06351118cf0a7e933f4a9796936b063114 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 22 Oct 2024 20:51:22 +0100 Subject: [PATCH] Added `ragfair.dynamic.barter.makeSingleStackOnly` config option, default to true --- project/assets/configs/ragfair.json | 1 + project/src/generators/RagfairOfferGenerator.ts | 3 +++ project/src/models/spt/config/IRagfairConfig.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/project/assets/configs/ragfair.json b/project/assets/configs/ragfair.json index 7372871c..7018ae99 100644 --- a/project/assets/configs/ragfair.json +++ b/project/assets/configs/ragfair.json @@ -39,6 +39,7 @@ "itemCountMax": 3, "priceRangeVariancePercent": 15, "minRoubleCostToBecomeBarter": 20000, + "makeSingleStackOnly": true, "itemTypeBlacklist": [ "55802f4a4bdc2ddb688b4569", "55802f3e4bdc2de7118b4584", diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index d2ba4d49..b2e10ff8 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -505,6 +505,9 @@ export class RagfairOfferGenerator { // Apply randomised properties this.randomiseOfferItemUpdProperties(randomUserId, itemWithChildren, itemDetails[1]); barterScheme = this.createBarterBarterScheme(itemWithChildren, this.ragfairConfig.dynamic.barter); + if (this.ragfairConfig.dynamic.barter.makeSingleStackOnly) { + itemWithChildren[0].upd.StackObjectsCount = 1; + } } else { // Apply randomised properties this.randomiseOfferItemUpdProperties(randomUserId, itemWithChildren, itemDetails[1]); diff --git a/project/src/models/spt/config/IRagfairConfig.ts b/project/src/models/spt/config/IRagfairConfig.ts index d692a121..24f713cb 100644 --- a/project/src/models/spt/config/IRagfairConfig.ts +++ b/project/src/models/spt/config/IRagfairConfig.ts @@ -97,6 +97,8 @@ export interface IBarterDetails { priceRangeVariancePercent: number; /** Min rouble price for an offer to be considered for turning into a barter */ minRoubleCostToBecomeBarter: number; + /** Should barter offers only single stack */ + makeSingleStackOnly: boolean; /** Item Tpls to never be turned into a barter */ itemTypeBlacklist: string[]; }