Skip to content

Support |SET pinning in booster name() predicate#10439

Closed
vanja-ivancevic wants to merge 1 commit intoCard-Forge:masterfrom
vanja-ivancevic:fix/booster-name-set-pinning
Closed

Support |SET pinning in booster name() predicate#10439
vanja-ivancevic wants to merge 1 commit intoCard-Forge:masterfrom
vanja-ivancevic:fix/booster-name-set-pinning

Conversation

@vanja-ivancevic
Copy link
Copy Markdown
Contributor

  • Booster templates using name("Card|SET") in a non-main-code position silently produced zero cards for that slot. The slot parser routed name(...) through buildExtraPredicate, which used PaperCardPredicates.names(...) to compare operand strings against card.getName(). Names carrying a |SET suffix never matched, so the slot dropped.
  • First surfaced on Shandalar Old Border's ICE booster, whose snow-covered basic land slot is pinned to the ICE printing: 1 name("Snow-Covered Plains|ICE", ...). Packs opened 14 cards instead of 15, with no snow basic.
  • Fix resolves pinned names via StaticData.getCommonCards().getCard(name) (same call the mainCode branch uses) and filters with a set-contains predicate. Plain names without | keep the existing PaperCardPredicates.names path, so current callers (Final Fantasy.txt, Oath of the Gatewatch.txt) are unaffected.
  • Benefits every booster-generation path since they all flow through BoosterGenerator.getBoosterPack: shop packs, draft packs, sealed packs, event rewards.

Booster templates using name("Card|SET") in a non-main-code position
silently produced zero cards for that slot. The slot parser routed
name(...) through buildExtraPredicate, which used
PaperCardPredicates.names(...) to compare operand strings against
card.getName(); names carrying a |SET suffix never matched, so the
slot dropped.

First surfaced on Shandalar Old Border's ICE booster, whose
snow-covered basic slot is pinned to the ICE printing:
1 name("Snow-Covered Plains|ICE", ...). Packs opened 14 cards
instead of 15, with no snow basic.

Resolve pinned names via StaticData.getCommonCards().getCard(name)
(the same call the mainCode branch uses) and filter with a
set-contains predicate. Plain names without | keep the existing
PaperCardPredicates.names path, so current callers (Final Fantasy,
Oath of the Gatewatch) are unaffected.
@Jetz72
Copy link
Copy Markdown
Contributor

Jetz72 commented Apr 20, 2026

Isn't there a fromSets( filter you can use a few lines down?

@vanja-ivancevic
Copy link
Copy Markdown
Contributor Author

Good catch, fromSets() already does the job. Closing in favor of #NEW which fixes the overlay data instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants