diff --git a/advancedConfig.jsonc b/advancedConfig.jsonc index fd60cea..fa868c1 100644 --- a/advancedConfig.jsonc +++ b/advancedConfig.jsonc @@ -26,5 +26,23 @@ "handbookPriceMultiplier": 3, // Overrides ragfairConfig.runIntervalSeconds if config.enableFasterSales is true. Default 3s. - "runIntervalSecondsOverride": 3 + "runIntervalSecondsOverride": 3, + + // When config.enableScarceOffers is true, use these values to limit the number of offers on the flea. + "offerItemCountOverride": { + "max": 3, + "min": 1 + }, + + // When config.enableScarceOffers is true, use these values to limit the quantity of a stackable item (like ammo) per offer on the flea. + "stackablePercentOverride": { + "max": 200, + "min": 20 + }, + + // When config.enableScarceOffers is true, use these values to limit the quantity of a non-stackable item (most items) per offer on the flea. + "nonStackableCountOverride": { + "max": 3, + "min": 1 + } } \ No newline at end of file diff --git a/config.jsonc b/config.jsonc index 0f2cc02..413cd5e 100644 --- a/config.jsonc +++ b/config.jsonc @@ -5,6 +5,9 @@ // Make cheap offers sell faster. Default true. "enableFasterSales": true, + // 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": true, + // Limits the flea price of many attachments as these prices can be inflated heavily by Gunsmith tasks in Live Tarkov. Default true. "limitMaxPriceOfAttachments": true, diff --git a/src/mod.ts b/src/mod.ts index 22ed174..e73ab6f 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -137,6 +137,19 @@ class TheBlacklistMod implements IPostDBLoadModAsync { if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) { ragfairConfig.runIntervalSeconds = this.advancedConfig.runIntervalSecondsOverride; } + + if (this.config.enableScarceOffers) { + this.updateRagfairConfigToHaveScarceOffers(ragfairConfig); + } + } + + private updateRagfairConfigToHaveScarceOffers(ragfairConfig: IRagfairConfig) { + const minMaxPropertiesToOverride = ["offerItemCount", "stackablePercent", "nonStackableCount"]; + + for (const propertyToOverride of minMaxPropertiesToOverride) { + ragfairConfig.dynamic[propertyToOverride].max = this.advancedConfig[`${propertyToOverride}Override`].max; + ragfairConfig.dynamic[propertyToOverride].min = this.advancedConfig[`${propertyToOverride}Override`].min; + } } // Returns true if we updated something using the customItemConfig so we can skip to the next handbook item.