Vision and stealth
Reveal a spot or a unit, make a unit invisible or camouflaged, and find what hides.
Quick start
import type { AbilityDef } from '@v12-engine/engine'
const farSight: AbilityDef = {
id: 'farSight',
name: 'Far Sight',
target: 'point',
range: 99,
manaCost: 50,
effects: [{ type: 'reveal', radius: 8, duration: 8 }]
}The caster's team sees an 8-cell circle anywhere on the map for 8 seconds. Every player sees it happen.
Common tasks
Go invisible
import type { BuffDef } from '@v12-engine/engine'
const windWalk: BuffDef = { id: 'windWalk', name: 'Wind Walk', duration: 20, invisible: true, breaksOn: ['attack', 'cast'], percent: { moveSpeed: 0.3 } }A unit type can be invisible too: invisible: { after: 1 } (a ward, a trap).
Find invisible enemies
detect finds invisible enemies around the spot for duration seconds.
import type { EffectDef } from '@v12-engine/engine'
const dust: EffectDef = { type: 'detect', radius: 9, duration: 12 }Mark a unit so your team sees it everywhere
The rest needs visionPack() in Rules.packs. A buff with revealed shows its carrier to the team of whoever put it on, through fog, bushes and invisibility.
import { type AbilityDef, type BuffDef, visionPack } from '@v12-engine/engine'
const hunted: BuffDef = { id: 'hunted', name: 'Mark of the Kindred', harmful: true, duration: 8, revealed: true }
// reveals every enemy within 25 for 4 seconds, wherever they go
const thrill: AbilityDef = { id: 'thrill', name: 'Thrill of the Hunt', target: 'none', effects: [{ type: 'revealUnit', radius: 25, duration: 4 }] }
const rules = { /* … */ packs: [visionPack()] }Camouflage: seen only up close
Enemies see a camouflaged unit only with a unit of theirs within camouflage cells, or for 2 seconds after it hits them.
import type { BuffDef } from '@v12-engine/engine'
const ghostwater: BuffDef = { id: 'ghostwater', name: 'Ghostwater Dive', duration: 5, camouflage: 4 }Hide in tall grass
A style of grass with conceals hides who stands in it from teams with nobody in the same patch: see Hide units in tall grass.
True sight
trueSight on a unit type or buff finds invisible and camouflaged enemies within that range, for as long as they stay near.
import type { BuffDef } from '@v12-engine/engine'
const oracleLens: BuffDef = { id: 'oracleLens', name: 'Oracle Lens', duration: 10, trueSight: 9 }Reference
| Field or effect | Pack | What it does |
|---|---|---|
reveal effect | The team sees a spot: radius, duration | |
detect effect | Finds invisible enemies around the spot: radius, duration (how long they stay seen) | |
buff invisible | Unseen by enemies unless detected; true or a function | |
unit invisible: { after } | Unseen after so many seconds | |
buff revealed | vision | Seen by the team of who put it on, wherever it stands |
revealUnit effect | vision | The team sees each unit reached for duration (4) seconds, wherever it goes |
buff camouflage | vision | Seen only from within this many cells; a number or function |
trueSight | vision | Unit type or buff: finds invisible and camouflaged enemies within this range |
Notes
- What is revealed or found is the
detectioncomponent (saved). Everything that asks what a team sees goes by it:world.isVisibleTo, what units pick, what commands a player may give, computer players and snapshots. - The fog is lit where a revealed unit stands, so the player sees it and the ground under it, nothing more.
- A camouflaged unit's own side sees it faded, as with invisibility (
unseen). - In code:
revealUnit(world, entity, team, seconds),camouflageOf. checkRuleswarns ofrevealed,camouflageandtrueSightin a game without the pack.