EffectCommon beta
Interface of @v12-engine/engine
export interface EffectCommonWhat every effect may say, whatever its type: who of what it reaches it applies to (effectTargets)
Members
affects
affects?: 'enemies' | 'allies' | 'all';Who an effect with a radius applies to. Follows from the kind of effect when left out
angle
angle?: EffectValue;Of a cone and an arc: how wide it opens, in radians
chance
chance?: EffectValue;It happens by chance: this share of the times it would (0.25 one in four), drawn from the world's numbers (world.rng), so the same every run. Once each time its list runs, for all it reaches; for a trigger (onHit, onDamaged…), each time it would go off (Bash), its cooldown starting only when it does; for an if, a condition like its others, drawn for each it asks of (and otherwise when the draw fails). A number, one per level, or code (EffectValue) asked with the target
ifBuff
ifBuff?: string;Only hits what carries this buff
kinds
kinds?: EntityKind[];Only hits these kinds of things. Everything but resources when left out
layers
layers?: Layer[];Where what it hits has to be: on the ground, in the air. Both when left out
length
length?: EffectValue;Of a cone, a line, a rect and a cross: how long it is, end to end. In code (EffectValue), asked as it lands
limit
limit?: Scaled;Of what its area reaches, at most this many, the first by sort: a number, or one per level. sort: 'lowestHealthShare', limit: 3 heals the three most hurt; sort: 'random', limit: 1 strikes one of them. Chosen before the game has its say (beforeEffect): a spell shield on one chosen takes the blow
look
look?: string;Which look of its ability the screen draws it with (AbilityLook.effects in the client: by this name, else by its place in the ability or its type). Nothing to the rules: the same game with another look
on
on?: 'caster';Applies to the caster, wherever the ability was aimed
only
only?: 'heroes';Only hits heroes
origin
origin?: ProxyOrigin;Goes off from units of the caster's of a type (ProxyOrigin), not from the caster: once from each it picks, that one the context's origin (a missile starts there, an area never takes it in, the strike says it came from there), the caster still who does it (whose the damage, the kills and the scaling are). Zed's shadows, Orianna's ball, Syndra's spheres, Azir's soldiers. Nothing where none is picked, unless caster says otherwise
radius
radius?: EffectValue;Makes the effect hit everything around the point of impact. Required for auras, and the size of a missile. In code (EffectValue), asked as it lands with no target
shape
shape?: EffectShape;What ground it covers (EffectShape), turned the way the ability was aimed: circle (its radius, what an effect with a radius alone covers), cone (length, angle), line (length, width), rect (length, width), ring (radius, width), arc (radius, angle, width), cross (length, width). A circle, a ring, a rectangle and a cross lie around where it landed; a cone, a line and an arc go off from the caster (or the context's origin) the way of where it landed. Everything in it, as affects says, is hit (effectArea, inArea). Of a zone: what is inside it, for onEnter, onLeave and edge
sort
sort?: TargetOrder | ((a: Entity, b: Entity) => number);Of what its area reaches, the order it goes to them in (TargetOrder), or a comparison: the first limit of it are hit. The nearest to the middle of its area (where it landed, or the caster for a cone, a line and an arc) when left out with a limit
tags
tags?: string[];Only hits what has one of these tags of its type (UnitTypeDef.tags): ['undead']. Everything when left out
when
when?: EffectMoment;When it happens, in a chain (EffectMoment): not now, but as the nearest effect before it in its list that comes to that moment gets there: hit a missile's every hit, arrived a pull's target arriving, landed a dash's end, end a missile's or zone's end. [missile, { type: 'damage', when: 'hit' }] is [{ ...missile, effects: [damage] }]: what waits goes into what it waits on (lowerChain), so one waiting on what waits itself happens later still. One with nothing before it to wait on never happens (checkRules says so)
where
where?: UnitCondition | UnitConditionCheck;Only hits what this says of it (UnitCondition: a buff or none, health under or over a share, a hero, tags, enemy or ally of the caster), or code (UnitConditionCheck, asked with the target): healthBelow: 0.5, notTags: ['mechanical'] . Of an effect with an area, asked of each in it; of one without, of its target
width
width?: EffectValue;Of a line, a rect and a cross: how far it covers on either side of its middle; of a ring and an arc, how thick it is, inwards from its radius. 1 when left out