Update types

This commit is contained in:
Dev 2023-08-01 17:37:33 +01:00
parent b84be52584
commit 21fc225eed
4 changed files with 17 additions and 5 deletions

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault
* @returns Nickname for bot
*/
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/**
* Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client

View File

@ -83,6 +83,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
};
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/**
* Update progress timer for water collector
* @param pmcData profile to update
@ -141,9 +142,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/**
* Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
}
export interface PmcTypes {
usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService";
/**
* Handles translating server text into different langauges
*/
export declare class LocalisationService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
protected localeService: LocaleService;
protected localeConfig: ILocaleConfig;
protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService);
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/**
* Get a localised value using the passed in key
* @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys
*/
getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
}