harvest/game
Forrest acf4e2f4c1 Task #9 follow-up: make the Workbench genuinely targetable (Decision 3)
FarmSim._breaker_goals() now treats an unbroken Workbench as guarding its
own work area unconditionally (not just when within guard_range of the
pen/shed/crop-field rects, which it normally isn't), alongside whatever
else actually guards something -- so it joins a non-empty guarding set
instead of only ever being a last-resort fallback. A broken Workbench (0
HP) drops out entirely: nothing left to gain by sending a breaker at it.

That alone wasn't enough in practice: the Workbench's footprint sits on
its own scene prop's real collision, which FarmNavigation.build() already
rasterized into blocked[] before any structure ever gets placed there --
unlike every player-placed structure, which validate()'s world-blocked
check keeps off already-blocked terrain. _rasterize_into() skipped tagging
structure_at[] on an already-blocked cell, so the Workbench was invisible
to ThiefBehavior._adjacent_structure() and FarmNavigation.barrier_ahead():
a fence breaker would walk right up to it and then just stand there,
forever stuck in SEEK, never transitioning to BREAK. Fixed by tagging
structure_at[] for a structure id even over a blocked cell; a terrain
block (id < 0) still skips already-blocked cells exactly as before, and
no existing (validate()-placed) structure's footprint was ever on blocked
terrain to begin with, so this changes nothing for fences, gates, traps,
or turrets.

test_structures.gd's Workbench check now proves targeting, not just
damage: with a real guarding structure also present (PenRing.build_gate_
only, the same single-barrier setup test_roster.gd's own fence-breaker
test uses) and the scarecrow kept well clear, a fence breaker spawned
with no hand-set state or barrier walks to and smashes the Workbench on
its own, and a broken Workbench is confirmed absent from the breaker
goals. Found by running the actual AI end to end (not by poking es.state/
es.barrier by hand, which only proves damage()).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 16:46:04 -04:00
..
resources Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
scenes Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
scripts Task #9 follow-up: make the Workbench genuinely targetable (Decision 3) 2026-10-05 16:46:04 -04:00
tests Task #9 follow-up: make the Workbench genuinely targetable (Decision 3) 2026-10-05 16:46:04 -04:00
tools Co-op voice/session work, config retune, net budget tool, overhaul plan 2026-10-05 13:35:53 -04:00
COOP.md Co-op voice/session work, config retune, net budget tool, overhaul plan 2026-10-05 13:35:53 -04:00
LAYOUT.md updates 2026-10-04 12:07:36 -04:00
PLAYTEST.md updates 2026-10-04 12:07:36 -04:00
RULES.md updates 2026-10-04 17:30:48 -04:00