Add extra slot config

This commit is contained in:
Platinum 2024-02-08 20:57:55 +11:00
parent 678f54cdc3
commit 071b921188
3 changed files with 20 additions and 1 deletions

View File

@ -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
}

View File

@ -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,

View File

@ -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<string, number>, originalPrice: number, ragfairConfig: IRagfairConfig): boolean {
if (customItemConfig?.blacklisted) {