diff --git a/project/assets/configs/bot.json b/project/assets/configs/bot.json index 38d291ea..99893582 100644 --- a/project/assets/configs/bot.json +++ b/project/assets/configs/bot.json @@ -268,7 +268,9 @@ "lightLaserLimit": 2 }, "faceShieldIsActiveChancePercent": 85, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 75, "weightingAdjustments": [{ "levelRange": { "min": 1, @@ -293,7 +295,9 @@ "marksman": { "nvgIsActiveChancePercent": 60, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 85, "weaponModLimits": { "scopeLimit": 1, "lightLaserLimit": 1 @@ -301,30 +305,42 @@ }, "cursedassault": { "faceShieldIsActiveChancePercent": 90, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "exusec": { "nvgIsActiveChancePercent": 80, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 90 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 90, + "laserIsActiveChancePercent": 85 }, "bossbully": { "nvgIsActiveChancePercent": 75, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "bossgluhar": { "nvgIsActiveChancePercent": 80, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 95 + "lightIsActiveDayChancePercent": 45, + "lightIsActiveNightChancePercent": 95, + "laserIsActiveChancePercent": 95 }, "bosskilla": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 35, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 85 }, "bosskojaniy": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75, "weaponModLimits": { "scopeLimit": 1, "lightLaserLimit": 1 @@ -332,57 +348,81 @@ }, "bosssanitar": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 85 }, "bosstagilla": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "bossknight": { "nvgIsActiveChancePercent": 90, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "bosszryachiy": { "nvgIsActiveChancePercent": 90, - "lightLaserIsActiveChancePercent": 95 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 85 }, "bosstest": {}, "followerbully": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followergluharassault": { "nvgIsActiveChancePercent": 75, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followergluharscout": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followergluharsecurity": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followergluharsnipe": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followerkojaniy": { "nvgIsActiveChancePercent": 80, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followersanitar": { "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followertagilla": {}, "followerbirdeye": { "nvgIsActiveChancePercent": 80, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75, "weaponModLimits": { "scopeLimit": 1, "lightLaserLimit": 1 @@ -391,28 +431,38 @@ "followerbigpipe": { "nvgIsActiveChancePercent": 90, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "followerzryachiy": { "nvgIsActiveChancePercent": 90, - "lightLaserIsActiveChancePercent": 95 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 85 }, "followertest": {}, "sectantpriest": { "nvgIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 95 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 85, + "laserIsActiveChancePercent": 95 }, "sectantwarrior": { "nvgIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 95 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 95 }, "test": {}, "pmcbot": { "nvgIsActiveChancePercent": 80, "faceShieldIsActiveChancePercent": 100, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 35, + "lightIsActiveNightChancePercent": 95, + "laserIsActiveChancePercent": 95, "weaponModLimits": { "scopeLimit": 1, "lightLaserLimit": 1 @@ -420,7 +470,9 @@ }, "assaultgroup": {}, "gifter": { - "lightLaserIsActiveChancePercent": 50 + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 75, + "laserIsActiveChancePercent": 75 }, "pmc": { "weaponModLimits": { @@ -441,7 +493,9 @@ }, "nvgIsActiveChancePercent": 50, "faceShieldIsActiveChancePercent": 85, - "lightLaserIsActiveChancePercent": 75, + "lightIsActiveDayChancePercent": 25, + "lightIsActiveNightChancePercent": 95, + "laserIsActiveChancePercent": 85, "randomisation": [{ "levelRange": { "min": 1, diff --git a/project/src/helpers/BotGeneratorHelper.ts b/project/src/helpers/BotGeneratorHelper.ts index deee2fb5..6feb8fef 100644 --- a/project/src/helpers/BotGeneratorHelper.ts +++ b/project/src/helpers/BotGeneratorHelper.ts @@ -1,8 +1,13 @@ import { inject, injectable } from "tsyringe"; +import { ApplicationContext } from "../context/ApplicationContext"; +import { ContextVariableType } from "../context/ContextVariableType"; import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { + IGetRaidConfigurationRequestData +} from "../models/eft/match/IGetRaidConfigurationRequestData"; import { BaseClasses } from "../models/enums/BaseClasses"; import { ConfigTypes } from "../models/enums/ConfigTypes"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; @@ -25,6 +30,7 @@ export class BotGeneratorHelper @inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("DurabilityLimitsHelper") protected durabilityLimitsHelper: DurabilityLimitsHelper, @inject("ItemHelper") protected itemHelper: ItemHelper, + @inject("ApplicationContext") protected applicationContext: ApplicationContext, @inject("LocalisationService") protected localisationService: LocalisationService, @inject("ConfigServer") protected configServer: ConfigServer ) @@ -87,10 +93,22 @@ export class BotGeneratorHelper itemProperties.FoodDrink = { HpPercent: itemTemplate._props.MaxResource }; } - if ([BaseClasses.FLASHLIGHT, BaseClasses.TACTICAL_COMBO].includes(itemTemplate._parent)) + if (itemTemplate._parent === BaseClasses.FLASHLIGHT) + { + // Get raid settings, if no raid, default to day + const raidSettings = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION)?.getValue(); + const raidIsNight = raidSettings?.timeVariant === "PAST"; + + // Get chance from botconfig for bot type, use 50% if no value found + const lightLaserActiveChance = raidIsNight + ? this.getBotEquipmentSettingFromConfig(botRole, "lightIsActiveNightChancePercent", 50) + : this.getBotEquipmentSettingFromConfig(botRole, "lightIsActiveDayChancePercent", 25); + itemProperties.Light = { IsActive: (this.randomUtil.getChance100(lightLaserActiveChance)), SelectedMode: 0 }; + } + else if (itemTemplate._parent === BaseClasses.TACTICAL_COMBO) { // Get chance from botconfig for bot type, use 50% if no value found - const lightLaserActiveChance = this.getBotEquipmentSettingFromConfig(botRole, "lightLaserIsActiveChancePercent", 50); + const lightLaserActiveChance = this.getBotEquipmentSettingFromConfig(botRole, "laserIsActiveChancePercent", 50); itemProperties.Light = { IsActive: (this.randomUtil.getChance100(lightLaserActiveChance)), SelectedMode: 0 }; } diff --git a/project/src/models/spt/config/IBotConfig.ts b/project/src/models/spt/config/IBotConfig.ts index 23b26ecf..6c872131 100644 --- a/project/src/models/spt/config/IBotConfig.ts +++ b/project/src/models/spt/config/IBotConfig.ts @@ -78,7 +78,9 @@ export interface EquipmentFilters weaponModLimits: ModLimits weaponSightWhitelist: Record faceShieldIsActiveChancePercent?: number; - lightLaserIsActiveChancePercent?: number; + lightIsActiveDayChancePercent?: number; + lightIsActiveNightChancePercent?: number; + laserIsActiveChancePercent?: number; nvgIsActiveChancePercent?: number; randomisation: RandomisationDetails[] blacklist: EquipmentFilterDetails[]