Skip to content

CampaignController beta ​

Interface of @v12-engine/client

ts
export interface CampaignController

A campaign between its missions: how far it is, which mission is next, and what there is to do. What a campaign's menu shows (CampaignDef.menu)

Members ​

chapters ​

ts
readonly chapters: readonly CampaignChapter[];

Its missions in chapters, in order (CampaignDef.chapters): those no chapter names in one of their own at the end, named as the campaign; one chapter of them all for a campaign that has none

complete ​

ts
complete(): boolean;

Whether every mission is won

difficulties ​

ts
readonly difficulties: readonly string[];

The difficulties it offers, by name (CampaignDef.difficulties)

difficulty ​

ts
difficulty(): string;

The difficulty its missions' computers play on: the one chosen (kept in the progress), else normal where offered, else the first

id ​

ts
readonly id: string;

The campaign's id

leave ​

ts
leave(): void;

Out of the campaign

missions ​

ts
readonly missions: readonly CampaignMissionInfo[];

The campaign's missions, in order

name ​

ts
readonly name: string;

The campaign's name on the menu

next ​

ts
next(): CampaignMissionInfo;

The mission to go on with: the one it is at, the last one once every one is won

play ​

ts
play(mission: string): void;

Plays a mission

progress ​

ts
readonly progress: Accessor<CampaignProgress>;

How far it is: the mission it is at, the ones won with their times, the heroes carried

reached ​

ts
reached(mission: string): boolean;

Whether a mission can be played: as its unlock says; else the first, one won, the one the campaign is at (where the last won led: MissionDef.next), and one after a mission won that says nothing of what comes after it

saves ​

ts
readonly saves: SavesController;

The games of the campaign saved in this browser: listed, loaded, deleted

setDifficulty ​

ts
setDifficulty(difficulty: string): void;

Chooses the difficulty, kept at once with the progress: the missions played from now on have it

startOver ​

ts
startOver(): void;

Starts the campaign over: what was won and carried is forgotten

total ​

ts
total(): number;

The seconds the missions won took, together

won ​

ts
won(mission: string): CampaignProgress['done'][string] | undefined;

What a mission was won with, when it was: its time, and the best