Skip to content

Boosters: fixed wrong card count in 30A, SWS and MH3 (#16370) - #16440

Merged
JayDi85 merged 1 commit into
magefree:masterfrom
Sharawey74:fix/16370-booster-sizes
Oct 7, 2026
Merged

JayDi85 merged 1 commit into
magefree:masterfrom
Sharawey74:fix/16370-booster-sizes

Conversation

@Sharawey74

@Sharawey74 Sharawey74 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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 enableDraftBooster sets 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 = 1 adds 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. getCardsByRarity keeps 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:

  • a booster where both wildcard slots rolled a commander got 13 cards (the second pick hit an empty list);
  • the other 7 commanders never appeared in MH3 boosters.

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):

Set Before After
30A, 2,000 boosters 15: 1,508, 14: 454, 13: 38 15: 2,000
SWS, 2,000 boosters 15: 1,985, 16: 15 15: 2,000
MH3, 20,000 boosters 38 boosters with 13 cards 14 cards in all of them
MH3 commanders, 20,000 boosters Disa the Restless only (1,701 times) all 8, from 196 to 230 times each

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, BoosterGenerationTest passes: 21 tests, 0 failures, 2 skipped (the existing @Ignore debug tests).

I could not run VerifyCardDataTest locally: 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.

* 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.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JayDi85
JayDi85 merged commit dac400b into magefree:master Oct 7, 2026
3 checks passed
@JayDi85

JayDi85 commented Oct 7, 2026

Copy link
Copy Markdown
Member

Thanks for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some sets wrongly generate boosters with 14 or 16 cards instead 15 (30A and other)

3 participants