From 27613fd5bfc1f2cd36d8069fac00f3be0e0298f8 Mon Sep 17 00:00:00 2001 From: Platinum Date: Sat, 13 Apr 2024 16:06:38 +1000 Subject: [PATCH] Add slow sales feature --- advancedConfig.jsonc | 6 ++++++ config.jsonc | 3 +++ src/mod.ts | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/advancedConfig.jsonc b/advancedConfig.jsonc index 31777d0..2b23752 100644 --- a/advancedConfig.jsonc +++ b/advancedConfig.jsonc @@ -27,6 +27,12 @@ // Overrides ragfairConfig.runIntervalValues.outOfRaid if config.enableFasterSales is true. Default 3s. "runIntervalSecondsOverride": 3, + // Sale times when slower sales is enabled. + "slowerSalesTime": { + "min": 5, + "max": 10 + }, + // When config.enableScarceOffers is true, use these values to limit the number of offers on the flea. "offerItemCountOverride": { "max": 4, diff --git a/config.jsonc b/config.jsonc index eef0a3c..49562a0 100644 --- a/config.jsonc +++ b/config.jsonc @@ -5,6 +5,9 @@ // Make cheap offers sell faster. Default true. "enableFasterSales": true, + // Makes your sales go through slower. Encourages you to sell some items in bulk instead of selling everything to the flea. Around 5 mins. Overwrites `enableFasterSales` if this is true. Default false. + "enableSlowerSales": false, + // Reduces the number of offers and quantities per offer to make the flea experience more hardcore. Highly recommend to enable but default is false. "enableScarceOffers": false, diff --git a/src/mod.ts b/src/mod.ts index c45c668..6390279 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -123,10 +123,14 @@ class TheBlacklistMod implements IPostDBLoadModAsync { ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = !!this.advancedConfig.useTraderPriceForOffersIfHigher; } - if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) { + if (!this.config.enableSlowerSales && this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) { ragfairConfig.runIntervalValues.outOfRaid = this.advancedConfig.runIntervalSecondsOverride; } + if (this.config.enableSlowerSales && this.advancedConfig.slowerSalesTime) { + ragfairConfig.sell.time = this.advancedConfig.slowerSalesTime; + } + if (this.config.enableScarceOffers) { this.updateRagfairConfigToHaveScarceOffers(ragfairConfig); }