Make use of SideType.SAVAGE enum

This commit is contained in:
Dev 2024-07-25 19:10:21 +01:00
parent 8f8a0c1f05
commit 019db50cf6
2 changed files with 6 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import { IBotCore } from "@spt/models/eft/common/tables/IBotCore";
import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { Difficulty } from "@spt/models/eft/common/tables/IBotType";
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { SideType } from "@spt/models/enums/SideType";
import { WildSpawnTypeNumber } from "@spt/models/enums/WildSpawnTypeNumber"; import { WildSpawnTypeNumber } from "@spt/models/enums/WildSpawnTypeNumber";
import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
@ -250,7 +251,7 @@ export class BotController {
): BotGenerationDetails { ): BotGenerationDetails {
return { return {
isPmc: generateAsPmc, isPmc: generateAsPmc,
side: "Savage", side: SideType.SAVAGE,
role: condition.Role, role: condition.Role,
playerLevel: this.getPlayerLevelFromProfile(pmcProfile), playerLevel: this.getPlayerLevelFromProfile(pmcProfile),
playerName: pmcProfile.Info.Nickname, playerName: pmcProfile.Info.Nickname,

View File

@ -20,6 +20,7 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { GameEditions } from "@spt/models/enums/GameEditions"; import { GameEditions } from "@spt/models/enums/GameEditions";
import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { ItemTpl } from "@spt/models/enums/ItemTpl";
import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { SideType } from "@spt/models/enums/SideType";
import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
@ -75,11 +76,11 @@ export class BotGenerator {
let bot = this.getCloneOfBotBase(); let bot = this.getCloneOfBotBase();
bot.Info.Settings.BotDifficulty = difficulty; bot.Info.Settings.BotDifficulty = difficulty;
bot.Info.Settings.Role = role; bot.Info.Settings.Role = role;
bot.Info.Side = "Savage"; bot.Info.Side = SideType.SAVAGE;
const botGenDetails: BotGenerationDetails = { const botGenDetails: BotGenerationDetails = {
isPmc: false, isPmc: false,
side: "Savage", side: SideType.SAVAGE,
role: role, role: role,
botRelativeLevelDeltaMax: 0, botRelativeLevelDeltaMax: 0,
botRelativeLevelDeltaMin: 0, botRelativeLevelDeltaMin: 0,
@ -196,7 +197,7 @@ export class BotGenerator {
); );
bot.Info.Settings.StandingForKill = botJsonTemplate.experience.standingForKill; bot.Info.Settings.StandingForKill = botJsonTemplate.experience.standingForKill;
bot.Info.Voice = this.weightedRandomHelper.getWeightedValue<string>(botJsonTemplate.appearance.voice); bot.Info.Voice = this.weightedRandomHelper.getWeightedValue<string>(botJsonTemplate.appearance.voice);
bot.Health = this.generateHealth(botJsonTemplate.health, bot.Info.Side === "Savage"); bot.Health = this.generateHealth(botJsonTemplate.health, bot.Info.Side === SideType.SAVAGE);
bot.Skills = this.generateSkills(<any>botJsonTemplate.skills); // TODO: fix bad type, bot jsons store skills in dict, output needs to be array bot.Skills = this.generateSkills(<any>botJsonTemplate.skills); // TODO: fix bad type, bot jsons store skills in dict, output needs to be array
if (botGenerationDetails.isPmc) { if (botGenerationDetails.isPmc) {