harvest/game/scripts
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
..
action_edges.gd updates 2026-10-04 12:07:36 -04:00
action_edges.gd.uid updates 2026-10-04 12:07:36 -04:00
alert_manager.gd Task #12 follow-up: theft alert for a claimed loose animal 2026-10-05 15:20:58 -04:00
alert_manager.gd.uid updates 2026-10-04 12:07:36 -04:00
animal_system.gd Task #12: animals start loose; herd into the player-built pen 2026-10-05 15:13:20 -04:00
animal_system.gd.uid updates 2026-10-04 12:07:36 -04:00
assessment.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
assessment.gd.uid updates 2026-10-04 12:07:36 -04:00
asset_hud.gd updates 2026-10-04 12:07:36 -04:00
asset_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
avatar.gd updates 2026-10-04 12:07:36 -04:00
avatar.gd.uid updates 2026-10-04 12:07:36 -04:00
build_hud.gd updates 2026-10-04 12:07:36 -04:00
build_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
build_mode.gd updates 2026-10-04 12:07:36 -04:00
build_mode.gd.uid updates 2026-10-04 12:07:36 -04:00
campaign_controller.gd updates 2026-10-04 12:07:36 -04:00
campaign_controller.gd.uid init 2026-10-03 12:14:28 -04:00
campaign_debug.gd updates 2026-10-04 12:07:36 -04:00
campaign_debug.gd.uid init 2026-10-03 12:14:28 -04:00
confirm_box.gd updates 2026-10-04 12:07:36 -04:00
confirm_box.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_hud.gd updates 2026-10-04 12:07:36 -04:00
coop_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_link.gd Co-op voice/session work, config retune, net budget tool, overhaul plan 2026-10-05 13:35:53 -04:00
coop_link.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_lobby.gd updates 2026-10-04 17:30:48 -04:00
coop_lobby.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_menu.gd updates 2026-10-04 12:07:36 -04:00
coop_menu.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_session.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
coop_session.gd.uid updates 2026-10-04 12:07:36 -04:00
coop_voice.gd Co-op voice/session work, config retune, net budget tool, overhaul plan 2026-10-05 13:35:53 -04:00
coop_voice.gd.uid updates 2026-10-04 12:07:36 -04:00
crop_unit.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
crop_unit.gd.uid init 2026-10-03 12:14:28 -04:00
day_night.gd updates 2026-10-04 12:07:36 -04:00
day_night.gd.uid updates 2026-10-04 12:07:36 -04:00
end_panel.gd Enemy roster reskin: thief -> Alien, breaker -> Alien Robot display names 2026-10-05 13:48:00 -04:00
end_panel.gd.uid updates 2026-10-04 12:07:36 -04:00
enemy_characters.gd updates 2026-10-04 12:07:36 -04:00
enemy_characters.gd.uid updates 2026-10-04 12:07:36 -04:00
enemy_system.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
enemy_system.gd.uid updates 2026-10-04 12:07:36 -04:00
farm_audio.gd Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
farm_audio.gd.uid updates 2026-10-04 12:07:36 -04:00
farm_marker.gd updates 2026-10-04 12:07:36 -04:00
farm_marker.gd.uid init 2026-10-03 12:14:28 -04:00
farm_navigation.gd Task #9 follow-up: make the Workbench genuinely targetable (Decision 3) 2026-10-05 16:46:04 -04:00
farm_navigation.gd.uid init 2026-10-03 12:14:28 -04:00
farm_projectiles.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
farm_projectiles.gd.uid updates 2026-10-04 12:07:36 -04:00
farm_sim.gd Task #9 follow-up: make the Workbench genuinely targetable (Decision 3) 2026-10-05 16:46:04 -04:00
farm_sim.gd.uid updates 2026-10-04 12:07:36 -04:00
farm_state.gd Task #10: per-instance Turret/Tar Patch leveling (L1-L3) 2026-10-05 15:48:19 -04:00
farm_state.gd.uid init 2026-10-03 12:14:28 -04:00
farm_zone.gd updates 2026-10-04 12:07:36 -04:00
farm_zone.gd.uid init 2026-10-03 12:14:28 -04:00
farm_zones.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
farm_zones.gd.uid init 2026-10-03 12:14:28 -04:00
farmers_return.gd updates 2026-10-04 12:07:36 -04:00
farmers_return.gd.uid updates 2026-10-04 12:07:36 -04:00
follow_camera.gd init 2026-10-03 12:14:28 -04:00
follow_camera.gd.uid init 2026-10-03 12:14:28 -04:00
game_config.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
game_config.gd.uid init 2026-10-03 12:14:28 -04:00
game_settings.gd updates 2026-10-04 12:07:36 -04:00
game_settings.gd.uid updates 2026-10-04 12:07:36 -04:00
gather_node.gd Task #4: Alien Goop resource and drop-on-kill from Aliens 2026-10-05 14:23:22 -04:00
gather_node.gd.uid updates 2026-10-04 12:07:36 -04:00
gdsync_link.gd updates 2026-10-04 12:07:36 -04:00
gdsync_link.gd.uid updates 2026-10-04 12:07:36 -04:00
interactions.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
interactions.gd.uid updates 2026-10-04 12:07:36 -04:00
loot_system.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
loot_system.gd.uid updates 2026-10-04 12:07:36 -04:00
main.gd updates 2026-10-04 17:30:48 -04:00
main.gd.uid updates 2026-10-04 12:07:36 -04:00
main_menu.gd updates 2026-10-04 12:07:36 -04:00
main_menu.gd.uid updates 2026-10-04 12:07:36 -04:00
night_plan.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
night_plan.gd.uid updates 2026-10-04 12:07:36 -04:00
pause_menu.gd updates 2026-10-04 12:07:36 -04:00
pause_menu.gd.uid updates 2026-10-04 12:07:36 -04:00
phase_hud.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
phase_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
player_character.gd updates 2026-10-04 12:07:36 -04:00
player_character.gd.uid init 2026-10-03 12:14:28 -04:00
pumpkin_bombs.gd updates 2026-10-04 12:07:36 -04:00
pumpkin_bombs.gd.uid updates 2026-10-04 12:07:36 -04:00
remote_controls.gd Co-op voice/session work, config retune, net budget tool, overhaul plan 2026-10-05 13:35:53 -04:00
remote_controls.gd.uid updates 2026-10-04 12:07:36 -04:00
resource_hud.gd Task #4: Alien Goop resource and drop-on-kill from Aliens 2026-10-05 14:23:22 -04:00
resource_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
resource_store.gd Task #4: Alien Goop resource and drop-on-kill from Aliens 2026-10-05 14:23:22 -04:00
resource_store.gd.uid updates 2026-10-04 12:07:36 -04:00
review_panel.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
review_panel.gd.uid updates 2026-10-04 12:07:36 -04:00
save_game.gd Task #10: per-instance Turret/Tar Patch leveling (L1-L3) 2026-10-05 15:48:19 -04:00
save_game.gd.uid updates 2026-10-04 12:07:36 -04:00
scarecrow.gd updates 2026-10-04 12:07:36 -04:00
scarecrow.gd.uid updates 2026-10-04 12:07:36 -04:00
scarecrow_combat.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
scarecrow_combat.gd.uid updates 2026-10-04 12:07:36 -04:00
scarecrow_hud.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
scarecrow_hud.gd.uid updates 2026-10-04 12:07:36 -04:00
settings_menu.gd updates 2026-10-04 17:30:48 -04:00
settings_menu.gd.uid updates 2026-10-04 12:07:36 -04:00
shed_counter.gd Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
shed_counter.gd.uid Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
shed_stock.gd Task #4: Alien Goop resource and drop-on-kill from Aliens 2026-10-05 14:23:22 -04:00
shed_stock.gd.uid updates 2026-10-04 12:07:36 -04:00
structure_system.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
structure_system.gd.uid updates 2026-10-04 12:07:36 -04:00
thief_behavior.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
thief_behavior.gd.uid updates 2026-10-04 12:07:36 -04:00
toast_feed.gd Enemy roster reskin: thief -> Alien, breaker -> Alien Robot display names 2026-10-05 13:48:00 -04:00
toast_feed.gd.uid updates 2026-10-04 12:07:36 -04:00
tutorial.gd Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
tutorial.gd.uid updates 2026-10-04 12:07:36 -04:00
ui_theme.gd updates 2026-10-04 12:07:36 -04:00
ui_theme.gd.uid updates 2026-10-04 12:07:36 -04:00
upgrade_panel.gd Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
upgrade_panel.gd.uid updates 2026-10-04 12:07:36 -04:00
upgrades.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
upgrades.gd.uid updates 2026-10-04 12:07:36 -04:00
wave_director.gd Task #15: UFO enemy, a fast flying fighter 2026-10-05 14:43:46 -04:00
wave_director.gd.uid updates 2026-10-04 12:07:36 -04:00
weapon_models.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
weapon_models.gd.uid updates 2026-10-04 12:07:36 -04:00
workbench.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
workbench.gd.uid updates 2026-10-04 12:07:36 -04:00
zone_banner.gd init 2026-10-03 12:14:28 -04:00
zone_banner.gd.uid init 2026-10-03 12:14:28 -04:00