Skip to content

BeforeEffect beta ​

Interface of @v12-engine/engine

ts
export interface BeforeEffect

An effect of an ability about to reach one target (beforeEffect): who it is from, the effect, whom it reaches, where it went off from. Cancelled, it does not reach that one, and only that one: the rest of an area are reached, a missile passes it by (it is in its hit, so it is not asked again). Asked wherever any effect reaches any target: who an effect applies to (effectTargets, so a damage, heal, buff, knockback, pull, dispel, a game's own that asks), a missile's hit (with missile: a shield that eats it takes it out with removeMissile), what a game's own effect asks (mayReach). Not for an aura's buff, which is kept up rather than landed. Asked only where a handler is there: a game without one pays nothing

Members ​

ability ​

ts
readonly ability: AbilityDef;

The ability the effect belongs to

cancel ​

ts
cancel(): void;

It does not reach this target

cancelled ​

ts
cancelled: boolean;

Whether a handler has called it off for this target; set by cancel()

caster ​

ts
readonly caster: Entity;

Whose the effect is

effect ​

ts
readonly effect: EffectDef;

The effect, as it runs (a chain lowered: lowerChain)

level ​

ts
readonly level: number;

The level it was cast at

missile ​

ts
readonly missile?: Missile;

The missile that reached the target, for a missile's hit

origin ​

ts
readonly origin?: Entity | Vec2;

What it went off from, when not the caster (EffectContext.origin)

point ​

ts
readonly point: Vec2;

Where it landed

target ​

ts
readonly target: Entity;

Whom it is about to reach