fix(doomsday): keep doomed warships on patrol instead of idling at ports#4597
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughWarships 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. ChangesDoomsday warship retreat handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
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.healWarshipso 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%warshipRetreatHealthPercentretreat 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:
Please put your Discord username so you can be contacted if a bug or regression is found:
zixer._