feat: Introduce three-tier expedition reward system #1399
Open
Geda173 wants to merge 5 commits into
Open
Conversation
Resolve FleetDispatchExpeditionTest import/helper conflicts and satisfy the level-8 PHPStan config main introduced (null guards in two expedition tests and AppUtil::selectWeightedRandom).
Hoist the tiered getRandomMessageVariationIdForVariant logic into ExpeditionGameMessage so the three message classes only declare their tier counts, and derive the exceptional range from all three counts (the exceptional count was previously unused). Make AppUtil::selectWeightedRandom use random_int consistently with a leading empty-array guard, and align the lang tier comments with the normal/rare/exceptional vocabulary.
Preview deploymentPreview environment for this PR is ready for functional testing. Use one of the test accounts below to log in.
Test accounts (click to expand)
This preview will be automatically destroyed when the PR is closed. |
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.
Description
This PR introduces the three-tier expedition reward system. Expedition finds (resources, ships, dark matter) now have three tiers of outcome, matching the original OGame behaviour:
The same 89/10/1 weighting was already present for combat (NPC battle size) and delay factors, but each used its own copy of the algorithm. These have been unified under a new
AppUtil::selectWeightedRandom()helper.Expedition messages are now classified by tier: normal-find messages are selected for normal outcomes, and more dramatic messages for rare/exceptional outcomes. A number of new messages have been added to fill out the rare and exceptional tiers.
Type of Change:
Related Issues
Fixes #957
Checklist
Before submitting this pull request, ensure all following requirements as outlined in CONTRIBUTING.md are met:
Additional Information
Not all tier slots have final messages yet. The rare and exceptional tiers for resources, ships, and dark matter currently use placeholder or partially sourced text. Authentic OGame messages for those tiers still need to be researched and added to
resources/lang/en/t_messages.php(and translated). The $numberOfVariations,$normalVariations,$rareVariations, and$exceptionalVariationscounts on each message class will need to be updated accordingly.