Skip to content

Commit

Permalink
mtgmatcher/callbacks: Simplify Deckmaster code
Browse files Browse the repository at this point in the history
  • Loading branch information
kodawah committed Jul 18, 2024
1 parent f4bed02 commit bfc5fae
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions mtgmatcher/callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,18 @@ func singleLetterVariant(inCard *Card, card *mtgjson.Card) bool {

func deckmastersVariant(inCard *Card, card *mtgjson.Card) bool {
numberSuffix := inCard.possibleNumberSuffix()
if len(card.Variations) > 0 && numberSuffix == "" {
numberSuffix = "a"
if inCard.Foil || inCard.Contains("Promo") {
numberSuffix = mtgjson.SuffixSpecial
} else if card.HasFinish(mtgjson.FinishNonfoil) &&
(card.Name == "Incinerate" || card.Name == "Icy Manipulator") {
numberSuffix = ""
switch card.Name {
case "Incinerate", "Icy Manipulator":
inCard.Foil = inCard.Foil || inCard.Contains("Promo")
return foilCheck(inCard, card)
default:
// Pick the first of the two if not specified
if len(card.Variations) > 0 && numberSuffix == "" && !inCard.isBasicLand() {
numberSuffix = "a"
}
}
if numberSuffix != "" && !strings.HasSuffix(card.Number, numberSuffix) {

if len(card.Variations) > 0 && numberSuffix != "" && !strings.HasSuffix(card.Number, numberSuffix) {
return true
}
return false
Expand Down Expand Up @@ -1026,6 +1028,7 @@ var numberFilterCallbacks = map[string]numberFilterCallback{
"STX": duplicateSomeFoil,
"SHM": duplicateSomeFoil,
"M3C": duplicateSomeFoil,
"DKM": duplicateSomeFoil,

// Intro lands from these sets when non-fullart always have this
"ZEN": duplicateBasicLands,
Expand Down

0 comments on commit bfc5fae

Please sign in to comment.