2022-07-30 00:35:54 -04:00
|
|
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
|
|
import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase";
|
|
|
|
import { Upd } from "../models/eft/common/tables/IItem";
|
|
|
|
import { StageBonus } from "../models/eft/hideout/IHideoutArea";
|
|
|
|
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData";
|
|
|
|
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
|
|
|
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
|
|
|
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
|
|
|
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
|
|
|
import { ILogger } from "../models/spt/utils/ILogger";
|
|
|
|
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
|
|
|
import { ConfigServer } from "../servers/ConfigServer";
|
|
|
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
|
|
import { PlayerService } from "../services/PlayerService";
|
|
|
|
import { HashUtil } from "../utils/HashUtil";
|
|
|
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
|
|
|
import { RandomUtil } from "../utils/RandomUtil";
|
|
|
|
import { TimeUtil } from "../utils/TimeUtil";
|
|
|
|
import { InventoryHelper } from "./InventoryHelper";
|
|
|
|
import { ProfileHelper } from "./ProfileHelper";
|
|
|
|
export declare class HideoutHelper {
|
|
|
|
protected logger: ILogger;
|
|
|
|
protected hashUtil: HashUtil;
|
|
|
|
protected timeUtil: TimeUtil;
|
|
|
|
protected randomUtil: RandomUtil;
|
|
|
|
protected databaseServer: DatabaseServer;
|
|
|
|
protected itemEventRouter: ItemEventRouter;
|
|
|
|
protected httpResponse: HttpResponseUtil;
|
|
|
|
protected profileHelper: ProfileHelper;
|
|
|
|
protected inventoryHelper: InventoryHelper;
|
|
|
|
protected playerService: PlayerService;
|
|
|
|
protected configServer: ConfigServer;
|
2022-08-08 20:03:48 -04:00
|
|
|
static bitcoinFarm: string;
|
|
|
|
static waterCollector: string;
|
|
|
|
static bitcoin: string;
|
|
|
|
static expeditionaryFuelTank: string;
|
2022-07-30 00:35:54 -04:00
|
|
|
protected hideoutConfig: IHideoutConfig;
|
|
|
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer);
|
|
|
|
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
|
|
|
/**
|
|
|
|
* This convinience function intialies new Production Object
|
|
|
|
* with all the constants.
|
|
|
|
*/
|
|
|
|
initProduction(recipeId: string, productionTime: number): Production;
|
|
|
|
isProductionType(productive: Productive): productive is Production;
|
|
|
|
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
2022-08-29 17:07:55 -04:00
|
|
|
/**
|
|
|
|
* TODO:
|
|
|
|
* After looking at the skills there doesnt seem to be a configuration per skill to boost
|
|
|
|
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it)
|
|
|
|
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
|
|
|
|
* @param pmcData
|
|
|
|
* @param bonus
|
|
|
|
*/
|
2022-07-30 00:35:54 -04:00
|
|
|
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
2022-08-29 17:07:55 -04:00
|
|
|
/**
|
|
|
|
* Process a players hideout, update areas that use resources + increment production timers
|
|
|
|
* @param sessionID Session id
|
|
|
|
*/
|
2022-07-30 00:35:54 -04:00
|
|
|
updatePlayerHideout(sessionID: string): void;
|
2022-08-29 17:07:55 -04:00
|
|
|
/**
|
|
|
|
* Update progress timer for water collector
|
|
|
|
* @param pmcData profile to update
|
|
|
|
* @param productionId id of water collection production to update
|
|
|
|
* @param hideoutProperties Hideout properties
|
|
|
|
*/
|
|
|
|
protected updateWaterCollectorProductionTimer(pmcData: IPmcData, productionId: string, hideoutProperties: {
|
|
|
|
btcFarmCGs?: number;
|
|
|
|
isGeneratorOn: boolean;
|
|
|
|
waterCollectorHasFilter: boolean;
|
|
|
|
}): void;
|
|
|
|
/**
|
|
|
|
* Iterate over productions and update their progress timers
|
|
|
|
* @param pmcData Profile to check for productions and update
|
|
|
|
* @param hideoutProperties Hideout properties
|
|
|
|
*/
|
|
|
|
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
|
|
|
|
btcFarmCGs: number;
|
|
|
|
isGeneratorOn: boolean;
|
|
|
|
waterCollectorHasFilter: boolean;
|
|
|
|
}): void;
|
|
|
|
/**
|
|
|
|
* Update progress timer for scav case
|
|
|
|
* @param pmcData Profile to update
|
|
|
|
* @param productionId Id of scav case production to update
|
|
|
|
*/
|
|
|
|
protected updateScavCaseProductionTimer(pmcData: IPmcData, productionId: string): void;
|
|
|
|
/**
|
|
|
|
* Iterate over hideout areas that use resources (fuel/filters etc) and update associated values
|
|
|
|
* @param sessionID Session id
|
|
|
|
* @param pmcData Profile to update areas of
|
|
|
|
* @param hideoutProperties hideout properties
|
|
|
|
*/
|
|
|
|
protected updateAreasWithResources(sessionID: string, pmcData: IPmcData, hideoutProperties: {
|
|
|
|
btcFarmCGs: number;
|
|
|
|
isGeneratorOn: boolean;
|
|
|
|
waterCollectorHasFilter: boolean;
|
|
|
|
}): void;
|
2022-07-30 00:35:54 -04:00
|
|
|
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
|
|
|
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
2022-08-29 17:07:55 -04:00
|
|
|
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
|
2022-08-28 23:48:57 -04:00
|
|
|
/**
|
2022-08-29 17:07:55 -04:00
|
|
|
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
|
|
|
* @param waterFilterArea water filter area to update
|
|
|
|
* @param production production object
|
|
|
|
* @param isGeneratorOn is generatory enabled
|
|
|
|
* @param pmcData Player profile
|
|
|
|
* @returns Updated HideoutArea object
|
2022-08-28 23:48:57 -04:00
|
|
|
*/
|
2022-08-29 17:07:55 -04:00
|
|
|
protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
2022-07-30 00:35:54 -04:00
|
|
|
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
2022-08-29 17:07:55 -04:00
|
|
|
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
|
2022-07-30 00:35:54 -04:00
|
|
|
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
|
|
|
protected getBTCSlots(pmcData: IPmcData): number;
|
|
|
|
protected getManagementSkillsSlots(): number;
|
|
|
|
protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
|
|
|
|
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
|
|
|
|
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
|
|
|
|
isProduction(productive: Productive): productive is Production;
|
|
|
|
getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
|
|
}
|