Skip to content

fix(doomsday): keep doomed warships on patrol instead of idling at ports#4597

Merged
evanpelle merged 1 commit into
openfrontio:mainfrom
Zixer1:balance/doomsday-warship-no-idle-retreat
Jul 13, 2026
Merged

fix(doomsday): keep doomed warships on patrol instead of idling at ports#4597
evanpelle merged 1 commit into
openfrontio:mainfrom
Zixer1:balance/doomsday-warship-no-idle-retreat

Conversation

@Zixer1

@Zixer1 Zixer1 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #4587 (the 5% drain floor).

Description:

A side below the Doomsday Clock bar cannot repair its navy: warship healing is suppressed in WarshipExecution.healWarship so the decay actually lands. Since #4587 floors the drain at 5% of max instead of sinking ships to zero, warships now survive at 5% health, which is below the 75% warshipRetreatHealthPercent retreat threshold. The result was that every doomed warship peeled off to the nearest port, docked, and then never healed, sitting idle and out of combat, instead of the intended crippled-but-still-fighting state.

This gates the repair-retreat on the Doomsday Clock, mirroring the existing heal gate: a doomed warship no longer starts a retreat, and any in-flight retreat or dock is cancelled so it returns to patrol. It keeps fighting at the floor until its side climbs back above the bar (healing resumes) or it is destroyed in combat.

No config, schema, or UI change. Deterministic (a boolean check over existing player/warship state). Covered by three new tests in tests/Warship.test.ts (doomed stays on patrol, non-doomed still retreats, doomed undocks).

Please complete the following:

  • I have added screenshots for all UI updates (no UI changes)
  • I process any text displayed to the user through translateText() and I've added it to the en.json file (no user-facing text)
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

zixer._

A side below the Doomsday Clock bar cannot repair its navy (warship
healing is suppressed in WarshipExecution.healWarship). With the 5%
drain floor, warships now survive at 5% health instead of sinking, which
is below the 75% retreat threshold, so every doomed warship peeled off to
the nearest port, docked, and never healed, sitting idle out of combat.

Gate the repair-retreat on the Doomsday Clock: a doomed warship no longer
starts a retreat, and any in-flight retreat or dock is cancelled so it
returns to patrol. It keeps fighting at the floor until the side recovers
above the bar (healing resumes) or it is destroyed.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0688ba53-a74f-4bdb-97a9-bc9ee8ab53fd

📥 Commits

Reviewing files that changed from the base of the PR and between 290d692 and 6bdb805.

📒 Files selected for processing (2)
  • src/core/execution/WarshipExecution.ts
  • tests/Warship.test.ts

Walkthrough

Warships now avoid repair retreats while their owner is under the Doomsday Clock. Existing retreats are cancelled, new retreats are blocked, and tests cover normal, doomed, and mid-repair doom scenarios.

Changes

Doomsday warship retreat handling

Layer / File(s) Summary
Guard repair retreat behavior
src/core/execution/WarshipExecution.ts
Cancels active repair retreats for doomed owners and prevents new repair retreats from starting.
Validate retreat state transitions
tests/Warship.test.ts
Tests retreat toward a port, patrol behavior while doomed, and undocking after becoming doomed during repair.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: tktk123456, bijx, evanpelle, flopinguin, aotumuri

Poem

A damaged warship turns away,
Then doom commands it: “No retreat today.”
Ports may wait, repairs may cease,
Patrol resumes beneath the peace.
Tests chart each course through darkened skies.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: doomed warships stay on patrol instead of idling at ports.
Description check ✅ Passed The description matches the patch and test coverage, describing the Doomsday Clock retreat gating fix.
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.

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-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Jul 13, 2026
@evanpelle evanpelle modified the milestones: Backlog, v32 Jul 13, 2026
@evanpelle evanpelle merged commit 9b69b7f into openfrontio:main Jul 13, 2026
17 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants