@peacockproject/core
Version:
Type definitions for Peacock's core.
146 lines (145 loc) • 4.86 kB
TypeScript
import type { CompletionData, GameVersion, GroupObjectiveDisplayOrderItem, MissionManifest, MissionManifestObjective, Unlockable, UserCentricContract } from "../types/types";
/**
* Get the sub-location from a contract's location field.
*
* @param contractData The contract data.
* @param gameVersion The game version.
* @returns The sub-location.
*/
export declare function getSubLocationFromContract(contractData: MissionManifest, gameVersion: GameVersion): Unlockable | undefined;
/**
* Get a sub-location by name.
*
* @param name The sublocation's name (e.g. `LOCATION_NORTHAMERICA_GARTERSNAKE`).
* @param gameVersion The game's version.
* @returns The sub-location.
*/
export declare function getSubLocationByName(name: string, gameVersion: GameVersion): Unlockable | undefined;
/**
* Get a parent location by name.
*
* @param name The parent location's name (e.g. `LOCATION_PARENT_ICA_FACILITY`).
* @param gameVersion The game's version.
* @returns The parent location.
*/
export declare function getParentLocationByName(name: string, gameVersion: GameVersion): Unlockable | undefined;
/**
* Generates a CompletionData object.
*
* @param subLocationId The ID of the targeted sub-location.
* @param userId The ID of the user.
* @param gameVersion The game's version.
* @param contractType The type of the contract, only used to distinguish evergreen from other types (default).
* @param subPackageId The sub package id you want (think of mastery).
* @returns The completion data object.
*/
export declare function generateCompletionData(subLocationId: string, userId: string, gameVersion: GameVersion, contractType?: string, subPackageId?: string): CompletionData;
/**
* Changes a contract to the "UserCentric" format.
*
* @param contractData Data about the contract.
* @param userId The target user's ID.
* @param gameVersion The game version.
* @returns The user-centric contract.
*/
export declare function generateUserCentric(contractData: MissionManifest | undefined, userId: string, gameVersion: GameVersion): UserCentricContract | undefined;
/**
* Converts a series of objectives into the format that the planning screen expects.
*
* @param objectives The objectives.
* @param gameChangers The game changers.
* @param displayOrder The order in which to display the objectives.
* @param isEvergreenSafehouse Is the contract the Safehouse?
* @returns The converted objectives.
*/
export declare function mapObjectives(objectives: MissionManifestObjective[], gameChangers: string[], displayOrder: GroupObjectiveDisplayOrderItem[]): MissionManifestObjective[];
export declare function complications(timeString: string): ({
IsCompleted: boolean;
ContractConditionType: string;
Primary: {
Type: string;
Properties: {
Id: string;
Name: string;
Description: string;
LongDescription: string;
TileImage: string;
Icon: string;
ObjectivesCategory: string;
};
}[];
Secondary: {
Type: string;
Properties: {
Id: string;
Name: string;
Description: string;
LongDescription: string;
TileImage: string;
Icon: string;
ObjectivesCategory: string;
};
}[];
} | {
IsCompleted: boolean;
ContractConditionType: string;
Primary: {
Type: string;
Properties: {
Id: string;
BriefingName: string;
BriefingText: {
$loc: {
key: string;
data: string;
};
};
LongBriefingText: {
$loc: {
key: string;
data: string;
};
};
Image: string;
ObjectivesCategory: string;
};
}[];
Secondary: {
Type: string;
Properties: {
Id: string;
BriefingName: string;
BriefingText: {
$loc: {
key: string;
data: string;
};
};
LongBriefingText: {
$loc: {
key: string;
data: string;
};
};
Image: string;
ObjectivesCategory: string;
};
}[];
ObjectiveInfo?: undefined;
} | {
IsCompleted: boolean;
ContractConditionType: string;
ObjectiveInfo: {
Type: string;
Properties: {
Id: string;
BriefingName: string;
BriefingText: string;
LongBriefingText: string;
Image: string;
ObjectivesCategory: string;
};
}[];
Primary?: undefined;
Secondary?: undefined;
})[];