diff --git a/Mage.Sets/src/mage/sets/AvacynRestored.java b/Mage.Sets/src/mage/sets/AvacynRestored.java index 3fe8eb08d14..7b90114a35c 100644 --- a/Mage.Sets/src/mage/sets/AvacynRestored.java +++ b/Mage.Sets/src/mage/sets/AvacynRestored.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 @@ -272,4 +278,110 @@ public final class AvacynRestored extends ExpansionSet { cards.add(new SetCardInfo("Zealous Conscripts", 166, Rarity.RARE, mage.cards.z.ZealousConscripts.class)); cards.add(new SetCardInfo("Zealous Strike", 41, Rarity.COMMON, mage.cards.z.ZealousStrike.class)); } + + @Override + public BoosterCollator createCollator() { + return new AvacynRestoredCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/avr.html +// Using USA collation for common/uncommon, rare collation inferred from other sets +class AvacynRestoredCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "159", "89", "11", "178", "147", "50", "110", "199", "27", "137", "87", "53", "163", "11", "179", "184", "67", "120", "127", "72", "39", "137", "199", "119", "188", "59", "131", "60", "120", "163", "184", "186", "91", "50", "131", "70", "110", "159", "204", "179", "89", "27", "128", "60", "4", "91", "178", "186", "59", "127", "30", "70", "39", "87", "204", "128", "185", "53", "30", "119", "147", "188", "72", "4", "185", "67"); + private final CardRun commonB = new CardRun(true, "12", "218", "181", "143", "40", "220", "88", "43", "37", "152", "105", "57", "34", "181", "49", "88", "138", "55", "12", "103", "167", "152", "35", "105", "49", "43", "34", "220", "196", "152", "57", "117", "135", "40", "35", "167", "218", "55", "103", "143", "57", "37", "196", "135", "12", "117", "181", "220", "138", "34", "218", "105", "37", "55", "196", "88", "135", "43", "40", "49", "35", "143", "167", "117", "103", "138"); + private final CardRun commonC1 = new CardRun(true, "221", "123", "28", "155", "202", "169", "100", "42", "29", "93", "3", "158", "174", "228", "123", "73", "213", "21", "202", "26", "156", "100", "99", "54", "197", "21", "187", "158", "28", "116", "83", "118", "169", "54", "156", "29", "187", "116", "213", "83", "93", "132", "26", "174", "223", "155", "42", "118", "99", "3", "228", "197", "132", "223", "73"); + private final CardRun commonC2 = new CardRun(true, "221", "115", "192", "9", "140", "71", "75", "15", "193", "114", "150", "41", "146", "192", "46", "75", "9", "114", "124", "150", "71", "14", "149", "183", "56", "115", "41", "140", "192", "15", "149", "124", "75", "183", "9", "71", "193", "146", "114", "56", "41", "124", "140", "46", "193", "14", "150", "183", "115", "15", "56", "149", "46", "14", "146"); + private final CardRun uncommonA = new CardRun(true, "207", "82", "224", "23", "212", "160", "51", "113", "180", "22", "136", "90", "19", "62", "145", "182", "86", "17", "157", "207", "101", "74", "90", "165", "205", "25", "157", "95", "201", "58", "66", "125", "175", "145", "17", "95", "212", "51", "109", "23", "201", "165", "82", "22", "224", "154", "180", "19", "109", "74", "58", "205", "125", "113", "182", "31", "160", "66", "25", "101", "175", "62", "86", "136", "31", "154"); + private final CardRun uncommonB = new CardRun(true, "80", "170", "144", "16", "122", "63", "13", "190", "216", "69", "84", "5", "198", "142", "85", "77", "168", "16", "139", "216", "80", "122", "144", "52", "13", "177", "198", "222", "84", "112", "142", "69", "7", "134", "177", "8", "108", "211", "85", "63", "139", "77", "190", "7", "8", "112", "211", "170", "52", "168", "108", "5", "134", "222"); + private final CardRun rare = new CardRun(false, "1", "2", "10", "18", "24", "32", "33", "36", "38", "44", "45", "47", "48", "61", "64", "65", "76", "78", "92", "94", "96", "98", "102", "104", "107", "111", "121", "126", "130", "133", "141", "151", "153", "162", "164", "166", "171", "173", "176", "191", "194", "195", "200", "203", "206", "214", "215", "217", "219", "225", "226", "227", "229", "1", "2", "10", "18", "24", "32", "33", "36", "38", "44", "45", "47", "48", "61", "64", "65", "76", "78", "92", "94", "96", "98", "102", "104", "107", "111", "121", "126", "130", "133", "141", "151", "153", "162", "164", "166", "171", "173", "176", "191", "194", "195", "200", "203", "206", "214", "215", "217", "219", "225", "226", "227", "229", "6", "20", "68", "79", "81", "97", "106", "129", "148", "161", "172", "189", "208", "209", "210"); + private final CardRun land = new CardRun(false, "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244"); + + 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(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( + 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); + 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/Gatecrash.java b/Mage.Sets/src/mage/sets/Gatecrash.java index 29e9a714594..7a460466155 100644 --- a/Mage.Sets/src/mage/sets/Gatecrash.java +++ b/Mage.Sets/src/mage/sets/Gatecrash.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 LevelX2 @@ -278,4 +284,109 @@ public final class Gatecrash extends ExpansionSet { cards.add(new SetCardInfo("Zarichi Tiger", 28, Rarity.COMMON, mage.cards.z.ZarichiTiger.class)); cards.add(new SetCardInfo("Zhur-Taa Swine", 210, Rarity.COMMON, mage.cards.z.ZhurTaaSwine.class)); } + + @Override + public BoosterCollator createCollator() { + return new GatecrashCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/gtc.html +// Using USA collation for all rarities +// Foil rare sheet used for regular rares as regular rare sheet is not known +class GatecrashCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "109", "58", "56", "135", "26", "19", "67", "118", "48", "107", "2", "76", "131", "41", "1", "58", "118", "100", "42", "2", "63", "129", "104", "41", "26", "76", "116", "111", "42", "25", "134", "107", "67", "35", "131", "9", "109", "37", "122", "63", "108", "32", "1", "135", "77", "111", "48", "25", "116", "37", "100", "19", "59", "122", "56", "108", "11", "32", "129", "59", "104", "9", "35", "77", "134", "11"); + private final CardRun commonB = new CardRun(true, "157", "175", "189", "187", "173", "172", "197", "186", "210", "102", "173", "223", "189", "225", "157", "190", "192", "186", "208", "172", "66", "161", "187", "218", "175", "193", "212", "210", "179", "197", "214", "66", "102", "161", "186", "157", "223", "197", "212", "218", "172", "192", "225", "173", "179", "193", "187", "208", "102", "190", "189", "214", "210", "175", "66", "190", "193", "225", "218", "223", "161", "214", "208", "179", "192", "212"); + private final CardRun commonC1 = new CardRun(true, "73", "40", "241", "127", "52", "78", "89", "243", "140", "92", "60", "226", "80", "115", "5", "52", "246", "28", "86", "8", "140", "241", "234", "73", "92", "28", "239", "51", "60", "115", "234", "244", "54", "4", "238", "105", "40", "243", "8", "127", "226", "54", "239", "4", "113", "105", "80", "246", "5", "89", "51", "78", "244", "113", "86"); + private final CardRun commonC2 = new CardRun(true, "22", "138", "68", "98", "125", "15", "31", "232", "85", "120", "22", "46", "235", "98", "62", "57", "15", "93", "236", "125", "31", "68", "24", "235", "93", "39", "62", "232", "138", "46", "85", "57", "24", "236", "120", "39", "68", "15", "235", "31", "93", "120", "232", "24", "85", "236", "138", "39", "22", "98", "57", "125", "62", "46", "238"); + private final CardRun uncommonA = new CardRun(true, "154", "166", "183", "160", "211", "217", "167", "30", "183", "230", "154", "227", "209", "219", "196", "217", "200", "160", "130", "206", "166", "155", "148", "181", "205", "167", "149", "211", "221", "130", "30", "206", "217", "209", "230", "211", "205", "155", "160", "196", "227", "183", "149", "181", "166", "200", "30", "219", "154", "221", "167", "148", "130", "219", "181", "227", "155", "230", "206", "221", "200", "149", "196", "205", "209", "148"); + private final CardRun uncommonB = new CardRun(true, "114", "17", "44", "103", "64", "124", "23", "36", "106", "137", "10", "29", "81", "103", "21", "124", "47", "106", "23", "29", "69", "132", "99", "10", "55", "103", "72", "137", "47", "21", "88", "64", "132", "55", "17", "72", "90", "124", "36", "99", "69", "81", "23", "44", "88", "114", "29", "72", "99", "17", "137", "44", "64", "90", "21", "36", "69", "114", "47", "88", "106", "10", "132", "81", "55", "90"); + private final CardRun uncommonC = new CardRun(true, "150", "169", "27", "145", "164", "237", "185", "216", "228", "202", "195", "185", "169", "158", "202", "237", "150", "168", "228", "164", "204", "233", "70", "216", "145", "184", "195", "96", "233", "169", "228", "184", "237", "70", "96", "150", "216", "158", "164", "195", "70", "27", "185", "168", "145", "202", "204", "27", "96", "233", "168", "158", "184", "204"); + private final CardRun uncommonD = new CardRun(true, "110", "84", "117", "38", "18", "87", "14", "139", "79", "95", "126", "16", "119", "49", "82", "110", "7", "84", "38", "119", "87", "16", "65", "49", "126", "79", "7", "139", "43", "95", "84", "14", "79", "119", "110", "38", "7", "82", "117", "95", "18", "65", "126", "87", "43", "82", "16", "117", "18", "49", "139", "65", "43", "14"); + private final CardRun rare = new CardRun(true, "3", "75", "153", "203", "45", "178", "20", "177", "220", "74", "207", "12", "213", "33", "198", "231", "194", "199", "53", "152", "128", "180", "71", "215", "162", "248", "152", "194", "97", "224", "174", "249", "222", "123", "191", "3", "121", "203", "178", "74", "146", "91", "142", "248", "112", "165", "201", "123", "163", "91", "151", "50", "170", "207", "247", "229", "12", "142", "249", "191", "94", "159", "6", "220", "83", "176", "245", "97", "242", "188", "133", "201", "53", "240", "75", "171", "156", "112", "141", "182", "50", "177", "146", "245", "143", "136", "222", "61", "163", "215", "170", "133", "20", "165", "33", "141", "34", "240", "199", "147", "13", "144", "101", "242", "213", "136", "151", "162", "45", "229", "83", "171", "247", "224", "101", "128", "6", "198", "61", "180", "231"); + private final CardRun land = new CardRun(false, "RTR_250", "RTR_251", "RTR_252", "RTR_253", "RTR_254", "RTR_255", "RTR_256", "RTR_257", "RTR_258", "RTR_259", "RTR_260", "RTR_261", "RTR_262", "RTR_263", "RTR_264", "RTR_265", "RTR_266", "RTR_267", "RTR_268", "RTR_269", "RTR_270", "RTR_271", "RTR_272", "RTR_273", "RTR_274"); + + 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 AAAABBBBC2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC2, commonC2 + ); + private final BoosterStructure ABC = new BoosterStructure(uncommonA, uncommonB, uncommonC); + private final BoosterStructure ABD = new BoosterStructure(uncommonA, uncommonB, uncommonD); + private final BoosterStructure ACD = new BoosterStructure(uncommonA, uncommonC, uncommonD); + private final BoosterStructure BCD = new BoosterStructure(uncommonB, uncommonC, uncommonD); + 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, + AAAABBC2C2C2C2, + AAAABBBBC2C2, + AAAABBBBC2C2 + ); + // In order for equal numbers of each uncommon to exist, the average booster must contain: + // 0.825 A uncommons (33 / 40) + // 0.825 B uncommons (33 / 40) + // 0.675 C uncommons (27 / 40) + // 0.675 D uncommons (27 / 40) + // These numbers are the same for all sets with 80 uncommons in asymmetrical A/B/C/D print runs + private final RarityConfiguration uncommonRuns = new RarityConfiguration( + ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, + ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, + ACD, BCD, ACD, BCD, ACD, BCD, ACD, + BCD, ACD, BCD, ACD, BCD, ACD, BCD + ); + 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/ReturnToRavnica.java b/Mage.Sets/src/mage/sets/ReturnToRavnica.java index b7965389943..70b7ebc3194 100644 --- a/Mage.Sets/src/mage/sets/ReturnToRavnica.java +++ b/Mage.Sets/src/mage/sets/ReturnToRavnica.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 magenoxx_at_gmail.com @@ -301,4 +307,109 @@ public final class ReturnToRavnica extends ExpansionSet { cards.add(new SetCardInfo("Worldspine Wurm", 140, Rarity.MYTHIC, mage.cards.w.WorldspineWurm.class)); cards.add(new SetCardInfo("Zanikev Locust", 84, Rarity.UNCOMMON, mage.cards.z.ZanikevLocust.class)); } + + @Override + public BoosterCollator createCollator() { + return new ReturnToRavnicaCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/rtr.html +// Using USA collation for all rarities +// Foil rare sheet used for regular rares as regular rare sheet is not known +class ReturnToRavnicaCollator implements BoosterCollator { + private final CardRun commonA = new CardRun(true, "26", "123", "93", "34", "69", "4", "88", "36", "128", "102", "27", "32", "125", "109", "19", "36", "239", "65", "2", "138", "42", "27", "107", "113", "32", "66", "26", "128", "31", "88", "2", "113", "45", "58", "10", "107", "116", "65", "4", "80", "119", "93", "46", "116", "58", "69", "19", "138", "45", "92", "9", "46", "119", "10", "109", "42", "123", "9", "102", "66", "125", "34", "92", "80", "239", "31"); + private final CardRun commonB = new CardRun(true, "156", "216", "160", "148", "199", "224", "205", "163", "151", "221", "193", "198", "149", "154", "195", "169", "165", "215", "223", "144", "91", "169", "199", "154", "160", "198", "156", "221", "223", "163", "165", "249", "224", "195", "148", "149", "216", "193", "144", "151", "215", "205", "249", "91", "224", "223", "198", "199", "215", "193", "148", "165", "221", "160", "169", "151", "216", "195", "163", "91", "156", "154", "205", "144", "149", "249"); + private final CardRun commonC1 = new CardRun(true, "122", "37", "99", "70", "22", "56", "124", "112", "59", "21", "38", "94", "136", "60", "37", "244", "115", "38", "8", "59", "87", "41", "122", "244", "56", "21", "72", "87", "132", "22", "75", "96", "124", "5", "242", "60", "43", "99", "8", "64", "136", "96", "41", "242", "12", "72", "43", "132", "5", "94", "70", "115", "12", "112", "75"); + private final CardRun commonC2 = new CardRun(true, "48", "74", "28", "85", "118", "62", "53", "13", "105", "246", "68", "137", "48", "25", "74", "105", "118", "64", "55", "13", "85", "78", "137", "237", "55", "62", "28", "118", "74", "108", "25", "237", "129", "78", "105", "53", "246", "62", "85", "129", "28", "108", "68", "55", "25", "246", "129", "48", "78", "13", "137", "53", "68", "237", "108"); + private final CardRun uncommonA = new CardRun(true, "24", "228", "50", "133", "79", "16", "98", "29", "114", "100", "30", "23", "61", "227", "95", "133", "24", "104", "77", "39", "98", "134", "16", "61", "100", "228", "133", "20", "76", "104", "30", "131", "24", "79", "95", "77", "16", "39", "134", "76", "98", "50", "114", "23", "79", "29", "131", "227", "20", "39", "61", "134", "50", "95", "228", "23", "76", "30", "114", "104", "29", "20", "77", "131", "100", "227"); + private final CardRun uncommonB = new CardRun(true, "192", "233", "203", "222", "196", "232", "57", "3", "194", "229", "167", "211", "196", "233", "158", "184", "172", "225", "146", "222", "192", "230", "179", "3", "168", "191", "232", "203", "161", "57", "168", "192", "225", "158", "211", "194", "232", "179", "222", "172", "233", "167", "161", "191", "230", "146", "184", "196", "229", "203", "3", "146", "211", "191", "225", "167", "168", "172", "229", "179", "184", "57", "194", "230", "158", "161"); + private final CardRun uncommonC = new CardRun(true, "111", "81", "54", "117", "235", "103", "127", "7", "82", "234", "6", "47", "106", "84", "245", "126", "54", "11", "81", "40", "82", "127", "111", "7", "235", "47", "117", "6", "103", "40", "11", "82", "126", "84", "234", "106", "235", "127", "81", "103", "245", "54", "111", "11", "47", "84", "117", "234", "7", "126", "106", "40", "6", "245"); + private final CardRun uncommonD = new CardRun(true, "182", "164", "181", "185", "207", "202", "204", "181", "186", "190", "173", "164", "145", "220", "214", "135", "182", "176", "218", "185", "89", "214", "202", "164", "218", "186", "135", "89", "190", "182", "204", "145", "185", "135", "51", "207", "173", "176", "181", "220", "51", "89", "214", "173", "204", "218", "220", "190", "202", "51", "176", "145", "186", "207"); + private final CardRun rare = new CardRun(true, "101", "73", "143", "219", "86", "139", "187", "201", "18", "52", "141", "212", "97", "49", "150", "120", "159", "17", "210", "241", "180", "52", "213", "14", "200", "63", "209", "35", "162", "219", "71", "15", "178", "155", "67", "86", "177", "248", "217", "247", "197", "90", "180", "248", "166", "240", "147", "247", "236", "142", "243", "153", "18", "140", "212", "166", "33", "139", "209", "183", "238", "226", "189", "33", "177", "97", "152", "236", "188", "110", "178", "67", "150", "14", "210", "101", "206", "231", "142", "130", "147", "83", "49", "155", "121", "170", "17", "15", "152", "241", "175", "238", "197", "1", "174", "90", "63", "171", "201", "130", "231", "157", "170", "44", "240", "162", "120", "189", "83", "175", "226", "157", "217", "73", "243", "141", "153", "121", "35", "208", "213"); + private final CardRun land = new CardRun(false, "250", "251", "252", "253", "254", "255", "256", "257", "258", "259", "260", "261", "262", "263", "264", "265", "266", "267", "268", "269", "270", "271", "272", "273", "274"); + + 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 AAAABBBBC2C2 = new BoosterStructure( + commonA, commonA, commonA, commonA, + commonB, commonB, commonB, commonB, + commonC2, commonC2 + ); + private final BoosterStructure ABC = new BoosterStructure(uncommonA, uncommonB, uncommonC); + private final BoosterStructure ABD = new BoosterStructure(uncommonA, uncommonB, uncommonD); + private final BoosterStructure ACD = new BoosterStructure(uncommonA, uncommonC, uncommonD); + private final BoosterStructure BCD = new BoosterStructure(uncommonB, uncommonC, uncommonD); + 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, + AAAABBC2C2C2C2, + AAAABBBBC2C2, + AAAABBBBC2C2 + ); + // In order for equal numbers of each uncommon to exist, the average booster must contain: + // 0.825 A uncommons (33 / 40) + // 0.825 B uncommons (33 / 40) + // 0.675 C uncommons (27 / 40) + // 0.675 D uncommons (27 / 40) + // These numbers are the same for all sets with 80 uncommons in asymmetrical A/B/C/D print runs + private final RarityConfiguration uncommonRuns = new RarityConfiguration( + ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, + ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, ABC, ABD, + ACD, BCD, ACD, BCD, ACD, BCD, ACD, + BCD, ACD, BCD, ACD, BCD, ACD, BCD + ); + 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/pom.xml b/pom.xml index aae0becdc92..b89837856ed 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.0.0-M5 - junit - junit - 4.13.2 + org.junit.vintage + junit-vintage-engine + 5.8.1 test @@ -216,6 +216,14 @@ + + + org.junit + junit-bom + 5.8.1 + pom + import + com.google.code.gson