Split config of lasers/lights active status by raid day/night status, default to day if no raid found

Removed:
lightLaserIsActiveChancePercent
Added:
lightIsActiveDayChancePercent?: number;
lightIsActiveNightChancePercent?: number;
laserIsActiveChancePercent?: number;
This commit is contained in:
Dev 2023-04-08 13:18:01 +01:00
parent 31c00b2979
commit c60c67fce5
3 changed files with 104 additions and 30 deletions

View File

@ -268,7 +268,9 @@
"lightLaserLimit": 2 "lightLaserLimit": 2
}, },
"faceShieldIsActiveChancePercent": 85, "faceShieldIsActiveChancePercent": 85,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 75,
"weightingAdjustments": [{ "weightingAdjustments": [{
"levelRange": { "levelRange": {
"min": 1, "min": 1,
@ -293,7 +295,9 @@
"marksman": { "marksman": {
"nvgIsActiveChancePercent": 60, "nvgIsActiveChancePercent": 60,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -301,30 +305,42 @@
}, },
"cursedassault": { "cursedassault": {
"faceShieldIsActiveChancePercent": 90, "faceShieldIsActiveChancePercent": 90,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"exusec": { "exusec": {
"nvgIsActiveChancePercent": 80, "nvgIsActiveChancePercent": 80,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 90 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 90,
"laserIsActiveChancePercent": 85
}, },
"bossbully": { "bossbully": {
"nvgIsActiveChancePercent": 75, "nvgIsActiveChancePercent": 75,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"bossgluhar": { "bossgluhar": {
"nvgIsActiveChancePercent": 80, "nvgIsActiveChancePercent": 80,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 95 "lightIsActiveDayChancePercent": 45,
"lightIsActiveNightChancePercent": 95,
"laserIsActiveChancePercent": 95
}, },
"bosskilla": { "bosskilla": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 35,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85
}, },
"bosskojaniy": { "bosskojaniy": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -332,57 +348,81 @@
}, },
"bosssanitar": { "bosssanitar": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 85
}, },
"bosstagilla": { "bosstagilla": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"bossknight": { "bossknight": {
"nvgIsActiveChancePercent": 90, "nvgIsActiveChancePercent": 90,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"bosszryachiy": { "bosszryachiy": {
"nvgIsActiveChancePercent": 90, "nvgIsActiveChancePercent": 90,
"lightLaserIsActiveChancePercent": 95 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85
}, },
"bosstest": {}, "bosstest": {},
"followerbully": { "followerbully": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followergluharassault": { "followergluharassault": {
"nvgIsActiveChancePercent": 75, "nvgIsActiveChancePercent": 75,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followergluharscout": { "followergluharscout": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followergluharsecurity": { "followergluharsecurity": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followergluharsnipe": { "followergluharsnipe": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followerkojaniy": { "followerkojaniy": {
"nvgIsActiveChancePercent": 80, "nvgIsActiveChancePercent": 80,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followersanitar": { "followersanitar": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followertagilla": {}, "followertagilla": {},
"followerbirdeye": { "followerbirdeye": {
"nvgIsActiveChancePercent": 80, "nvgIsActiveChancePercent": 80,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -391,28 +431,38 @@
"followerbigpipe": { "followerbigpipe": {
"nvgIsActiveChancePercent": 90, "nvgIsActiveChancePercent": 90,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"followerzryachiy": { "followerzryachiy": {
"nvgIsActiveChancePercent": 90, "nvgIsActiveChancePercent": 90,
"lightLaserIsActiveChancePercent": 95 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85
}, },
"followertest": {}, "followertest": {},
"sectantpriest": { "sectantpriest": {
"nvgIsActiveChancePercent": 100, "nvgIsActiveChancePercent": 100,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 95 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 95
}, },
"sectantwarrior": { "sectantwarrior": {
"nvgIsActiveChancePercent": 100, "nvgIsActiveChancePercent": 100,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 95 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 95
}, },
"test": {}, "test": {},
"pmcbot": { "pmcbot": {
"nvgIsActiveChancePercent": 80, "nvgIsActiveChancePercent": 80,
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 35,
"lightIsActiveNightChancePercent": 95,
"laserIsActiveChancePercent": 95,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -420,7 +470,9 @@
}, },
"assaultgroup": {}, "assaultgroup": {},
"gifter": { "gifter": {
"lightLaserIsActiveChancePercent": 50 "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75
}, },
"pmc": { "pmc": {
"weaponModLimits": { "weaponModLimits": {
@ -441,7 +493,9 @@
}, },
"nvgIsActiveChancePercent": 50, "nvgIsActiveChancePercent": 50,
"faceShieldIsActiveChancePercent": 85, "faceShieldIsActiveChancePercent": 85,
"lightLaserIsActiveChancePercent": 75, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 95,
"laserIsActiveChancePercent": 85,
"randomisation": [{ "randomisation": [{
"levelRange": { "levelRange": {
"min": 1, "min": 1,

View File

@ -1,8 +1,13 @@
import { inject, injectable } from "tsyringe"; import { inject, injectable } from "tsyringe";
import { ApplicationContext } from "../context/ApplicationContext";
import { ContextVariableType } from "../context/ContextVariableType";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import {
IGetRaidConfigurationRequestData
} from "../models/eft/match/IGetRaidConfigurationRequestData";
import { BaseClasses } from "../models/enums/BaseClasses"; import { BaseClasses } from "../models/enums/BaseClasses";
import { ConfigTypes } from "../models/enums/ConfigTypes"; import { ConfigTypes } from "../models/enums/ConfigTypes";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
@ -25,6 +30,7 @@ export class BotGeneratorHelper
@inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("DatabaseServer") protected databaseServer: DatabaseServer,
@inject("DurabilityLimitsHelper") protected durabilityLimitsHelper: DurabilityLimitsHelper, @inject("DurabilityLimitsHelper") protected durabilityLimitsHelper: DurabilityLimitsHelper,
@inject("ItemHelper") protected itemHelper: ItemHelper, @inject("ItemHelper") protected itemHelper: ItemHelper,
@inject("ApplicationContext") protected applicationContext: ApplicationContext,
@inject("LocalisationService") protected localisationService: LocalisationService, @inject("LocalisationService") protected localisationService: LocalisationService,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer
) )
@ -87,10 +93,22 @@ export class BotGeneratorHelper
itemProperties.FoodDrink = { HpPercent: itemTemplate._props.MaxResource }; itemProperties.FoodDrink = { HpPercent: itemTemplate._props.MaxResource };
} }
if ([BaseClasses.FLASHLIGHT, BaseClasses.TACTICAL_COMBO].includes(<BaseClasses>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<IGetRaidConfigurationRequestData>();
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 // 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 }; itemProperties.Light = { IsActive: (this.randomUtil.getChance100(lightLaserActiveChance)), SelectedMode: 0 };
} }

View File

@ -78,7 +78,9 @@ export interface EquipmentFilters
weaponModLimits: ModLimits weaponModLimits: ModLimits
weaponSightWhitelist: Record<string, string[]> weaponSightWhitelist: Record<string, string[]>
faceShieldIsActiveChancePercent?: number; faceShieldIsActiveChancePercent?: number;
lightLaserIsActiveChancePercent?: number; lightIsActiveDayChancePercent?: number;
lightIsActiveNightChancePercent?: number;
laserIsActiveChancePercent?: number;
nvgIsActiveChancePercent?: number; nvgIsActiveChancePercent?: number;
randomisation: RandomisationDetails[] randomisation: RandomisationDetails[]
blacklist: EquipmentFilterDetails[] blacklist: EquipmentFilterDetails[]