From 071b9211889035a391ec699f29b6975a7b41dab2 Mon Sep 17 00:00:00 2001 From: Platinum Date: Thu, 8 Feb 2024 20:57:55 +1100 Subject: [PATCH] Add extra slot config --- advancedConfig.jsonc | 5 ++++- config.jsonc | 3 +++ src/mod.ts | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/advancedConfig.jsonc b/advancedConfig.jsonc index 61f6469..4cf40c6 100644 --- a/advancedConfig.jsonc +++ b/advancedConfig.jsonc @@ -43,5 +43,8 @@ "nonStackableCountOverride": { "max": 3, "min": 1 - } + }, + + // Adds the specified amount of offers for your current flea market rating if config.addExtraOfferSlot is enabled. + "extraOfferSlotsToAdd": 1 } \ No newline at end of file diff --git a/config.jsonc b/config.jsonc index 523f77b..c8020ec 100644 --- a/config.jsonc +++ b/config.jsonc @@ -8,6 +8,9 @@ // 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, + // Adds an extra offer for your current flea market rating bracket. So a new account at level 15 can create 3 offers instead of 2. Default is false. Extra amount is configurable in advancedConfigs. + "addExtraOfferSlot": 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 e73ab6f..13ca5ff 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -29,6 +29,7 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { HandbookItem } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { getAttachmentCategoryIds, isBulletOrShotgunShell } from "./helpers"; +import { IGlobals } from "@spt-aki/models/eft/common/IGlobals"; class TheBlacklistMod implements IPostDBLoadModAsync { private logger: ILogger; @@ -62,10 +63,12 @@ class TheBlacklistMod implements IPostDBLoadModAsync { const itemTable = tables.templates.items; const handbookItems = tables.templates.handbook.Items; const prices = tables.templates.prices; + const globals = tables.globals; this.baselineBullet = itemTable[this.advancedConfig.baselineBulletId]; this.updateRagfairConfig(ragfairConfig); + this.updateGlobals(globals); if (this.config.limitMaxPriceOfAttachments) { this.attachmentCategoryIds = getAttachmentCategoryIds(tables.templates.handbook.Categories); @@ -152,6 +155,16 @@ class TheBlacklistMod implements IPostDBLoadModAsync { } } + private updateGlobals(globals: IGlobals) { + const ragfairConfig = globals.config.RagFair; + + if (this.config.addExtraOfferSlot) { + for (const settingForBracket of ragfairConfig.maxActiveOfferCount) { + settingForBracket.count += this.advancedConfig.extraOfferSlotsToAdd; + } + } + } + // Returns true if we updated something using the customItemConfig so we can skip to the next handbook item. private updateItemUsingCustomItemConfig(customItemConfig, item: ITemplateItem , prices: Record, originalPrice: number, ragfairConfig: IRagfairConfig): boolean { if (customItemConfig?.blacklisted) {