Log inGet started
Package

Sprayers.module

Newest version

README.md

Sprayers — the crop dusters

Four aircraft work the farm and they go where the eating is. Each one reads the field ledger and claims the plot with the best combination of standing crop and heat — how hard that plot is being eaten right now — then sweeps it in lanes, turning outside the crop so every lane is covered end to end. Settle on one field and you heat it; heat it enough and an aeroplane comes for it. That is the round's risk and reward in one mechanic: the ground worth eating is the ground with a duster over it.

The spray is a trail, not a bubble: a plume hanging behind and below the aircraft out to C.SPRAY_TRAIL metres, C.SPRAY_RADIUS wide. It exists only while the duster is actually over crop, and it cannot reach a swarm above C.SPRAY_CEILING — climbing is always the answer, it just costs you the feed.

local spr = Locust.systems.sprayers        -- always guard for nil
spr.exposure(x, z, y, cloudRadius) -> 0..1  -- how deep in spray a swarm is
spr.threatNear(x, z, r) -> boolean          -- is a live plume within r metres

exposure takes the swarm's own radius because a cloud is a body, not a point: a plume that clips its edge takes part of it, and a bigger swarm is a bigger target. Rules applies the loss to the player (and fires "sprayed"); this module applies it to the rivals, so a duster is a hazard on the board rather than a hazard aimed at one player.

Locust.state.sprayers[i] carries x y z heading spraying field for anyone who wants to draw or listen to them.