Skip to content

foliagePack beta ​

Function of @v12-engine/engine

ts
export declare function foliagePack(options: FoliageOptions): GamePack;

Grass and bushes in the rules, on a layer of cells whose values are styles (CellLayerValue.foliage, FoliageStyleDef): the styles that conceal hide who stands in them (as concealmentPack, patch by patch, while they stand whole), a style may slow or stop one on foot, be crushed under who walks over it, be ruined and grow back, catch fire and pass it on (FoliageFire). What happened to each cell is kept in the layer's state layer (foliageStateLayer). One a game:

export const rules = ...myGame, packs: [foliagePack( layer: 'grass', fire: damage: 8 )]

A layer of the pack is not given to concealmentPack too: the pack hides in it by itself. Its styles are read from the game's layers as laid (foliageStyle: the code, the game's data.json, the map's definitions), so a style the editor made hides and slows as one of the code's. What it does today: hiding by style and state, a style's speed and walkable, trampling (trample: 'crush', by who tramples says), fire (ignite, FoliageFire) with firebreak, extinguish and stopFire, ruin (ruin) and growing back (regrow, by itself where a style regrows), and the foliage ability effect