Summons and ground objects
Units an ability brings into the world: summons that fight beside you, wards, traps, walls, barrels, portals, and units you cast from (a shadow, a ball).
Quick start
import type { AbilityDef, UnitTypeDef } from '@v12-engine/engine'
export const waterElemental: UnitTypeDef = {
id: 'waterElemental',
name: 'Water Elemental',
kind: 'unit',
radius: 0.5,
stats: { health: 525, attackDamage: 20, attackSpeed: 1, attackRange: 3, moveSpeed: 3 },
sight: 8,
attacks: [{ damagePoint: 0.3, acquisitionRange: 6, projectileSpeed: 10 }]
}
export const summonWaterElemental: AbilityDef = {
id: 'summonWaterElemental',
name: 'Summon Water Elemental',
target: 'none',
manaCost: 125,
cooldown: 20,
effects: [{ type: 'summon', unit: 'waterElemental', lifetime: 60 }]
}An elemental appears beside the caster for 60 seconds. It follows its master, attacks whoever attacks the master, and dies with it.
Common tasks
Summon a pack that fights the nearest enemy
import type { EffectDef } from '@v12-engine/engine'
const voidSwarm: EffectDef = { type: 'summon', unit: 'voidling', count: 4, lifetime: 8, spread: 1.5, aggro: 'nearest' }follow: false leaves them where they appear. diesWithMaster: false keeps them after the master dies. The hero panel lists a hero's live summons with their time left.
Put down a ward
spawn puts a unit of the caster's at the spot. Give its type a lifetime, invisible and uses:
import type { AbilityDef, UnitTypeDef } from '@v12-engine/engine'
const sentryWard: UnitTypeDef = {
id: 'sentryWard',
name: 'Sentry Ward',
kind: 'unit',
radius: 0.3,
stats: { health: 1 },
sight: 10,
lifetime: 180,
invisible: { after: 1 },
uses: 2 // goes down after two hits, whatever they deal
}
const placeWard: AbilityDef = { id: 'placeWard', name: 'Sentry Ward', target: 'point', range: 5, effects: [{ type: 'spawn', unit: 'sentryWard' }] }Raise the dead
import type { EffectDef } from '@v12-engine/engine'
const raiseDead: EffectDef = { type: 'raiseDead', unit: 'skeleton', count: 2, duration: 40 }
// Animate Dead: anyone's dead, as what they were
const animateDead: EffectDef = { type: 'raiseDead', as: 'themselves', count: 6, duration: 40 }
// Resurrection: your side's dead, back as they were, for good
const resurrection: EffectDef = { type: 'revive', count: 6, radius: 9 }Make illusions
import type { EffectDef } from '@v12-engine/engine'
const mirrorImage: EffectDef = { type: 'illusion', count: 2, duration: 30, dealt: 0.33, taken: 2, on: 'caster' }Lay a trap
Ground objects need groundObjectsPack() in Rules.packs. A trigger on a unit type sets off an ability when an enemy comes near. Teemo's Noxious Trap:
import { type AbilityDef, groundObjectsPack, type UnitTypeDef } from '@v12-engine/engine'
const shroom: UnitTypeDef = {
id: 'shroom',
name: 'Noxious Trap',
kind: 'unit',
radius: 0.3,
stats: { health: 1 },
sight: 2,
invisible: { after: 1 },
trigger: { ability: 'shroomBurst', radius: 0.8, arm: 1 }
}
const noxiousTrap: AbilityDef = { id: 'noxiousTrap', name: 'Noxious Trap', target: 'point', range: 9, effects: [{ type: 'spawn', unit: 'shroom' }] }
const shroomBurst: AbilityDef = { id: 'shroomBurst', name: 'Shroom', target: 'none', effects: [{ type: 'damage', amount: 100, radius: 2 }] }
const rules = { /* … */ packs: [groundObjectsPack()] }Raise a wall
line lays several along the aim; across: true turns the line a quarter so it stands in front. Anivia's Crystallize:
import type { AbilityDef } from '@v12-engine/engine'
const crystallize: AbilityDef = {
id: 'crystallize',
name: 'Crystallize',
target: 'point',
range: 10,
effects: [{ type: 'spawn', unit: 'iceWall', duration: 5, line: { count: 5, length: 4, across: true } }]
}ring: { count, radius } lays them round a circle (Jarvan's Cataclysm).
Block missiles with a wall
blocksMissiles on the type eats enemy missiles that meet it. Yasuo's Wind Wall is a line of these:
import type { UnitTypeDef } from '@v12-engine/engine'
const windWallPiece: UnitTypeDef = {
id: 'windWallPiece',
name: 'Wind Wall',
kind: 'unit',
radius: 0.6,
stats: { health: 1 },
sight: 2,
invulnerable: true,
lifetime: 4,
blocksMissiles: 'enemies'
}Something allies click to use
use makes allies walk up to it and use it on right-click: the ability goes off in its maker's name. Thresh's lantern, a portal pair:
import type { UnitTypeDef } from '@v12-engine/engine'
const lantern: UnitTypeDef = {
id: 'lantern',
name: 'Dark Passage',
kind: 'unit',
radius: 0.3,
stats: { health: 1 },
sight: 3,
lifetime: 6,
use: { ability: 'lanternPull', range: 1.5, times: 1 }
}Barrels that chain explode
burst sets off an ability where it dies, and kills others of its type within chain, which burst in turn. Gangplank's Powder Keg (see the cookbook).
Cast from a unit you own
origin makes an effect go off from units of the caster's (a shadow, a ball, soldiers) while the caster still owns the damage. Zed's Razor Shuriken flies from him and each shadow:
import type { AbilityDef } from '@v12-engine/engine'
const razorShuriken: AbilityDef = {
id: 'razorShuriken',
name: 'Razor Shuriken',
target: 'point',
range: 9,
effects: [{ type: 'missile', speed: 17, distance: 9, pierce: true, origin: { proxy: 'shadow', pick: 'all', caster: true }, effects: [{ type: 'damage', amount: 80 }] }]
}Send the proxy somewhere
sendProxy moves the unit an effect goes off from to where it was aimed. Orianna's ball, thrown from wherever it is (from her if she has none):
import type { AbilityDef } from '@v12-engine/engine'
const commandAttack: AbilityDef = {
id: 'commandAttack',
name: 'Command: Attack',
target: 'point',
range: 8,
effects: [
{ type: 'missile', speed: 12, toPoint: true, pierce: true, origin: { proxy: 'ball', caster: 'otherwise' }, effects: [{ type: 'damage', amount: 60 }] },
{ type: 'sendProxy', speed: 12, origin: { proxy: 'ball' } }
]
}
// Azir's soldiers strike as he attacks: an onHit whose effects go off from them
const sandSoldiers: AbilityDef = {
id: 'sandSoldiers',
name: 'Sand Soldiers',
target: 'passive',
effects: [{ type: 'onHit', effects: [{ type: 'damage', amount: 25, shape: 'line', length: 4, origin: { proxy: 'soldier', pick: 'all', near: 3.5 } }] }]
}Reference
summon
| Field | Type | Default | What it does |
|---|---|---|---|
unit | string | Unit type | |
count | Scaled | 1 | How many |
lifetime | Scaled | for good | Seconds they stay |
spread | number | 1.5 | Cells around where it landed |
follow | boolean | true | Walks with its master when it has nothing to do |
aggro | nearest, mastersAttacker, none | mastersAttacker | Who it goes for |
diesWithMaster | boolean | true | Dies when the master dies |
spawn, raiseDead, revive, illusion
| Effect | Fields | What it does |
|---|---|---|
spawn | unit, duration, owner: 'neutral', looksLike, data, line, ring | Puts a unit of the caster's at the spot |
raiseDead | unit, count, duration, as: 'themselves' | Raises corpses around the spot |
revive | count (all), radius (6) | Your side's dead come back as they were |
illusion | count, duration, dealt (1/3), taken (2) | Copies of the target |
Unit type fields for placed things
| Field | What it does |
|---|---|
lifetime | Gone by itself after so many seconds |
invisible: { after } | Enemies can't see it after so many seconds, unless they detect it |
uses | Goes down after so many attacks or spells, whatever they deal |
trigger: { ability, radius, by, arm, times } (pack) | Goes off as one it is by (enemies, allies, all, maker) comes within radius; armed after arm seconds; gone after times (1; 0 for ever) |
use: { ability, by, range, times } (pack) | Allies (by default) right-click to walk up and use it; the point is the next one laid with it (a portal's other end) |
blocksMissiles: 'enemies' | 'all' (pack) | Missiles that meet it are gone; thrown ones fly over |
burst: { ability, chain } (pack) | Where it dies the ability goes off; its kind within chain die and burst too |
targetableBy | Only these abilities may target it |
origin (ProxyOrigin)
| Field | What it says |
|---|---|
proxy | The unit type of the caster's it goes off from |
pick | nearest to where it was aimed (default), all, newest, oldest |
caster | true: from the caster as well. 'otherwise': from the caster when none is picked |
range, near | Only those within this far of the caster, or of where it was aimed |
at: 'proxy' | Lands where each proxy stands, not where it was aimed |
target | The proxy is the effect's target too (Zed's swap) |
The caster's proxies are those of the type it put down (madeBy), or of one nobody put down, those of its owner.
In code
summonsOf(world, master) lists living summons (each with a summoned component: by, follow, aggro, diesWithMaster, at). useObject(world, user, object) uses a ground object. proxiesOf(context, origin) says which units an origin picks. A ground object's state is the groundObject component; who made it is madeBy. Both saved.
Notes
- With
aggro: 'mastersAttacker', the master being hurt sends every summon at the attacker at once (unless its player gave it an order), and the attacker scoresFOE_BONUSintargetScorefor 6 seconds. GameView.hud.summons: falsehides the summons on the hero panel.raiseDeadunits are summons too, and outlive whoever raised them.- A building laid by
linetakes a cell, one to a cell.