Defenses
defensesReveals discovered hostiles and defensive structures with map positions, terrain, and walkability to inform tactical decisions.
Instructions
Where the threats are versus what you have to fight them with. Returns active hostiles the fort has DISCOVERED (same fog-of-war gate and same count as threats()' active_hostiles and military()'s hostiles_on_map — a unit standing on an undiscovered tile is never listed and never leaks its position or creature token) with map positions and their geometry to the fort core and to the nearest drawbridge (dist = 8-directional tile count (Chebyshev), dz = z-levels with + meaning above the threat, dir = compass bearing; the nearest bridge is chosen on 3D distance, so a bridge many z-levels away never wins on horizontal proximity alone), plus an inventory of controllable defensive structures (drawbridges with positions, levers, floodgates, hatches, cage traps, locked doors). Terrain-aware: each threat is classified inside/outside the fort's walled perimeter — "inside" means its tile shares a walkability group with your citizens, i.e. a hostile could walk to your population through connected open space without breaching a wall (walk_group 0 = no walkable footing, e.g. a flier over open air). A perimeter_terrain field reads the busiest citizen level via the terrain substrate: an ASCII tile grid (with legend) plus counts of walls, fortifications (with positions), and open-to-sky vs covered vs undiscovered tiles. Facts only — decide the tactics yourself, and use identify() for a creature's trait facts (e.g. cage traps do not hold a TRAPAVOID creature). Caveats: inside/outside is walking connectivity, so a FLIER or BUILDING_DESTROYER can reach you while reported "outside" — cross-reference its traits. perimeter_terrain is a single z-level and does not synthesize a multi-z approach vector; undiscovered tiles are fog of war ("?") and never leak their real type. Which lever raises which bridge is not recorded in the raws, so bridges and levers are reported separately, not linked. Returns {"error":"no fort loaded"} if no fort is active.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||