Repository navigation
Boosters: fixed wrong card count in 30A, SWS and MH3 (#16370) - #16440
Merged
Merged
Conversation
* 30A: the set has no mythic rares, but used the default mythic ratio, so a rare slot sometimes took a card from an empty mythic list (14 or 13 cards); * SWS: the only double-faced card (Anakin Skywalker, mythic) had its own extra slot, so a booster got 16 cards when that slot rolled mythic; use the normal rarity slots instead (numBoosterDoubleFaced = -1, as in M19 and MH3); * MH3: the M3C commander list kept one printing per name before filtering by number magefree#1-8, so only Disa the Restless was left; a booster with two commander wildcards got 13 cards, and the other 7 commanders never appeared; * tests: added booster size and MH3 commander checks.
JayDi85
approved these changes
Oct 7, 2026
Member
|
Thanks for PR |
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.
Fixes #16370, related to #12590
Each of the three sets had a different cause.
30A (13 or 14 cards)
The set has no mythic rares, but
enableDraftBoostersets the default mythic ratio (1 in 8). For each of the 2 rare slots, a mythic roll took a card from an empty list and the slot stayed empty. Fix:ratioBoosterMythic = 0, as in other sets without mythics.SWS (16 cards)
numBoosterDoubleFaced = 1adds an extra double-faced slot on top of the 15 normal cards. The set has only one double-faced card, Anakin Skywalker (mythic), so that slot stayed empty unless it rolled mythic (1 in 121), and then the booster had 16 cards. Fix:numBoosterDoubleFaced = -1, as in M19 and MH3, so Anakin is a normal mythic in the rare slot.MH3 (13 cards)
The commander list was built as
M3C.getCardsByRarity(MYTHIC)and then filtered to card numbers 1-8.getCardsByRaritykeeps one printing per name first, and for 7 of the 8 commanders the kept printing was above #8, so the filter removed them. Only Disa the Restless was left:Fix: a small helper,
findUniqueCards, applies the number range in the query and only then keeps one printing per name. I used it for the Special Guests list too, since it had the same pattern (all 10 cards were already present there, so nothing changes in practice).I left the MH3 size at 14: the code builds 14 slots on purpose, which matches the real MH3 Play Booster (14 Magic cards plus a token/ad) and
enablePlayBooster. If you expect 15 there, tell me and I will add the slot.Results
Measured locally with a temporary test (not part of this PR):
Tests
Added to
BoosterGenerationTest:test_BoosterSize_NoMissingOrExtraCards: 1,000 boosters each of 30A (15 cards), SWS (15) and MH3 (14);test_ModernHorizons3_AllCommandersInBoosters: all 8 M3C commanders must appear.On the old set code both new tests fail (30A got 14 cards; the commander list was only Disa the Restless). With the fix,
BoosterGenerationTestpasses: 21 tests, 0 failures, 2 skipped (the existing@Ignoredebug tests).I could not run
VerifyCardDataTestlocally: in this setup it needs the MTGJSON download and a scanned card database, so it failed before reaching these sets. It should run normally in CI.