Commit graph

9 commits

Author SHA1 Message Date
Forrest
e435b76aa2 #38: touch action buttons
TouchButtons (phones only, Main adds it beside TouchSticks): Pause, Fear, Bomb,
Patch, Use (word from the new read-only Interactions.focus_info()) and Build,
round Sketch buttons that press the existing actions for at least one physics
tick, shown only when they can do something and hidden whenever the tree is
paused or a menu, panel or sign is up. Columns follow TouchSticks.move_on_right
(now a variable); both join "touch_controls" with apply_settings (Swap sticks),
which Main calls at startup; Prompts.move_side() reads the live sticks. Stick
fingers keep their drags over buttons. New Sketch icons: fear, patch, use,
build, pause. Test: game/tests/mobile/buttons_test.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:25:57 -04:00
Forrest
9f4a1895bd #36: prompts in touch words
Prompts (game/scripts/prompts.gd) holds every key-naming prompt: on a phone
(MobilePort.active()) it says each in touch words, elsewhere exactly the old
string. World labels drop the key (Gather, Repair, Upgrade to, Upgrades, Shop),
the build ghost says Place / Dismantle, the build bar's line is
"Place · Rotate · Dismantle · Done" and its slots drop the number keys, the
cutscenes say "Hold to skip" / "Tap to skip", the tip footer says
"× hides tips", and the tutorial's tips and the first morning's sign name the
thumbs (sides from TouchSticks), Use, Build, Place, Fear, Bomb, Patch, the
hotbar, and the backpack. MobilePort gains the `forced` test override.
game/tests/mobile/prompts_test.gd checks every phone string and that the
desktop strings are byte for byte as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:30:26 -04:00
Forrest
1e91ccf594 Task #23: remove the zone banner and the message feed
The user asked to drop the pop-up status lines, including replies to the
player's own actions.

- farm.tscn (edited as text): the ZoneBanner and Hud/ToastFeed nodes, their
  ext_resources, and FarmSim's toasts export are gone. zone_banner.gd and
  toast_feed.gd (with their .uid files) are deleted.
- FarmSim: no toast wiring, no arrival_message, no outside-the-fence or
  sunrise lines. Main: no lobby-failure or microphone lines; _set_hud only
  hides Hud. CampaignDebug: F2 no longer toasts (the F1 readout shows the
  scenario).
- CoopSession: the host no longer sends "toast" or "arrived" events, and
  the partner no longer handles them. The joined/left/version lines are gone
  (the partner's main menu still says why a session ended). A refused
  build request still sends the error sound. PROTOCOL stays 5: the other
  messages and records are unchanged, and _apply_event ignores unknown
  kinds, so mixed builds still work together.
- BuildMode.message is removed (no test listens to it). Interactions.message
  and UpgradePanel.message stay because tests listen to them.
- test_farm_layout: the banner checks are removed.
- RULES.md, README.md, COOP.md, and LAYOUT.md no longer describe the banner
  or toasts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:02:37 -04:00
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
Forrest
fa7f67fe04 Task #16: per-player pouch in co-op
Each scarecrow carries its own pouch (ResourceStore.pouches by avatar
slot; slot 0 is the solo player / host, `pouch` stays slot 0's), with one
shared pouch_capacity so a Bigger pouch grows both. The shed stays shared.

- Gathering, the shed drop-off, repair, upgrade-in-place, patching,
  building and buying all act on the acting avatar's slot. The host pays
  the partner's "place" and "buy" requests from P2's pouch and the shed.
- The partner's build mode, build hotbar, shop menus and materials HUD
  check affordability against P2's pouch (FarmSim.set_local).
- Alien Goop goes to the killer's pouch: FarmSim sets
  EnemySystem.attacker around each avatar's combat step and shots carry
  their shooter's slot; bomb/turret kills go to the nearest scarecrow.
  The replica no longer rolls goop locally.
- When the partner leaves, their pouch goes into the shed (and is named
  in the toast); a co-op save continued alone banks P2's pouch at morning.
- FarmState.VERSION 7 (resources.partner_pouch) with a v6 migration;
  CoopSession.PROTOCOL 4.
- Tests: per-slot store rules, v6 save migration, and test_coop cases for
  separate gathering, no cross-banking in the shed, own-pouch paying,
  shared capacity, goop credit and leaving. test_coop's crowd case now
  resets the loopback's drop counter so earlier traffic can't change
  which messages it loses.
- Docs: COOP.md and RULES.md no longer say the pouch is shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 13:06:25 -04:00
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
Forrest
62324ff4b1 Task #10: per-instance Turret/Tar Patch leveling (L1-L3)
Adds a per-placed-structure "level" (1-3) to automated_defense and
slowing_trap, upgraded independently (not account-wide) by holding
interact at that specific structure, by day, once it's undamaged
(repair still takes priority while it isn't), for a config-tunable
per-level cost.

Turret L2 fires turret_level_fire_mult (3x, matching the live Rapid
Fire multiplier) as often; L3 keeps that rate and fires
turret_l3_projectiles shots at once in a fan. A tar patch's trigger
footprint and visual grow by trap_level_size_mult per level (L2
double, L3 triple its L1 size); a bigger footprint that would overlap
a neighbor or the world refuses the upgrade with a reason.

FarmState.VERSION bumps 5->6 (STRUCTURE_KEYS gains "level"; migrate()
backfills level 1 on older saves, following the v2->v3 precedent for
night_log). Co-op: an upgrade is driven the same way repair already
is -- entirely host-side, off the partner's held interact button, no
new "req" case -- so the only wire change is forwarding the upgrade
channel's target/progress in the avatar snapshot, same as repair's.

New test_structures.gd coverage: fire interval and projectile count
per turret level, tar patch footprint per level, each proven
independently for two separately-placed structures of the same type,
plus the upgrade rules (repair-first, room, afford) and that level
survives a save/retry round trip.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 15:48:19 -04:00
Forrest
308854d52c Task #6: Supply Shed as its own weapon shop, separate from the Workbench
Adds a second UpgradePanel instance (shop "shed") at the Supply Shed's new
ShedCounter node, opened by interact like the Workbench. corn_shooter and
pumpkin_bomb move there ("shop": "shed" in GameConfig.upgrades); the
Workbench's panel (shop "workbench", the default) keeps rapid_fire,
heavy_seeds, and the rest, with "requires" still crossing shops. Co-op buys
go through the same ["buy", id] host gate; a shed_requested signal mirrors
workbench_requested so the partner's own shed panel opens. The shed's
walk-in pouch deposit is unaffected (no interact, not gated by the
counter's reach).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 15:13:48 -04:00
Forrest
4298caf5cb updates 2026-10-04 12:07:36 -04:00