From 5322d77398d2cdac6a52028b764739cef663dda3 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:23:06 +1000 Subject: [PATCH 01/12] [PLS] Planeshift - striped collation --- Mage.Sets/src/mage/sets/Planeshift.java | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index 2ae0b873728c..dab91a3452df 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -4,6 +4,14 @@ import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; +import mage.util.RandomUtil; + +import java.util.ArrayList; +import java.util.List; /** * @author North @@ -175,4 +183,59 @@ private Planeshift() { cards.add(new SetCardInfo("Warped Devotion", 57, Rarity.UNCOMMON, mage.cards.w.WarpedDevotion.class)); cards.add(new SetCardInfo("Waterspout Elemental", 38, Rarity.RARE, mage.cards.w.WaterspoutElemental.class)); } + + @Override + public BoosterCollator createCollator() { + return new PlaneshiftCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/pls.html +// Using Striped collation +class PlaneshiftCollator implements BoosterCollator { + private final CardRun common = new CardRun(10, + "111", "76", "81", "17", "33", "48","111", "95", "1", "21", + "90", "97", "31", "39", "65", "79", "15","125", "50", "76", + "34", "41","110", "88", "3", "27", "53", "66","114", "7", + "58", "87", "2","109", "54", "67", "93", "8", "30","110", + "17", "25", "56", "71", "97", "6", "36", "46", "72", "79", + "128", "15", "63", "22", "95","101", "13", "65", "31", "87", + "64","127", "91", "45", "7", "58","125", "78", "41", "6", + "81", "39","113", "72", "34", "90", "53","128", "64", "27", + "3", "66", "21","114", "50", "2", "63", "25","113", "46", + "33", "88", "48", "1","127", "22", "93", "45", "13","109", + "8", "54", "30", "67", "78","101", "56", "36", "71", "91") + private final CardRun uncommon = new CardRun(12, + "138", "43","115", "19","136", "32","121", "73","136", "92","105", "55", + "5", "32", "75","129", "92", "47", "9","115", "35","137", "62","126", + "99", "94","141", "57","108", "18","142", "24", "99", "73","135", "84", + "47","105", "9","135", "26","123", "68","138", "77","123", "49","142", + "137", "16","126", "20","143", "62","105", "83","132", "57","129", "5", + "26","134", "68","115", "84","137", "47","100", "16", "20", "75","100", + "123", "83","138", "55","126", "5","141", "32","122", "60","136", "77", + "43","122", "18","134", "24", "99", "62","143", "94","121", "43","132", + "143", "19", "35", "60","132", "77", "49", "19","134", "24", "83", "75", + "121", "57","142", "9","122", "35", "60", "92","129", "55", "18", "26", + "73","108", "84", "49", "16","100", "20","135", "68","108", "94","141") + private final CardRun rare = new CardRun(false, "58", "1", "61", "2", "174", "286", "9", "10", "69", "229", "116", "179", "117", "180", "120", "121", "231", "13", "297", "73", "75", "182", "298", "234", "77", "318", "79", "126", "319", "127", "287", "17", "320", "18", "82", "19", "20", "187", "21", "132", "192", "85", "24", "141", "242", "142", "143", "243", "197", "288", "245", "300", "198", "26", "28", "248", "29", "204", "32", "149", "205", "303", "207", "152", "321", "208", "33", "290", "255", "256", "209", "153", "257", "259", "210", "305", "212", "89", "90", "92", "323", "39", "157", "218", "220", "267", "326", "294", "101", "327", "271", "273", "163", "276", "328", "164", "329", "278", "105", "108", "165", "110", "166", "112", "113", "296", "280", "227", "57", "285"); + + private final BoosterStructure C11 = new BoosterStructure( + common, common, common, common, common, common, + common, common, common, common, common + ); + private final BoosterStructure U3 = new BoosterStructure(uncommon, uncommon, uncommon); + private final BoosterStructure R1 = new BoosterStructure(rare); + + private final RarityConfiguration commonRuns = new RarityConfiguration(C11); + private final RarityConfiguration uncommonRuns = new RarityConfiguration(U3); + private final RarityConfiguration rareRuns = new RarityConfiguration(R1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(commonRuns.getNext().makeRun()); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + return booster; + } } \ No newline at end of file From 82fc636d18181abcad0c1261ba46547094ac3ac9 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:27:37 +1000 Subject: [PATCH 02/12] Enable Striped Collation Uses stripe widths of 2-5 inclusive with equal chances for each. If data can be obtained, a later improvement would be to give different weightings to different stripe widths. --- .../src/main/java/mage/collation/Rotater.java | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 0af5fa77497c..67242631909a 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -15,7 +15,7 @@ public class Rotater { private final List items; - private int position; + private int position, stripeLen = 0, stripeWidth, stripeDepth; public Rotater(T item) { this(true, item); @@ -37,10 +37,49 @@ public Rotater(boolean keepOrder, T... items) { } } +// for striped collation + public Main(int sLen, String... items) { +// should there be an error check? +// assert ( items.size() % sLen ) == 0; + this.stripeLen = sLen; + this.items = Arrays.asList(items); + this.position = RandomUtil.nextInt(this.items.size()); + this.stripeWidth= this.nextWidth(); + this.stripeDepth= 1+ RandomUtil.nextInt(this.stripeWidth); + } + +// choose a stripe width between 2 & 5 inclusive +// ToDo when data available: enable different widths to have different likelihoods + public int nextWidth() { + return 2+ RandomUtil.nextInt(4); + } + public int iterate() { int i = position; - position++; - position %= items.size(); + if( stripeLen >0 ){ + if( stripeDepth < stripeWidth ){ + ++stripeDepth; + position -= 10; + if (position <0 ){ + position += items.size(); + } + }else{ + stripeDepth= 1; + if( (position % stripeLen) >0 ){ + position += stripeLen * (stripeWidth-1); + position %= items.size(); + }else{ + this.stripeWidth= this.nextWidth(); + } + position -= 1; + if (position <0 ){ + position += items.size(); + } + } + }else{ + position++; + position %= items.size(); + } return i; } From 53c3ec7dad29313892567d74d82ed3327afa2eb1 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:27:54 +1000 Subject: [PATCH 03/12] Fixed error Found error - had failed to change one of the classnames from my test version to xmage version. Also made nextWidth private. (No need for it to be public.) --- Mage/src/main/java/mage/collation/Rotater.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 67242631909a..e56d1875dcbe 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -38,7 +38,7 @@ public Rotater(boolean keepOrder, T... items) { } // for striped collation - public Main(int sLen, String... items) { + public Rotater(int sLen, String... items) { // should there be an error check? // assert ( items.size() % sLen ) == 0; this.stripeLen = sLen; @@ -50,7 +50,7 @@ public Main(int sLen, String... items) { // choose a stripe width between 2 & 5 inclusive // ToDo when data available: enable different widths to have different likelihoods - public int nextWidth() { + private int nextWidth() { return 2+ RandomUtil.nextInt(4); } From f57ab161c55a5bd28f0cc4f39cc9be86b277636b Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:37:26 +1000 Subject: [PATCH 04/12] Add files via upload --- Mage/src/main/java/mage/collation/Rotater.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index e56d1875dcbe..b659d4809ca7 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -38,7 +38,7 @@ public Rotater(boolean keepOrder, T... items) { } // for striped collation - public Rotater(int sLen, String... items) { + public Rotater(int sLen, T... items) { // should there be an error check? // assert ( items.size() % sLen ) == 0; this.stripeLen = sLen; From ae75e9979492ef96bc8e08f66c9eda9c70c91896 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:49:00 +1000 Subject: [PATCH 05/12] Add files via upload --- Mage.Sets/src/mage/sets/Planeshift.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index dab91a3452df..88820af026c7 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -204,7 +204,7 @@ class PlaneshiftCollator implements BoosterCollator { "81", "39","113", "72", "34", "90", "53","128", "64", "27", "3", "66", "21","114", "50", "2", "63", "25","113", "46", "33", "88", "48", "1","127", "22", "93", "45", "13","109", - "8", "54", "30", "67", "78","101", "56", "36", "71", "91") + "8", "54", "30", "67", "78","101", "56", "36", "71", "91"); private final CardRun uncommon = new CardRun(12, "138", "43","115", "19","136", "32","121", "73","136", "92","105", "55", "5", "32", "75","129", "92", "47", "9","115", "35","137", "62","126", @@ -216,7 +216,7 @@ class PlaneshiftCollator implements BoosterCollator { "43","122", "18","134", "24", "99", "62","143", "94","121", "43","132", "143", "19", "35", "60","132", "77", "49", "19","134", "24", "83", "75", "121", "57","142", "9","122", "35", "60", "92","129", "55", "18", "26", - "73","108", "84", "49", "16","100", "20","135", "68","108", "94","141") + "73","108", "84", "49", "16","100", "20","135", "68","108", "94","141"); private final CardRun rare = new CardRun(false, "58", "1", "61", "2", "174", "286", "9", "10", "69", "229", "116", "179", "117", "180", "120", "121", "231", "13", "297", "73", "75", "182", "298", "234", "77", "318", "79", "126", "319", "127", "287", "17", "320", "18", "82", "19", "20", "187", "21", "132", "192", "85", "24", "141", "242", "142", "143", "243", "197", "288", "245", "300", "198", "26", "28", "248", "29", "204", "32", "149", "205", "303", "207", "152", "321", "208", "33", "290", "255", "256", "209", "153", "257", "259", "210", "305", "212", "89", "90", "92", "323", "39", "157", "218", "220", "267", "326", "294", "101", "327", "271", "273", "163", "276", "328", "164", "329", "278", "105", "108", "165", "110", "166", "112", "113", "296", "280", "227", "57", "285"); private final BoosterStructure C11 = new BoosterStructure( From 5cf897c2ff7329441304468c9ed1d8ea433060de Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:42:06 +1000 Subject: [PATCH 06/12] Moving Striped Collation code into CardRun --- .../src/main/java/mage/collation/CardRun.java | 45 +++++++++++++++ .../src/main/java/mage/collation/Rotater.java | 55 ++----------------- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/Mage/src/main/java/mage/collation/CardRun.java b/Mage/src/main/java/mage/collation/CardRun.java index c34876bf9d68..7391b1584176 100644 --- a/Mage/src/main/java/mage/collation/CardRun.java +++ b/Mage/src/main/java/mage/collation/CardRun.java @@ -1,11 +1,56 @@ package mage.collation; +import mage.util.RandomUtil; + /** * @author TheElk801 */ public class CardRun extends Rotater { + private int cardPos,stripeLen=0,stripeWidth,stripeDepth; + // cardPos is used in place of private super.position for Striped Collation public CardRun(boolean keepOrder, String... numbers) { super(keepOrder, numbers); } + + public CardRun(int sLen, String... numbers) { + super(true, numbers); + cardPos= RandomUtil.nextInt( this.numItems() ); + stripeWidth= nextWidth(); + stripeDepth= 1+ RandomUtil.nextInt( stripeWidth ); + // assert sLen >0; + // assert this.numItems() % sLen == 0; + } + + private int nextWidth() { + return 2+ RandomUtil.nextInt(4); + } + + public int iterate() { + if( stripeLen ==0 ){ + return super.iterate(); + }else{ + int i = cardPos; + if( stripeDepth < stripeWidth ){ + ++stripeDepth; + cardPos -= 10; + if (cardPos <0 ){ + cardPos += this.numItems(); + } + }else{ + stripeDepth= 1; + if( (cardPos % stripeLen) >0 ){ + cardPos += stripeLen * (stripeWidth-1); + cardPos %= this.numItems(); + }else{ + this.stripeWidth= this.nextWidth(); + } + cardPos -= 1; + if (cardPos <0 ){ + cardPos += this.numItems(); + } + } + return i; + } + } } diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index b659d4809ca7..617fc97bcaaf 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -25,61 +25,18 @@ public Rotater(T item1, T item2) { this(true, item1, item2); } - public Rotater(boolean keepOrder, T... items) { - if (keepOrder) { - this.items = Arrays.asList(items); - this.position = RandomUtil.nextInt(this.items.size()); - } else { - this.items = new ArrayList(); - Collections.addAll(this.items, items); - Collections.shuffle(this.items, RandomUtil.getRandom()); - this.position = 0; - } + public int numItems() { + return items.size(); } -// for striped collation - public Rotater(int sLen, T... items) { -// should there be an error check? -// assert ( items.size() % sLen ) == 0; - this.stripeLen = sLen; - this.items = Arrays.asList(items); - this.position = RandomUtil.nextInt(this.items.size()); - this.stripeWidth= this.nextWidth(); - this.stripeDepth= 1+ RandomUtil.nextInt(this.stripeWidth); - } - -// choose a stripe width between 2 & 5 inclusive -// ToDo when data available: enable different widths to have different likelihoods - private int nextWidth() { - return 2+ RandomUtil.nextInt(4); + public String getItem(int i) { + return items.get(i); } public int iterate() { int i = position; - if( stripeLen >0 ){ - if( stripeDepth < stripeWidth ){ - ++stripeDepth; - position -= 10; - if (position <0 ){ - position += items.size(); - } - }else{ - stripeDepth= 1; - if( (position % stripeLen) >0 ){ - position += stripeLen * (stripeWidth-1); - position %= items.size(); - }else{ - this.stripeWidth= this.nextWidth(); - } - position -= 1; - if (position <0 ){ - position += items.size(); - } - } - }else{ - position++; - position %= items.size(); - } + position++; + position %= items.size(); return i; } From 670917c3cbd22542ca1968f3f0e0ddad7f31afd7 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:54:10 +1000 Subject: [PATCH 07/12] Add files via upload --- Mage/src/main/java/mage/collation/CardRun.java | 2 ++ Mage/src/main/java/mage/collation/Rotater.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/collation/CardRun.java b/Mage/src/main/java/mage/collation/CardRun.java index 7391b1584176..ac713f38aa43 100644 --- a/Mage/src/main/java/mage/collation/CardRun.java +++ b/Mage/src/main/java/mage/collation/CardRun.java @@ -22,6 +22,8 @@ public CardRun(int sLen, String... numbers) { // assert this.numItems() % sLen == 0; } + // randomly choose a stripe width between 2 & 5 (inclusive) + // ToDo: when data available, use different weightings for different widths private int nextWidth() { return 2+ RandomUtil.nextInt(4); } diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 617fc97bcaaf..2255daeb0a78 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -15,7 +15,7 @@ public class Rotater { private final List items; - private int position, stripeLen = 0, stripeWidth, stripeDepth; + private int position; public Rotater(T item) { this(true, item); From a5f14d61ddbc2e756c12860ea137b0740f2b51f6 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:00:37 +1000 Subject: [PATCH 08/12] Add files via upload --- Mage/src/main/java/mage/collation/Rotater.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 2255daeb0a78..04379dfdb5f1 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -25,6 +25,18 @@ public Rotater(T item1, T item2) { this(true, item1, item2); } + public Rotater(boolean keepOrder, T... items) { + if (keepOrder) { + this.items = Arrays.asList(items); + this.position = RandomUtil.nextInt(this.items.size()); + } else { + this.items = new ArrayList(); + Collections.addAll(this.items, items); + Collections.shuffle(this.items, RandomUtil.getRandom()); + this.position = 0; + } + } + public int numItems() { return items.size(); } From f1df1aeebb40500dfd6acfcff3ebbcf73f5e6355 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:48:02 +1000 Subject: [PATCH 09/12] Add files via upload --- .../src/main/java/mage/collation/CardRun.java | 38 ++++++------------- .../src/main/java/mage/collation/Rotater.java | 19 ++++++---- 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/Mage/src/main/java/mage/collation/CardRun.java b/Mage/src/main/java/mage/collation/CardRun.java index ac713f38aa43..b2589dd1c288 100644 --- a/Mage/src/main/java/mage/collation/CardRun.java +++ b/Mage/src/main/java/mage/collation/CardRun.java @@ -6,8 +6,7 @@ * @author TheElk801 */ public class CardRun extends Rotater { - private int cardPos,stripeLen=0,stripeWidth,stripeDepth; - // cardPos is used in place of private super.position for Striped Collation + private int stripeLen=0,stripeWidth,stripeDepth; public CardRun(boolean keepOrder, String... numbers) { super(keepOrder, numbers); @@ -15,11 +14,9 @@ public CardRun(boolean keepOrder, String... numbers) { public CardRun(int sLen, String... numbers) { super(true, numbers); - cardPos= RandomUtil.nextInt( this.numItems() ); + stripeLen= sLen; stripeWidth= nextWidth(); stripeDepth= 1+ RandomUtil.nextInt( stripeWidth ); - // assert sLen >0; - // assert this.numItems() % sLen == 0; } // randomly choose a stripe width between 2 & 5 (inclusive) @@ -31,28 +28,15 @@ private int nextWidth() { public int iterate() { if( stripeLen ==0 ){ return super.iterate(); - }else{ - int i = cardPos; - if( stripeDepth < stripeWidth ){ - ++stripeDepth; - cardPos -= 10; - if (cardPos <0 ){ - cardPos += this.numItems(); - } - }else{ - stripeDepth= 1; - if( (cardPos % stripeLen) >0 ){ - cardPos += stripeLen * (stripeWidth-1); - cardPos %= this.numItems(); - }else{ - this.stripeWidth= this.nextWidth(); - } - cardPos -= 1; - if (cardPos <0 ){ - cardPos += this.numItems(); - } - } - return i; + if( stripeDepth < stripeWidth ){ + ++stripeDepth; + return super.iterate(-stripeLen); } + stripeDepth= 1; + if this.isEdge(stripeLen){ + this.stripeWidth= this.nextWidth(); + return super.iterate(-1); + } + return super.iterate((stripeLen * (stripeWidth-1)) -1); } } diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 04379dfdb5f1..42f75c1ba500 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -37,20 +37,23 @@ public Rotater(boolean keepOrder, T... items) { } } - public int numItems() { - return items.size(); - } - - public String getItem(int i) { - return items.get(i); + public boolean isEdge(int rowLen) { + return (position % rowLen)==0; } - public int iterate() { + public int iterate(int offset) { int i = position; - position++; + position += offset; + while (position <0) { + position += items.size(); + } position %= items.size(); return i; } + + public int iterate() { + return iterate(1)' + } public T getNext() { return items.get(iterate()); From 780dab0935271d1973ecd2561e4191e83005240a Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:56:09 +1000 Subject: [PATCH 10/12] Add files via upload --- Mage/src/main/java/mage/collation/CardRun.java | 7 ++++--- Mage/src/main/java/mage/collation/Rotater.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Mage/src/main/java/mage/collation/CardRun.java b/Mage/src/main/java/mage/collation/CardRun.java index b2589dd1c288..8d16d0d03c87 100644 --- a/Mage/src/main/java/mage/collation/CardRun.java +++ b/Mage/src/main/java/mage/collation/CardRun.java @@ -26,14 +26,15 @@ private int nextWidth() { } public int iterate() { - if( stripeLen ==0 ){ + if ( stripeLen ==0 ){ return super.iterate(); - if( stripeDepth < stripeWidth ){ + } + if ( stripeDepth < stripeWidth ){ ++stripeDepth; return super.iterate(-stripeLen); } stripeDepth= 1; - if this.isEdge(stripeLen){ + if ( this.isEdge(stripeLen)){ this.stripeWidth= this.nextWidth(); return super.iterate(-1); } diff --git a/Mage/src/main/java/mage/collation/Rotater.java b/Mage/src/main/java/mage/collation/Rotater.java index 42f75c1ba500..f28f65afc0f0 100644 --- a/Mage/src/main/java/mage/collation/Rotater.java +++ b/Mage/src/main/java/mage/collation/Rotater.java @@ -52,7 +52,7 @@ public int iterate(int offset) { } public int iterate() { - return iterate(1)' + return this.iterate(1); } public T getNext() { From 878be187d11609e3ef2d7c1c59fbbd8e197eacd9 Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:44:47 +1000 Subject: [PATCH 11/12] Oops forgot the [PLS] rares --- Mage.Sets/src/mage/sets/Planeshift.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index 88820af026c7..4622cba46e27 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -217,7 +217,7 @@ class PlaneshiftCollator implements BoosterCollator { "143", "19", "35", "60","132", "77", "49", "19","134", "24", "83", "75", "121", "57","142", "9","122", "35", "60", "92","129", "55", "18", "26", "73","108", "84", "49", "16","100", "20","135", "68","108", "94","141"); - private final CardRun rare = new CardRun(false, "58", "1", "61", "2", "174", "286", "9", "10", "69", "229", "116", "179", "117", "180", "120", "121", "231", "13", "297", "73", "75", "182", "298", "234", "77", "318", "79", "126", "319", "127", "287", "17", "320", "18", "82", "19", "20", "187", "21", "132", "192", "85", "24", "141", "242", "142", "143", "243", "197", "288", "245", "300", "198", "26", "28", "248", "29", "204", "32", "149", "205", "303", "207", "152", "321", "208", "33", "290", "255", "256", "209", "153", "257", "259", "210", "305", "212", "89", "90", "92", "323", "39", "157", "218", "220", "267", "326", "294", "101", "327", "271", "273", "163", "276", "328", "164", "329", "278", "105", "108", "165", "110", "166", "112", "113", "296", "280", "227", "57", "285"); + private final CardRun rare = new CardRun(false, "96", "98", "40", "59", "102", "42", "4", "103", "131", "104", "23", "106", "107", "139", "80", "61", "112", "44", "82", "10", "116", "140", "69", "117", "85", "11", "51", "118", "28", "86", "70", "12", "29", "52", "119", "89", "120", "14", "124", "133", "37", "74", "130", "38"); private final BoosterStructure C11 = new BoosterStructure( common, common, common, common, common, common, From 548f5513fa9e6ac583fbe8152db0221aa9cd8dbf Mon Sep 17 00:00:00 2001 From: tiera3 <87589219+tiera3@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:27:50 +1000 Subject: [PATCH 12/12] [PCY] Prophecy - striped collation --- Mage.Sets/src/mage/sets/Prophecy.java | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Mage.Sets/src/mage/sets/Prophecy.java b/Mage.Sets/src/mage/sets/Prophecy.java index fda54f8e3a8a..d84322ff2e14 100644 --- a/Mage.Sets/src/mage/sets/Prophecy.java +++ b/Mage.Sets/src/mage/sets/Prophecy.java @@ -4,6 +4,14 @@ import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; +import mage.collation.BoosterCollator; +import mage.collation.BoosterStructure; +import mage.collation.CardRun; +import mage.collation.RarityConfiguration; +import mage.util.RandomUtil; + +import java.util.ArrayList; +import java.util.List; /** * @@ -172,4 +180,59 @@ private Prophecy() { cards.add(new SetCardInfo("Withdraw", 54, Rarity.COMMON, mage.cards.w.Withdraw.class)); cards.add(new SetCardInfo("Zerapa Minotaur", 108, Rarity.COMMON, mage.cards.z.ZerapaMinotaur.class)); } + + @Override + public BoosterCollator createCollator() { + return new ProphecyCollator(); + } +} + +// Booster collation info from https://www.lethe.xyz/mtg/collation/pls.html +// Using Striped collation +class ProphecyCollator implements BoosterCollator { + private final CardRun common = new CardRun(10, + "65","118", "99", "54", "16", "78","128", "91", "36", "24", + "100", "35", "26", "58","120", "96", "49", "14", "55","126", + "27", "79","116", "93", "31", "8", "65","121", "87", "50", + "129", "88", "29", "20", "61","118", "99", "46", "2", "79", + "43", "16", "64","134", "84", "45", "11", "81","123", "91", + "6", "73", "98", "42","128", "19", "62", "88", "35","121", + "67", "36","131", "24", "96", "58", "50","129", "8", "84", + "120", "14","108", "81", "31","134", "27", "98", "55", "49", + "104", "78", "43","123", "20","100", "67", "29","131", "19", + "54","110", "6", "87", "64", "46","116", "26","104", "62", + "11", "93", "73", "45", "126", "2","108", "61", "42","110"); + private final CardRun uncommon = new CardRun(12, + "53","138", "7", "85","130", "25", "70", "34", "10","107","141", "53", + "124", "51", "97", "9", "53","132","101", "69", "83","111", "92","117", + "76", "90", "48","125", "80", "85","124", "9","122", "63", "44", "85", + "23", "41","122", "7", "34","136", "38","138", "23", "90", "59", "10", + "135", "71", "83", "70","142", "1", "72", "41", "71", "25","142","111", + "72", "44", "18", "41", "59","107", "18", "76", "51","132", "1", "76", + "38","138","135","141", "44","122", "86","136","101", "38", "80", "86", + "101", "17", "72", "25", "92", "48","130", "33", "70", "83", "33", "18", + "132", "80", "9","117", "34", "10", "69","125", "7", "69", "23", "71", + "63", "97","130", "86","136", "51","107","141", "97","124","142","125", + "90", "33", "59","111", "63","117", "17", "92","135", "1", "48", "17"); + private final CardRun rare = new CardRun(false, "28", "82", "3", "109", "30", "56", "4", "57", "5", "60", "137", "32", "112", "113", "89", "114", "66", "37", "68", "12", "115", "139", "94", "95", "13", "15", "119", "39", "74", "40", "75", "77", "21", "102", "103", "22", "47", "127", "105", "52", "106", "133", "140", "143"); + + private final BoosterStructure C11 = new BoosterStructure( + common, common, common, common, common, common, + common, common, common, common, common + ); + private final BoosterStructure U3 = new BoosterStructure(uncommon, uncommon, uncommon); + private final BoosterStructure R1 = new BoosterStructure(rare); + + private final RarityConfiguration commonRuns = new RarityConfiguration(C11); + private final RarityConfiguration uncommonRuns = new RarityConfiguration(U3); + private final RarityConfiguration rareRuns = new RarityConfiguration(R1); + + @Override + public List makeBooster() { + List booster = new ArrayList<>(); + booster.addAll(uncommonRuns.getNext().makeRun()); + booster.addAll(rareRuns.getNext().makeRun()); + booster.addAll(commonRuns.getNext().makeRun()); + return booster; + } }