harvest/game/tests
Forrest df10a1967c Task #9: Workbench auto-grants after Night 1, destructible/repairable
Gate the Workbench to appear once Night 1 is survived instead of being
buildable: StructureSystem.grant_workbench() (an unvalidated, unpurchased
place() variant, grant()) adds a "workbench" structure record at the scene
node's position, reusing the existing damage/repair/targeting/save pipeline
end to end. The grant happens on CampaignController.night_ending (so it
lands in state before the morning snapshot, like #13's crop growth) and is
re-derived from FarmState.nights_survived on load/retry (sync_from_state).

The Workbench's view is the scene's own node (hidden until granted, shown
by StructureSystem._add_view) instead of a second built mesh, so it gets
the standard HP bar, damage tint, and wobble for free. It's repair-only:
damage() never removes its record at 0 HP ("broken" instead of destroyed),
and it can't be dismantled. Interactions refuses to open its shop before
it exists or while broken (and no longer treats it as focusable), and
coop_session.gd's "buy" request handler refuses a workbench-shop item
(Upgrades.shop_of) the same way for a co-op partner. review_panel.gd's
pre-grant summary line no longer promises the work area from night one.

No FarmState.VERSION bump: a "workbench" record is a new type string, not
a new field, and from_dict() already validates types generically.

Tests: a new test_structures.gd check covers absent/no-prompt/shop-refused
before Night 1 (including a co-op "buy" request), granted after, damaged
by an enemy (thief_behavior.gd's generic BREAK state), broken-not-destroyed
at 0 HP with its shop refused, repaired at the normal proportional cost,
and persistence through a save/retry round trip. test_cycle.gd and
test_nights.gd pre-grant the workbench in setup (grant_workbench()) so
their per-night structure-count invariants aren't thrown off by the
night-1 grant itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 16:27:55 -04:00
..
pen_ring.gd Task #11: Animal Pen boundary becomes player-built 2026-10-05 14:34:02 -04:00
pen_ring.gd.uid Task #11: Animal Pen boundary becomes player-built 2026-10-05 14:34:02 -04:00
run_tests.gd updates 2026-10-04 12:07:36 -04:00
run_tests.gd.uid init 2026-10-03 12:14:28 -04:00
test_campaign.gd updates 2026-10-04 12:07:36 -04:00
test_campaign.gd.uid init 2026-10-03 12:14:28 -04:00
test_coop.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
test_coop.gd.uid updates 2026-10-04 12:07:36 -04:00
test_cycle.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
test_cycle.gd.uid updates 2026-10-04 12:07:36 -04:00
test_economy.gd Task #6: Supply Shed as its own weapon shop, separate from the Workbench 2026-10-05 15:13:48 -04:00
test_economy.gd.uid updates 2026-10-04 12:07:36 -04:00
test_farm_layout.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
test_farm_layout.gd.uid init 2026-10-03 12:14:28 -04:00
test_farm_state.gd Task #12: animals start loose; herd into the player-built pen 2026-10-05 15:13:20 -04:00
test_farm_state.gd.uid init 2026-10-03 12:14:28 -04:00
test_flow.gd Enemy roster reskin: thief -> Alien, breaker -> Alien Robot display names 2026-10-05 13:48:00 -04:00
test_flow.gd.uid updates 2026-10-04 12:07:36 -04:00
test_nights.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
test_nights.gd.uid updates 2026-10-04 12:07:36 -04:00
test_outcome.gd updates 2026-10-04 12:07:36 -04:00
test_outcome.gd.uid init 2026-10-03 12:14:28 -04:00
test_roster.gd Merge task #15: UFO enemy (fast flying fighter), 7 in night 5 2026-10-05 14:47:10 -04:00
test_roster.gd.uid updates 2026-10-04 12:07:36 -04:00
test_save.gd Task #10: per-instance Turret/Tar Patch leveling (L1-L3) 2026-10-05 15:48:19 -04:00
test_save.gd.uid updates 2026-10-04 12:07:36 -04:00
test_scarecrow.gd updates 2026-10-04 12:07:36 -04:00
test_scarecrow.gd.uid updates 2026-10-04 12:07:36 -04:00
test_structures.gd Task #9: Workbench auto-grants after Night 1, destructible/repairable 2026-10-05 16:27:55 -04:00
test_structures.gd.uid updates 2026-10-04 12:07:36 -04:00
test_targets.gd Task #12 follow-up: theft alert for a claimed loose animal 2026-10-05 15:20:58 -04:00
test_targets.gd.uid updates 2026-10-04 12:07:36 -04:00
test_theft.gd Task #13: two new crop fields with staged growth (Night 2 / Night 4) 2026-10-05 15:52:38 -04:00
test_theft.gd.uid updates 2026-10-04 12:07:36 -04:00
test_weapons.gd Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray) 2026-10-05 15:39:56 -04:00
test_weapons.gd.uid updates 2026-10-04 12:07:36 -04:00