mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
refactor: added shared code to hide mutate cards
This commit is contained in:
parent
5ccff95b24
commit
49b0568143
9 changed files with 100 additions and 80 deletions
|
|
@ -11,6 +11,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||||
import mage.abilities.keyword.ReachAbility;
|
import mage.abilities.keyword.ReachAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.ExpansionSet;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
|
@ -19,8 +20,8 @@ import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -30,11 +31,14 @@ import java.util.UUID;
|
||||||
public final class IshkanahBroodmother extends CardImpl {
|
public final class IshkanahBroodmother extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.SPIDER, "Spiders");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.SPIDER, "Spiders");
|
||||||
private static final List<String> spellbook = Collections.unmodifiableList(Arrays.asList(
|
private static final List<String> spellbook;
|
||||||
|
|
||||||
|
static {
|
||||||
|
spellbook = new ArrayList<>(Arrays.asList(
|
||||||
"Arachnoform",
|
"Arachnoform",
|
||||||
"Brood Weaver",
|
"Brood Weaver",
|
||||||
"Drider",
|
"Drider",
|
||||||
// "Glowstone Recluse", mutate card
|
"Glowstone Recluse", // mutate card
|
||||||
"Gnottvold Recluse",
|
"Gnottvold Recluse",
|
||||||
"Hatchery Spider",
|
"Hatchery Spider",
|
||||||
"Mammoth Spider",
|
"Mammoth Spider",
|
||||||
|
|
@ -47,6 +51,8 @@ public final class IshkanahBroodmother extends CardImpl {
|
||||||
"Sporecap Spider",
|
"Sporecap Spider",
|
||||||
"Twin-Silk Spider"
|
"Twin-Silk Spider"
|
||||||
));
|
));
|
||||||
|
spellbook.removeIf(card -> ExpansionSet.HIDE_MUTATE_CARDS && ExpansionSet.MUTATE_CARD_NAMES.contains(card));
|
||||||
|
}
|
||||||
|
|
||||||
public IshkanahBroodmother(UUID ownerId, CardSetInfo setInfo) {
|
public IshkanahBroodmother(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@ import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||||
import mage.abilities.effects.common.DraftFromSpellbookEffect;
|
import mage.abilities.effects.common.DraftFromSpellbookEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.ExpansionSet;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -29,16 +30,19 @@ public final class TirelessAngler extends CardImpl {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final List<String> spellbook = Collections.unmodifiableList(Arrays.asList(
|
private static final List<String> spellbook;
|
||||||
// "Archipelagore", mutate card
|
|
||||||
|
static {
|
||||||
|
spellbook = new ArrayList<>(Arrays.asList(
|
||||||
|
"Archipelagore", // mutate card
|
||||||
"Fleet Swallower",
|
"Fleet Swallower",
|
||||||
"Moat Piranhas",
|
"Moat Piranhas",
|
||||||
"Mystic Skyfish",
|
"Mystic Skyfish",
|
||||||
"Nadir Kraken",
|
"Nadir Kraken",
|
||||||
// "Pouncing Shoreshark", mutate card
|
"Pouncing Shoreshark", // mutate card
|
||||||
"Riptide Turtle",
|
"Riptide Turtle",
|
||||||
"Ruin Crab",
|
"Ruin Crab",
|
||||||
// "Sea-Dasher Octopus", mutate card
|
"Sea-Dasher Octopus", // mutate card
|
||||||
"Serpent of Yawning Depths",
|
"Serpent of Yawning Depths",
|
||||||
"Sigiled Starfish",
|
"Sigiled Starfish",
|
||||||
"Spined Megalodon",
|
"Spined Megalodon",
|
||||||
|
|
@ -46,6 +50,8 @@ public final class TirelessAngler extends CardImpl {
|
||||||
"Voracious Greatshark",
|
"Voracious Greatshark",
|
||||||
"Wormhole Serpent"
|
"Wormhole Serpent"
|
||||||
));
|
));
|
||||||
|
spellbook.removeIf(card -> ExpansionSet.HIDE_MUTATE_CARDS && ExpansionSet.MUTATE_CARD_NAMES.contains(card));
|
||||||
|
}
|
||||||
|
|
||||||
public TirelessAngler(UUID ownerId, CardSetInfo setInfo) {
|
public TirelessAngler(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public final class Commander2020 extends ExpansionSet {
|
public final class Commander2020 extends ExpansionSet {
|
||||||
|
|
||||||
private static final List<String> mutateNames = Arrays.asList(
|
|
||||||
"Mindleecher",
|
|
||||||
"Otrimi, the Ever-Playful",
|
|
||||||
"Sawtusk Demolisher",
|
|
||||||
"Souvenir Snatcher"
|
|
||||||
);
|
|
||||||
|
|
||||||
private static final Commander2020 instance = new Commander2020();
|
private static final Commander2020 instance = new Commander2020();
|
||||||
|
|
||||||
public static Commander2020 getInstance() {
|
public static Commander2020 getInstance() {
|
||||||
|
|
@ -353,6 +346,6 @@ public final class Commander2020 extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Zetalpa, Primal Dawn", 107, Rarity.RARE, mage.cards.z.ZetalpaPrimalDawn.class));
|
cards.add(new SetCardInfo("Zetalpa, Primal Dawn", 107, Rarity.RARE, mage.cards.z.ZetalpaPrimalDawn.class));
|
||||||
cards.add(new SetCardInfo("Zulaport Cutthroat", 142, Rarity.UNCOMMON, mage.cards.z.ZulaportCutthroat.class));
|
cards.add(new SetCardInfo("Zulaport Cutthroat", 142, Rarity.UNCOMMON, mage.cards.z.ZulaportCutthroat.class));
|
||||||
|
|
||||||
cards.removeIf(setCardInfo -> mutateNames.contains(setCardInfo.getName())); // remove when mutate is implemented
|
cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -444,6 +444,6 @@ public final class Fallout extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Yes Man, Personal Securitron", 901, Rarity.RARE, mage.cards.y.YesManPersonalSecuritron.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Yes Man, Personal Securitron", 901, Rarity.RARE, mage.cards.y.YesManPersonalSecuritron.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Young Deathclaws", 125, Rarity.UNCOMMON, mage.cards.y.YoungDeathclaws.class));
|
cards.add(new SetCardInfo("Young Deathclaws", 125, Rarity.UNCOMMON, mage.cards.y.YoungDeathclaws.class));
|
||||||
|
|
||||||
cards.removeIf(setCardInfo -> IkoriaLairOfBehemoths.mutateNames.contains(setCardInfo.getName())); // remove when mutate is implemented
|
cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,14 @@ public final class HistoricAnthology4 extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Inspiring Statuary", 23, Rarity.RARE, mage.cards.i.InspiringStatuary.class));
|
cards.add(new SetCardInfo("Inspiring Statuary", 23, Rarity.RARE, mage.cards.i.InspiringStatuary.class));
|
||||||
cards.add(new SetCardInfo("Lys Alana Huntmaster", 15, Rarity.COMMON, mage.cards.l.LysAlanaHuntmaster.class));
|
cards.add(new SetCardInfo("Lys Alana Huntmaster", 15, Rarity.COMMON, mage.cards.l.LysAlanaHuntmaster.class));
|
||||||
cards.add(new SetCardInfo("Marit Lage's Slumber", 6, Rarity.RARE, mage.cards.m.MaritLagesSlumber.class));
|
cards.add(new SetCardInfo("Marit Lage's Slumber", 6, Rarity.RARE, mage.cards.m.MaritLagesSlumber.class));
|
||||||
// cards.add(new SetCardInfo("Sawtusk Demolisher", 16, Rarity.RARE, mage.cards.s.SawtuskDemolisher.class)); TODO: reenable when mutate is implemented
|
cards.add(new SetCardInfo("Sawtusk Demolisher", 16, Rarity.RARE, mage.cards.s.SawtuskDemolisher.class));
|
||||||
cards.add(new SetCardInfo("Spider Spawning", 17, Rarity.UNCOMMON, mage.cards.s.SpiderSpawning.class));
|
cards.add(new SetCardInfo("Spider Spawning", 17, Rarity.UNCOMMON, mage.cards.s.SpiderSpawning.class));
|
||||||
cards.add(new SetCardInfo("Sword of Body and Mind", 24, Rarity.MYTHIC, mage.cards.s.SwordOfBodyAndMind.class));
|
cards.add(new SetCardInfo("Sword of Body and Mind", 24, Rarity.MYTHIC, mage.cards.s.SwordOfBodyAndMind.class));
|
||||||
cards.add(new SetCardInfo("Think Twice", 7, Rarity.COMMON, mage.cards.t.ThinkTwice.class));
|
cards.add(new SetCardInfo("Think Twice", 7, Rarity.COMMON, mage.cards.t.ThinkTwice.class));
|
||||||
cards.add(new SetCardInfo("Thraben Inspector", 3, Rarity.COMMON, mage.cards.t.ThrabenInspector.class));
|
cards.add(new SetCardInfo("Thraben Inspector", 3, Rarity.COMMON, mage.cards.t.ThrabenInspector.class));
|
||||||
cards.add(new SetCardInfo("Torment of Scarabs", 11, Rarity.UNCOMMON, mage.cards.t.TormentOfScarabs.class));
|
cards.add(new SetCardInfo("Torment of Scarabs", 11, Rarity.UNCOMMON, mage.cards.t.TormentOfScarabs.class));
|
||||||
cards.add(new SetCardInfo("Triumphant Reckoning", 4, Rarity.MYTHIC, mage.cards.t.TriumphantReckoning.class));
|
cards.add(new SetCardInfo("Triumphant Reckoning", 4, Rarity.MYTHIC, mage.cards.t.TriumphantReckoning.class));
|
||||||
|
|
||||||
|
cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,39 +13,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
||||||
|
|
||||||
public static final List<String> mutateNames = Arrays.asList(
|
|
||||||
"Archipelagore",
|
|
||||||
"Auspicious Starrix",
|
|
||||||
"Boneyard Lurker",
|
|
||||||
"Brokkos, Apex of Forever",
|
|
||||||
"Cavern Whisperer",
|
|
||||||
"Chittering Harvester",
|
|
||||||
"Cloudpiercer",
|
|
||||||
"Cubwarden",
|
|
||||||
"Dirge Bat",
|
|
||||||
"Dreamtail Heron",
|
|
||||||
"Everquill Phoenix",
|
|
||||||
"Gemrazer",
|
|
||||||
"Glowstone Recluse",
|
|
||||||
"Huntmaster Liger",
|
|
||||||
"Illuna, Apex of Wishes",
|
|
||||||
"Insatiable Hemophage",
|
|
||||||
"Lore Drakkis",
|
|
||||||
"Majestic Auricorn",
|
|
||||||
"Migratory Greathorn",
|
|
||||||
"Necropanther",
|
|
||||||
"Nethroi, Apex of Death",
|
|
||||||
"Parcelbeast",
|
|
||||||
"Porcuparrot",
|
|
||||||
"Pouncing Shoreshark",
|
|
||||||
"Regal Leosaur",
|
|
||||||
"Sea-Dasher Octopus",
|
|
||||||
"Snapdax, Apex of the Hunt",
|
|
||||||
"Trumpeting Gnarr",
|
|
||||||
"Vadrok, Apex of Thunder",
|
|
||||||
"Vulpikeet"
|
|
||||||
);
|
|
||||||
|
|
||||||
private static final IkoriaLairOfBehemoths instance = new IkoriaLairOfBehemoths();
|
private static final IkoriaLairOfBehemoths instance = new IkoriaLairOfBehemoths();
|
||||||
|
|
||||||
public static IkoriaLairOfBehemoths getInstance() {
|
public static IkoriaLairOfBehemoths getInstance() {
|
||||||
|
|
@ -453,7 +420,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Zirda, the Dawnwaker", 233, Rarity.RARE, mage.cards.z.ZirdaTheDawnwaker.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Zirda, the Dawnwaker", 233, Rarity.RARE, mage.cards.z.ZirdaTheDawnwaker.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Zirda, the Dawnwaker", 360, Rarity.RARE, mage.cards.z.ZirdaTheDawnwaker.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Zirda, the Dawnwaker", 360, Rarity.RARE, mage.cards.z.ZirdaTheDawnwaker.class, NON_FULL_USE_VARIOUS));
|
||||||
|
|
||||||
cards.removeIf(setCardInfo -> mutateNames.contains(setCardInfo.getName())); // remove when mutate is implemented
|
cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ import mage.cards.ExpansionSet;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.SetType;
|
import mage.constants.SetType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://scryfall.com/sets/prm
|
* https://scryfall.com/sets/prm
|
||||||
*/
|
*/
|
||||||
|
|
@ -23,6 +26,8 @@ public class MagicOnlinePromos extends ExpansionSet {
|
||||||
// workaround to fix compilation error: java: code too large
|
// workaround to fix compilation error: java: code too large
|
||||||
addPart1(); // A-L
|
addPart1(); // A-L
|
||||||
addPart2(); // K-Z
|
addPart2(); // K-Z
|
||||||
|
|
||||||
|
cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPart1() {
|
private void addPart1() {
|
||||||
|
|
|
||||||
|
|
@ -1990,6 +1990,8 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
// special check: mutate is not supported yet, so must be removed from sets
|
// special check: mutate is not supported yet, so must be removed from sets
|
||||||
if (card.getAbilities().containsClass(MutateAbility.class)) {
|
if (card.getAbilities().containsClass(MutateAbility.class)) {
|
||||||
|
// how-to fix: add that code at the end of the set
|
||||||
|
// cards.removeIf(card -> HIDE_MUTATE_CARDS && MUTATE_CARD_NAMES.contains(card.getName()));
|
||||||
fail(card, "abilities", "mutate cards aren't implemented and shouldn't be available");
|
fail(card, "abilities", "mutate cards aren't implemented and shouldn't be available");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,45 @@ public abstract class ExpansionSet implements Serializable {
|
||||||
public static final CardGraphicInfo FULL_ART = new CardGraphicInfo(FrameStyle.MPOP_FULL_ART_BASIC, false);
|
public static final CardGraphicInfo FULL_ART = new CardGraphicInfo(FrameStyle.MPOP_FULL_ART_BASIC, false);
|
||||||
public static final CardGraphicInfo FULL_ART_USE_VARIOUS = new CardGraphicInfo(FrameStyle.MPOP_FULL_ART_BASIC, true);
|
public static final CardGraphicInfo FULL_ART_USE_VARIOUS = new CardGraphicInfo(FrameStyle.MPOP_FULL_ART_BASIC, true);
|
||||||
|
|
||||||
|
// TODO: enable after mutate implementation
|
||||||
|
public static final boolean HIDE_MUTATE_CARDS = true;
|
||||||
|
public static final Set<String> MUTATE_CARD_NAMES = new HashSet<>(Arrays.asList(
|
||||||
|
"Archipelagore",
|
||||||
|
"Auspicious Starrix",
|
||||||
|
"Boneyard Lurker",
|
||||||
|
"Cavern Whisperer",
|
||||||
|
"Chittering Harvester",
|
||||||
|
"Cloudpiercer",
|
||||||
|
"Cubwarden",
|
||||||
|
"Dirge Bat",
|
||||||
|
"Dreamtail Heron",
|
||||||
|
"Everquill Phoenix",
|
||||||
|
"Gemrazer",
|
||||||
|
"Glowstone Recluse",
|
||||||
|
"Huntmaster Liger",
|
||||||
|
"Illuna, Apex of Wishes",
|
||||||
|
"Insatiable Hemophage",
|
||||||
|
"Lore Drakkis",
|
||||||
|
"Majestic Auricorn",
|
||||||
|
"Mindleecher",
|
||||||
|
"Migratory Greathorn",
|
||||||
|
"Necropanther",
|
||||||
|
"Nethroi, Apex of Death",
|
||||||
|
"Otrimi, the Ever-Playful",
|
||||||
|
"Parcelbeast",
|
||||||
|
"Porcuparrot",
|
||||||
|
"Pouncing Shoreshark",
|
||||||
|
"Regal Leosaur",
|
||||||
|
"Sawtusk Demolisher",
|
||||||
|
"Sea-Dasher Octopus",
|
||||||
|
"Snapdax, Apex of the Hunt",
|
||||||
|
"Souvenir Snatcher",
|
||||||
|
"Sawtusk Demolisher",
|
||||||
|
"Trumpeting Gnarr",
|
||||||
|
"Vadrok, Apex of Thunder",
|
||||||
|
"Vulpikeet"
|
||||||
|
));
|
||||||
|
|
||||||
public static class SetCardInfo implements Serializable {
|
public static class SetCardInfo implements Serializable {
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue