BeforeEffect beta
Interface of @v12-engine/engine
export interface BeforeEffectAn 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
readonly ability: AbilityDef;The ability the effect belongs to
cancel
cancel(): void;It does not reach this target
cancelled
cancelled: boolean;Whether a handler has called it off for this target; set by cancel()
caster
readonly caster: Entity;Whose the effect is
effect
readonly effect: EffectDef;The effect, as it runs (a chain lowered: lowerChain)
level
readonly level: number;The level it was cast at
missile
readonly missile?: Missile;The missile that reached the target, for a missile's hit
origin
readonly origin?: Entity | Vec2;What it went off from, when not the caster (EffectContext.origin)
point
readonly point: Vec2;Where it landed
target
readonly target: Entity;Whom it is about to reach