Allow selecting missile launch silo - #4888
Conversation
WalkthroughThe 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. ChangesMissile silo targeting
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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. Comment |
|
Hi @tcb714, thanks for the contribution. This PR was automatically closed because it doesn't fit our contribution workflow:
To contribute to OpenFront:
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. |
There was a problem hiding this comment.
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
📒 Files selected for processing (13)
resources/lang/en.jsonsrc/client/Transport.tssrc/client/controllers/BuildPreviewController.tssrc/core/Schemas.tssrc/core/execution/ConstructionExecution.tssrc/core/execution/ExecutionManager.tssrc/core/execution/MIRVExecution.tssrc/core/execution/NukeExecution.tssrc/core/game/Game.tssrc/core/game/PlayerImpl.tstests/MissileSilo.test.tstests/client/controllers/BuildPreviewController.test.tstests/core/IntentTileRefSchemas.test.ts
| const spawn = this.player.canBuild( | ||
| UnitType.MIRV, | ||
| this.dst, | ||
| null, | ||
| this.sourceSiloId, | ||
| ); |
There was a problem hiding this comment.
🗄️ 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.
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
The repository-wide suite has unrelated local-environment failures involving Node 26 localStorage configuration, unavailable assets, and the development authentication API.
Discord username
tommysaucebonegenie