UNPKG

@peacockproject/core

Version:

Type definitions for Peacock's core.

20 lines (19 loc) 1.46 kB
import type { ContractSession, GameVersion, JwtData, MissionManifest, Seconds } from "./types/types"; import { ScoringHeadline } from "./types/scoring"; import { MissionEndRequestQuery } from "./types/gameSchemas"; import { CalculateScoreResult, CalculateSniperScoreResult, CalculateXpResult, MissionEndResult } from "./types/score"; import { InventoryItem } from "./inventory"; export declare function calculateGlobalXp(contractSession: ContractSession, gameVersion: GameVersion): CalculateXpResult; export declare function calculateScore(gameVersion: GameVersion, contractSession: ContractSession, contractData: MissionManifest, timeTotal: Seconds): CalculateScoreResult; export declare function calculateSniperScore(contractSession: ContractSession, timeTotal: Seconds, inventory: InventoryItem[]): [CalculateSniperScoreResult, ScoringHeadline[]]; /** * Get the data for a mission end screen. * This function also changes the user's data, unless `isDryRun` is true. * `isDryRun` is a hack because 2016 exists, and needs some of this data before * the intended route will be called. * @param query The query for the route. * @param jwt User's JWT data. * @param gameVersion The game version. * @param isDryRun When true, the function will not change the user's data or commit scores. */ export declare function getMissionEndData(query: MissionEndRequestQuery, jwt: JwtData, gameVersion: GameVersion, isDryRun: boolean): Promise<MissionEndResult>;