Repository navigation
feat(fleets): add moonbreak, expedition and moon-lock formulas - #45
Merged
Merged
Conversation
og-bot-discord and ogame-ui each carried their own copy of three calculations: the moonbreak chance and Deathstar losses (`!mb`), the expedition maximum find (`!oge`) and the ships a moon lock needs (`!ogl`). They agree today — 25 edge cases compared, bot against site, identical — but nothing kept them that way. They now live here, so both can call the same code: - getMoonbreakWaves, getWaveChance, getMoonbreakChance and getMoonbreakLosses, unrounded, the loss bands clamped to the fleet; - getExpeditionFindBase and getExpeditionMaxFind; - getCargoCapacity, Hyperspace Technology plus any other bonus; - getMoonLockShips. getExpeditionMaxFind also covers what both copies hard-coded or left out. The class is a parameter: only a Discoverer gets the class bonus (`explorerBonusIncreasedExpeditionOutcome` in serverData) and the economy speed, any other class gets the base alone. The two lifeform bonuses that touch the find are taken as the totals the in-game bonus page shows: the Discoverer enhancement amplifies the class bonus, the expedition resource bonus multiplies the whole find. A Discoverer with a Pathfinder and no lifeform bonus gives exactly the figure the bot and the site have always shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 4.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description of what this resolves:
og-bot-discord and ogame-ui each carry their own copy of the moonbreak (
!mb), expedition (!oge) and moon-lock (!ogl) calculations. They agree today (25 edge cases compared, bot against site, all identical), but nothing keeps them in step. This moves the three calculations into the library, so both consumers can call the same code, and makes the expedition find account for the character class and the lifeform bonuses.Changes proposed in this pull request:
Fleets.getMoonbreakWaves,getWaveChance,getMoonbreakChance,getMoonbreakLosses: unrounded values, loss bands clamped to the fleet. Pinned to the figures the bot and the site show.Fleets.getExpeditionFindBase,getExpeditionMaxFind. The class is a parameter: only a Discoverer gets the class bonus (explorerBonusIncreasedExpeditionOutcome) and the economy speed. The lifeform Discoverer enhancement amplifies the class bonus, and the lifeform expedition resource bonus multiplies the find. Both are taken as the totals the in-game bonus page shows. A Discoverer with a Pathfinder and no lifeform bonus gives exactly today's figure.Fleets.getCargoCapacity: Hyperspace Technology plus any other bonus (Collector, lifeform), all shares of the base cargo.Fleets.getMoonLockShips: ships to destroy for the 2 000 000 debris threshold.Lint, tests (382) and
tscpass. This is afeat:, so the expected release is 4.1.0.To check before merging. Two points of the expedition formula come from community tools, not from a first-party source:
They deserve a check against a few real expedition reports.
Fixes: —
🤖 Generated with Claude Code