Skip to content

feat(guns): explain the special guns when they come online - #44

Merged
vriesd merged 1 commit into
mainfrom
feat/special-gun-intro
Nov 13, 2026
Merged

vriesd merged 1 commit into
mainfrom
feat/special-gun-intro

Conversation

@vriesd

@vriesd vriesd commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Since #43 the main gun is no longer picked: from sector 3 you fly Lance and Q borrows Scatter or Seekers on a charge. Nothing told the player that.

Now the refit bay after sector 2 opens with a short "SPECIAL GUNS ONLINE" card: three sentences and one CONTINUE button, nothing to choose. It says "Press Q" on a keyboard and "Tap the swap key" on touch. In sector 3 a small Q SPECIAL GUN label sits next to the charge bar (a pulse ring around the swap key on touch) until the first swap.

Sectors 1–2 and all balance numbers are untouched.

Proof: typecheck, lint, format, knip, unit tests (678 pass), build and bundle check pass; Playwright desktop + mobile 97 passed (5 existing skips), including a new test for the card and the hint; card and hint checked in screenshots on desktop and phone.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 and Claude Fable 5.2 in Claude Code.

🤖 Generated with Claude Code

…swap in sector 3

- The refit bay after sector 2 opens on a one-button SPECIAL GUNS ONLINE card
  (Lance, Q / the touch swap key, the charge). No options; CONTINUE, Enter,
  Space or Escape close it. Shown on every visit to that bay, at no other,
  and not again after a resize restart of the same visit.
- Sector 3 points at the swap until the first successful swap there:
  `Q  SPECIAL GUN` beside the HUD charge bar on a keyboard, a pulsing ring
  around the touch swap key (still with reduced motion). The state lives in
  ShipSystemsRuntime.isSwapHintPending.
- Docs and CHANGELOG (Unreleased, Added).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T21:14:06.187161Z 5c0e081 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment on lines +135 to +140
this.dialog = createSpecialGunIntroCard(touch, () => {
this.closeDialog();
this.specialGunIntroClosed = true;
audioManager.playUi();
this.offerShipSystemPick();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Closing the dialog with Enter allows Phaser's queued Enter keydown event to trigger handleUnfocusedKey('Enter'), accidentally purchasing the first purchasable upgrade card.
Severity: MEDIUM

Suggested Fix

Call stopPropagation() or prevent the default action on the Enter key event within the dialog continue handler, or defer un-inerting the upgrade bay view until the next frame/tick so the queued Enter event is consumed safely.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/scenes/PlanetIntermissionScene.ts#L135-L140

Potential issue: When closing the "SPECIAL GUNS ONLINE" dialog using the Enter key on
the CONTINUE button, the dialog closes synchronously and immediately un-inerts the
upgrade bay. Because Phaser queues native key events and processes them on a later game
step, the scene's keydown handler then receives the queued Enter event after
`this.dialog` has been reset to undefined. The handler invokes
`view.handleUnfocusedKey('Enter')`, which focuses and purchases the first available
upgrade card without player intent.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bug: the Enter keydown never reaches Phaser. Every UI layer stops propagation of Enter/Space pressed on a focused button (keepNativeKeys in src/ui/dom.ts:42), so the scene's keydown handler does not see the key that closed the card. The e2e test closes the card with Enter on desktop and the bay afterwards still shows 8000 credits and Hull Armor at 0/5.

@vriesd
vriesd merged commit 4561b48 into main Nov 13, 2026
10 checks passed
@vriesd
vriesd deleted the feat/special-gun-intro branch November 13, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants