cyberpunk mmo roguelike built on atproto protokill.sh

feat(interact): add the targeted context menu #518

targeting main from claude/targeted-menu
Merged opened by functor-dirk.test.pds.did.bot
targeting main from claude/targeted-menu

What #

Right-click on the physical map now opens the context menu for the cell under the cursor at any range; the interact key opens the same menu for the cell under the view cursor, and falls back to the adjacent interact when no cursor is set. Left-click and travel are unchanged, and hover still paints the inspect summary.

The core answers a free PlayerAction::Menu { x, y } query with realspace.context_menu, built from the pack verb records and gated by each verb's reach:

  • an adjacent verb is shut with "move beside it" when the runner is not beside the target;
  • Fire reads the same ShotObservation list the core resolves, so a nearer body or a target out of range is shut rather than "ready";
  • Aim is gated on the target's line and range band and names the real reason: dry, reloading, out of range, no line of fire, or no ranged weapon;
  • a wireless / interface verb offers the link hack as Connect { x, y } when the kit reaches the device.

The query spends no turn — including while downed or staggered — and any real action closes the menu. Available verbs list first; a shut verb is greyed with its reason. Number keys choose a row, Esc closes. A route menu opened by a verb owns the number keys; the context menu stays behind it.

Context menu at range: the Security door's verbs, each shut with "move beside it"

Tests #

  • a distant guard offers Aim/Fire; Talk is shut with "move beside it";
  • a distant camera offers its link hack as the Connect action; Smash is shut;
  • Fire and Aim agree with the legal actions and act; Connect starts the camera's trace;
  • a Menu query spends no turn while downed (no bleed-out) or staggered (the shock stays for the next real action);
  • the scenario suite now asserts a specific refusal for every shut verb, not just a non-empty log;
  • a new agreement test checks every route-based verb's inspect family names the route it runs — it caught the breach-port inspect entry;
  • scripts/ci.sh <pinned base>, scripts/wasm-test.sh and scripts/mouse-smoke.sh (right-click opens the door context menu and takes the screenshot above).

Scope #

The physical pane is covered. The Net pane and the strategic screens keep their existing click behaviour; their contextual menus are a follow-up.

Moddability gaps #

  • reach is data; the action a verb maps to is a closed Rust vocabulary.
  • Fire/Aim apply to persons and monsters through synthetic target tags; the Net and strategic panes are not wired yet.
  • The data-port breach is main's own intrusion observer and stays outside the context menu for now.

🤖 Generated with Claude Code

Commits 1

feat(interact): add the targeted context menu
Sign up or Sign in to add to the discussion.