Skip to main content
Deno 2 is finally here 🎉️
Learn more
class InraidController
import { InraidController } from "https://deno.land/x/sptaki@1.2.0/controllers/mod.ts";

Logic for handling In Raid callbacks

Constructors

new
InraidController(
logger: ILogger,
saveServer: SaveServer,
jsonUtil: JsonUtil,
timeUtil: TimeUtil,
databaseServer: DatabaseServer,
pmcChatResponseService: PmcChatResponseService,
matchBotDetailsCacheService: MatchBotDetailsCacheService,
questHelper: QuestHelper,
itemHelper: ItemHelper,
profileHelper: ProfileHelper,
playerScavGenerator: PlayerScavGenerator,
healthHelper: HealthHelper,
traderHelper: TraderHelper,
traderServicesService: TraderServicesService,
insuranceService: InsuranceService,
inRaidHelper: InRaidHelper,
applicationContext: ApplicationContext,
configServer: ConfigServer,
mailSendService: MailSendService,
randomUtil: RandomUtil,
)

Properties

protected
airdropConfig: IAirdropConfig
protected
applicationContext: ApplicationContext
protected
btrConfig: IBTRConfig
protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
healthHelper: HealthHelper
protected
hideoutConfig: IHideoutConfig
protected
inRaidConfig: IInRaidConfig
protected
inRaidHelper: InRaidHelper
protected
insuranceService: InsuranceService
protected
itemHelper: ItemHelper
protected
jsonUtil: JsonUtil
protected
locationConfig: ILocationConfig
protected
logger: ILogger
protected
mailSendService: MailSendService
protected
matchBotDetailsCacheService: MatchBotDetailsCacheService
protected
playerScavGenerator: PlayerScavGenerator
protected
pmcChatResponseService: PmcChatResponseService
protected
profileHelper: ProfileHelper
protected
questHelper: QuestHelper
protected
ragfairConfig: IRagfairConfig
protected
randomUtil: RandomUtil
protected
saveServer: SaveServer
protected
timeUtil: TimeUtil
protected
traderConfig: ITraderConfig
protected
traderHelper: TraderHelper
protected
traderServicesService: TraderServicesService

Methods

protected
handlePostRaidPlayerScavKarmaChanges(
pmcData: IPmcData,
scavData: IPmcData,
): void

Update profile with scav karma values based on in-raid actions

protected
handlePostRaidPlayerScavProcess(
scavData: IPmcData,
sessionID: string,
pmcData: IPmcData,
isDead: boolean,
): void

Update profile after player completes scav raid

protected
isPlayerDead(statusOnExit: PlayerRaidEndState): boolean

Is the player dead after a raid - dead is anything other than "survived" / "runner"

Mark inventory items as FiR if player survived raid, otherwise remove FiR from them

protected
mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void

merge two dictionaries together Prioritise pair that has true as a value

protected
migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void

Scav quest progress isnt transferred automatically from scav to pmc, we do this manually

protected
performPostRaidActionsWhenDead(
postRaidSaveRequest: ISaveProgressRequestData,
pmcData: IPmcData,
sessionID: string,
): IPmcData

Make changes to PMC profile after they've died in raid, Alter body part hp, handle insurance, delete inventory items, remove carried quest items

protected
profileHasConditionCounters(profile: IPmcData): boolean

Does provided profile contain any condition counters

protected
reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void

Reduce body part hp to % of max

protected
savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void

Handle updating the profile post-pscav raid

protected
savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void

Handle updating player profile post-pmc raid

protected
updatePmcCharismaSkillPostScavRaid(
postRaidServerScavProfile: IPmcData,
postRaidServerPmcProfile: IPmcData,
preRaidScavCharismaProgress: number,
): void

Post-scav-raid any charisma increase must be propigated into PMC profile

protected
updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void

Adjust player characters body part hp post-raid

addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void

Save locationId to active profiles inraid object AND app context

Get airdrop config from configs/airdrop.json

Get BTR config from configs/btr.json

Get the inraid config from configs/inraid.json

getSandboxMaxPatrolValue(url: string, sessionID: string): number
getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[]

Handle singleplayer/traderServices/getTraderServices

getTraitorScavHostileChance(url: string, sessionID: string): number
itemDelivery(
sessionId: string,
traderId: string,
items: Item[],
): void

Handle singleplayer/traderServices/itemDelivery

savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void

Handle raid/profile/save Save profile state to disk Handles pmc/pscav