EffectFields beta
Interface of @v12-engine/engine
export interface EffectFieldsThe fields the engine's effects read, by name: each type of effect has those of them it reads (EffectTypes, a Pick of these), and a game's own type picks of them or says its own
Members
ability
ability?: string;For refresh: the ability that is ready again, when it is not the one the effect belongs to. For grantAbility and swapAbility, in a game with the ability changes pack (abilityChangesPack): the ability given
amount
amount?: EffectValue;How much: of damage, healing, mana, a shield (buff). A number, one per level, or code asked for each target (EffectValue); with what the caster's stats add (scaling) and the formulas of damage, heal and buff (byMaxHealth, byCurrentHealth, byMissingHealth, byStacks, byDistance, targetScaling) on top
arc
arc?: {
height: number;
time?: number;
};For missiles: thrown, not shot. It goes height up in the middle of its way and comes down at its end, time seconds after it set off however far that is (speed otherwise). It flies over everything, and what is within its radius where it comes down is what it hits
as
as?: 'themselves';For raiseDead: the corpses rise as what they were, the caster's (Animate Dead), rather than as its unit
atLevel
atLevel?: number;For grantAbility and swapAbility, in a game with the ability changes pack: the level it is given at: the level of what it takes the place of, or the effect's own, when left out
attack
attack?: boolean;For onKill: only when it was an attack of the carrier that killed. For onDamaged: only when an attack hurt it
back
back?: MorphBack[];For morph: what turns the form back (MorphBack): the ability cast again, its duration up, its death. All three when left out (the ability only with toggle); without ability, the ability cast again in the form starts its time over
below
below?: number;For onLowHealth: the part of its max health (0.3: 30%) the carrier's health falls below for it to go off: once as it falls past it, not again until it is back above
blocked
blocked?: boolean;For missiles: buildings and trees in its way stop it, without anything happening to them
bounce
bounce?: {
count: Scaled;
range: number;
falloff?: number;
};For missiles: where it would be done (it reached its target, was used up by what it hit, came down, or came to the end of its way) it springs on to the nearest thing it may hit within range that it has not hit yet, and flies after that one, count times. Every spring takes falloff of the amounts off what it does (0.25: a quarter less each time). Its onEnd is where it is done for good
buff
buff?: string;Id of the buff to put on the targets
buy
buy?: string;For exchange: the resource the caster's owner trades for, by id
byCurrentHealth
byCurrentHealth?: Scaled;For damage, heal and a shield (buff): a part of the health the target has now, added for each it reaches
byDamage
byDamage?: Scaled;For damage, heal and a shield (buff) a trigger sets off: a part of the damage that set it off (EffectContext.damage), added (0.2: a fifth of it): Spiked Carapace's returned damage, a heal by what was taken
byDistance
byDistance?: {
per: number;
most?: number;
};For damage, heal and a shield (buff): the whole of it times 1 and per for every unit of distance from where it went off to the target (a missile's way, or from the caster or the origin), most times at the most: a javelin that hurts more the farther it flew
byMaxHealth
byMaxHealth?: Scaled;For damage, heal and a shield (buff): a part of the target's maximum health, added for each it reaches (0.08: 8% of its max health). Death and Decay, a % health nuke
byMissingHealth
byMissingHealth?: Scaled;For damage: a part of what the target has lost of its health, added to the amount for each it hits (0.1: a tenth of its missing health), worked out as it lands
byStacks
byStacks?: {
buff: string;
of?: 'target' | 'caster';
amount: Scaled;
};For damage, heal and a shield (buff): amount more for each stack of buff on the target (of: 'target', when left out) or the caster: Rend's spears, a passive's marks
caster
caster?: UnitCondition | UnitConditionCheck;For if: what must hold of the caster (UnitCondition, or code), for effects to happen rather than otherwise
climb
climb?: number;For a leap: how much higher than where it takes off the ground on its way may stand. What stands higher is a wall to it: it comes down in front of it. Over anything when left out
collide
collide?: EffectDef[];For dash and knockback, in a game with the moves pack (movesPack): what happens to each enemy of the caster the one moved meets on its way, once each, in the caster's name, the one met its target and the one moved where they go off from (EffectContext.origin): Lee Sin's Dragon's Rage (who the kicked one flies into is hurt and thrown up), Rammus's Powerball
consumes
consumes?: boolean;For onHit: the attack that sets it off uses up one of whileBuff's stacks, the buff for its last (or one that does not count them): "the next attack" of Power Fist, Siphoning Strike, Nether Blade, Flurry's two. Used up by the attack that kills too, after what the kill sets off (onKill still sees it)
cooldown
cooldown?: Scaled;For the triggers of a passive (onHit, onKill, onCast, onDamaged, onAbilityHit, onLowHealth): seconds before it can go off again once it did, kept on the ability's own cooldown (AbilityState.cooldown, shown on its button) for an ability, on the carrier for an item's or a buff's. Every time when left out
count
count?: Scaled;For missiles: how many are sent, spread over an angle in radians. What one of them hit the others pass by
damageType
damageType?: DamageType;For damage. Magic when left out
data
data?: Record<string, unknown>;For spawn: components it starts with, by id, in the form a save keeps them in
delay
delay?: Scaled;For missiles: seconds they take shape where they were cast before they set off. The caster is free to go
direction
direction?: KnockbackDirection;For knockback, in a game with the moves pack (movesPack): which way it throws (KnockbackDirection): away from where the effects go off from (the caster, or the context's origin: what it always did), aim the way the ability was aimed (Thresh's Flay, Vayne's Condemn, Poppy's charge), over the caster to land distance beyond it on its other side (Singed's Fling: give it a leap), or towards it, to its edge at the most (a yank)
distance
distance?: Scaled;For missiles: how far they fly, in cells
duration
duration?: EffectValue;Seconds the buff lasts, when that is different from its usual duration. In code (EffectValue), asked for each target
edge
edge?: EffectDef[];For zone: what happens to each who crosses its edge, in or out, once it is laid (Veigar's Event Horizon, Thresh's Box): those inside as it is laid have not crossed it
effects
effects?: EffectDef[];What happens to what is hit. For missiles: everything they pass through. For onHit: the target of an attack. For dash: what is around where it ends. For pull: what was pulled, as it arrives. For after: what is there when the time is up. For zone: what is inside, over and over
every
every?: number;For onHit: only every so many of the carrier's attacks that land (while it carries whileBuff, where it says), counted on the carrier and saved with it: Jhin's fourth shot, a third strike. Every attack when left out
falloff
falloff?: number;For missiles that go through what they hit (pierce): what part of the amounts each one it went through takes off the next (0.3: a third less on the second, less again on the third). Read by damage, heal and mana (share)
follow
follow?: 'caster' | 'target';For zone: goes with a unit, the caster or the target, and faces the way it does; it ends (with its onEnd) when that one dies or leaves the world
from
from?: string;For swapAbility, in a game with the ability changes pack: the caster's ability that gives way, the one the effect belongs to when left out
health
health?: number;For onFatal: the share of its max health the carrier is left with, rather than dying: all of it when left out
hitsOnReturn
hitsOnReturn?: boolean;For missiles that come back (returns): on the way back they hit what they pass through again, each once more (Ahri's Orb of Deception); the caster's place is still where it ends
homing
homing?: boolean;For missiles: flies after the unit the ability was cast on, and only hits that one
how
how?: string;For damage: how what it kills dies, for the screen, over the ability's own how
impact
impact?: string;For after: the name its arrival goes by for whoever draws it and plays its sound, where one ability sets off several that do not look alike: the last of a barrage. The ability's own when left out
into
into?: string;For morph: the unit type the caster turns into where it stands, a hero's form (HeroDef.forms)
leap
leap?: number;For dash: how high the caster rises on the way, which makes it a leap. For whoever draws it
line
line?: SpawnLine;For spawn, in a game with the ground objects pack (groundObjectsPack): so many along a line (SpawnLine), buildings one to a cell: Anivia's Crystallize (across), Taliyah's Weaver's Wall, Yasuo's Wind Wall, Bard's portals (two: one where he stands, one where he aimed)
looksLike
looksLike?: 'target' | 'caster';For spawn: drawn as the target or the caster is (its model, its owner's colour, its size), while it stays what its own type is
melee
melee?: boolean;For onDamaged: only for an attack that hits from up close (one with no missile: AttackDef.projectileSpeed left out): Thorns Aura, Spiked Carapace
onEnd
onEnd?: EffectDef[];For missiles that were not stopped, and for zones: what happens where and when they end
onEnter
onEnter?: EffectDef[];For zone: what happens to each who comes into it (its own radius or shape, as affects says), those inside as it is laid included. Each in it is seen to every round of the world, not four times a second
onLeave
onLeave?: EffectDef[];For zone: what happens to each who goes out of it, alive
onWall
onWall?: EffectDef[];For missiles: what happens where it meets a wall (ground it cannot cross, a cliff above where it set off, the edge of the play area, a building or a tree): it stops there, and these go off there, to the last one it hit where there is one (Bard's Cosmic Binding). For dash and knockback, in a game with the moves pack (movesPack): the one moved stops at such a wall (what flies meets none), and these go off there in the caster's name, to the one moved (Vayne's Condemn, Poppy's Heroic Charge)
otherwise
otherwise?: EffectDef[];For charged: what happens when the ability is not charged. For if: what happens when its conditions do not hold
owner
owner?: 'neutral';For spawn: whose it is: the caster's when left out, or the neutral player's (a soul nobody owns)
pick
pick?: 'ultimate' | 'first' | 'random';For stealAbility, in a game with the ability changes pack: which of the target's abilities it takes: its ultimate (when left out), its first, or one at random (world.rng)
pierce
pierce?: boolean | number;For missiles: goes on after it hit something. False for the ones that are used up by the first thing in their way; a number for those that go through so many and are used up by the next (1: Lux's Light Binding, two at the most)
pool
pool?: string;For gain, in a game with the resources pack (resourcesPack): which of the pools (UnitTypeDef.pools) of what it reaches it fills (or empties, with an amount under 0)
priority
priority?: number;For onHit with a slot: which of those sharing it goes off, the highest first (0 when left out); the first of the carrier's abilities, then items, then buffs among equals
rate
rate?: number;For exchange: how much of buy comes for each one of sell (0.5: 100 lumber for 50 gold)
returns
returns?: boolean;For missiles: once done (it hit what used it up or what it flew after, came to the end of its way, or came down) it flies back to the caster, after it wherever it goes, and touches nobody on the way; its onEnd happens where the caster is when it gets there, not where it turned. Gone, with nothing more, if the caster is
rider
rider?: 'caster' | 'target';For attach, in a game with the moves pack: who is put on whom: the caster on the unit it was cast on (Yuumi's You and Me!, when left out) or that unit on the caster (Kalista's Fate's Call)
ring
ring?: {
count: number;
radius: number;
};For spawn, in a game with the ground objects pack: count round a circle of radius about where it landed, the first the way it was aimed: Jarvan's Cataclysm
scaling
scaling?: Scaling;What the stats of the caster add to the amount: { abilityPower: 0.6 } adds 60% of its ability power. level is for every level of the hero past the first
seconds
seconds?: Scaled;For pull: how long the drag takes, from where the target is to where it ends. Its speed is set by it as it starts: a caster that walks off makes it take longer
seek
seek?: number;For missiles: they find their own targets: while one flies with nobody to go after, it turns after the nearest it may hit within this far of it and flies after that one (Fox-Fire, Dance of Arrows); another, if that one is gone first
sell
sell?: string;For exchange: the resource the caster's owner trades away, by id
sight
sight?: number;For missiles: how far the team of the caster sees around it
slot
slot?: string;For onHit: the slot it takes among what the carrier's attacks set off (its attack modifiers: an orb, a poison, a frost), from its abilities, items and buffs alike. Of those that share a slot only one goes off, the one of the highest priority; those of different slots, and those of none, all add up (RuleSettings.combat.attackModifiers)
speed
speed?: number;For missiles: how fast they travel, in units per second, and how far
split
split?: EffectDef[];For missiles: what goes off from where it is, the way it flew, once it is done (it hit what used it up, reached whom it flew after, or came to the end of its way) or is split by the game (splitMissile): missiles in it fly on from there at their own spread (Vel'Koz's Plasma Fission: two at a half turn's spread, a quarter either side)
spread
spread?: number;For missiles: the angle, in radians, the missiles are spread over
stack
stack?: boolean;For buff: adds one to how many of it the target carries instead of renewing it, up to what the buff allows
stacks
stacks?: Scaled;For removeBuff: how many stacks of buff come off: all of it when left out, the buff itself once none is left
steer
steer?: {
rate?: number;
};For missiles: turned by their owner as they fly, towards the point the steer command gives (steerMissile), at most rate radians a second (π when left out): Yuumi's Prowling Projectile, Viktor's storm
stops
stops?: boolean;For dash and knockback with collide: the one moved stops at the first one it meets
target
target?: UnitCondition | UnitConditionCheck;For if: what must hold of the target (UnitCondition, or code): the unit it was cast on, or each one within its radius or shape, where it has one. With no target there, it does not hold
targetScaling
targetScaling?: Partial<Record<StatKey, Scaled>>;For damage, heal and a shield (buff): parts of the target's stats added ({ armor: 1 }: as much as its armor; { health: 0.05 }: 5% of its max health), as scaling adds the caster's
through
through?: number;For a dash to a unit (to: 'target'), in a game with the moves pack: it goes on through the unit, this far past its middle, along the way from where the caster set off (Yasuo's Sweeping Blade); the place is fixed as it sets off
to
to?: 'home' | 'point' | 'target';For teleport: where to, however far: the caster's side's home (homeOf), where it was aimed, or by its target. For dash, in a game with the moves pack (movesPack): target rushes to the unit it was cast on, after it as it moves, to its edge (or through it); its effects happen to it there
toggle
toggle?: boolean;For morph: the form lasts until the ability is cast again in it, which turns it back (a toggle); with a duration too, until whichever comes first
toPoint
toPoint?: boolean;For missiles: flies to the spot the ability was aimed at and stops there, distance away at the most. For pull: drags to where the effect landed (a zone's middle, the spot of an after) rather than to the caster
unit
unit?: string;Unit type, for effects that bring one into the world
uses
uses?: number;For grantAbility, swapAbility and stealAbility, in a game with the ability changes pack: casts of it before it is gone (and what it took the place of is back): one for a stolen one when left out, for ever otherwise
whileBuff
whileBuff?: string;For onHit and onKill: only while the carrier carries this buff