Burn grass with an ability
Give the ability a foliage effect with act: 'ignite'. The grass where it lands catches, set alight by the caster, so any fire damage is dealt by them.
ts
// in src/rules.ts
import type { AbilityDef } from '@v12-engine/engine'
export const fireArrow: AbilityDef = {
id: 'fireArrow',
name: 'Fire Arrow',
target: 'point',
range: 9,
cooldown: 12,
effects: [{ type: 'foliage', act: 'ignite', radius: 1.5 }]
}Done: cast it on dry grass and a circle of radius 1.5 cells, about three cells across, catches, then spreads as the grass's rules say. The game needs foliagePack and a flammable style (Set grass on fire).
A fireball that burns grass and trees
One ability can burn the grass and what stands in it, and deal damage too:
ts
import type { AbilityDef } from '@v12-engine/engine'
export const fireball: AbilityDef = {
id: 'fireball',
name: 'Fireball',
target: 'point',
range: 10,
cooldown: 20,
effects: [
{ type: 'damage', amount: 120, radius: 2.5 },
{ type: 'foliage', act: 'ignite', radius: 2.5 },
{ type: 'burn', act: 'light', radius: 2.5 } // trees and huts, with `burningPack`
]
}Other things an ability can do to grass
ts
import type { AbilityDef } from '@v12-engine/engine'
export const scythe: AbilityDef = { id: 'scythe', name: 'Scythe', target: 'point', range: 3, effects: [{ type: 'foliage', act: 'ruin', how: 'cut', radius: 2 }] }
export const quake: AbilityDef = { id: 'quake', name: 'Quake', target: 'point', range: 8, effects: [{ type: 'foliage', act: 'ruin', how: 'crush', radius: 4 }] }
export const bloom: AbilityDef = { id: 'bloom', name: 'Bloom', target: 'point', range: 8, effects: [{ type: 'foliage', act: 'regrow', over: 6, radius: 5 }] }
export const scour: AbilityDef = { id: 'scour', name: 'Scour', target: 'point', range: 6, effects: [{ type: 'foliage', act: 'clear', radius: 2, layer: 'grass' }] }In the editor
- Open the Data panel and pick the ability.
- Under its effects, Add… a row, pick the type foliage, then set act, layer, how, over and the radius.
Reference
| Field | What it does |
|---|---|
act | ignite, extinguish, ruin, regrow or clear |
layer | The layer it acts on; every layer of the pack when left out |
how | For ruin: cut (the default), crush or scorch |
over | For regrow: the seconds it takes to grow back; at once when left out |
radius, shape | The area; just the cell it landed on when it has neither |
The caster is by for each act: foliageIgnited, foliageRuined and foliageRegrown name them, and fire damage is dealt by them. See Effects: every type.