harvest/game/tests
Forrest 315e6890f7 Task #22: the joining player can open the store
Cause: the open path itself worked. A real two-process run with an E key event opened the
shed's menu when P2 stood at the counter. What failed in play was reach:
- The partner's game never showed the counter's "[E / X] Shop" prompt.
  CoopSession._gather_node resolved only the workbench and gather points, so P2's
  replicated focus was null at the counter. P2 couldn't tell where the 2.2 m reach around
  the counter's invisible point was.
- The host took P2's press on the first tick after the input record arrived, before its
  copy of P2 had eased to the position in that same record. It dropped the press silently
  if the lagging copy was out of reach. Walking in at 5 or 9 m/s and pressing E at 2.1 m
  (inside the reach on P2's screen) failed 3/3. The host's copy was 2.31-2.66 m out.

Fixes:
- The snapshot's focus now resolves the ShedCounter (_focus_node), so the prompt shows.
- The host keeps a partner's interact press pending for 0.3 s (Interactions.PRESS_WINDOW)
  until a counter in reach takes it.
- Interact while the partner's shop menu is open closes it on the partner's machine, and
  that press is taken back (RemoteControls.Sender.take_back), so the host never reopens it.
- When the host completes P2's "buy", it sends a "bought" event. Once P2's farm state has
  the upgrade, the partner's panel emits bought (UpgradePanel.confirm_bought). As in solo,
  the new weapon goes into P2's hand and the jingle plays. Still paid from P2's pouch,
  then the shed.
- CoopSession.PROTOCOL 4 -> 5.

Tests: test_coop _shops covers both shops opening on the client only, the prompt, interact
closing, a press taken while the host's copy is 3.8 m out still opening, an early press not
opening later, and a client weapon buy paid from P2's pouch and the shed and equipped on
both farms. coop_smoke now opens and closes the shed by day with E key events, both
standing and on arrival at a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 13:47:52 -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 Task #20: lettuce and corn fields on the south soil, map grows to 60 x 80 2026-10-06 13:10:08 -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 #22: the joining player can open the store 2026-10-06 13:47:52 -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 #16: per-player pouch in co-op 2026-10-06 13:06:25 -04:00
test_economy.gd.uid updates 2026-10-04 12:07:36 -04:00
test_farm_layout.gd Task #20: lettuce and corn fields on the south soil, map grows to 60 x 80 2026-10-06 13:10:08 -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_radar.gd Task #8: Radar item, a Supply Shed minimap reveal 2026-10-05 16:08:54 -04:00
test_radar.gd.uid Task #8: Radar item, a Supply Shed minimap reveal 2026-10-05 16:08:54 -04:00
test_roster.gd Task #19: UFO model built from primitives 2026-10-06 12:55:14 -04:00
test_roster.gd.uid updates 2026-10-04 12:07:36 -04:00
test_save.gd Task #16: per-player pouch in co-op 2026-10-06 13:06:25 -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 follow-up: make the Workbench genuinely targetable (Decision 3) 2026-10-05 16:46:04 -04:00
test_structures.gd.uid updates 2026-10-04 12:07:36 -04:00
test_targets.gd Task #20: lettuce and corn fields on the south soil, map grows to 60 x 80 2026-10-06 13:10:08 -04:00
test_targets.gd.uid updates 2026-10-04 12:07:36 -04:00
test_theft.gd Task #20: lettuce and corn fields on the south soil, map grows to 60 x 80 2026-10-06 13:10:08 -04:00
test_theft.gd.uid updates 2026-10-04 12:07:36 -04:00
test_weapons.gd Task #17: Propane Torch sprays a band of fire 2026-10-06 13:04:54 -04:00
test_weapons.gd.uid updates 2026-10-04 12:07:36 -04:00