Skip to content

five-on-it / packages/missions/src/expressions / Scope

Interface: Scope ​

Defined in: packages/missions/src/expressions.ts:60

What a condition can ask about on one step of one player's mission.

Methods ​

count() ​

count(query): number

Defined in: packages/missions/src/expressions.ts:70

How many a query finds.

Parameters ​

query ​

{ players: { caught?: true; group?: string; in?: string; near?: { place: string; radius: number; }; tag?: string; team?: string; }; } | { enemies: { caught?: true; group?: string; in?: string; near?: { place: string; radius: number; }; tag?: string; team?: string; }; } | { vehicles: { caught?: true; group?: string; in?: string; near?: { place: string; radius: number; }; tag?: string; team?: string; }; } | { items: { caught?: true; group?: string; in?: string; near?: { place: string; radius: number; }; tag?: string; team?: string; }; }

Returns ​

number


counter() ​

counter(id): number

Defined in: packages/missions/src/expressions.ts:64

A counter's value (0 for one never set).

Parameters ​

id ​

string

Returns ​

number


elapsed() ​

elapsed(): number

Defined in: packages/missions/src/expressions.ts:68

Whole seconds since the mission started.

Returns ​

number


flag() ​

flag(id): boolean

Defined in: packages/missions/src/expressions.ts:62

Whether a flag is set.

Parameters ​

id ​

string

Returns ​

boolean


form() ​

form(field): string

Defined in: packages/missions/src/expressions.ts:88

What a field of the form of the app button being pressed holds (empty outside a press).

Parameters ​

field ​

string

Returns ​

string


hasApp() ​

hasApp(id): boolean

Defined in: packages/missions/src/expressions.ts:86

Whether an app is installed on the player's phone.

Parameters ​

id ​

string

Returns ​

boolean


health() ​

health(ref): number

Defined in: packages/missions/src/expressions.ts:74

A ref's health in per cent (a group's: the mean of its members', the fallen at 0).

Parameters ​

ref ​

"player" | { actor: string; } | { place: string; } | { team: string; }

Returns ​

number


items() ​

items(tag): number

Defined in: packages/missions/src/expressions.ts:78

How many items answering to a tag the player carries.

Parameters ​

tag ​

string

Returns ​

number


phaseOf() ​

phaseOf(npc): number

Defined in: packages/missions/src/expressions.ts:80

The alert phase's rank (0 normal to 4 alert) of an NPC actor, or of the compound (the room's highest).

Parameters ​

npc ​

string

Returns ​

number


points() ​

points(ref): readonly Point[]

Defined in: packages/missions/src/expressions.ts:72

Where a ref stands: one point for the player, a vehicle or a place, the members still standing for a group, none for what is not there.

Parameters ​

ref ​

"player" | { actor: string; } | { place: string; } | { team: string; }

Returns ​

readonly Point[]


stealth() ​

stealth(what): number

Defined in: packages/missions/src/expressions.ts:82

What the player did since the mission started: people killed, alarms caused, times seen.

Parameters ​

what ​

"seen" | "kills" | "alerts"

Returns ​

number


tagged() ​

tagged(tag): readonly Point[]

Defined in: packages/missions/src/expressions.ts:84

Where the mission's vehicles with a tag stand (not wrecked).

Parameters ​

tag ​

string

Returns ​

readonly Point[]


time() ​

time(): number

Defined in: packages/missions/src/expressions.ts:90

The time of day by the room clock (minutes after midnight).

Returns ​

number


timeLeft() ​

timeLeft(): number

Defined in: packages/missions/src/expressions.ts:66

Whole seconds left on the objective's clock; Infinity without one.

Returns ​

number


wanted() ​

wanted(): number

Defined in: packages/missions/src/expressions.ts:76

The player's Wanted level, in stars.

Returns ​

number


weather() ​

weather(): string

Defined in: packages/missions/src/expressions.ts:92

The weather's kind now.

Returns ​

string