Skip to content

Crowd control ​

Stuns, roots, silences, fears, charms, taunts and the like are buffs with a flag. Put them on with the buff effect.

Quick start ​

ts
import type { AbilityDef, BuffDef } from '@v12-engine/engine'

export const stunned: BuffDef = { id: 'stunned', name: 'Stunned', harmful: true, duration: 2, stun: true }

export const thunderBolt: AbilityDef = {
	id: 'thunderBolt',
	name: 'Thunder Bolt',
	target: 'unit',
	targets: { enemies: true },
	range: 6,
	cooldown: 9,
	effects: [
		{ type: 'damage', amount: 100 },
		{ type: 'buff', buff: 'stunned' }
	]
}

The target takes 100 damage and can't act for 2 seconds. What it was told to do waits and resumes after.

Common tasks ​

Root, silence, disarm ​

ts
import type { BuffDef } from '@v12-engine/engine'

const entangle: BuffDef = { id: 'entangle', name: 'Entangle', harmful: true, duration: 3, root: true } // can't move; still attacks and casts
const silenced: BuffDef = { id: 'silenced', name: 'Silence', harmful: true, duration: 3, silence: true } // can't cast
const disarmed: BuffDef = { id: 'disarmed', name: 'Disarm', harmful: true, duration: 3, disarm: true } // can't attack

silence can also be a function that picks which abilities it blocks: (ability) => ability.tags?.includes('fire') ?? false.

Knock up or knock down ​

airborne is a stun that throws the unit in the air; down lays it on the ground. Both are stuns with a look.

ts
import type { BuffDef } from '@v12-engine/engine'

const knockedUp: BuffDef = { id: 'knockedUp', name: 'Airborne', harmful: true, duration: 1, stun: true, airborne: true }

Fear, charm or taunt ​

control takes the unit's orders while it lasts. fear walks it away from who put it on, charm toward them, taunt makes it attack them.

ts
import type { BuffDef } from '@v12-engine/engine'

const terrify: BuffDef = { id: 'terrify', name: 'Terrify', harmful: true, duration: 1.5, control: 'fear' }
const charmed: BuffDef = { id: 'charmed', name: 'Charm', harmful: true, duration: 1.5, control: 'charm' }
const taunted: BuffDef = { id: 'taunted', name: 'Frenzying Taunt', harmful: true, duration: 2.5, control: 'taunt' }

A control in code steers the unit itself every tick: control: (world, carrier, instance, dt, source) => { /* moveTo, engage… */ }.

Sleep, polymorph ​

Sleep is a stun that breaks on damage. A polymorph is a disarm, a silence and a slow, drawn as another unit type.

ts
import type { BuffDef } from '@v12-engine/engine'

const sleep: BuffDef = { id: 'sleep', name: 'Sleep', harmful: true, duration: 6, stun: true, breaksOn: ['damage'] }
const hex: BuffDef = { id: 'hex', name: 'Hex', harmful: true, duration: 4, disarm: true, silence: true, percent: { moveSpeed: -0.3 } }

Draw hex as a sheep with drawnAs: 'sheep' on its look (Ability visuals).

Suppress, ground, unstoppable ​

ts
import type { BuffDef } from '@v12-engine/engine'

// like a stun, but tenacity doesn't shorten it and cleanse doesn't remove it
const netherGrasp: BuffDef = { id: 'netherGrasp', name: 'Nether Grasp', harmful: true, duration: 2.5, suppress: true }
// can't dash or blink
const adhesive: BuffDef = { id: 'adhesive', name: 'Mega Adhesive', harmful: true, duration: 2, grounded: true }
// immune to every hold, knockback and pull; slows still slow
const ragnarok: BuffDef = { id: 'ragnarok', name: 'Ragnarok', duration: 6, unstoppable: true, percent: { attackSpeed: 0.5 } }

Cleanse ​

cleanse takes off stuns, roots, silences, disarms, controls and slows. It reaches allies when affects is left out. It doesn't remove a suppression or a knock-up.

ts
import type { AbilityDef } from '@v12-engine/engine'

const scurvy: AbilityDef = { id: 'removeScurvy', name: 'Remove Scurvy', target: 'none', effects: [{ type: 'cleanse', on: 'caster' }] }

dispel takes off any buff whose dispellable allows it, and hurts summons by amount.

Bring a flyer down ​

grounds: true makes a flying unit count as on the ground for whatever is aimed at it.

Walk through units ​

ts
import type { BuffDef } from '@v12-engine/engine'

const ghost: BuffDef = { id: 'ghost', name: 'Ghost', duration: 10, phasing: true, percent: { moveSpeed: 0.3 } }

phasing: the carrier walks through other units, and they through it; neither steers round nor pushes the other. Walls, cliffs, buildings and trees still stop it. A function (world, carrier, instance) => boolean says so for one moment. isPhasing(world, entity) reads it. Phantom Stride and Shadowveil use it.

Reference ​

FlagWhat it does
stunCan't act: no moving, attacking or casting. Orders wait; a channel breaks
airborneThrown up: a stun with a look
downKnocked down: lies on the ground, gets up at the end
rootCan't move; still attacks and casts
silenceCan't cast (or a function: which abilities it blocks). Items and hero spells still work
disarmDoesn't attack
controlfear, charm, taunt, or a BuffControl function run every tick
suppressHeld like a stun; tenacity doesn't shorten it, cleanse doesn't remove it
groundedCan't dash or blink of its own: such an ability is refused ("Grounded")
groundsA flyer counts as on the ground
unstoppableNothing that holds a unit up affects it, and it isn't thrown or pulled; slows still slow
phasingWalks through units and they through it; walls and buildings still stop it
breaksOndamage, attack, cast

Notes ​

  • Tenacity (mobaStatsPack) shortens harmful stuns and controls.
  • A controlled unit refuses every new order, the player's or anyone's, and doesn't autocast. The last control it got is the one it follows; a stun holds it still.
  • While controlled, a unit carries the controlled component (the buff and its source; saved, sent to everyone who sees it). controlOf and isControlled read it.
  • isCleansable says what cleanse takes off. holdsUp is the set unstoppable ignores.
  • The screen draws a mark over feared, charmed and taunted units; marker: false on the look hides it.