Skip to content

Commit

Permalink
abugames: Fixup a few cards from inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
kodawah committed Sep 5, 2024
1 parent 3e0f689 commit a679a39
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
2 changes: 2 additions & 0 deletions abugames/abugames.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func (abu *ABUGames) processEntry(channel chan<- resultChan, page int) error {
// There are a bunch of non-existing prerelease cards from mh2
// and promo pack DFC from lci (among others)
if strings.Contains(theCard.Variation, "Prerelease") ||
strings.Contains(theCard.Variation, "The List") ||
strings.Contains(theCard.Variation, "Mystery Booster") ||
strings.Contains(theCard.Variation, "Promo Pack") {
continue
}
Expand Down
32 changes: 26 additions & 6 deletions abugames/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var cardTable = map[string]string{
"Simic Signat": "Simic Signet",
"Specmen 73": "Specimen 73",
"Zilortha, Strength Incarnated": "Zilortha, Strength Incarnate",
"Makindi Siderunner": "Makindi Sliderunner",

"Godzilla, King of the Monsters / Zilortha, Strength Incarnate": "Zilortha, Strength Incarnate",

Expand Down Expand Up @@ -221,11 +222,7 @@ func preprocess(card *ABUCard) (*mtgmatcher.InputCard, error) {
edition = "PRNA"
variation = "189"
}
if strings.Contains(variation, "Scandanavia") {
variation = strings.Replace(variation, "Scandanavia", "Scandinavia", 1)
} else if strings.Contains(variation, "Phillippines") {
variation = strings.Replace(variation, "Phillippines", "Philippines", 1)
} else if strings.Contains(variation, "Secret") || strings.Contains(variation, "Lair") {
if strings.Contains(variation, "Secret") || strings.Contains(variation, "Lair") {
num := mtgmatcher.ExtractNumber(variation)
if num != "" {
variation = num
Expand All @@ -240,8 +237,12 @@ func preprocess(card *ABUCard) (*mtgmatcher.InputCard, error) {
variation = strings.Replace(variation, "FNM", "", 1)
} else if card.Layout == "Planar" {
edition = "Planechase Promos"
} else if variation == "Preview" {
if len(mtgmatcher.MatchInSet(cardName, "MGB")) > 0 {
edition = "MGB"
}
}
case "Secret Lair":
case "Secret Lair", "Secret Lair Drop":
edition = "Secret Lair Drop"
if len(mtgmatcher.MatchInSetNumber(cardName, "SLC", card.Number)) > 0 {
edition = "SLC"
Expand Down Expand Up @@ -290,6 +291,25 @@ func preprocess(card *ABUCard) (*mtgmatcher.InputCard, error) {
cardName = "Spellbinding Soprano"
variation = "Promo Pack"
}
case "Fourth Edition Foreign Black Border":
variation = strings.TrimSuffix(variation, " Japanese")
variation = strings.TrimSuffix(variation, " BB")
variations := strings.Fields(variation)
if len(variations) > 1 && len(variations[0]) == 1 {
variation = strings.Join(variations[1:], " ")
}
case "Fallen Empires":
variations := strings.Fields(variation)
if len(variations) > 1 && len(variations[0]) == 1 {
variation = strings.Join(variations[1:], " ")
}
}

// Either Promo or "European Land Program"
if strings.Contains(variation, "Scandanavia") {
variation = strings.Replace(variation, "Scandanavia", "Scandinavia", 1)
} else if strings.Contains(variation, "Phillippines") {
variation = strings.Replace(variation, "Phillippines", "Philippines", 1)
}

name, found := cardTable[cardName]
Expand Down
17 changes: 17 additions & 0 deletions mtgmatcher/variants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,8 @@ var femVariants = map[string]map[string]string{
"guy with shield on horse": "16b",
"bryon wackwitz female knight": "16a",
"bryon wackwitz male knight": "16b",
"bryon wackwitz flag": "16a",
"bryon wackwitz shield": "16b",

"female": "16a",
"male": "16b",
Expand Down Expand Up @@ -3089,6 +3091,11 @@ var rinVariants = map[string]map[string]string{

"sphere": "176",

"b mouth": "175",
"a bathyscape": "176",
"c pulley": "177",
"d tower": "178",

"v.2": "175",
"v.1": "176",
"v.3": "177",
Expand All @@ -3112,6 +3119,11 @@ var rinVariants = map[string]map[string]string{

"pot": "179",

"d vat": "179",
"b pillar": "180",
"c sphere": "181",
"a bug": "182",

"v.3": "179",
"v.2": "180",
"v.4": "181",
Expand All @@ -3137,6 +3149,11 @@ var rinVariants = map[string]map[string]string{

"mountain": "185",

"a forest": "183",
"c plains": "184",
"b mountains": "185",
"d seashore": "186",

"v.1": "183",
"v.3": "184",
"v.2": "185",
Expand Down

0 comments on commit a679a39

Please sign in to comment.