Skip to content

Allow selecting missile launch silo - #4888

Closed
tcb714 wants to merge 1 commit into
openfrontio:mainfrom
tcb714:agent/select-missile-silo
Closed

Allow selecting missile launch silo#4888
tcb714 wants to merge 1 commit into
openfrontio:mainfrom
tcb714:agent/select-missile-silo

Conversation

@tcb714

@tcb714 tcb714 commented Aug 5, 2026

Copy link
Copy Markdown

Related to #4886 (currently awaiting the required maintainer approval and assignment).

Description

Players can now click one of their ready missile silos while aiming an Atom Bomb, Hydrogen Bomb, or MIRV to choose its launch source.

The optional source silo ID travels through the existing build intent and is validated in the deterministic simulation. If no silo is selected, the current nearest-ready-silo behavior remains unchanged. If the selected silo becomes unavailable, the launch is rejected rather than silently falling back to a different silo.

Validation

  • Focused Vitest coverage: 43 tests passed
  • TypeScript compilation: passed
  • Lint: passed
  • Manual local two-silo game: confirmed trajectory source switch, launch, and cooldown rejection

The repository-wide suite has unrelated local-environment failures involving Node 26 localStorage configuration, unavailable assets, and the development authentication API.

Discord username

tommysaucebonegenie

@CLAassistant

CLAassistant commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds missile silo selection to the build preview. The selected silo ID travels through the build intent and construction pipeline. Nuke and MIRV validation use that silo when launching. Tests cover selection, schema validation, and launch behavior.

Changes

Missile silo targeting

Layer / File(s) Summary
Client silo selection
src/client/controllers/BuildPreviewController.ts, resources/lang/en.json, tests/client/controllers/BuildPreviewController.test.ts
Missile previews support silo-selection mode, ready-silo validation, selected-silo persistence, selection feedback, and source silo IDs in build intents.
Intent and construction propagation
src/core/Schemas.ts, src/client/Transport.ts, src/core/execution/ExecutionManager.ts, src/core/execution/ConstructionExecution.ts, tests/core/IntentTileRefSchemas.test.ts
Build intents accept an optional non-negative sourceSiloId and forward it into missile construction.
Source silo launch validation
src/core/execution/NukeExecution.ts, src/core/execution/MIRVExecution.ts, src/core/game/Game.ts, src/core/game/PlayerImpl.ts, tests/MissileSilo.test.ts
Nuke, MIRV, atom bomb, and hydrogen bomb validation uses the selected ready silo, or the nearest ready silo when no ID is supplied.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels: UI/UX

Suggested reviewers: evanpelle

Poem

A silo is chosen, its number sent,
Through preview, intent, and launch event.
Nukes and MIRVs now know the way,
Ready silos guide the play. 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: selecting a missile launch silo.
Description check ✅ Passed The description accurately explains silo selection, validation behavior, testing, and fallback behavior covered by the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the auto-closed-needs-issue PR closed by gate — see comment for next steps label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Hi @tcb714, thanks for the contribution.

This PR was automatically closed because it doesn't fit our contribution workflow:

  • You aren't currently assigned to an issue labelled approved, and
  • The change is larger than 50 lines (our cap for unsolicited contributions).

To contribute to OpenFront:

  1. For bugs or small quality-of-life improvements: open an issue. A maintainer will label it approved if it's something we'll work on.
  2. For feature ideas: discuss in the dev Discord first. We don't accept unsolicited feature PRs — even if they're good ideas, every merged feature is a permanent maintenance burden.
  3. Once an issue is labelled approved, comment asking to be assigned. After you're assigned, you can open a PR referencing that issue.

If you believe this was closed in error, please reach out on our Discord or comment below.

See CONTRIBUTING.md for the full contribution process.

Automated PR gate. Source.

@github-actions github-actions Bot closed this Aug 5, 2026
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Aug 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/execution/MIRVExecution.ts`:
- Around line 74-79: Move the MIRV alliance-breaking logic in init() to execute
only after canBuild() validates the selected silo and spawn succeeds; preserve
rejection when the selected silo ID is unavailable. Add a regression test
covering an allied target with an invalid selected silo ID and verify the
alliance remains intact and no MIRV launches.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c3f5d09-a945-46b9-9ab9-83c4d40f4c65

📥 Commits

Reviewing files that changed from the base of the PR and between 74cdee4 and 1e6a568.

📒 Files selected for processing (13)
  • resources/lang/en.json
  • src/client/Transport.ts
  • src/client/controllers/BuildPreviewController.ts
  • src/core/Schemas.ts
  • src/core/execution/ConstructionExecution.ts
  • src/core/execution/ExecutionManager.ts
  • src/core/execution/MIRVExecution.ts
  • src/core/execution/NukeExecution.ts
  • src/core/game/Game.ts
  • src/core/game/PlayerImpl.ts
  • tests/MissileSilo.test.ts
  • tests/client/controllers/BuildPreviewController.test.ts
  • tests/core/IntentTileRefSchemas.test.ts

Comment on lines +74 to +79
const spawn = this.player.canBuild(
UnitType.MIRV,
this.dst,
null,
this.sourceSiloId,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not break alliances before MIRV launch validation succeeds.

init() breaks alliances and changes relations before this call can reject an unavailable selected silo. If the selected silo becomes unavailable, canBuild() returns false and no MIRV launches, but the target alliance is already broken.

Move the MIRV betrayal logic to after successful spawn validation. Add a regression test for an allied target with an invalid selected silo ID.

Based on PR objectives, an unavailable selected silo must reject the launch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/execution/MIRVExecution.ts` around lines 74 - 79, Move the MIRV
alliance-breaking logic in init() to execute only after canBuild() validates the
selected silo and spawn succeeds; preserve rejection when the selected silo ID
is unavailable. Add a regression test covering an allied target with an invalid
selected silo ID and verify the alliance remains intact and no MIRV launches.

@github-project-automation github-project-automation Bot moved this from Complete to Development in OpenFront Release Management Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-closed-needs-issue PR closed by gate — see comment for next steps

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

2 participants