Skip to content

Commit

Permalink
Reworking standard legality (magefree#12624)
Browse files Browse the repository at this point in the history
* rework standard rotation

* add comment

* add flag to previous sets
  • Loading branch information
theelk801 authored Jul 31, 2024
1 parent 27e7d44 commit 8ed3c0c
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import mage.cards.ExpansionSet;
import mage.cards.Sets;
import mage.cards.decks.Constructed;
import mage.constants.SetType;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
Expand All @@ -27,15 +25,6 @@ public Standard() {
banned.add("Invoke Despair");
}

private static boolean isFallSet(ExpansionSet set) {
Calendar cal = Calendar.getInstance();
cal.setTime(set.getReleaseDate());
// Fall sets are normally released during or after September and before November
return set.getSetType() == SetType.EXPANSION
&& Calendar.SEPTEMBER <= cal.get(Calendar.MONTH)
&& cal.get(Calendar.MONTH) < Calendar.NOVEMBER;
}

static List<String> makeLegalSets() {
GregorianCalendar current = new GregorianCalendar();
// Get the third most recent fall set that's been released.
Expand All @@ -44,7 +33,7 @@ static List<String> makeLegalSets() {
.values()
.stream()
.filter(set -> !set.getReleaseDate().after(current.getTime()))
.filter(Standard::isFallSet)
.filter(ExpansionSet::isRotationSet)
.sorted(ExpansionSet.getComparator())
.skip(2)
.findFirst()
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/BattleForZendikar.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ private BattleForZendikar() {
this.blockName = "Battle for Zendikar";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Bloomburrow.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private Bloomburrow() {
super("Bloomburrow", "BLB", ExpansionSet.buildDate(2024, 8, 2), SetType.EXPANSION);
this.blockName = "Bloomburrow"; // for sorting in GUI
this.hasBasicLands = true;
this.rotationSet = true;
this.hasBoosters = false; // temporary

cards.add(new SetCardInfo("Agate Assault", 122, Rarity.COMMON, mage.cards.a.AgateAssault.class));
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ private ChampionsOfKamigawa() {
super("Champions of Kamigawa", "CHK", ExpansionSet.buildDate(2004, 9, 1), SetType.EXPANSION);
this.blockName = "Kamigawa";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Coldsnap.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ private Coldsnap() {
super("Coldsnap", "CSP", ExpansionSet.buildDate(2006, 6, 21), SetType.EXPANSION);
this.blockName = "Ice Age";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/DominariaUnited.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private DominariaUnited() {
super("Dominaria United", "DMU", ExpansionSet.buildDate(2022, 9, 9), SetType.EXPANSION);
this.blockName = "Dominaria United";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
Expand Down
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/DragonsOfTarkir.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;

/**
*
* @author fireshoes
*/
public final class DragonsOfTarkir extends ExpansionSet {
Expand All @@ -28,11 +27,13 @@ private DragonsOfTarkir() {
this.blockName = "Khans of Tarkir";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;

cards.add(new SetCardInfo("Acid-Spewer Dragon", 86, Rarity.UNCOMMON, mage.cards.a.AcidSpewerDragon.class));
cards.add(new SetCardInfo("Aerie Bowmasters", 170, Rarity.COMMON, mage.cards.a.AerieBowmasters.class));
cards.add(new SetCardInfo("Ainok Artillerist", 171, Rarity.COMMON, mage.cards.a.AinokArtillerist.class));
Expand Down
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/GuildsOfRavnica.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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.cards.repository.CardInfo;
import mage.constants.Rarity;
import mage.constants.SetType;

Expand All @@ -24,6 +24,7 @@ private GuildsOfRavnica() {
super("Guilds of Ravnica", "GRN", ExpansionSet.buildDate(2018, 10, 5), SetType.EXPANSION);
this.blockName = "Guilds of Ravnica";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
Expand Down
49 changes: 25 additions & 24 deletions Mage.Sets/src/mage/sets/Innistrad.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private Innistrad() {
super("Innistrad", "ISD", ExpansionSet.buildDate(2011, 9, 30), SetType.EXPANSION);
this.blockName = "Innistrad";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 9;
this.numBoosterUncommon = 3;
Expand Down Expand Up @@ -343,24 +344,24 @@ class InnistradCollator implements BoosterCollator {
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(
commonA, commonA,
commonB, commonB,
commonC1, commonC1, commonC1, commonC1, commonC1
commonA, commonA,
commonB, commonB,
commonC1, commonC1, commonC1, commonC1, commonC1
);
private final BoosterStructure AAABC1C1C1C1C1 = new BoosterStructure(
commonA, commonA, commonA,
commonB,
commonC1, commonC1, commonC1, commonC1, commonC1
commonA, commonA, commonA,
commonB,
commonC1, commonC1, commonC1, commonC1, commonC1
);
private final BoosterStructure AAABBC2C2C2C2 = new BoosterStructure(
commonA, commonA, commonA,
commonB, commonB,
commonC2, commonC2, commonC2, commonC2
commonA, commonA, commonA,
commonB, commonB,
commonC2, commonC2, commonC2, commonC2
);
private final BoosterStructure AAAABBBC2C2 = new BoosterStructure(
commonA, commonA, commonA, commonA,
commonB, commonB, commonB,
commonC2, commonC2
commonA, commonA, commonA, commonA,
commonB, commonB, commonB,
commonC2, commonC2
);
private final BoosterStructure AAB = new BoosterStructure(uncommonA, uncommonA, uncommonB);
private final BoosterStructure ABB = new BoosterStructure(uncommonA, uncommonB, uncommonB);
Expand All @@ -378,18 +379,18 @@ class InnistradCollator implements BoosterCollator {
// 2.46 C1 commons (135 / 55)
// 1.64 C2 commons (90 / 55)
private final RarityConfiguration commonRuns = new RarityConfiguration(
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2,
AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2,
AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1, AABBC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABC1C1C1C1C1, AAABC1C1C1C1C1, AAABC1C1C1C1C1,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2, AAABBC2C2C2C2,
AAABBC2C2C2C2, AAABBC2C2C2C2,
AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2,
AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2, AAAABBBC2C2
);
// In order for equal numbers of each uncommon to exist, the average booster must contain:
// 1.65 A uncommons (33 / 20)
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/InnistradMidnightHunt.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private InnistradMidnightHunt() {
this.blockName = "Innistrad: Midnight Hunt";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 9;
this.numBoosterUncommon = 3;
Expand Down
3 changes: 1 addition & 2 deletions Mage.Sets/src/mage/sets/Invasion.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

package mage.sets;

import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;

/**
*
* @author North
*/
public final class Invasion extends ExpansionSet {
Expand All @@ -21,6 +19,7 @@ private Invasion() {
super("Invasion", "INV", ExpansionSet.buildDate(2000, 9, 2), SetType.EXPANSION);
this.blockName = "Invasion";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Ixalan.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private Ixalan() {
this.blockName = "Ixalan";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Kaladesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ private Kaladesh() {
this.blockName = "Kaladesh";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
Expand Down
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/KhansOfTarkir.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;

/**
*
* @author LevelX2
*/
public final class KhansOfTarkir extends ExpansionSet {
Expand All @@ -28,11 +27,13 @@ private KhansOfTarkir() {
this.blockName = "Khans of Tarkir";
this.hasBoosters = true;
this.hasBasicLands = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;

cards.add(new SetCardInfo("Abomination of Gudul", 159, Rarity.COMMON, mage.cards.a.AbominationOfGudul.class));
cards.add(new SetCardInfo("Abzan Ascendancy", 160, Rarity.RARE, mage.cards.a.AbzanAscendancy.class));
cards.add(new SetCardInfo("Abzan Banner", 215, Rarity.COMMON, mage.cards.a.AbzanBanner.class));
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/sets/Lorwyn.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

package mage.sets;

import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;

/**
*
* @author North
*/
public final class Lorwyn extends ExpansionSet {
Expand All @@ -21,11 +19,13 @@ private Lorwyn() {
super("Lorwyn", "LRW", ExpansionSet.buildDate(2007, 10, 12), SetType.EXPANSION);
this.blockName = "Lorwyn";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 0;

cards.add(new SetCardInfo("Adder-Staff Boggart", 148, Rarity.COMMON, mage.cards.a.AdderStaffBoggart.class));
cards.add(new SetCardInfo("Aethersnipe", 50, Rarity.COMMON, mage.cards.a.Aethersnipe.class));
cards.add(new SetCardInfo("Ajani Goldmane", 1, Rarity.RARE, mage.cards.a.AjaniGoldmane.class));
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MercadianMasques.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private MercadianMasques() {
super("Mercadian Masques", "MMQ", ExpansionSet.buildDate(1999, 8, 25), SetType.EXPANSION);
this.blockName = "Masques";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Mirrodin.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ private Mirrodin() {
super("Mirrodin", "MRD", ExpansionSet.buildDate(2003, 9, 2), SetType.EXPANSION);
this.blockName = "Mirrodin";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Odyssey.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private Odyssey() {
super("Odyssey", "ODY", ExpansionSet.buildDate(2001, 9, 22), SetType.EXPANSION);
this.blockName = "Odyssey";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Onslaught.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ private Onslaught() {
super("Onslaught", "ONS", ExpansionSet.buildDate(2002, 10, 7), SetType.EXPANSION);
this.blockName = "Onslaught";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

package mage.sets;

import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;

/**
*
* @author loki
*/
public final class RavnicaCityOfGuilds extends ExpansionSet {
Expand All @@ -21,11 +19,13 @@ private RavnicaCityOfGuilds() {
super("Ravnica: City of Guilds", "RAV", ExpansionSet.buildDate(2005, 9, 24), SetType.EXPANSION);
this.blockName = "Ravnica";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 0;

cards.add(new SetCardInfo("Agrus Kos, Wojek Veteran", 190, Rarity.RARE, mage.cards.a.AgrusKosWojekVeteran.class));
cards.add(new SetCardInfo("Auratouched Mage", 1, Rarity.UNCOMMON, mage.cards.a.AuratouchedMage.class));
cards.add(new SetCardInfo("Autochthon Wurm", 191, Rarity.RARE, mage.cards.a.AutochthonWurm.class));
Expand Down
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/ReturnToRavnica.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;

/**
*
* @author magenoxx_at_gmail.com
*/
public final class ReturnToRavnica extends ExpansionSet {
Expand All @@ -27,11 +26,13 @@ private ReturnToRavnica() {
super("Return to Ravnica", "RTR", ExpansionSet.buildDate(2012, 10, 5), SetType.EXPANSION);
this.blockName = "Return to Ravnica";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;

cards.add(new SetCardInfo("Abrupt Decay", 141, Rarity.RARE, mage.cards.a.AbruptDecay.class));
cards.add(new SetCardInfo("Aerial Predation", 113, Rarity.COMMON, mage.cards.a.AerialPredation.class));
cards.add(new SetCardInfo("Angel of Serenity", 1, Rarity.MYTHIC, mage.cards.a.AngelOfSerenity.class));
Expand Down
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/ScarsOfMirrodin.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;

/**
*
* @author nantuko84
*/
public final class ScarsOfMirrodin extends ExpansionSet {
Expand All @@ -27,11 +26,13 @@ private ScarsOfMirrodin() {
super("Scars of Mirrodin", "SOM", ExpansionSet.buildDate(2010, 10, 1), SetType.EXPANSION);
this.blockName = "Scars of Mirrodin";
this.hasBoosters = true;
this.rotationSet = true;
this.numBoosterLands = 1;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;

cards.add(new SetCardInfo("Abuna Acolyte", 1, Rarity.UNCOMMON, mage.cards.a.AbunaAcolyte.class));
cards.add(new SetCardInfo("Accorder's Shield", 136, Rarity.COMMON, mage.cards.a.AccordersShield.class));
cards.add(new SetCardInfo("Acid Web Spider", 108, Rarity.UNCOMMON, mage.cards.a.AcidWebSpider.class));
Expand Down
Loading

0 comments on commit 8ed3c0c

Please sign in to comment.