From ea270a95a56fa02044eefa1832ffa2432dff17e8 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 11 Jul 2023 11:58:26 +0100 Subject: [PATCH] Move hard coded gameversion/account type values into bot config --- project/assets/configs/bot.json | 12 ++++++++++++ project/src/generators/BotGenerator.ts | 8 +++----- project/src/models/spt/config/IPmcConfig.ts | 8 ++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/project/assets/configs/bot.json b/project/assets/configs/bot.json index d2936f22..de546f73 100644 --- a/project/assets/configs/bot.json +++ b/project/assets/configs/bot.json @@ -993,6 +993,18 @@ } }, "pmc": { + "gameVersionWeight": { + "standard": 5, + "left_behind": 1, + "prepare_for_escape": 1, + "edge_of_darkness": 3 + }, + "accountTypeWeight": { + 0: 15, + 1: 1, + 256: 3, + 512: 3 + }, "vestLoot": { "whitelist": [ "5485a8684bdc2da71d8b4567", diff --git a/project/src/generators/BotGenerator.ts b/project/src/generators/BotGenerator.ts index cf81ec8c..130040b4 100644 --- a/project/src/generators/BotGenerator.ts +++ b/project/src/generators/BotGenerator.ts @@ -426,7 +426,7 @@ export class BotGenerator */ protected getRandomisedGameVersionAndCategory(botInfo: Info): void { - if (botInfo.Nickname === "Nikita") + if (botInfo.Nickname.toLowerCase() === "nikita") { botInfo.GameVersion = "edge_of_darkness"; botInfo.AccountType = MemberCategory.DEVELOPER; @@ -434,10 +434,8 @@ export class BotGenerator return; } - const gameVersions = ["standard", "standard", "left_behind", "prepare_for_escape", "edge_of_darkness"]; - const accountTypes = [MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEFAULT,MemberCategory.DEVELOPER, MemberCategory.SHERPA,MemberCategory.SHERPA,MemberCategory.SHERPA,MemberCategory.EMISSARY, MemberCategory.EMISSARY, MemberCategory.EMISSARY]; // 0 = normal, 1 = dev, 256 = sherpa, 512 = emissary - botInfo.GameVersion = this.randomUtil.getArrayValue(gameVersions); - botInfo.AccountType = this.randomUtil.getArrayValue(accountTypes); + botInfo.GameVersion = this.weightedRandomHelper.getWeightedValue(this.botConfig.pmc.gameVersionWeight); + botInfo.AccountType = Number.parseInt(this.weightedRandomHelper.getWeightedValue(this.botConfig.pmc.accountTypeWeight)); } /** diff --git a/project/src/models/spt/config/IPmcConfig.ts b/project/src/models/spt/config/IPmcConfig.ts index a3fe27ab..f94380ce 100644 --- a/project/src/models/spt/config/IPmcConfig.ts +++ b/project/src/models/spt/config/IPmcConfig.ts @@ -1,9 +1,17 @@ +import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + /** What game version should the PMC have */ + gameVersionWeight: Record + /** What account type should the PMC have */ + accountTypeWeight: Record + /** Global whitelist/blacklist of vest loot for PMCs */ vestLoot: SlotLootSettings + /** Global whitelist/blacklist of pocket loot for PMCs */ pocketLoot: SlotLootSettings + /** Global whitelist/blacklist of backpack loot for PMCs */ backpackLoot: SlotLootSettings dynamicLoot: DynamicLoot useDifficultyOverride: boolean