EffectContext beta
Interface of @v12-engine/engine
export interface EffectContextWhat an effect is run with: the world, the caster, the ability and its level, the target and where it landed
Members
ability
ability: AbilityDef;The definition of the ability being cast
caster
caster: Entity;The unit that cast the ability
charged
charged?: boolean;The ability went off charged, see charge on the ability
damage
damage?: number;For the effects of a trigger set off by damage (onDamaged, onAbilityHit, an onHit): the damage that did, after armor and shields, for the formula byDamage and a game's own amounts
distance
distance?: number;How far what carried the effect here has come, for what a missile does
heading
heading?: number;The way the effects face, for those with a shape (EffectCommon.shape): radians, as a unit's facing. From where they go off from to where they landed when left out (effectHeading): a zone keeps the way it was cast, or the way the unit it follows faces
held
held?: number;For an ability held to charge and let go (AbilityDef.hold): how full it was, 0 let go at once to 1 full. Its amounts are grown by it (HoldDef.scale); a game's own amounts read it. Carried by its missiles
interval
interval?: number;For an effect that is kept up all the time (a passive asked every round): the seconds since it was last asked. Something that works per second multiplies by this, rather than counting on how often it is asked
level
level: number;Level the ability was cast at
origin
origin?: Entity | Vec2;What the effects go off from, when not the caster: a unit of its (a ball, a shadow, a soldier) or a place. A missile starts there and aims from there, an area of the effects never takes it in, and the strike the screens hear says it came from there; the caster stays who does it (whose the damage and the kills are, whose stats scale it). The caster when left out (effectOrigin)
point
point: Vec2;Where the ability landed: the target, the chosen spot, or the caster
share
share?: number;What part of their amounts the effects come to (damage, heal, mana): less on every spring of a missile that bounces (EffectFields.bounce). All of it when left out; a game's own effect with an amount multiplies by it too
stacks
stacks?: number;How many of the buff that ran out there were, for what happens when it does
target
target?: Entity;The unit the ability was cast on, if any
world
world: World;The world the ability is cast in