Skip to main content
The Deno 2 Release Candidate is here
Learn more
class HideoutHelper
import { HideoutHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/HideoutHelper.d.ts";

Constructors

new
HideoutHelper(
logger: ILogger,
hashUtil: HashUtil,
timeUtil: TimeUtil,
databaseServer: DatabaseServer,
eventOutputHolder: EventOutputHolder,
httpResponse: HttpResponseUtil,
profileHelper: ProfileHelper,
inventoryHelper: InventoryHelper,
playerService: PlayerService,
localisationService: LocalisationService,
itemHelper: ItemHelper,
configServer: ConfigServer,
jsonUtil: JsonUtil,
)

Properties

protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
eventOutputHolder: EventOutputHolder
protected
hashUtil: HashUtil
protected
hideoutConfig: IHideoutConfig
protected
httpResponse: HttpResponseUtil
protected
inventoryHelper: InventoryHelper
protected
itemHelper: ItemHelper
protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
playerService: PlayerService
protected
profileHelper: ProfileHelper
protected
timeUtil: TimeUtil

Methods

protected
addBtcToProduction(btcProd: Production, coinCraftTimeSeconds: number): void

Add bitcoin object to btc production products array and set progress time

protected
doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean

Check if a productions progress value matches its corresponding recipes production time value

protected
doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean
protected
getAreaUpdObject(
stackCount: number,
resourceValue: number,
resourceUnitsConsumed: number,
isFoundInRaid: boolean,
): Upd

Create a upd object using passed in parameters

protected
getBTCSlots(pmcData: IPmcData): number

Get a count of how many possible BTC can be gathered by the profile

protected
getDogtagCombatSkillBonusPercent(pmcData: IPmcData, activeDogtags: Item[]): number

Calculate the raw dogtag combat skill bonus for place of fame based on number of dogtags Reverse engineered from client code

Get a count of how many additional bitcoins player hideout can hold with elite skill

HideoutManagement skill gives a consumption bonus the higher the level 0.5% per level per 1-51, (25.5% at max)

protected
getHideoutProperties(pmcData: IPmcData): { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }

Get various properties that will be passed to hideout update-related functions

protected
getSkillBonusMultipliedBySkillLevel(
pmcData: IPmcData,
skill: SkillTypes,
valuePerLevel: number,
): number

Get a multipler based on players skill level and value per level

protected
getTimeAdjustedWaterFilterDrainRate(
secondsSinceServerTick: number,
totalProductionTime: number,
productionProgress: number,
baseFilterDrainRate: number,
): number

Get an adjusted water filter drain rate based on time elapsed since last run, handle edge case when craft time has gone on longer than total production time

protected
getTimeElapsedSinceLastServerTick(
pmcData: IPmcData,
isGeneratorOn: boolean,
): number

Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off

protected
getTotalProductionTimeSeconds(prodId: string): number

Get the production time in seconds for the desired production

protected
getWaterFilterDrainRate(pmcData: IPmcData): number

Get the water filter drain rate based on hideout bonues player has

protected
hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean

Hideout improvement is flagged as complete

protected
updateAirFilters(
airFilterArea: HideoutArea,
pmcData: IPmcData,
isGeneratorOn: boolean,
): void
protected
updateAreasWithResources(
sessionID: string,
pmcData: IPmcData,
hideoutProperties: { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; },
): void

Iterate over hideout areas that use resources (fuel/filters etc) and update associated values

protected
updateBitcoinFarm(
pmcData: IPmcData,
btcFarmCGs: number,
isGeneratorOn: boolean,
): Production
protected
updateFuel(
generatorArea: HideoutArea,
pmcData: IPmcData,
isGeneratorOn: boolean,
): void

Decrease fuel from generator slots based on amount of time since last time this occured

protected
updateProductionProgress(
pmcData: IPmcData,
prodId: string,
hideoutProperties: { btcFarmCGs?: number; isGeneratorOn: boolean; waterCollectorHasFilter?: boolean; },
): void

Update a productions progress value based on the amount of time that has passed

protected
updateProductionTimers(pmcData: IPmcData, hideoutProperties: { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void

Iterate over productions and update their progress timers

protected
updateScavCaseProductionTimer(pmcData: IPmcData, productionId: string): void

Update progress timer for scav case

protected
updateWaterCollector(
sessionId: string,
pmcData: IPmcData,
hideoutProperties: { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; },
): void
protected
updateWaterCollectorProductionTimer(
pmcData: IPmcData,
productionId: string,
hideoutProperties: { btcFarmCGs?: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; },
): void

Update progress timer for water collector

protected
updateWaterFilters(
waterFilterArea: HideoutArea,
production: Production,
isGeneratorOn: boolean,
pmcData: IPmcData,
): void

Adjust water filter objects resourceValue or delete when they reach 0 resource

Add/remove bonus combat skill based on number of dogtags in place of fame hideout area

Apply bonus to player profile given after completing hideout upgrades

getAdjustedCraftTimeWithSkills(
pmcData: IPmcData,
recipeId: string,
applyHideoutManagementBonus?: boolean,
): number

Get craft time and make adjustments to account for dev profile + crafting skill level

getBTC(
pmcData: IPmcData,
sessionId: string,
): void

Gather crafted BTC from hideout area and add to inventory Reset production start timestamp if hideout area at full coin capacity

getSkillProductionTimeReduction(
pmcData: IPmcData,
productionTime: number,
skill: SkillTypes,
amountPerLevel: number,
): number
initProduction(
recipeId: string,
productionTime: number,
needFuelForAllProductionTime: boolean,
): Production

This convenience function initializes new Production Object with all the constants.

isProduction(productive: Productive): productive is Production
isProductionType(productive: Productive): productive is Production

Is the provided object a Production type

Add production to profiles' Hideout.Production array

Iterate over hideout improvements not completed and check if they need to be adjusted

Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded

updatePlayerHideout(sessionID: string): void

Process a players hideout, update areas that use resources + increment production timers

Static Properties

bitcoinFarm: string
bitcoinProductionId: string
bitcoinTpl: string
expeditionaryFuelTank: string
maxSkillPoint: number
waterCollector: string