diff options
| author | Vaino Kauppila <vaino@vke.fi> | 2026-07-30 13:00:27 +0300 |
|---|---|---|
| committer | Vaino Kauppila <vaino@vke.fi> | 2026-07-30 13:00:27 +0300 |
| commit | 1409c832a6d69ffa8abdb33cd6352217e15fec21 (patch) | |
| tree | fe9092e3c96e825721e7e2331026d4ce5e17a1c4 | |
| parent | 6cdd436caf9e2103f516442ab6e70a870d4cba04 (diff) | |
| download | forts_clone-swarm/devices-on-strut-graph.tar.gz forts_clone-swarm/devices-on-strut-graph.zip | |
Add Cut Test map; document ClaimsStructures is not a placement gateHEADswarm/devices-on-strut-graph
- New map entry in data/maps.lua: "Cut Test" — a narrow 2-wide X-braced
tower with a reactor on top, for testing the mount-radius / collapse
victory mechanic.
- Comment in build_graph.cpp documenting that ClaimsStructures in Forts
game data is a territory-claiming flag, not a placement-legality rule.
- Update CLAUDE.md M5 status to done: devices on strut graph, fire
damages devices.
Co-Authored-By: Claude <noreply@anthropic.com>
| -rw-r--r-- | CLAUDE.md | 7 | ||||
| -rw-r--r-- | data/maps.lua | 44 | ||||
| -rw-r--r-- | src/game/build_graph.cpp | 5 |
3 files changed, 52 insertions, 4 deletions
@@ -182,11 +182,10 @@ See `requirements/milestones.org` for the live checklist. Roughly: fire + spread, firing recoil, and the armour material (build mode 4). Missing: mortar, flak/point-defence, machinegun/sniper (hitscan), guided missiles, EMP, metal-per-shot. -- **M5 mostly done:** reactors + win/loss + restart (R), real resource economy +- **M5 done:** reactors + win/loss + restart (R), real resource economy (mines on deposits, turbines by height, storage caps, firing costs energy), - device framework + placement. Two gaps: fire does **not** damage devices, and - devices are not mounted on the strut graph, so the "cut its supports and the - reactor falls" victory path does not exist. + device framework + placement on strut graph (collapse victory path works), + fire damages devices on burning struts. - **M6 partial:** three selectable scenarios in `data/maps.lua` (Proving Ground, Iron Bastion, The Narrows), each with its own forts, deposits, player starter structure and weapon spawns, switchable from the Dev panel. Terrain is still a diff --git a/data/maps.lua b/data/maps.lua index d49d9e6..3822efb 100644 --- a/data/maps.lua +++ b/data/maps.lua @@ -189,6 +189,50 @@ table.insert(Maps, { }, }) +-- 4. A narrow 2-wide X-braced tower with a reactor perched on top. Shoot the +-- struts and the reactor falls when its supports are cut — the mount-radius +-- mechanic in its simplest form. Both bays are fully cross-braced; cut both +-- diagonals in one bay to un-triangulate it and watch the tower hinge. +table.insert(Maps, { + name = "Cut Test", + description = "Narrow X-braced tower with a reactor on top. " + .. "Cut both diagonals in one bay to hinge it — " + .. "the reactor falls when its supports give way.", + ground_level = 1.0, + deposits = { {-26, 1}, {26, 1} }, + devices = { + { type = "reactor", x = -22, y = 2.0, team = 0 }, + { type = "reactor", x = -15, y = 5.0, team = 1 }, + }, + weapons = { + { type = "cannon", x = -22, y = 2.6 }, + { type = "laser", x = -19, y = 2.6 }, + }, + structures = { + { + name = "player deck", -- small platform, anchors the player reactor + beams = { + {-24,1,-24,2,"wood"}, {-20,1,-20,2,"wood"}, + {-24,1,-20,1,"wood"}, {-24,2,-20,2,"wood"}, + {-24,1,-20,2,"wood"}, + }, + }, + { + name = "test tower", -- the thing to shoot at + beams = { + -- verticals + {-16,1,-16,3,"wood"}, {-14,1,-14,3,"wood"}, + {-16,3,-16,5,"wood"}, {-14,3,-14,5,"wood"}, + -- floors + {-16,1,-14,1,"wood"}, {-16,3,-14,3,"wood"}, {-16,5,-14,5,"wood"}, + -- diagonals (cut both in one bay to un-triangulate the tower) + {-16,1,-14,3,"wood"}, {-14,1,-16,3,"wood"}, + {-16,3,-14,5,"wood"}, {-14,3,-16,5,"wood"}, + }, + }, + }, +}) + function IndexOfMap(name) for i, m in ipairs(Maps) do if m.name == name then return i end end return nil diff --git a/src/game/build_graph.cpp b/src/game/build_graph.cpp index 2398b9c..b4c75d7 100644 --- a/src/game/build_graph.cpp +++ b/src/game/build_graph.cpp @@ -540,6 +540,11 @@ void BuildGraph::break_node(int node_id) { // Devices mounted on the strut graph // ============================================================================= + +// NOTE: ClaimsStructures in Forts game data is a territory/team-claiming flag, +// not a placement-legality rule. Do NOT add a strut-proximity placement gate +// without new evidence. Every device snaps onto the nearest strut; unmounted +// devices die only from weapon damage, which is acceptable. int BuildGraph::mount_device(int na, int nb, int device_type, int team, float hp) { if (na < 0 || na >= (int)nodes.size()) return -1; if (nb < 0 || nb >= (int)nodes.size()) return -1; |
