diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index bb377fdf99..820b3cea0b 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -2,9 +2,14 @@ package mage.sets; import mage.cards.ExpansionSet; import mage.cards.repository.CardInfo; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; import mage.constants.Rarity; import mage.constants.SetType; +import java.util.ArrayList; import java.util.List; /** @@ -439,4 +444,98 @@ public final class CoreSet2021 extends ExpansionSet { } return cardInfos; } + + @Override + public BoosterCollator createCollator() { + return new CoreSet2021Collator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/m21.html +// Using USA collation for common/uncommon, rare collation inferred from other sets +class CoreSet2021Collator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "26", "59", "153", "39", "54", "140", "2", "83", "132", "12", "72", "148", "19", "50", "134", "30", "47", "155", "11", "56", "153", "42", "46", "165", "31", "59", "168", "35", "83", "141", "15", "62", "152", "2", "55", "163", "26", "50", "140", "12", "81", "132", "39", "54", "134", "30", "72", "148", "19", "56", "168", "11", "47", "165", "42", "62", "141", "35", "46", "152", "31", "55", "155", "15", "81", "163"); + private final CardRun commonB = new CardRun(true, "195", "119", "176", "111", "178", "100", "210", "94", "207", "87", "199", "93", "205", "90", "211", "98", "196", "121", "194", "126", "306", "100", "176", "111", "178", "94", "195", "87", "207", "119", "199", "128", "210", "93", "211", "126", "205", "98", "184", "90", "196", "128", "194", "87", "178", "121", "176", "300", "195", "100", "199", "119", "207", "94", "210", "126", "205", "90", "211", "93", "196", "128", "184", "121", "194", "98"); + private final CardRun commonC1 = new CardRun(true, "113", "44", "193", "145", "235", "156", "24", "86", "20", "192", "96", "67", "238", "91", "161", "248", "212", "99", "236", "147", "14", "66", "115", "158", "231", "44", "51", "145", "113", "193", "235", "96", "24", "156", "201", "248", "67", "147", "238", "20", "192", "86", "161", "91", "236", "99", "66", "212", "14", "115", "231", "158", "237", "201", "51"); + private final CardRun commonC2 = new CardRun(true, "16", "65", "200", "123", "4", "58", "105", "189", "237", "102", "303", "40", "85", "123", "77", "169", "187", "287", "105", "65", "159", "202", "16", "58", "137", "200", "102", "77", "189", "85", "40", "169", "8", "187", "65", "4", "202", "105", "159", "58", "16", "189", "137", "123", "200", "4", "8", "187", "169", "85", "102", "295", "202", "159", "40"); + private final CardRun uncommonA = new CardRun(true, "18", "120", "41", "129", "151", "177", "25", "190", "53", "107", "229", "22", "170", "43", "89", "175", "233", "118", "206", "157", "88", "234", "33", "241", "219", "63", "182", "230", "25", "124", "166", "129", "186", "41", "57", "215", "68", "190", "229", "120", "36", "144", "89", "304", "223", "18", "218", "82", "206", "234", "177", "151", "107", "43", "219", "53", "157", "63", "36", "223", "138", "233", "22", "88", "175", "215", "120", "166", "68", "308", "124", "170", "230", "33", "129", "182", "218", "241", "144", "82", "18", "177", "118", "229", "41", "89", "190", "36", "57", "151", "53", "157", "219", "25", "234", "43", "63", "206", "138", "118", "22", "107", "166", "215", "170", "175", "223", "68", "233", "186", "57", "33", "88", "144", "218", "241", "182", "124", "82", "230"); + private final CardRun uncommonB = new CardRun(true, "227", "92", "78", "109", "209", "79", "150", "226", "198", "160", "101", "5", "97", "80", "10", "130", "84", "131", "49", "214", "220", "181", "213", "37", "149", "34", "171", "64", "154", "221", "17", "216", "298", "71", "203", "150", "61", "209", "78", "34", "217", "122", "160", "3", "226", "174", "131", "79", "227", "80", "198", "5", "92", "289", "112", "49", "181", "154", "84", "213", "101", "214", "130", "97", "64", "226", "203", "149", "220", "17", "109", "61", "171", "37", "112", "296", "217", "174", "150", "216", "71", "122", "79", "209", "3", "221", "80", "130", "198", "131", "10", "227", "92", "84", "5", "181", "160", "101", "49", "214", "154", "34", "213", "97", "37", "171", "220", "203", "221", "17", "122", "64", "3", "217", "61", "149", "71", "216", "112", "174"); + private final CardRun rare = new CardRun(false, "9", "13", "21", "23", "28", "29", "32", "38", "45", "52", "60", "69", "70", "73", "74", "76", "95", "104", "106", "110", "116", "117", "125", "127", "133", "136", "139", "142", "146", "162", "167", "172", "173", "180", "185", "188", "191", "197", "204", "208", "222", "224", "225", "232", "239", "240", "242", "246", "252", "253", "254", "255", "256", "9", "13", "21", "23", "28", "29", "32", "38", "45", "52", "60", "69", "70", "73", "74", "76", "95", "104", "106", "110", "116", "117", "125", "127", "133", "136", "139", "142", "146", "162", "167", "172", "173", "180", "185", "188", "191", "197", "204", "208", "222", "224", "225", "232", "239", "240", "242", "246", "252", "253", "254", "255", "256", "1", "6", "7", "27", "48", "75", "103", "108", "114", "135", "143", "164", "179", "183", "228"); + private final CardRun land = new CardRun(true, "247", "269", "245", "273", "259", "261", "251", "265", "257", "244", "266", "249", "270", "250", "274", "258", "309", "243", "263", "259", "268", "313", "247", "271", "245", "272", "251", "311", "259", "262", "257", "244", "264", "258", "249", "243", "260", "247", "267", "251", "310", "250", "269", "273", "258", "261", "244", "265", "245", "266", "259", "270", "257", "249", "274", "247", "309", "250", "263", "251", "268", "243", "313", "245", "271", "272", "258", "311", "244", "262", "259", "264", "249", "312", "257", "247", "260", "245", "267", "250", "310", "312", "269", "243", "273", "251", "261", "243", "265", "244", "266", "249", "270", "250", "274", "258", "309", "263", "247", "268", "245", "313", "251", "271", "259", "272", "257", "244", "311", "250", "262", "249", "264", "243", "312", "258", "260", "257", "267", "310"); + + private final BoosterStructure AABBC1C1C1C1C1C1 = new BoosterStructure( + commonA, commonA, + commonB, commonB, + commonC1, commonC1, commonC1, commonC1, commonC1, commonC1 + ); + private final BoosterStructure AAABBC1C1C1C1C1 = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, + commonC1, commonC1, commonC1, commonC1, commonC1 + ); + private final BoosterStructure AAAABBC2C2C2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, + commonC2, commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAAABBBC2C2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, commonB, + commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAAABBBBC2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC2, commonC2 + ); + private final BoosterStructure AAB = new BoosterStructure(uncommonA, uncommonA, uncommonB); + private final BoosterStructure ABB = new BoosterStructure(uncommonA, uncommonB, uncommonB); + private final BoosterStructure R1 = new BoosterStructure(rare); + private final BoosterStructure L1 = new BoosterStructure(land); + + // In order for equal numbers of each common to exist, the average booster must contain: + // 3.27 A commons (36 / 11) + // 2.18 B commons (24 / 11) + // 2.73 C1 commons (30 / 11, or 60 / 11 in each C1 booster) + // 1.82 C2 commons (20 / 11, or 40 / 11 in each C2 booster) + // These numbers are the same for all sets with 101 commons in A/B/C1/C2 print runs + // and with 10 common slots per booster + private final RarityConfiguration commonRuns = new RarityConfiguration( + AABBC1C1C1C1C1C1, + AABBC1C1C1C1C1C1, + AABBC1C1C1C1C1C1, + AABBC1C1C1C1C1C1, + AABBC1C1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBBC2C2C2, + AAAABBBC2C2C2, + AAAABBBBC2C2 + ); + private final RarityConfiguration uncommonRuns = new RarityConfiguration(AAB, ABB); + private final RarityConfiguration rareRuns = new RarityConfiguration(R1); + private final RarityConfiguration landRuns = new RarityConfiguration(L1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + booster.addAll(landRuns.getNext().makeRun()); + return booster; + } } diff --git a/Mage.Sets/src/mage/sets/Innistrad.java b/Mage.Sets/src/mage/sets/Innistrad.java index 6f062c6cc0..17209d98a2 100644 --- a/Mage.Sets/src/mage/sets/Innistrad.java +++ b/Mage.Sets/src/mage/sets/Innistrad.java @@ -326,7 +326,7 @@ public final class Innistrad extends ExpansionSet { } // Booster collation info from https://www.lethe.xyz/mtg/collation/isd.html -// Using USA collation for common/uncommon, rare collation inferred from other sets +// Using USA collation class InnistradCollator implements BoosterCollator { private final CardRun commonA = new CardRun(true, "103", "48", "57", "128", "11", "30", "96", "202", "160", "86", "55", "12", "151", "237", "179", "59", "42", "101", "96", "39", "128", "210", "55", "142", "30", "95", "124", "202", "59", "4", "160", "50", "190", "142", "86", "103", "184", "4", "131", "31", "50", "219", "210", "95", "135", "237", "101", "11", "63", "12", "184", "131", "57", "219", "116", "42", "124", "48", "190", "135", "63", "151", "31", "39", "116", "179"); private final CardRun commonB = new CardRun(true, "127", "37", "198", "143", "54", "69", "224", "108", "93", "34", "154", "169", "54", "144", "111", "24", "65", "92", "154", "234", "175", "169", "34", "69", "111", "143", "65", "14", "154", "175", "24", "108", "198", "224", "65", "34", "144", "69", "170", "92", "108", "37", "143", "14", "175", "56", "198", "127", "234", "93", "144", "37", "54", "170", "111", "56", "14", "93", "127", "169", "224", "92", "24", "56", "234", "170"); @@ -334,8 +334,12 @@ class InnistradCollator implements BoosterCollator { private final CardRun commonC2 = new CardRun(true, "41", "173", "74", "206", "102", "7", "75", "153", "79", "113", "173", "148", "201", "118", "75", "83", "156", "41", "200", "91", "113", "102", "79", "7", "156", "173", "1", "91", "74", "246", "118", "153", "7", "206", "83", "201", "1", "74", "148", "118", "156", "200", "113", "206", "41", "79", "91", "153", "201", "75", "102", "1", "200", "148", "83"); private final CardRun uncommonA = new CardRun(true, "125", "76", "133", "20", "22", "221", "98", "171", "66", "139", "100", "49", "32", "235", "133", "191", "125", "58", "229", "35", "137", "72", "98", "203", "221", "20", "76", "217", "150", "122", "72", "187", "88", "15", "240", "229", "161", "53", "235", "97", "100", "15", "232", "171", "139", "53", "217", "97", "240", "35", "150", "191", "88", "58", "227", "22", "66", "187", "137", "122", "161", "32", "232", "227", "49", "203"); private final CardRun uncommonB = new CardRun(true, "62", "223", "157", "85", "28", "218", "16", "192", "60", "225", "157", "180", "28", "45", "110", "222", "172", "163", "27", "60", "162", "188", "223", "110", "70", "19", "163", "218", "192", "85", "172", "109", "45", "19", "158", "225", "233", "119", "188", "26", "62", "27", "158", "222", "211", "119", "70", "233", "162", "26", "16", "109", "211", "180"); - private final CardRun rare = new CardRun(false, "2", "6", "9", "10", "13", "17", "21", "25", "36", "44", "46", "61", "67", "71", "78", "82", "84", "89", "94", "99", "104", "115", "117", "121", "130", "134", "136", "140", "141", "147", "164", "174", "177", "186", "189", "194", "199", "205", "212", "220", "228", "231", "236", "238", "239", "241", "242", "243", "244", "245", "247", "248", "249", "2", "6", "9", "10", "13", "17", "21", "25", "36", "44", "46", "61", "67", "71", "78", "82", "84", "89", "94", "99", "104", "115", "117", "121", "130", "134", "136", "140", "141", "147", "164", "174", "177", "186", "189", "194", "199", "205", "212", "220", "228", "231", "236", "238", "239", "241", "242", "243", "244", "245", "247", "248", "249", "3", "23", "68", "77", "87", "105", "112", "129", "155", "178", "207", "213", "214", "215", "226"); - private final CardRun doubleFaced = new CardRun(false, "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "38", "51", "165", "168", "185", "209", "8", "47", "114", "145", "159", "182", "208", "8", "47", "114", "145", "159", "182", "208", "8", "47", "114", "145", "159", "182", "208", "8", "47", "114", "145", "159", "182", "208", "8", "47", "114", "145", "159", "182", "208", "8", "47", "114", "145", "159", "182", "208", "64", "90", "149", "152", "176", "193", "64", "90", "149", "152", "176", "193", "181"); + private final CardRun rareA = new CardRun(true, "3", "68", "141", "105", "178", "236", "17", "112", "213", "71", "207", "141", "87", "236", "77", "17", "207", "155", "215", "71", "236", "112", "177", "23", "129", "77", "115", "215", "177", "141", "226", "87", "17", "129", "213", "115", "177", "68", "155", "236", "105", "71", "177", "214", "23", "141", "3", "115", "71", "178", "226", "17", "214", "115", "243"); + private final CardRun rareB = new CardRun(true, "84", "10", "174", "247", "25", "89", "121", "243", "10", "186", "61", "147", "84", "121", "130", "220", "174", "89", "147", "25", "61", "247", "186", "130", "89", "245", "25", "84", "186", "147", "121", "10", "61", "245", "243", "130", "174", "84", "247", "89", "220", "243", "186", "245", "130", "10", "220", "247", "147", "174", "61", "121", "25", "220", "245"); + private final CardRun rareC = new CardRun(true, "164", "238", "2", "228", "239", "21", "212", "248", "231", "242", "104", "13", "205", "2", "249", "241", "228", "21", "238", "46", "205", "239", "13", "249", "164", "104", "228", "238", "46", "82", "21", "241", "2", "248", "205", "164", "231", "238", "13", "249", "21", "248", "46", "82", "239", "228", "212", "242", "241", "104", "231", "46", "249", "205", "82", "164", "248", "242", "2", "104", "239", "231", "241", "13", "82", "242"); + private final CardRun rareD = new CardRun(true, "117", "199", "67", "36", "189", "94", "244", "6", "194", "117", "44", "140", "78", "199", "134", "99", "9", "94", "44", "194", "78", "212", "136", "189", "117", "67", "6", "199", "140", "9", "134", "78", "117", "244", "44", "199", "99", "136", "9", "67", "189", "6", "94", "36", "244", "140", "99", "67", "194", "189", "9", "36", "44", "134", "94", "136", "244", "194", "99", "78", "36", "134", "212", "140", "6", "136"); + private final CardRun doubleFacedA = new CardRun(true, "149", "168", "208", "185", "8", "38", "114", "168", "145", "185", "193", "38", "8", "168", "208", "185", "145", "38", "64", "168", "114", "185", "90", "38", "208", "168", "8", "185", "114", "38", "145", "168", "149", "185", "8", "38", "208", "168", "181", "185", "145", "38", "114", "168", "193", "185", "208", "38", "8", "168", "64", "185", "114", "38", "145", "168", "90", "185", "8", "38", "208", "168", "145", "185", "114", "38"); + private final CardRun doubleFacedB = new CardRun(true, "159", "165", "182", "209", "51", "47", "165", "176", "209", "51", "159", "165", "182", "209", "51", "47", "165", "159", "209", "51", "182", "165", "152", "209", "51", "47", "159", "165", "209", "51", "182", "165", "47", "209", "51", "176", "165", "159", "209", "51", "182", "165", "47", "209", "51", "159", "165", "182", "209", "51", "152", "165", "47", "209", "51"); private final CardRun land = new CardRun(false, "250", "251", "252", "253", "254", "255", "256", "257", "258", "259", "260", "261", "262", "263", "264"); private final BoosterStructure AABBC1C1C1C1C1 = new BoosterStructure( @@ -360,8 +364,12 @@ class InnistradCollator implements BoosterCollator { ); private final BoosterStructure AAB = new BoosterStructure(uncommonA, uncommonA, uncommonB); private final BoosterStructure ABB = new BoosterStructure(uncommonA, uncommonB, uncommonB); - private final BoosterStructure R1 = new BoosterStructure(rare); - private final BoosterStructure D1 = new BoosterStructure(doubleFaced); + private final BoosterStructure R1 = new BoosterStructure(rareA); + private final BoosterStructure R2 = new BoosterStructure(rareB); + private final BoosterStructure R3 = new BoosterStructure(rareC); + private final BoosterStructure R4 = new BoosterStructure(rareD); + private final BoosterStructure D1 = new BoosterStructure(doubleFacedA); + private final BoosterStructure D2 = new BoosterStructure(doubleFacedB); private final BoosterStructure L1 = new BoosterStructure(land); // In order for equal numbers of each common to exist, the average booster must contain: @@ -391,8 +399,16 @@ class InnistradCollator implements BoosterCollator { AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, ABB, ABB, ABB, ABB, ABB, ABB, ABB ); - private final RarityConfiguration rareRuns = new RarityConfiguration(R1); - private final RarityConfiguration dfcRuns = new RarityConfiguration(D1); + private final RarityConfiguration rareRuns = new RarityConfiguration( + R1, R1, R1, R1, R1, + R2, R2, R2, R2, R2, + R3, R3, R3, R3, R3, R3, + R4, R4, R4, R4, R4, R4 + ); + private final RarityConfiguration dfcRuns = new RarityConfiguration( + D1, D1, D1, D1, D1, D1, + D2, D2, D2, D2, D2 + ); private final RarityConfiguration landRuns = new RarityConfiguration(L1); @Override diff --git a/Mage.Sets/src/mage/sets/Magic2013.java b/Mage.Sets/src/mage/sets/Magic2013.java index ebf5803ca1..391404dea8 100644 --- a/Mage.Sets/src/mage/sets/Magic2013.java +++ b/Mage.Sets/src/mage/sets/Magic2013.java @@ -1,10 +1,16 @@ - package mage.sets; import mage.cards.ExpansionSet; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; import mage.constants.Rarity; import mage.constants.SetType; +import java.util.ArrayList; +import java.util.List; + /** * * @author North @@ -275,4 +281,123 @@ public final class Magic2013 extends ExpansionSet { cards.add(new SetCardInfo("Yeva's Forcemage", 198, Rarity.COMMON, mage.cards.y.YevasForcemage.class)); cards.add(new SetCardInfo("Zombie Goliath", 119, Rarity.COMMON, mage.cards.z.ZombieGoliath.class)); } + + @Override + public BoosterCollator createCollator() { + return new Magic2013Collator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/m13.html +// Using USA collation +class Magic2013Collator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "86", "186", "146", "9", "62", "100", "25", "75", "179", "152", "98", "17", "76", "155", "170", "157", "89", "18", "62", "137", "195", "124", "100", "30", "41", "146", "172", "35", "82", "89", "61", "48", "178", "25", "30", "98", "53", "137", "186", "35", "143", "75", "108", "152", "172", "34", "76", "157", "86", "9", "178", "124", "61", "170", "108", "17", "155", "48", "179", "34", "82", "195", "41", "18", "143", "53"); + private final CardRun commonB = new CardRun(true, "93", "40", "55", "147", "60", "101", "181", "11", "58", "130", "99", "164", "121", "15", "40", "110", "60", "55", "93", "13", "130", "147", "165", "54", "99", "11", "189", "153", "3", "58", "93", "164", "78", "130", "40", "165", "110", "13", "55", "101", "153", "54", "15", "189", "78", "99", "181", "3", "147", "164", "60", "121", "11", "110", "189", "54", "13", "153", "181", "15", "101", "78", "58", "121", "165", "3"); + private final CardRun commonC1 = new CardRun(true, "194", "85", "135", "115", "74", "6", "196", "160", "144", "94", "66", "5", "90", "198", "192", "156", "47", "38", "119", "194", "122", "94", "80", "2", "182", "79", "139", "83", "224", "160", "16", "47", "144", "119", "198", "85", "38", "139", "74", "192", "135", "2", "90", "79", "196", "115", "122", "6", "80", "182", "5", "156", "83", "66", "16"); + private final CardRun commonC2 = new CardRun(true, "49", "24", "163", "106", "51", "134", "12", "7", "190", "92", "149", "128", "24", "111", "169", "50", "116", "134", "163", "51", "224", "49", "106", "149", "161", "111", "12", "126", "24", "169", "190", "116", "7", "128", "92", "49", "161", "51", "126", "106", "50", "190", "163", "149", "111", "92", "134", "7", "161", "12", "116", "169", "126", "50", "128"); + private final CardRun uncommonA = new CardRun(true, "159", "10", "207", "201", "81", "73", "185", "127", "212", "4", "96", "43", "175", "215", "133", "39", "114", "67", "166", "73", "127", "95", "201", "212", "28", "188", "151", "114", "215", "213", "10", "185", "67", "91", "207", "141", "42", "19", "166", "214", "96", "71", "151", "39", "205", "91", "159", "42", "142", "19", "214", "211", "188", "81", "133", "4", "205", "213", "175", "71", "142", "28", "211", "43", "95", "141"); + private final CardRun uncommonB = new CardRun(true, "154", "107", "65", "210", "171", "208", "31", "84", "57", "132", "173", "219", "202", "107", "52", "21", "154", "187", "208", "112", "46", "31", "22", "177", "125", "84", "204", "52", "227", "21", "187", "112", "120", "209", "46", "27", "210", "105", "125", "171", "219", "65", "202", "132", "227", "173", "204", "57", "22", "120", "105", "27", "209", "177"); + private final CardRun rareA = new CardRun(true, "20", "70", "162", "228", "14", "37", "88", "29", "45", "229", "129", "109", "217", "136", "72", "14", "118", "88", "228", "20", "193", "45", "70", "229", "136", "162", "129", "29", "109", "118", "37", "193", "72", "228", "45", "88", "20", "129", "136", "70", "109", "14", "162", "229", "72", "37", "228", "193", "29", "20", "118", "45", "129", "14", "70", "217", "162", "109", "37", "29", "229", "88", "193", "136", "118", "72"); + private final CardRun rareB = new CardRun(true, "26", "148", "184", "220", "68", "168", "77", "131", "223", "64", "218", "222", "184", "168", "220", "102", "68", "148", "103", "222", "64", "131", "218", "102", "77", "26", "184", "223", "103", "131", "68", "64", "148", "222", "102", "184", "218", "168", "131", "26", "103", "220", "77", "148", "223", "218", "68", "26", "222", "220", "64", "103", "168", "102", "223"); + private final CardRun rareC = new CardRun(true, "33", "59", "221", "87", "23", "206", "191", "226", "117", "69", "33", "217", "225", "221", "140", "87", "197", "59", "138", "226", "69", "216", "206", "180", "140", "59", "23", "221", "117", "191", "225", "216", "33", "197", "138", "87", "180", "226", "206", "117", "59", "191", "140", "23", "180", "216", "221", "69", "206", "197", "117", "33", "180", "138", "216", "226", "197", "225", "69", "23", "191", "87", "217", "138", "225", "140"); + private final CardRun rareD = new CardRun(true, "145", "104", "183", "203", "8", "36", "123", "113", "176", "1", "97", "44", "145", "183", "200", "203", "104", "56", "158", "174", "8", "199", "44", "113", "145", "1", "203", "176", "63", "123", "200", "8", "167", "104", "199", "150", "44", "36", "176", "77", "203", "145", "32", "174", "104", "63", "150", "8", "44", "176", "97", "167", "158", "32", "56"); + private final CardRun land = new CardRun(false, "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249"); + + private final BoosterStructure AAABC1C1C1C1C1C1 = new BoosterStructure( + commonA, commonA, commonA, + commonB, + commonC1, commonC1, commonC1, commonC1, commonC1, commonC1 + ); + private final BoosterStructure AAABBC1C1C1C1C1 = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, + commonC1, commonC1, commonC1, commonC1, commonC1 + ); + private final BoosterStructure AAABBBC2C2C2C2 = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, + commonC2, commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAABBBBC2C2C2 = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAAABBC2C2C2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, + commonC2, commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAAABBBC2C2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, commonB, + commonC2, commonC2, commonC2 + ); + private final BoosterStructure AAB = new BoosterStructure(uncommonA, uncommonA, uncommonB); + private final BoosterStructure ABB = new BoosterStructure(uncommonA, uncommonB, uncommonB); + private final BoosterStructure R1 = new BoosterStructure(rareA); + private final BoosterStructure R2 = new BoosterStructure(rareB); + private final BoosterStructure R3 = new BoosterStructure(rareC); + private final BoosterStructure R4 = new BoosterStructure(rareD); + private final BoosterStructure L1 = new BoosterStructure(land); + + // In order for equal numbers of each common to exist, the average booster must contain: + // 3.27 A commons (36 / 11) + // 2.18 B commons (24 / 11) + // 2.73 C1 commons (30 / 11, or 60 / 11 in each C1 booster) + // 1.82 C2 commons (20 / 11, or 40 / 11 in each C2 booster) + // These numbers are the same for all sets with 101 commons in A/B/C1/C2 print runs + // and with 10 common slots per booster + private final RarityConfiguration commonRuns = new RarityConfiguration( + AAABC1C1C1C1C1C1, + AAABC1C1C1C1C1C1, + AAABC1C1C1C1C1C1, + AAABC1C1C1C1C1C1, + AAABC1C1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + AAABBC1C1C1C1C1, + + AAABBBC2C2C2C2, + AAABBBC2C2C2C2, + AAABBBC2C2C2C2, + AAABBBBC2C2C2, + AAABBBBC2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBC2C2C2C2, + AAAABBBC2C2C2, + AAAABBBC2C2C2 + ); + // In order for equal numbers of each uncommon to exist, the average booster must contain: + // 1.65 A uncommons (33 / 20) + // 1.35 B uncommons (27 / 20) + // These numbers are the same for all sets with 60 uncommons in asymmetrical A/B print runs + private final RarityConfiguration uncommonRuns = new RarityConfiguration( + AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, AAB, + ABB, ABB, ABB, ABB, ABB, ABB, ABB + ); + + private final RarityConfiguration rareRuns = new RarityConfiguration( + R1, R1, R1, R1, R1, R1, + R2, R2, R2, R2, R2, + R3, R3, R3, R3, R3, R3, + R4, R4, R4, R4, R4 + ); + + private final RarityConfiguration landRuns = new RarityConfiguration(L1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + booster.addAll(landRuns.getNext().makeRun()); + return booster; + } } diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index c7ba126018..9539f63b75 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -1,9 +1,16 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; import mage.constants.Rarity; import mage.constants.SetType; +import java.util.ArrayList; +import java.util.List; + /** * @author TheElk801 */ @@ -495,4 +502,44 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Ziatora, the Incinerator", 339, Rarity.MYTHIC, mage.cards.z.ZiatoraTheIncinerator.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ziatora, the Incinerator", 404, Rarity.MYTHIC, mage.cards.z.ZiatoraTheIncinerator.class, NON_FULL_USE_VARIOUS)); } + + @Override + public BoosterCollator createCollator() { + return new StreetsOfNewCapennaCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/snc.html +// Using USA collation for common/uncommon, rare collation inferred from other sets +class StreetsOfNewCapennaCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "131", "164", "76", "49", "2", "132", "149", "74", "66", "7", "106", "154", "78", "53", "16", "108", "153", "75", "43", "4", "100", "157", "85", "48", "13", "120", "155", "88", "50", "6", "111", "150", "84", "60", "19", "119", "136", "70", "58", "28", "102", "139", "91", "39", "9", "113", "138", "71", "37", "32", "115", "133", "79", "35", "25", "131", "140", "86", "49", "26", "124", "149", "76", "36", "7", "132", "164", "78", "53", "2", "106", "153", "74", "66", "16", "100", "154", "75", "43", "4", "108", "157", "88", "48", "13", "120", "150", "85", "50", "6", "111", "155", "84", "58", "9", "119", "136", "70", "60", "19", "113", "138", "91", "35", "28", "115", "139", "71", "37", "32", "102", "133", "79", "39", "25", "124", "140", "86", "36", "26", "236"); + private final CardRun commonB = new CardRun(true, "151", "87", "222", "168", "256", "224", "18", "239", "249", "80", "251", "5", "40", "255", "243", "125", "328", "247", "174", "31", "137", "57", "352", "59", "190", "242", "248", "221", "73", "259", "114", "146", "104", "176", "238", "356", "194", "241", "222", "151", "252", "87", "201", "224", "354", "168", "5", "249", "40", "251", "239", "18", "255", "80", "243", "214", "125", "137", "31", "174", "247", "57", "59", "242", "190", "248", "73", "253", "221", "114", "241", "357", "194", "146", "104", "176", "238", "252", "87", "319", "258", "151", "222", "236", "168", "256", "249", "18", "239", "40", "335", "251", "5", "80", "214", "255", "125", "243", "174", "350", "57", "137", "31", "242", "309", "253", "59", "333", "248", "114", "73", "194", "259", "146", "104", "176", "238", "258", "201", "241", "252"); + private final CardRun uncommonA = new CardRun(true, "296", "55", "173", "89", "127", "1", "161", "52", "235", "205", "99", "227", "156", "203", "234", "177", "20", "44", "196", "128", "185", "135", "103", "29", "187", "92", "225", "47", "23", "212", "147", "77", "118", "61", "8", "218", "110", "142", "180", "82", "169", "89", "173", "55", "1", "161", "127", "52", "321", "235", "227", "156", "99", "203", "234", "20", "301", "196", "128", "44", "135", "185", "103", "187", "92", "225", "29", "47", "212", "23", "77", "147", "61", "118", "142", "8", "332", "110", "169", "82", "303", "55", "89", "300", "1", "161", "127", "52", "205", "156", "99", "227", "235", "203", "20", "177", "234", "185", "44", "314", "128", "187", "135", "103", "29", "92", "225", "47", "147", "118", "23", "326", "61", "77", "8", "142", "218", "82", "110", "180"); + private final CardRun uncommonB = new CardRun(true, "244", "51", "317", "54", "121", "90", "33", "143", "175", "107", "98", "331", "117", "81", "181", "152", "220", "64", "83", "163", "182", "96", "298", "245", "141", "17", "178", "122", "226", "3", "233", "189", "158", "62", "21", "204", "45", "27", "323", "123", "54", "244", "199", "51", "121", "143", "33", "175", "90", "117", "217", "81", "107", "98", "220", "152", "181", "83", "64", "304", "163", "171", "96", "141", "178", "245", "17", "122", "3", "226", "62", "189", "233", "158", "204", "45", "21", "123", "208", "27", "244", "54", "199", "51", "121", "143", "90", "107", "33", "175", "117", "98", "217", "152", "81", "220", "64", "163", "181", "83", "182", "96", "141", "245", "171", "17", "226", "233", "3", "302", "122", "21", "62", "158", "189", "27", "320", "45", "123", "208"); + private final CardRun rare = new CardRun(false, "10", "12", "14", "22", "24", "38", "41", "46", "56", "63", "65", "69", "72", "93", "94", "95", "97", "105", "109", "112", "116", "126", "130", "144", "145", "148", "160", "165", "166", "167", "170", "172", "179", "183", "184", "188", "191", "192", "195", "198", "200", "207", "209", "210", "211", "215", "216", "219", "223", "228", "229", "230", "232", "237", "246", "250", "254", "257", "260", "261", "10", "12", "14", "22", "24", "38", "41", "46", "56", "63", "65", "69", "72", "93", "94", "95", "97", "105", "109", "112", "116", "126", "130", "144", "145", "148", "160", "165", "166", "167", "170", "172", "179", "183", "184", "188", "191", "192", "195", "198", "200", "207", "209", "210", "211", "215", "216", "219", "223", "228", "229", "230", "232", "237", "246", "250", "254", "257", "260", "261", "11", "15", "30", "34", "42", "67", "68", "101", "129", "134", "159", "162", "186", "193", "197", "202", "206", "213", "231", "240"); + private final CardRun land = new CardRun(false, "262", "263", "264", "265", "266", "267", "268", "269", "270", "271", "272", "273", "274", "275", "276", "277", "278", "279", "280", "281"); + + private final BoosterStructure AAAAAABBBB = new BoosterStructure( + commonA, commonA, commonA, commonA, commonA, commonA, + commonB, commonB, commonB, commonB + ); + private final BoosterStructure AAA = new BoosterStructure(uncommonA, uncommonA, uncommonA); + private final BoosterStructure BBB = new BoosterStructure(uncommonB, uncommonB, uncommonB); + private final BoosterStructure R1 = new BoosterStructure(rare); + private final BoosterStructure L1 = new BoosterStructure(land); + + private final RarityConfiguration commonRuns = new RarityConfiguration(AAAAAABBBB); + private final RarityConfiguration uncommonRuns = new RarityConfiguration(AAA, BBB); + private final RarityConfiguration rareRuns = new RarityConfiguration(R1); + private final RarityConfiguration landRuns = new RarityConfiguration(L1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + booster.addAll(landRuns.getNext().makeRun()); + return booster; + } } diff --git a/Mage.Sets/src/mage/sets/UltimateMasters.java b/Mage.Sets/src/mage/sets/UltimateMasters.java index 7e39b5da52..6d6bba9560 100644 --- a/Mage.Sets/src/mage/sets/UltimateMasters.java +++ b/Mage.Sets/src/mage/sets/UltimateMasters.java @@ -1,9 +1,16 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; import mage.constants.Rarity; import mage.constants.SetType; +import java.util.ArrayList; +import java.util.List; + /** * @author JayDi85 */ @@ -281,4 +288,106 @@ public final class UltimateMasters extends ExpansionSet { cards.add(new SetCardInfo("Woodfall Primus", 195, Rarity.RARE, mage.cards.w.WoodfallPrimus.class)); cards.add(new SetCardInfo("Young Pyromancer", 155, Rarity.UNCOMMON, mage.cards.y.YoungPyromancer.class)); } + + @Override + public BoosterCollator createCollator() { + return new UltimateMastersCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/uma.html +// Using Japanese collation for common/uncommon, rare collation inferred from other sets +class UltimateMastersCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "79", "221", "44", "137", "60", "43", "68", "212", "73", "134", "82", "21", "57", "225", "54", "180", "75", "226", "78", "144", "68", "16", "69", "129", "44", "252", "79", "72", "221", "49", "137", "45", "43", "82", "225", "78", "144", "73", "21", "54", "212", "57", "180", "60", "226", "68", "134", "75", "21", "69", "129", "44", "252", "49", "72", "221", "79", "137", "45", "16", "82", "212", "57", "134", "78", "43", "54", "226", "60", "180", "69", "225", "73", "144", "45", "21", "75", "129", "44", "221", "79", "72", "252", "49", "144", "60", "16", "82", "212", "68", "137", "78", "43", "54", "226", "73", "180", "57", "225", "45", "134", "75", "16", "69", "129", "49", "252", "72"); + private final CardRun commonB = new CardRun(true, "90", "173", "191", "96", "194", "55", "100", "168", "102", "53", "161", "114", "170", "92", "111", "190", "102", "156", "95", "231", "171", "118", "48", "185", "109", "108", "181", "91", "192", "105", "166", "179", "107", "173", "120", "86", "168", "103", "184", "156", "100", "194", "55", "96", "178", "90", "48", "191", "114", "170", "118", "111", "190", "109", "168", "108", "231", "171", "105", "53", "161", "103", "92", "156", "91", "170", "86", "178", "185", "107", "184", "120", "95", "166", "90", "173", "179", "96", "194", "48", "118", "191", "102", "55", "190", "114", "192", "100", "111", "161", "109", "181", "231", "92", "171", "108", "53", "185", "107", "95", "166", "91", "192", "105", "178", "179", "103", "184", "86", "120", "181"); + private final CardRun commonC = new CardRun(true, "140", "8", "40", "121", "24", "29", "142", "213", "30", "128", "235", "12", "133", "220", "23", "143", "222", "42", "123", "230", "33", "135", "213", "24", "151", "214", "19", "141", "224", "40", "149", "25", "133", "29", "153", "8", "36", "142", "211", "18", "121", "23", "22", "140", "219", "24", "148", "220", "12", "143", "213", "10", "151", "235", "40", "123", "222", "30", "141", "230", "18", "128", "8", "19", "135", "219", "23", "121", "25", "153", "33", "148", "214", "10", "142", "222", "22", "149", "29", "42", "140", "224", "33", "128", "220", "12", "133", "211", "36", "153", "219", "42", "143", "214", "30", "141", "235", "19", "151", "230", "10", "135", "224", "22", "149", "25", "123", "18", "148", "211", "36"); + private final CardRun uncommonA = new CardRun(true, "136", "183", "80", "209", "74", "9", "113", "13", "127", "17", "228", "223", "246", "217", "247", "209", "165", "216", "115", "26", "198", "163", "83", "136", "52", "74", "183", "9", "130", "80", "127", "223", "17", "13", "247", "113", "228", "246", "216", "165", "26", "136", "217", "115", "163", "198", "83", "183", "13", "74", "209", "127", "17", "80", "223", "52", "136", "113", "228", "130", "165", "247", "216", "115", "26", "246", "217", "198", "9", "209", "13", "163", "80", "183", "83", "130", "223", "17", "165", "52", "74", "113", "127", "246", "9", "217", "228", "216", "83", "247", "52", "115", "130", "26", "198", "163"); + private final CardRun uncommonB = new CardRun(true, "112", "188", "65", "158", "84", "125", "193", "56", "182", "196", "131", "39", "200", "169", "28", "97", "35", "160", "62", "155", "205", "89", "20", "98", "122", "47", "250", "208", "39", "70", "88", "177", "197", "67", "125", "119", "234", "37", "66", "126", "65", "188", "131", "157", "101", "145", "20", "162", "61", "28", "210", "240", "186", "139", "64", "218", "15", "138", "201", "159", "27", "169", "84", "193", "2", "97", "205", "88", "35", "56", "112", "200", "59", "196", "70", "155", "89", "208", "122", "62", "182", "61", "158", "119", "47", "126", "15", "67", "145", "101", "64", "197", "98", "162", "250", "138", "66", "186", "37", "160", "210", "2", "157", "201", "234", "159", "218", "139", "27", "59", "177", "240"); + private final CardRun rare = new CardRun(false, "1", "3", "11", "14", "31", "32", "34", "38", "41", "46", "50", "51", "58", "63", "76", "81", "87", "93", "94", "99", "110", "116", "117", "132", "146", "147", "150", "152", "154", "164", "167", "172", "174", "175", "176", "195", "199", "204", "207", "215", "227", "232", "236", "238", "239", "242", "243", "245", "248", "249", "251", "253", "254"); + private final CardRun mythic = new CardRun(false, "4", "5", "6", "7", "71", "77", "85", "104", "106", "124", "187", "189", "202", "203", "206", "229", "233", "237", "241", "244"); + private final CardRun foilCommon = new CardRun(false, "8", "10", "12", "16", "18", "19", "21", "22", "23", "24", "25", "29", "30", "33", "36", "40", "42", "43", "44", "45", "48", "49", "53", "54", "55", "57", "60", "68", "69", "72", "73", "75", "78", "79", "82", "86", "90", "91", "92", "95", "96", "100", "102", "103", "105", "107", "108", "109", "111", "114", "118", "120", "121", "123", "128", "129", "133", "134", "135", "137", "140", "141", "142", "143", "144", "148", "149", "151", "153", "156", "161", "166", "168", "170", "171", "173", "178", "179", "180", "181", "184", "185", "190", "191", "192", "194", "211", "212", "213", "214", "219", "220", "221", "222", "224", "225", "226", "230", "231", "235", "252"); + private final CardRun foilUncommon = new CardRun(false, "2", "9", "13", "15", "17", "20", "26", "27", "28", "35", "37", "39", "47", "52", "56", "59", "61", "62", "64", "65", "66", "67", "70", "74", "80", "83", "84", "88", "89", "97", "98", "101", "112", "113", "115", "119", "122", "125", "126", "127", "130", "131", "136", "138", "139", "145", "155", "157", "158", "159", "160", "162", "163", "165", "169", "177", "182", "183", "186", "188", "193", "196", "197", "198", "200", "201", "205", "208", "209", "210", "216", "217", "218", "223", "228", "234", "240", "246", "247", "250"); + + private final BoosterStructure AABBBBCCCC = new BoosterStructure( + commonA, commonA, + commonB, commonB, commonB, commonB, + commonC, commonC, commonC, commonC + ); + + private final BoosterStructure AAABBBCCCC = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, + commonC, commonC, commonC, commonC + ); + + private final BoosterStructure AAABBBBCCC = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC, commonC, commonC + ); + + private final BoosterStructure ABB = new BoosterStructure(uncommonA, uncommonB, uncommonB); + private final BoosterStructure BBB = new BoosterStructure(uncommonB, uncommonB, uncommonB); + private final BoosterStructure R1 = new BoosterStructure(rare); + private final BoosterStructure M1 = new BoosterStructure(mythic); + private final BoosterStructure FC = new BoosterStructure(foilCommon); + private final BoosterStructure FU = new BoosterStructure(foilUncommon); + + // In order for equal numbers of each common to exist, the average booster must contain: + // 2.67 A commons (270 / 101) + // 3.66 B commons (370 / 101) + // 3.66 C commons (370 / 101) + private final RarityConfiguration commonRuns = new RarityConfiguration( + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC + ); + // In order for equal numbers of each uncommon to exist, the average booster must contain: + // 0.9 A uncommons (72 / 80) + // 2.1 B uncommons (168 / 80) + private final RarityConfiguration uncommonRuns = new RarityConfiguration( + ABB, ABB, ABB, ABB, ABB, ABB, ABB, ABB, ABB, BBB + ); + private final RarityConfiguration rareRuns = new RarityConfiguration(R1, R1, R1, R1, R1, R1, R1, M1); + private final RarityConfiguration foilRuns = new RarityConfiguration( + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FC, FC, FC, FC, FC, FC, FC, FC, + FU, FU, FU, FU, FU, FU, FU, FU, + FU, FU, FU, FU, FU, FU, FU, FU, + FU, FU, FU, FU, FU, FU, FU, FU, + R1, R1, R1, R1, R1, R1, R1, M1 + ); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + booster.addAll(foilRuns.getNext().makeRun()); + return booster; + } } diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 44e7be65b7..fc644ff641 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -4,9 +4,14 @@ import mage.cards.ExpansionSet; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; import mage.constants.Rarity; import mage.constants.SetType; +import java.util.ArrayList; import java.util.List; /** @@ -437,4 +442,81 @@ public final class ZendikarRising extends ExpansionSet { .maxCardNumber(maxCardNumberInBooster))); return cardInfos; } + + @Override + public BoosterCollator createCollator() { + return new ZendikarRisingCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/znr.html +// Using Japanese collation for common/uncommon, rare collation inferred from other sets +class ZendikarRisingCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "45", "110", "99", "254", "105", "102", "255", "117", "135", "114", "243", "128", "79", "107", "116", "168", "92", "131", "71", "93", "251", "119", "78", "103", "164", "101", "112", "45", "101", "243", "116", "135", "107", "254", "103", "128", "164", "117", "79", "93", "102", "251", "131", "71", "99", "112", "255", "114", "78", "110", "168", "119", "45", "105", "92", "164", "93", "103", "135", "101", "105", "251", "117", "79", "114", "168", "99", "254", "107", "78", "131", "255", "110", "92", "45", "119", "128", "243", "112", "102", "71", "116", "135", "92", "103", "254", "99", "114", "79", "107", "168", "117", "105", "243", "131", "71", "119", "112", "251", "110", "78", "101", "128", "255", "93", "164", "116", "102"); + private final CardRun commonB = new CardRun(true, "208", "173", "36", "210", "88", "10", "195", "28", "194", "8", "104", "181", "18", "13", "206", "158", "32", "188", "42", "256", "185", "9", "157", "197", "14", "191", "84", "33", "200", "22", "184", "253", "3", "177", "36", "206", "14", "210", "18", "173", "200", "28", "9", "184", "104", "13", "208", "158", "33", "194", "88", "8", "202", "157", "22", "188", "253", "35", "177", "3", "256", "195", "43", "191", "10", "185", "84", "42", "197", "32", "181", "9", "256", "210", "35", "88", "202", "42", "181", "28", "206", "18", "195", "13", "173", "194", "43", "188", "33", "84", "208", "22", "104", "177", "8", "158", "197", "36", "185", "3", "253", "184", "32", "200", "10", "191", "14", "157", "202", "43", "35"); + private final CardRun commonC = new CardRun(true, "294", "82", "142", "100", "65", "138", "34", "296", "155", "162", "51", "96", "172", "47", "144", "100", "59", "152", "182", "62", "169", "199", "50", "138", "56", "310", "142", "48", "38", "167", "58", "214", "137", "62", "29", "149", "73", "293", "140", "57", "190", "172", "55", "25", "133", "47", "96", "302", "50", "182", "133", "56", "38", "144", "73", "213", "142", "58", "297", "138", "48", "25", "155", "62", "214", "152", "57", "34", "137", "55", "306", "140", "59", "65", "169", "29", "82", "162", "199", "51", "149", "55", "172", "73", "162", "65", "96", "299", "51", "38", "169", "48", "214", "167", "47", "152", "213", "59", "144", "190", "57", "140", "304", "56", "149", "199", "58", "137", "29", "50", "155"); + private final CardRun uncommon = new CardRun(true, "227", "66", "20", "170", "238", "204", "257", "126", "205", "171", "21", "228", "295", "160", "235", "52", "229", "163", "109", "201", "89", "237", "31", "69", "121", "218", "250", "139", "187", "74", "11", "236", "196", "143", "81", "221", "154", "222", "70", "141", "249", "97", "290", "247", "94", "87", "219", "1", "130", "136", "15", "224", "248", "6", "212", "123", "17", "113", "227", "217", "83", "238", "66", "20", "257", "170", "126", "204", "52", "160", "21", "205", "301", "109", "228", "171", "218", "139", "75", "89", "201", "69", "235", "121", "31", "143", "187", "229", "11", "74", "154", "237", "250", "81", "196", "141", "222", "249", "70", "7", "236", "97", "291", "248", "87", "94", "6", "219", "221", "123", "247", "224", "130", "1", "212", "113", "17", "136", "66", "227", "217", "83", "238", "170", "20", "126", "75", "205", "52", "160", "257", "109", "309", "228", "21", "171", "235", "201", "163", "89", "143", "218", "121", "69", "31", "139", "229", "250", "187", "11", "74", "196", "154", "7", "237", "222", "81", "249", "141", "94", "70", "247", "311", "97", "219", "6", "87", "130", "15", "248", "224", "123", "212", "1", "136", "236", "17", "83", "113", "217"); + private final CardRun uncommonDFC = new CardRun(true, "180", "120", "80", "166", "19", "46", "91", "134", "26", "192", "132", "64", "40", "216", "146", "111", "86", "37", "165", "211", "80", "120", "166", "19", "180", "46", "91", "134", "192", "26", "64", "132", "216", "86", "146", "40", "211", "111", "80", "165", "120", "180", "37", "166", "46", "192", "91", "19", "134", "132", "64", "216", "26", "86", "146", "211", "40", "165", "111", "80", "180", "37", "166", "120", "46", "216", "19", "134", "91", "192", "26", "64", "132", "211", "86", "40", "146", "111", "80", "165", "37", "120", "180", "19", "166", "46", "192", "134", "26", "91", "216", "64", "132", "40", "211", "146", "86", "111", "165", "37"); + private final CardRun rare = new CardRun(false, "4", "5", "16", "23", "24", "27", "39", "41", "49", "53", "54", "61", "67", "68", "72", "85", "95", "108", "115", "118", "124", "125", "127", "129", "145", "148", "151", "153", "156", "159", "175", "176", "183", "186", "193", "198", "203", "207", "209", "220", "223", "225", "226", "233", "234", "239", "240", "241", "242", "246", "252", "262", "265", "4", "5", "16", "23", "24", "27", "39", "41", "49", "53", "54", "61", "67", "68", "72", "85", "95", "108", "115", "118", "124", "125", "127", "129", "145", "148", "151", "153", "156", "159", "175", "176", "183", "186", "193", "198", "203", "207", "209", "220", "223", "225", "226", "233", "234", "239", "240", "241", "242", "246", "252", "262", "265", "2", "44", "63", "77", "98", "122", "147", "150", "178", "179", "230", "231", "232", "244", "245"); + private final CardRun rareDFC = new CardRun(false, "30", "60", "106", "174", "189", "258", "259", "260", "261", "263", "264", "30", "60", "106", "174", "189", "258", "259", "260", "261", "263", "264", "12", "76", "90", "161", "215"); + private final CardRun land = new CardRun(true, "266", "278", "276", "269", "279", "272", "277", "267", "275", "273", "270", "274", "268", "280", "271", "278", "269", "279", "266", "277", "272", "276", "280", "267", "278", "271", "275", "273", "270", "274", "266", "279", "272", "276", "268", "277", "269", "280", "267", "271", "275", "278", "274", "279", "266", "276", "273", "277", "270", "268", "280", "275", "269", "278", "267", "271", "279", "274", "272", "273", "269", "266", "276", "275", "270", "277", "271", "268", "273", "269", "272", "280", "267", "276", "274", "268", "270", "278", "266", "273", "279", "271", "275", "277", "272", "267", "274", "280", "268", "276", "270", "278", "266", "273", "269", "279", "272", "267", "275", "271", "274", "268", "277", "270", "280"); + + private final BoosterStructure AABBBBCCCC = new BoosterStructure( + commonA, commonA, + commonB, commonB, commonB, commonB, + commonC, commonC, commonC, commonC + ); + + private final BoosterStructure AAABBBCCCC = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, + commonC, commonC, commonC, commonC + ); + + private final BoosterStructure AAABBBBCCC = new BoosterStructure( + commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC, commonC, commonC + ); + + private final BoosterStructure UD = new BoosterStructure(uncommon, uncommon, uncommonDFC, rare); + private final BoosterStructure RD = new BoosterStructure(uncommon, uncommon, uncommon, rareDFC); + private final BoosterStructure L1 = new BoosterStructure(land); + + // In order for equal numbers of each common to exist, the average booster must contain: + // 2.67 A commons (270 / 101) + // 3.66 B commons (370 / 101) + // 3.66 C commons (370 / 101) + private final RarityConfiguration commonRuns = new RarityConfiguration( + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AABBBBCCCC, AABBBBCCCC, AABBBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, AAABBBCCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, + AAABBBBCCC, AAABBBBCCC, AAABBBBCCC, AAABBBBCCC + ); + + private final RarityConfiguration uncommonRuns = new RarityConfiguration(UD, UD, UD, UD, UD, UD, UD, UD, UD, RD, RD); + private final RarityConfiguration landRuns = new RarityConfiguration(L1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(landRuns.getNext().makeRun()); + return booster; + } }