warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
217 lines (216 loc) • 5.16 kB
TypeScript
/**
* Interim step for an event reward system.
* @typedef {object} InterimStep
* @property {number} goal Goal amount
* @property {Reward} reward Reward for reaching the step
* @property {number} winnerCount Amount of players at this step
* @property {object} message Message received when reaching the interim step
*/
/**
* Progress for one of multiple stages
* @typedef {object} ProgressStep
* @property {string} type Type of progress
* @property {number} progressAmt Amount of progress
*/
/**
* Represents an in-game special event
* @augments {WorldstateObject}
*/
export default class WorldEvent extends WorldstateObject {
/**
* Asynchronously build a new WorldEvent
* @param {object} data The event data
* @param {object} deps The dependencies object
* @param {string} deps.locale Locale to use for translations
* @returns {Promise.<WorldEvent>} The created WorldEvent object
*/
static build(data: object, deps: {
locale: string;
}): Promise<WorldEvent>;
/**
* @param {object} data The event data
* @param {object} deps The dependencies object
* @param {string} deps.locale Locale to use for translations
*/
constructor(data: object, { locale }?: {
locale: string;
});
/**
* The event's main score goal
* @type {number}
*/
maximumScore: number;
/**
* The current score on the event
* @type {number}
*/
currentScore: number;
/**
* The first intermediate score goal
* @type {?number}
*/
smallInterval: number | null;
/**
* The second intermediate score goal
* @type {?number}
*/
largeInterval: number | null;
/**
* The faction that the players must fight in the event
* @type {string}
*/
faction: string;
/**
* The description of the event
* @type {string}
*/
description: string;
/**
* Tooltip for the event
* @type {?string}
*/
tooltip: string | null;
/**
* The node where the event takes place
* @type {?string}
*/
node: string | null;
/**
* The other nodes where the event takes place
* @type {string[]}
*/
concurrentNodes: string[];
/**
* The victim node
* @type {?string}
*/
victimNode: string | null;
/**
* The score description
* @type {?string}
*/
scoreLocTag: string | null;
/**
* The event's rewards
* @type {Reward[]}
*/
rewards: Reward[];
/**
* Whether or not this is expired (at time of object creation)
* @type {boolean}
*/
expired: boolean;
/**
* Health remaining for the target
* @type {number}
*/
health: number;
jobs: any[];
previousJobs: any[];
/**
* Previous job id
* @type {string}
*/
previousId: string;
/**
* Array of steps
* @type {InterimStep[]}
*/
interimSteps: InterimStep[];
/**
* Progress Steps, if any are present
* @type {ProgressStep[]}
*/
progressSteps: ProgressStep[];
/**
* Total of all MultiProgress
* @type {number}
*/
progressTotal: number;
/**
* Whether to show the total score at the end of the mission
* @type {boolean}
*/
showTotalAtEndOfMission: boolean;
/**
* Whether the event is personal
* @type {boolean}
*/
isPersonal: boolean;
/**
* Whether the event is community
* @type {boolean}
*/
isCommunity: boolean;
regionDrops: any;
/**
* Archwing Drops in effect while this event is active
* @type {string[]}
*/
archwingDrops: string[];
asString: string;
/**
* Metadata provided by DE
* @type {object}
*/
metadata: object;
/**
* Bonuses given for completion
* @type {Array.<number>}
*/
completionBonuses: Array<number>;
scoreVar: any;
altExpiry: any;
altActivation: any;
nextAlt: {
expiry: any;
activation: any;
};
affiliatedWith: any;
/**
* The event's tag
* @type {string}
*/
tag: string;
/**
* Get whether the event has expired
* @returns {boolean} whether the event has expired
*/
getExpired(): boolean;
}
/**
* Interim step for an event reward system.
*/
export type InterimStep = {
/**
* Goal amount
*/
goal: number;
/**
* Reward for reaching the step
*/
reward: Reward;
/**
* Amount of players at this step
*/
winnerCount: number;
/**
* Message received when reaching the interim step
*/
message: object;
};
/**
* Progress for one of multiple stages
*/
export type ProgressStep = {
/**
* Type of progress
*/
type: string;
/**
* Amount of progress
*/
progressAmt: number;
};
import WorldstateObject from './WorldstateObject.js';
import Reward from './Reward.js';