Reviewed-on: #1 Co-authored-by: Platinum <platinumgamer@hotmail.com> Co-committed-by: Platinum <platinumgamer@hotmail.com>
196 lines
9.7 KiB
TypeScript
196 lines
9.7 KiB
TypeScript
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
|
import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator";
|
|
import { HealthHelper } from "@spt/helpers/HealthHelper";
|
|
import { InRaidHelper } from "@spt/helpers/InRaidHelper";
|
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
|
import { Item } from "@spt/models/eft/common/tables/IItem";
|
|
import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData";
|
|
import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData";
|
|
import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState";
|
|
import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig";
|
|
import { IBTRConfig } from "@spt/models/spt/config/IBTRConfig";
|
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
|
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
|
import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig";
|
|
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
|
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
|
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
|
import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel";
|
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
|
import { SaveServer } from "@spt/servers/SaveServer";
|
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
|
import { InsuranceService } from "@spt/services/InsuranceService";
|
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
|
import { MailSendService } from "@spt/services/MailSendService";
|
|
import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService";
|
|
import { PmcChatResponseService } from "@spt/services/PmcChatResponseService";
|
|
import { TraderServicesService } from "@spt/services/TraderServicesService";
|
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
|
/**
|
|
* Logic for handling In Raid callbacks
|
|
*/
|
|
export declare class InraidController {
|
|
protected logger: ILogger;
|
|
protected saveServer: SaveServer;
|
|
protected timeUtil: TimeUtil;
|
|
protected databaseService: DatabaseService;
|
|
protected pmcChatResponseService: PmcChatResponseService;
|
|
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
|
protected questHelper: QuestHelper;
|
|
protected itemHelper: ItemHelper;
|
|
protected profileHelper: ProfileHelper;
|
|
protected playerScavGenerator: PlayerScavGenerator;
|
|
protected healthHelper: HealthHelper;
|
|
protected traderHelper: TraderHelper;
|
|
protected traderServicesService: TraderServicesService;
|
|
protected localisationService: LocalisationService;
|
|
protected insuranceService: InsuranceService;
|
|
protected inRaidHelper: InRaidHelper;
|
|
protected applicationContext: ApplicationContext;
|
|
protected configServer: ConfigServer;
|
|
protected mailSendService: MailSendService;
|
|
protected randomUtil: RandomUtil;
|
|
protected airdropConfig: IAirdropConfig;
|
|
protected btrConfig: IBTRConfig;
|
|
protected inRaidConfig: IInRaidConfig;
|
|
protected traderConfig: ITraderConfig;
|
|
protected locationConfig: ILocationConfig;
|
|
protected ragfairConfig: IRagfairConfig;
|
|
protected hideoutConfig: IHideoutConfig;
|
|
protected botConfig: IBotConfig;
|
|
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil);
|
|
/**
|
|
* Save locationId to active profiles inraid object AND app context
|
|
* @param sessionID Session id
|
|
* @param info Register player request
|
|
*/
|
|
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
|
/**
|
|
* Handle raid/profile/save
|
|
* Save profile state to disk
|
|
* Handles pmc/pscav
|
|
* @param offraidData post-raid request data
|
|
* @param sessionID Session id
|
|
*/
|
|
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
|
/**
|
|
* Handle updating player profile post-pmc raid
|
|
* @param sessionID Session id
|
|
* @param postRaidRequest Post-raid data
|
|
*/
|
|
protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
|
|
/**
|
|
* Make changes to PMC profile after they've died in raid,
|
|
* Alter body part hp, handle insurance, delete inventory items, remove carried quest items
|
|
* @param postRaidSaveRequest Post-raid save request
|
|
* @param pmcData Pmc profile
|
|
* @param sessionID Session id
|
|
* @returns Updated profile object
|
|
*/
|
|
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData;
|
|
/**
|
|
* Adjust player characters body part hp post-raid
|
|
* @param postRaidSaveRequest post raid data
|
|
* @param pmcData player profile
|
|
*/
|
|
protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void;
|
|
/**
|
|
* Reduce body part hp to % of max
|
|
* @param pmcData profile to edit
|
|
* @param multiplier multiplier to apply to max health
|
|
*/
|
|
protected reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void;
|
|
/**
|
|
* Handle updating the profile post-pscav raid
|
|
* @param sessionID Session id
|
|
* @param postRaidRequest Post-raid data of raid
|
|
*/
|
|
protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
|
|
/**
|
|
* merge two dictionaries together
|
|
* Prioritise pair that has true as a value
|
|
* @param primary main dictionary
|
|
* @param secondary Secondary dictionary
|
|
*/
|
|
protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void;
|
|
/**
|
|
* Post-scav-raid any charisma increase must be propigated into PMC profile
|
|
* @param postRaidServerScavProfile Scav profile after adjustments made from raid
|
|
* @param postRaidServerPmcProfile Pmc profile after raid
|
|
* @param preRaidScavCharismaProgress charisma progress value pre-raid
|
|
*/
|
|
protected updatePmcCharismaSkillPostScavRaid(postRaidServerScavProfile: IPmcData, postRaidServerPmcProfile: IPmcData, preRaidScavCharismaProgress: number): void;
|
|
/**
|
|
* Does provided profile contain any condition counters
|
|
* @param profile Profile to check for condition counters
|
|
* @returns Profile has condition counters
|
|
*/
|
|
protected profileHasConditionCounters(profile: IPmcData): boolean;
|
|
/**
|
|
* Scav quest progress isnt transferred automatically from scav to pmc, we do this manually
|
|
* @param scavProfile Scav profile with quest progress post-raid
|
|
* @param pmcProfile Server pmc profile to copy scav quest progress into
|
|
*/
|
|
protected migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void;
|
|
/**
|
|
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
|
* @param statusOnExit exit value from offraidData object
|
|
* @returns true if dead
|
|
*/
|
|
protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean;
|
|
/**
|
|
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
|
* @param offraidData Save Progress Request
|
|
*/
|
|
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void;
|
|
/**
|
|
* Update profile after player completes scav raid
|
|
* @param scavData Scav profile
|
|
* @param sessionID Session id
|
|
* @param offraidData Post-raid save request
|
|
* @param pmcData Pmc profile
|
|
* @param isDead Is player dead
|
|
*/
|
|
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
|
/**
|
|
* Update profile with scav karma values based on in-raid actions
|
|
* @param pmcData Pmc profile
|
|
* @param offraidData Post-raid save request
|
|
* @param scavData Scav profile
|
|
*/
|
|
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData): void;
|
|
/**
|
|
* Get the inraid config from configs/inraid.json
|
|
* @returns InRaid Config
|
|
*/
|
|
getInraidConfig(): IInRaidConfig;
|
|
/**
|
|
* Get airdrop config from configs/airdrop.json
|
|
* @returns Airdrop config
|
|
*/
|
|
getAirdropConfig(): IAirdropConfig;
|
|
/**
|
|
* Get BTR config from configs/btr.json
|
|
* @returns Airdrop config
|
|
*/
|
|
getBTRConfig(): IBTRConfig;
|
|
/**
|
|
* Handle singleplayer/traderServices/getTraderServices
|
|
* @returns Trader services data
|
|
*/
|
|
getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[];
|
|
/**
|
|
* Handle singleplayer/traderServices/itemDelivery
|
|
*/
|
|
itemDelivery(sessionId: string, traderId: string, items: Item[]): void;
|
|
getTraitorScavHostileChance(url: string, sessionID: string): number;
|
|
getSandboxMaxPatrolValue(url: string, sessionID: string): number;
|
|
getBossConvertSettings(url: string, sessionId: string): string[];
|
|
}
|