2022-08-17 02:29:54 -04:00
|
|
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
|
|
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
2023-02-12 23:21:22 -05:00
|
|
|
import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
2022-08-17 02:29:54 -04:00
|
|
|
import { IHealthConfig } from "../models/spt/config/IHealthConfig";
|
|
|
|
import { ILogger } from "../models/spt/utils/ILogger";
|
|
|
|
import { ConfigServer } from "../servers/ConfigServer";
|
|
|
|
import { SaveServer } from "../servers/SaveServer";
|
|
|
|
import { JsonUtil } from "../utils/JsonUtil";
|
|
|
|
import { TimeUtil } from "../utils/TimeUtil";
|
|
|
|
export declare class HealthHelper {
|
|
|
|
protected jsonUtil: JsonUtil;
|
|
|
|
protected logger: ILogger;
|
|
|
|
protected timeUtil: TimeUtil;
|
|
|
|
protected saveServer: SaveServer;
|
|
|
|
protected configServer: ConfigServer;
|
|
|
|
protected healthConfig: IHealthConfig;
|
|
|
|
constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer);
|
|
|
|
/**
|
2023-02-12 23:21:22 -05:00
|
|
|
* Resets the profiles vitality/health and vitality/effects properties to their defaults
|
2022-08-17 02:29:54 -04:00
|
|
|
* @param sessionID Session Id
|
|
|
|
* @returns updated profile
|
|
|
|
*/
|
|
|
|
resetVitality(sessionID: string): IAkiProfile;
|
|
|
|
/**
|
|
|
|
* Update player profile with changes from request object
|
|
|
|
* @param pmcData Player profile
|
2023-02-12 23:21:22 -05:00
|
|
|
* @param request Heal request
|
2022-08-17 02:29:54 -04:00
|
|
|
* @param sessionID Session id
|
|
|
|
* @param addEffects Should effects be added or removed (default - add)
|
|
|
|
*/
|
2023-02-12 23:21:22 -05:00
|
|
|
saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
|
|
|
/**
|
|
|
|
* Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality
|
|
|
|
* @param pmcData Profile to update
|
|
|
|
* @param sessionId Session id
|
|
|
|
*/
|
2022-08-17 02:29:54 -04:00
|
|
|
protected saveHealth(pmcData: IPmcData, sessionID: string): void;
|
|
|
|
/**
|
|
|
|
* Save effects to profile
|
|
|
|
* Works by removing all effects and adding them back from profile
|
2023-01-08 01:07:39 -05:00
|
|
|
* Removes empty 'Effects' objects if found
|
2022-08-17 02:29:54 -04:00
|
|
|
* @param pmcData Player profile
|
2023-02-12 23:21:22 -05:00
|
|
|
* @param sessionId Session id
|
|
|
|
* @param bodyPartsWithEffects dict of body parts with effects that should be added to profile
|
2022-08-17 02:29:54 -04:00
|
|
|
* @param addEffects Should effects be added back to profile
|
|
|
|
*/
|
2023-02-12 23:21:22 -05:00
|
|
|
protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void;
|
2022-08-17 02:29:54 -04:00
|
|
|
/**
|
|
|
|
* Add effect to body part in profile
|
|
|
|
* @param pmcData Player profile
|
|
|
|
* @param effectBodyPart body part to edit
|
|
|
|
* @param effectType Effect to add to body part
|
2023-01-08 01:07:39 -05:00
|
|
|
* @param duration How long the effect has left in seconds (-1 by default, no duration).
|
2022-08-17 02:29:54 -04:00
|
|
|
*/
|
2023-02-12 23:21:22 -05:00
|
|
|
protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void;
|
2022-08-17 02:29:54 -04:00
|
|
|
protected isEmpty(map: any): boolean;
|
|
|
|
}
|