Converted scav 2 boss system boss array to weighted system
This commit is contained in:
parent
c6ed811894
commit
0a6ef574d0
@ -2708,14 +2708,14 @@
|
|||||||
"disableLootOnBotTypes": [],
|
"disableLootOnBotTypes": [],
|
||||||
"assaultToBossConversion": {
|
"assaultToBossConversion": {
|
||||||
"bossConvertEnabled": false,
|
"bossConvertEnabled": false,
|
||||||
"bossesToConvertTo": [
|
"bossesToConvertToWeights": {
|
||||||
"bossKilla",
|
"bossKilla": 1,
|
||||||
"bossSanitar",
|
"bossSanitar": 1,
|
||||||
"bossKolontay",
|
"bossKolontay": 1,
|
||||||
"bossKnight",
|
"bossKnight": 1,
|
||||||
"followerBigPipe",
|
"followerBigPipe": 1,
|
||||||
"followerBirdEye"
|
"followerBirdEye": 1
|
||||||
],
|
},
|
||||||
"bossConvertMinMax": {
|
"bossConvertMinMax": {
|
||||||
"assault": {
|
"assault": {
|
||||||
"min": 100,
|
"min": 100,
|
||||||
|
@ -5,6 +5,7 @@ import { BotGenerator } from "@spt/generators/BotGenerator";
|
|||||||
import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper";
|
import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper";
|
||||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { MinMax } from "@spt/models/common/MinMax";
|
import { MinMax } from "@spt/models/common/MinMax";
|
||||||
import { Condition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData";
|
import { Condition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData";
|
||||||
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
@ -39,6 +40,7 @@ export class BotController
|
|||||||
@inject("BotGenerator") protected botGenerator: BotGenerator,
|
@inject("BotGenerator") protected botGenerator: BotGenerator,
|
||||||
@inject("BotHelper") protected botHelper: BotHelper,
|
@inject("BotHelper") protected botHelper: BotHelper,
|
||||||
@inject("BotDifficultyHelper") protected botDifficultyHelper: BotDifficultyHelper,
|
@inject("BotDifficultyHelper") protected botDifficultyHelper: BotDifficultyHelper,
|
||||||
|
@inject("WeightedRandomHelper") protected weightedRandomHelper: WeightedRandomHelper,
|
||||||
@inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService,
|
@inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService,
|
||||||
@inject("MatchBotDetailsCacheService") protected matchBotDetailsCacheService: MatchBotDetailsCacheService,
|
@inject("MatchBotDetailsCacheService") protected matchBotDetailsCacheService: MatchBotDetailsCacheService,
|
||||||
@inject("LocalisationService") protected localisationService: LocalisationService,
|
@inject("LocalisationService") protected localisationService: LocalisationService,
|
||||||
@ -434,16 +436,20 @@ export class BotController
|
|||||||
botGenerationDetails.botCountToGenerate = this.botConfig.presetBatch[botGenerationDetails.role];
|
botGenerationDetails.botCountToGenerate = this.botConfig.presetBatch[botGenerationDetails.role];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Only runs if bot didnt get picked to be PMC & Boss Convert is enabled
|
// Only convert to boss when not already converted to PMC & Boss Convert is enabled
|
||||||
if (this.botConfig.assaultToBossConversion.bossConvertEnabled && !botGenerationDetails.isPmc) {
|
const toBossSettings = this.botConfig.assaultToBossConversion;
|
||||||
const bossConvertPercent = this.botConfig.assaultToBossConversion.bossConvertMinMax[requestedBot.Role.toLowerCase()];
|
if (toBossSettings.bossConvertEnabled && !botGenerationDetails.isPmc)
|
||||||
|
{
|
||||||
|
const bossConvertPercent = toBossSettings.bossConvertMinMax[requestedBot.Role.toLowerCase()];
|
||||||
// Only Pass if role exists
|
// Only Pass if role exists
|
||||||
if (bossConvertPercent) {
|
if (bossConvertPercent)
|
||||||
|
{
|
||||||
const convertToBoss = this.botHelper.rollChanceToBePmc(requestedBot.Role, bossConvertPercent);
|
const convertToBoss = this.botHelper.rollChanceToBePmc(requestedBot.Role, bossConvertPercent);
|
||||||
// Should become Boss
|
if (convertToBoss)
|
||||||
if (convertToBoss) {
|
{
|
||||||
// Seems Actual bosses have the same Brain issues like PMC gaining Boss Brains We cant use all bosses
|
// Seems Actual bosses have the same Brain issues like PMC gaining Boss Brains We cant use all bosses
|
||||||
botGenerationDetails.role = this.randomUtil.drawRandomFromList(this.botConfig.assaultToBossConversion.bossesToConvertTo)[0];
|
botGenerationDetails.role
|
||||||
|
= this.weightedRandomHelper.getWeightedValue(toBossSettings.bossesToConvertToWeights);
|
||||||
botGenerationDetails.botDifficulty = this.getPMCDifficulty(requestedBot.Difficulty);
|
botGenerationDetails.botDifficulty = this.getPMCDifficulty(requestedBot.Difficulty);
|
||||||
botGenerationDetails.botCountToGenerate = this.botConfig.presetBatch[botGenerationDetails.role];
|
botGenerationDetails.botCountToGenerate = this.botConfig.presetBatch[botGenerationDetails.role];
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export interface IBotConfig extends IBaseConfig
|
|||||||
export interface IAssaultToBossConversion
|
export interface IAssaultToBossConversion
|
||||||
{
|
{
|
||||||
bossConvertEnabled: boolean
|
bossConvertEnabled: boolean
|
||||||
bossesToConvertTo: string[]
|
bossesToConvertToWeights: Record<string, MinMax>
|
||||||
bossConvertMinMax: Record<string, MinMax>
|
bossConvertMinMax: Record<string, MinMax>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user