diff options
| author | Vaino Kauppila <vaino@vke.fi> | 2026-07-30 11:56:27 +0300 |
|---|---|---|
| committer | Vaino Kauppila <vaino@vke.fi> | 2026-07-30 11:56:27 +0300 |
| commit | 6cdd436caf9e2103f516442ab6e70a870d4cba04 (patch) | |
| tree | 7a69242d34ef3739f3e554227213ec5d91a2a958 /meson.build | |
| parent | 521b5da83485a956811fc510cba9f139acad8b26 (diff) | |
| download | forts_clone-6cdd436caf9e2103f516442ab6e70a870d4cba04.tar.gz forts_clone-6cdd436caf9e2103f516442ab6e70a870d4cba04.zip | |
Mount devices on the strut graph so cutting supports destroys them
Implements win-condition path (c): destroy the enemy reactor by cutting
its supports so it falls. Previously devices sat at fixed map coordinates,
structurally immune to collapse.
- BuildGraph gains MountedDevice tracking: mount_device/unmount_device,
is_device_alive/get_device_hp/damage_device, nearest_device, with a
break_node index-shift fix so mount references stay correct as other
geometry on the same fort is destroyed. update_fire now also damages
any device mounted on a burning strut.
- app.cpp mounts devices onto the nearest strut (within 2 units) at both
map-load and interactive placement, and after each tick's structural
collapse pass, zeroes a device's HP if its mount didn't survive -- which
flows through the existing win-condition/cleanup code unchanged.
- tools/device_collapse_test.cpp: 15 headless tests covering collapse,
partial support loss, splash/beam/fire-through-mount damage, multiple
devices, index stability, and clean unmount.
Verified: full test suite passes (15/15), sim_check shows zero regressions
across all 3 maps.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 02e2d3a..df9208e 100644 --- a/meson.build +++ b/meson.build @@ -174,3 +174,13 @@ executable('sim_check', 'tools/sim_check.cpp', dependencies: [lua_dep, glm_dep, sol2_dep], cpp_args: extra_cpp_args, ) + +# Device-on-strut-graph collapse test. Constructs a minimal fort, mounts a +# device, cuts the supports, and asserts the device falls and is destroyed. +# Pure graph test — no Lua data, no SDL. +executable('device_collapse_test', 'tools/device_collapse_test.cpp', + 'src/game/build_graph.cpp', + include_directories: [engine_inc] + extra_inc, + dependencies: [glm_dep], + cpp_args: extra_cpp_args, +) |
