From cabd17d2c99edb29af8eae9794538a631f267c74 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 23 Sep 2024 12:16:47 +0100 Subject: [PATCH] Added config option `forceRigWhenNoVest` Wired up to bot generation Updated Raiders to use true value --- project/assets/configs/bot.json | 1 + project/src/generators/BotInventoryGenerator.ts | 7 ++++++- project/src/models/spt/config/IBotConfig.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/project/assets/configs/bot.json b/project/assets/configs/bot.json index 82779acc..90d05b18 100644 --- a/project/assets/configs/bot.json +++ b/project/assets/configs/bot.json @@ -789,6 +789,7 @@ "lightIsActiveNightChancePercent": 95, "laserIsActiveChancePercent": 95, "forceOnlyArmoredRigWhenNoArmor": true, + "forceRigWhenNoVest": true, "forceStock": true, "weaponModLimits": { "scopeLimit": 1, diff --git a/project/src/generators/BotInventoryGenerator.ts b/project/src/generators/BotInventoryGenerator.ts index c3381bcd..395696f8 100644 --- a/project/src/generators/BotInventoryGenerator.ts +++ b/project/src/generators/BotInventoryGenerator.ts @@ -240,7 +240,7 @@ export class BotInventoryGenerator { randomisationDetails: randomistionDetails, }); - // Bot has no armor vest and flagged to be foreced to wear armored rig in this event + // Bot has no armor vest and flagged to be forceed to wear armored rig in this event if (botEquipConfig.forceOnlyArmoredRigWhenNoArmor && !hasArmorVest) { // Filter rigs down to only those with armor this.filterRigsToThoseWithProtection(templateInventory.equipment); @@ -252,6 +252,11 @@ export class BotInventoryGenerator { this.filterRigsToThoseWithoutProtection(templateInventory.equipment); } + // Bot is flagged as always needing a vest + if (botEquipConfig.forceRigWhenNoVest && !hasArmorVest) { + wornItemChances.equipment.TacticalVest = 100; + } + this.generateEquipment({ rootEquipmentSlot: EquipmentSlots.TACTICAL_VEST, rootEquipmentPool: templateInventory.equipment.TacticalVest, diff --git a/project/src/models/spt/config/IBotConfig.ts b/project/src/models/spt/config/IBotConfig.ts index dea58b63..a7edef89 100644 --- a/project/src/models/spt/config/IBotConfig.ts +++ b/project/src/models/spt/config/IBotConfig.ts @@ -138,6 +138,7 @@ export interface EquipmentFilters { /** Should the stock mod be forced to spawn on bot */ forceStock?: boolean; armorPlateWeighting?: IArmorPlateWeights[]; + forceRigWhenNoVest?: boolean; } export interface ModLimits {