diff --git a/forge-core/src/main/java/forge/StaticData.java b/forge-core/src/main/java/forge/StaticData.java index 727c25c008a..81c737e60e8 100644 --- a/forge-core/src/main/java/forge/StaticData.java +++ b/forge-core/src/main/java/forge/StaticData.java @@ -43,7 +43,10 @@ public class StaticData { private Predicate modernPredicate; private Predicate commanderPredicate; private Predicate oathbreakerPredicate; + private Predicate tinyLeadersPredicate; + private Predicate tinyLeadersAllowedAsCommanderPredicate; private Predicate duelCommanderPredicate; + private Predicate duelCommanderAllowedAsCommanderPredicate; private boolean filteredHandsEnabled = false; @@ -430,8 +433,14 @@ public boolean allowCustomCardsInDecksConformance() { public void setBrawlPredicate(Predicate brawlPredicate) { this.brawlPredicate = brawlPredicate; } + public void setTinyLeadersPredicate(Predicate tinyLeadersPredicate) { this.tinyLeadersPredicate = tinyLeadersPredicate; } + + public void setTinyLeadersAllowedAsCommanderPredicate(Predicate tinyLeadersAllowedAsCommanderPredicate) { this.tinyLeadersAllowedAsCommanderPredicate = tinyLeadersAllowedAsCommanderPredicate; } + public void setDuelCommanderPredicate(Predicate duelCommanderPredicate) { this.duelCommanderPredicate = duelCommanderPredicate; } + public void setDuelCommanderAllowedAsCommanderPredicate(Predicate duelCommanderAllowedAsCommanderPredicate) { this.duelCommanderAllowedAsCommanderPredicate = duelCommanderAllowedAsCommanderPredicate; } + public Predicate getStandardPredicate() { return standardPredicate; } public Predicate getPioneerPredicate() { return pioneerPredicate; } @@ -444,8 +453,14 @@ public boolean allowCustomCardsInDecksConformance() { public Predicate getBrawlPredicate() { return brawlPredicate; } + public Predicate getTinyLeadersPredicate() { return tinyLeadersPredicate; } + public Predicate getDuelCommanderPredicate() { return duelCommanderPredicate; } + public Predicate getDuelCommanderAllowedAsCommanderPredicate() { return duelCommanderAllowedAsCommanderPredicate; } + + public Predicate getTinyLeadersAllowedAsCommanderPredicate() { return tinyLeadersAllowedAsCommanderPredicate; } + /** * Get an alternative card print for the given card wrt. the input setReleaseDate. * The reference release date will be used to retrieve the alternative art, according diff --git a/forge-core/src/main/java/forge/deck/DeckFormat.java b/forge-core/src/main/java/forge/deck/DeckFormat.java index 3a69166c64b..8fd5f724631 100644 --- a/forge-core/src/main/java/forge/deck/DeckFormat.java +++ b/forge-core/src/main/java/forge/deck/DeckFormat.java @@ -37,6 +37,7 @@ import org.apache.commons.lang3.Range; import org.apache.commons.lang3.tuple.ImmutablePair; +import javax.smartcardio.Card; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -60,43 +61,19 @@ public String getAttractionDeckConformanceProblem(Deck deck) { } }, Commander ( Range.is(99), Range.between(0, 10), 1, null, - card -> StaticData.instance().getCommanderPredicate().apply(card) + card -> StaticData.instance().getCommanderPredicate().apply(card), null ), Oathbreaker ( Range.is(58), Range.between(0, 10), 1, null, - card -> StaticData.instance().getOathbreakerPredicate().apply(card) + card -> StaticData.instance().getOathbreakerPredicate().apply(card), null ), Pauper ( Range.is(60), Range.between(0, 10), 1), Brawl ( Range.is(59), Range.between(0, 15), 1, null, - card -> StaticData.instance().getBrawlPredicate().apply(card) + card -> StaticData.instance().getBrawlPredicate().apply(card), null ), - TinyLeaders ( Range.is(49), Range.between(0, 10), 1, new Predicate() { - private final Set bannedCards = ImmutableSet.of( - "Ancestral Recall", "Balance", "Black Lotus", "Black Vise", "Channel", "Chaos Orb", "Contract From Below", "Counterbalance", "Darkpact", "Demonic Attorney", "Demonic Tutor", "Earthcraft", "Edric, Spymaster of Trest", "Falling Star", - "Fastbond", "Flash", "Goblin Recruiter", "Grindstone", "Hermit Druid", "Imperial Seal", "Jeweled Bird", "Karakas", "Library of Alexandria", "Mana Crypt", "Mana Drain", "Mana Vault", "Metalworker", "Mind Twist", "Mishra's Workshop", - "Mox Emerald", "Mox Jet", "Mox Pearl", "Mox Ruby", "Mox Sapphire", "Najeela, the Blade Blossom", "Necropotence", "Shahrazad", "Skullclamp", "Sol Ring", "Strip Mine", "Survival of the Fittest", "Sword of Body and Mind", "Time Vault", "Time Walk", "Timetwister", - "Timmerian Fiends", "Tolarian Academy", "Umezawa's Jitte", "Vampiric Tutor", "Wheel of Fortune", "Yawgmoth's Will"); - - @Override - public boolean apply(CardRules rules) { - // Check for split cards explicitly, as using rules.getManaCost().getCMC() - // will return the sum of the costs, which is not what we want. - if (rules.getMainPart().getManaCost().getCMC() > 3) { - return false; //only cards with CMC less than 3 are allowed - } - ICardFace otherPart = rules.getOtherPart(); - if (otherPart != null && otherPart.getManaCost().getCMC() > 3) { - return false; //only cards with CMC less than 3 are allowed - } - return !bannedCards.contains(rules.getName()); - } - }) { - private final Set bannedCommanders = ImmutableSet.of("Derevi, Empyrial Tactician", "Erayo, Soratami Ascendant", "Rofellos, Llanowar Emissary"); - - @Override - public boolean isLegalCommander(CardRules rules) { - return super.isLegalCommander(rules) && !bannedCommanders.contains(rules.getName()); - } - + TinyLeaders ( Range.is(49), Range.between(0, 10), 1, null, + card -> StaticData.instance().getTinyLeadersPredicate().apply(card), + card -> StaticData.instance().getTinyLeadersAllowedAsCommanderPredicate().apply(card) + ) { @Override public void adjustCMCLevels(List> cmcLevels) { cmcLevels.clear(); @@ -105,49 +82,10 @@ public void adjustCMCLevels(List> cmcLevels) { cmcLevels.add(ImmutablePair.of(new FilterCMC(3, 3), 3)); } }, - DuelCommander ( Range.is(99), Range.is(0), 1, null, - card -> StaticData.instance().getDuelCommanderPredicate().apply(card) - ) { - private final Set bannedCommanders = ImmutableSet.of( - "Ajani, Nacatl Pariah", - "Akiri, Line-Slinger", - "Arahbo, Roar of the World", - "Asmoranomardicadaistinaculdacar", - "Baral, Chief of Compliance", - "Breya, Etherium Shaper", - "Derevi, Empyrial Tactician", - "Dihada, Binder of Wills", - "Edgar Markov", - "Edric, Spymaster of Trest", - "Emry, Lurker of the Loch", - "Eris, Roar of the Storm", - "Esior, Wardwing Familiar", - "Geist of Saint Traft", - "Inalla, Archmage Ritualist", - "Krark, the Thumbless", - "Minsc & Boo, Timeless Heroes", - "Nadu, Winged Wisdom", - "Najeela, the Blade-Blossom", - "Old Stickfingers", - "Oloro, Ageless Ascetic", - "Omnath, Locus of Creation", - "Prime Speaker Vannifar", - "Raffine, Scheming Seer", - "Rofellos, Llanowar Emissary", - "Shorikai, Genesis Engine", - "Tamiyo, Inquisitive Student", - "Tasigur, the Golden Fang", - "Urza, Lord High Artificer", - "Vial Smasher the Fierce", - "Winota, Joiner of Forces", - "Yuriko, the Tiger's Shadow", - "Zurgo Bellstriker"); - - @Override - public boolean isLegalCommander(CardRules rules) { - return super.isLegalCommander(rules) && !bannedCommanders.contains(rules.getName()); - } - }, + DuelCommander ( Range.is(99), Range.between(0, 10), 1, null, + card -> StaticData.instance().getDuelCommanderPredicate().apply(card), + card -> StaticData.instance().getDuelCommanderAllowedAsCommanderPredicate().apply(card) + ), PlanarConquest ( Range.between(40, Integer.MAX_VALUE), Range.is(0), 1), Adventure ( Range.between(40, Integer.MAX_VALUE), Range.between(0, 15), 4), Vanguard ( Range.between(60, Integer.MAX_VALUE), Range.is(0), 4), @@ -160,31 +98,35 @@ public boolean isLegalCommander(CardRules rules) { private final int maxCardCopies; private final Predicate cardPoolFilter; private final Predicate paperCardPoolFilter; + private final Predicate paperCardCommanderFilter; private final static String ADVPROCLAMATION = "Advantageous Proclamation"; // private final static String SOVREALM = "Sovereign's Realm"; - DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0, Predicate paperCardPoolFilter0) { + DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0, Predicate paperCardPoolFilter0, Predicate paperCardCommanderFilter0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; cardPoolFilter = cardPoolFilter0; paperCardPoolFilter = paperCardPoolFilter0; + paperCardCommanderFilter = paperCardCommanderFilter0; } DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; - paperCardPoolFilter = null; cardPoolFilter = cardPoolFilter0; + paperCardPoolFilter = null; + paperCardCommanderFilter = null; } DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; - paperCardPoolFilter = null; cardPoolFilter = null; + paperCardPoolFilter = null; + paperCardCommanderFilter = null; } public boolean hasCommander() { @@ -284,7 +226,7 @@ public String getDeckConformanceProblem(Deck deck) { } for (PaperCard pc : commanders) { - if (!isLegalCommander(pc.getRules())) { + if (!isLegalCommander(pc)) { return "has an illegal commander"; } cmdCI |= pc.getRules().getColorIdentity().getColor(); @@ -518,10 +460,16 @@ public boolean isLegalCard(PaperCard pc) { return cardPoolFilter.apply(pc.getRules()); } - public boolean isLegalCommander(CardRules rules) { + public boolean isLegalCommander(PaperCard card) { + CardRules rules = card.getRules(); + if (cardPoolFilter != null && !cardPoolFilter.apply(rules)) { return false; } + if (paperCardCommanderFilter != null && !paperCardCommanderFilter.apply(card)) { + return false; + } + if (this.equals(DeckFormat.Oathbreaker)) { return rules.canBeOathbreaker(); } @@ -560,6 +508,17 @@ public Predicate hasLegalCardsPredicate(boolean enforceDeckLegality) { } } } + + for (final PaperCard commander : deck.getCommanders()) { + if (!isLegalCommander(commander)) { + System.err.println( + "Excluding deck: '" + deck.toString() + + "' Reason: '" + commander.getName() + "' is not a legal commander." + ); + return false; + } + } + return true; }; } @@ -569,7 +528,7 @@ public Predicate isLegalCardPredicate() { } public Predicate isLegalCommanderPredicate() { - return card -> isLegalCommander(card.getRules()); + return this::isLegalCommander; } public Predicate isLegalCardForCommanderPredicate(List commanders) { diff --git a/forge-game/src/main/java/forge/game/GameFormat.java b/forge-game/src/main/java/forge/game/GameFormat.java index 018168cbbfa..12d6e90c0a0 100644 --- a/forge-game/src/main/java/forge/game/GameFormat.java +++ b/forge-game/src/main/java/forge/game/GameFormat.java @@ -75,6 +75,7 @@ public enum FormatSubType { protected final List allowedSetCodes; // this is mutable to support quest mode set unlocks protected final List allowedRarities; protected final List bannedCardNames; + protected final List bannedAsCommanderCardNames; protected final List restrictedCardNames; protected final List additionalCardNames; // for cards that are legal but not reprinted in any of the allowed Sets protected boolean restrictedLegendary = false; @@ -84,22 +85,24 @@ public enum FormatSubType { protected final transient List allowedSetCodes_ro; protected final transient List bannedCardNames_ro; + protected final transient List bannedAsCommanderCardNames_ro; protected final transient List restrictedCardNames_ro; protected final transient List additionalCardNames_ro; protected final transient Predicate filterRules; protected final transient Predicate filterPrinted; + protected final transient Predicate filterAllowedAsCommander; private final int index; public GameFormat(final String fName, final Iterable sets, final List bannedCards) { - this(fName, parseDate(DEFAULTDATE), sets, bannedCards, null, false, null, null, 0, FormatType.CUSTOM, FormatSubType.CUSTOM); + this(fName, parseDate(DEFAULTDATE), sets, bannedCards, null, null, false, null, null, 0, FormatType.CUSTOM, FormatSubType.CUSTOM); } - public static final GameFormat NoFormat = new GameFormat("(none)", parseDate(DEFAULTDATE) , null, null, null, false + public static final GameFormat NoFormat = new GameFormat("(none)", parseDate(DEFAULTDATE) , null, null, null, null, false , null, null, Integer.MAX_VALUE, FormatType.CUSTOM, FormatSubType.CUSTOM); - public GameFormat(final String fName, final Date effectiveDate, final Iterable sets, final List bannedCards, + public GameFormat(final String fName, final Date effectiveDate, final Iterable sets, final List bannedCards, final List bannedAsCommander, final List restrictedCards, Boolean restrictedLegendary, final List additionalCards, final List rarities, int compareIdx, FormatType formatType, FormatSubType formatSubType) { this.index = compareIdx; @@ -124,6 +127,7 @@ public GameFormat(final String fName, final Date effectiveDate, final Iterable() : Lists.newArrayList(bannedCards); + bannedAsCommanderCardNames = bannedAsCommander == null ? new ArrayList<>() : Lists.newArrayList(bannedAsCommander); restrictedCardNames = restrictedCards == null ? new ArrayList<>() : Lists.newArrayList(restrictedCards); allowedRarities = rarities == null ? new ArrayList<>() : rarities; this.restrictedLegendary = restrictedLegendary; @@ -131,11 +135,13 @@ public GameFormat(final String fName, final Date effectiveDate, final Iterable buildFilter(boolean printed) { Predicate p = Predicates.not(IPaperCard.Predicates.names(this.getBannedCardNames())); @@ -204,6 +210,10 @@ public List getBannedCardNames() { return this.bannedCardNames_ro; } + public List getBannedAsCommanderCardNames() { + return this.bannedAsCommanderCardNames_ro; + } + public List getRestrictedCards() { return restrictedCardNames_ro; } @@ -247,6 +257,10 @@ public Predicate getFilterPrinted() { return this.filterPrinted; } + public Predicate getFilterAllowedAsCommander() { + return this.filterAllowedAsCommander; + } + public boolean isSetLegal(final String setCode) { return this.getAllowedSetCodes().isEmpty() || this.getAllowedSetCodes().contains(setCode); } @@ -357,6 +371,7 @@ public static class Reader extends StorageReaderRecursiveFolderWithUserFolder> contents = FileSection.parseSections(FileUtil.readFile(file)); List sets = null; // default: all sets allowed List bannedCards = null; // default: nothing banned + List bannedAsCommanders = null; // default: nothing banned List restrictedCards = null; // default: nothing restricted Boolean restrictedLegendary = false; List additionalCards = null; // default: nothing additional @@ -413,10 +429,16 @@ protected GameFormat read(File file) { if ( null != strSets ) { sets = Arrays.asList(strSets.split(", ")); } + String strCars = section.get("banned"); if ( strCars != null ) { bannedCards = Arrays.asList(strCars.split("; ")); } + + strCars = section.get("bannedAsCommander"); + if ( strCars != null ) { + bannedAsCommanders = Arrays.asList(strCars.split("; ")); + } strCars = section.get("restricted"); if ( strCars != null ) { @@ -445,7 +467,7 @@ protected GameFormat read(File file) { } } - GameFormat result = new GameFormat(title, date, sets, bannedCards, restrictedCards, restrictedLegendary, additionalCards, rarities, idx, formatType,formatsubType); + GameFormat result = new GameFormat(title, date, sets, bannedCards, bannedAsCommanders, restrictedCards, restrictedLegendary, additionalCards, rarities, idx, formatType,formatsubType); naturallyOrdered.add(result); return result; } diff --git a/forge-gui-mobile/src/forge/adventure/scene/AdventureDeckEditor.java b/forge-gui-mobile/src/forge/adventure/scene/AdventureDeckEditor.java index 1c0fa85e556..f3c9ef668d3 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/AdventureDeckEditor.java +++ b/forge-gui-mobile/src/forge/adventure/scene/AdventureDeckEditor.java @@ -922,7 +922,7 @@ protected void addCommanderItems(final FDropDownMenu menu, final PaperCard card, } boolean isLegalCommander; String captionSuffix = Forge.getLocalizer().getMessage("lblCommander"); - isLegalCommander = DeckFormat.Commander.isLegalCommander(card.getRules()); + isLegalCommander = DeckFormat.Commander.isLegalCommander(card); if (isLegalCommander && !parentScreen.getCommanderPage().cardManager.getPool().contains(card)) { addItem(menu, "Set", "as " + captionSuffix, parentScreen.getCommanderPage().getIcon(), isAddMenu, isAddSource, new Callback() { @Override diff --git a/forge-gui-mobile/src/forge/deck/FDeckEditor.java b/forge-gui-mobile/src/forge/deck/FDeckEditor.java index 8b4175f9c1a..6cb11945f0f 100644 --- a/forge-gui-mobile/src/forge/deck/FDeckEditor.java +++ b/forge-gui-mobile/src/forge/deck/FDeckEditor.java @@ -10,10 +10,12 @@ import forge.Forge; import forge.Forge.KeyInputAdapter; import forge.Graphics; +import forge.StaticData; import forge.assets.*; import forge.card.CardEdition; import forge.card.MagicColor; import forge.deck.io.DeckPreferences; +import forge.game.GameFormat; import forge.gamemodes.limited.BoosterDraft; import forge.gamemodes.planarconquest.ConquestUtil; import forge.gui.GuiBase; @@ -1266,8 +1268,10 @@ protected boolean canBeCommander(final PaperCard card) { return card.getRules().canBeOathbreaker(); case PlanarConquest: return false; //don't set commander this way in Planar Conquest + case DuelCommander: + return DeckFormat.DuelCommander.isLegalCommander(card); default: - return DeckFormat.Commander.isLegalCommander(card.getRules()); + return DeckFormat.Commander.isLegalCommander(card); } } diff --git a/forge-gui/res/formats/Casual/DuelCommander.txt b/forge-gui/res/formats/Casual/DuelCommander.txt index 0a1f70fcb4b..e3f20293709 100644 --- a/forge-gui/res/formats/Casual/DuelCommander.txt +++ b/forge-gui/res/formats/Casual/DuelCommander.txt @@ -4,3 +4,4 @@ Type:Casual Subtype:Commander Order:143 Banned:Ancestral Recall; Ancient Tomb; Back to Basics; Bazaar of Baghdad; Black Lotus; Capture of Jingzhou; Cavern of Souls; Channel; Chrome Mox; Comet, Stellar Pup; Deadly Rollick; Deflecting Swat; Dig Through Time; Emrakul, the Aeons Torn; Entomb; Fastbond; Field of the Dead; Fierce Guardianship; Flawless Maneuver; Food Chain; Gaea’s Cradle; Genesis Storm; Gifts Ungiven; Grim Monolith; Hermit Druid; Hogaak, Arisen Necropolis; Humility; Imperial Seal; Jeweled Lotus; Karakas; Library of Alexandria; Lion's Eye Diamond; Lotus Petal; Loyal Retainers; Lutri, The Spellchaser; Maddening Hex; Mana Crypt; Mana Drain; Mana Vault; Mishra’s Workshop; Mox Amber; Mox Diamond; Mox Emerald; Mox Jet; Mox Opal; Mox Pearl; Mox Ruby; Mox Sapphire; Mystical Tutor; Natural Order; Necrotic Ooze; Oath of Druids; Price of Progress; Protean Hulk; Ragavan, Nimble Pilferer; Rain of Filth; Scapeshift; Sensei’s Divining Top; Serra's Sanctum; Sol Ring; Strip Mine; Temporal Manipulation; Thassa’s Oracle; The One Ring; The Tabernacle at Pendrell Vale; Timetwister; Time Vault; Time Walk; Time Warp; Tinker; Tolarian Academy; Trazyn The Infinite; Treasure Cruise; Uro, Titan of Nature's Wrath; Vampiric Tutor; Wasteland +BannedAsCommander:Ajani, Nacatl Pariah; Akiri, Line-Slinger; Arahbo, Roar of the World; Asmoranomardicadaistinaculdacar; Baral, Chief of Compliance; Breya, Etherium Shaper; Derevi, Empyrial Tactician; Dihada, Binder of Wills; Edgar Markov; Edric, Spymaster of Trest; Emry, Lurker of the Loch; Eris, Roar of the Storm; Esior, Wardwing Familiar; Geist of Saint Traft; Inalla, Archmage Ritualist; Krark, the Thumbless; Minsc & Boo, Timeless Heroes; Nadu, Winged Wisdom; Najeela, the Blade-Blossom; Old Stickfingers; Oloro, Ageless Ascetic; Omnath, Locus of Creation; Prime Speaker Vannifar; Raffine, Scheming Seer; Rofellos, Llanowar Emissary; Shorikai, Genesis Engine; Tamiyo, Inquisitive Student; Tasigur, the Golden Fang; Urza, Lord High Artificer; Vial Smasher the Fierce; Winota, Joiner of Forces; Yuriko, the Tiger's Shadow; Zurgo Bellstriker diff --git a/forge-gui/res/formats/Casual/TinyLeaders.txt b/forge-gui/res/formats/Casual/TinyLeaders.txt new file mode 100644 index 00000000000..b71f63b30a9 --- /dev/null +++ b/forge-gui/res/formats/Casual/TinyLeaders.txt @@ -0,0 +1,7 @@ +[format] +Name:Tiny Leaders +Type:Casual +Subtype:Commander +Order:144 +Banned:Ancestral Recall; Balance; Black Lotus; Black Vise; Channel; Chaos Orb; Contract From Below; Counterbalance; Darkpact; Demonic Attorney; Demonic Tutor; Earthcraft; Edric, Spymaster of Trest; Falling Star; Fastbond; Flash; Goblin Recruiter; Grindstone; Hermit Druid; Imperial Seal; Jeweled Bird; Karakas; Library of Alexandria; Mana Crypt; Mana Drain; Mana Vault; Metalworker; Mind Twist; Mishra's Workshop; Mox Emerald; Mox Jet; Mox Pearl; Mox Ruby; Mox Sapphire; Najeela, the Blade Blossom; Necropotence; Shahrazad; Skullclamp; Sol Ring; Strip Mine; Survival of the Fittest; Sword of Body and Mind; Time Vault; Time Walk; Timetwister; Timmerian Fiends; Tolarian Academy; Umezawa's Jitte; Vampiric Tutor; Wheel of Fortune; Yawgmoth's Will +BannedAsCommander:Derevi, Empyrial Tactician; Erayo, Soratami Ascendant; Rofellos, Llanowar Emissary diff --git a/forge-gui/src/main/java/forge/gamemodes/quest/data/GameFormatQuest.java b/forge-gui/src/main/java/forge/gamemodes/quest/data/GameFormatQuest.java index 54030ccd2c8..98c507b8bbd 100644 --- a/forge-gui/src/main/java/forge/gamemodes/quest/data/GameFormatQuest.java +++ b/forge-gui/src/main/java/forge/gamemodes/quest/data/GameFormatQuest.java @@ -105,8 +105,8 @@ public GameFormatQuest(final String newName, final List setsToAllow, fin * @param setRotation */ public GameFormatQuest(final GameFormat toCopy, boolean allowSetUnlocks, ISetRotation setRotation) { - super(toCopy.getName(), toCopy.getEffectiveDate(), toCopy.getAllowedSetCodes(), toCopy.getBannedCardNames(), toCopy.getRestrictedCards(), - toCopy.isRestrictedLegendary(),toCopy.getAdditionalCards(), toCopy.getAllowedRarities(), + super(toCopy.getName(), toCopy.getEffectiveDate(), toCopy.getAllowedSetCodes(), toCopy.getBannedCardNames(), toCopy.getBannedAsCommanderCardNames(), + toCopy.getRestrictedCards(), toCopy.isRestrictedLegendary(),toCopy.getAdditionalCards(), toCopy.getAllowedRarities(), toCopy.getIndex(), FormatType.CUSTOM, FormatSubType.CUSTOM); allowUnlocks = allowSetUnlocks; this.setRotation = setRotation; diff --git a/forge-gui/src/main/java/forge/model/FModel.java b/forge-gui/src/main/java/forge/model/FModel.java index 2fc0cb42329..abb60574e74 100644 --- a/forge-gui/src/main/java/forge/model/FModel.java +++ b/forge-gui/src/main/java/forge/model/FModel.java @@ -213,7 +213,10 @@ public void report(final int current, final int total) { magicDb.setCommanderPredicate(formats.get("Commander").getFilterRules()); magicDb.setOathbreakerPredicate(formats.get("Oathbreaker").getFilterRules()); magicDb.setBrawlPredicate(formats.get("Brawl").getFilterRules()); + magicDb.setTinyLeadersPredicate(formats.get("Tiny Leaders").getFilterRules()); + magicDb.setTinyLeadersAllowedAsCommanderPredicate(formats.get("Tiny Leaders").getFilterAllowedAsCommander()); magicDb.setDuelCommanderPredicate(formats.get("Duel Commander").getFilterRules()); + magicDb.setDuelCommanderAllowedAsCommanderPredicate(formats.get("Duel Commander").getFilterAllowedAsCommander()); magicDb.setFilteredHandsEnabled(preferences.getPrefBoolean(FPref.FILTERED_HANDS)); try { diff --git a/forge-lda/src/main/java/forge/lda/LDAModelGenetrator.java b/forge-lda/src/main/java/forge/lda/LDAModelGenetrator.java index 8a83ae5725e..dcb81740e30 100644 --- a/forge-lda/src/main/java/forge/lda/LDAModelGenetrator.java +++ b/forge-lda/src/main/java/forge/lda/LDAModelGenetrator.java @@ -305,9 +305,7 @@ public static HashMap>> initializeComma } //filter to just legal commanders - List legends = Lists.newArrayList(Iterables.filter(cardList,Predicates.compose( - DeckFormat.Commander::isLegalCommander, PaperCard::getRules - ))); + List legends = Lists.newArrayList(Iterables.filter(cardList, DeckFormat.Commander::isLegalCommander)); //generate lookups for legends to link commander names to matrix rows for (int i=0; i