diff --git a/project/assets/configs/pmc.json b/project/assets/configs/pmc.json index 875736fc..2adf4fbe 100644 --- a/project/assets/configs/pmc.json +++ b/project/assets/configs/pmc.json @@ -744,34 +744,66 @@ "maxPocketLootTotalRub": 50000, "maxVestLootTotalRub": 50000, "convertIntoPmcChance": { - "assault": { - "min": 25, - "max": 35 - }, - "cursedassault": { - "min": 15, - "max": 30 - }, - "pmcbot": { - "min": 5, - "max": 10 - }, - "exusec": { - "min": 5, - "max": 5 - }, - "arenafighter": { - "min": 0, - "max": 0 - }, - "arenafighterevent": { - "min": 0, - "max": 0 - }, - "crazyassaultevent": { - "min": 0, - "max": 0 - } + "default":{ + "assault": { + "min": 25, + "max": 35 + }, + "cursedassault": { + "min": 15, + "max": 30 + }, + "pmcbot": { + "min": 5, + "max": 10 + }, + "exusec": { + "min": 5, + "max": 5 + }, + "arenafighter": { + "min": 0, + "max": 0 + }, + "arenafighterevent": { + "min": 0, + "max": 0 + }, + "crazyassaultevent": { + "min": 0, + "max": 0 + } + }, + "factory4_day":{ + "assault": { + "min": 10, + "max": 15 + }, + "cursedassault": { + "min": 15, + "max": 30 + }, + "pmcbot": { + "min": 5, + "max": 10 + }, + "exusec": { + "min": 5, + "max": 5 + }, + "arenafighter": { + "min": 0, + "max": 0 + }, + "arenafighterevent": { + "min": 0, + "max": 0 + }, + "crazyassaultevent": { + "min": 0, + "max": 0 + } + } }, "hostilitySettings": { "pmcusec": { diff --git a/project/src/controllers/BotController.ts b/project/src/controllers/BotController.ts index fbbdf0fe..e8acd4b8 100644 --- a/project/src/controllers/BotController.ts +++ b/project/src/controllers/BotController.ts @@ -394,7 +394,7 @@ export class BotController { } // Roll chance to be pmc if type is allowed to be one - const botConvertRateMinMax = this.pmcConfig.convertIntoPmcChance[requestedBot.Role.toLowerCase()]; + const botConvertRateMinMax = this.getPmcConversionMinMaxForLocation(requestedBot.Role, raidSettings?.location); if (botConvertRateMinMax) { // Should bot become PMC const convertToPmc = this.botHelper.rollChanceToBePmc(requestedBot.Role, botConvertRateMinMax); @@ -450,6 +450,15 @@ export class BotController { return [desiredBot]; } + protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string) { + const mapSpecificConversionValues = this.pmcConfig.convertIntoPmcChance[location?.toLowerCase()]; + if (!mapSpecificConversionValues) { + return mapSpecificConversionValues.default; + } + + return mapSpecificConversionValues[requestedBotRole?.toLowerCase()]; + } + protected updateBotGenerationDetailsToRandomBoss( botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record, diff --git a/project/src/helpers/BotHelper.ts b/project/src/helpers/BotHelper.ts index 5230f4e3..5683db57 100644 --- a/project/src/helpers/BotHelper.ts +++ b/project/src/helpers/BotHelper.ts @@ -92,29 +92,6 @@ export class BotHelper { } } - /** - * Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check - * @param botRole the bot role to check if should be a pmc - * @returns true if should be a pmc - */ - public shouldBotBePmc(botRole: string): boolean { - const botRoleLowered = botRole.toLowerCase(); - - // Handle when map waves have these types in the bot type - if (this.botRoleIsPmc(botRoleLowered)) { - return true; - } - - const botConvertMinMax = this.pmcConfig.convertIntoPmcChance[botRoleLowered]; - - // no bot type defined in config, default to false - if (!botConvertMinMax) { - return false; - } - - return this.rollChanceToBePmc(botRoleLowered, botConvertMinMax); - } - public rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean { return ( role.toLowerCase() in this.pmcConfig.convertIntoPmcChance && diff --git a/project/src/models/spt/config/IPmcConfig.ts b/project/src/models/spt/config/IPmcConfig.ts index a533a4dd..5eec5788 100644 --- a/project/src/models/spt/config/IPmcConfig.ts +++ b/project/src/models/spt/config/IPmcConfig.ts @@ -36,8 +36,8 @@ export interface IPmcConfig extends IBaseConfig { maxBackpackLootTotalRub: MinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; - /** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */ - convertIntoPmcChance: Record; + /** Percentage chance a bot from a wave is converted into a PMC, first key = map, second key = bot wildspawn type (assault/exusec), value: min+max chance to be converted */ + convertIntoPmcChance: Record>; /** How many levels above player level can a PMC be */ botRelativeLevelDeltaMax: number; /** How many levels below player level can a PMC be */