diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 008a3b654a..3437772294 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -538,7 +538,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { // Always hide not hidden popup window or enlarged card view if a frame is set to active try { ActionCallback callback = Plugins.instance.getActionCallback(); - if (callback != null && callback instanceof MageActionCallback) { + if (callback instanceof MageActionCallback) { ((MageActionCallback) callback).hideEnlargedCard(); } Component container = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); diff --git a/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogManager.java b/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogManager.java index 2f7f69998e..329ff3ec0e 100644 --- a/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogManager.java +++ b/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogManager.java @@ -319,7 +319,7 @@ public class DialogManager extends JComponent implements MouseListener, if (e.getButton() == MouseEvent.BUTTON1) { j = (JComponent) getComponentAt(e.getX(), e.getY()); - if (j != null && j instanceof DialogContainer) { + if (j instanceof DialogContainer) { rec = j.getBounds(); bDragged = true; mx = e.getX(); diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java index d838688768..fd53051191 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java @@ -398,18 +398,6 @@ public class MageBook extends JComponent { cardImg.setCardCaptionTopOffset(8); // card caption below real card caption to see full name even with mana icons - boolean implemented = card.getRarity() != Rarity.NA; - - // implemented label - // old code, nowadays app load only implemented cards (JayDi85, 23.11.2017) - /* - GlowText label = new GlowText(); - label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f); - label.setText(implemented ? "Implemented" : "Not implemented"); - int dx = implemented ? 15 : 5; - label.setBounds(rectangle.x + dx, rectangle.y + cardDimensions.frameHeight + 7, 110, 30); - jLayeredPane.add(label); - */ // card number label JLabel cardNumber = new JLabel(); int dy = -5; // image panel have empty space in bottom (bug?), need to move label up @@ -542,7 +530,7 @@ public class MageBook extends JComponent { Class<?> c = Class.forName(className); Constructor<?> cons = c.getConstructor(); Object newToken = cons.newInstance(); - if (newToken != null && newToken instanceof mage.game.permanent.token.Token) { + if (newToken instanceof Token) { ((Token) newToken).setExpansionSetCodeForImage(set); ((Token) newToken).setOriginalExpansionSetCode(set); ((Token) newToken).setTokenType(token.getType()); @@ -592,7 +580,7 @@ public class MageBook extends JComponent { Class<?> c = Class.forName(className); Constructor<?> cons = c.getConstructor(); Object newEmblem = cons.newInstance(); - if (newEmblem != null && newEmblem instanceof mage.game.command.Emblem) { + if (newEmblem instanceof Emblem) { ((Emblem) newEmblem).setExpansionSetCodeForImage(set); emblems.add((Emblem) newEmblem); @@ -649,7 +637,7 @@ public class MageBook extends JComponent { Class<?> c = Class.forName(className); Constructor<?> cons = c.getConstructor(); Object newPlane = cons.newInstance(); - if (newPlane != null && newPlane instanceof mage.game.command.Plane) { + if (newPlane instanceof Plane) { ((Plane) newPlane).setExpansionSetCodeForImage(set); planes.add((Plane) newPlane); diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java index c2b24748e3..20e6513c1d 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java @@ -369,7 +369,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid { if (!card.getId().equals(bigCard.getCardId())) { if (!MageFrame.isLite()) { Image image = Plugins.instance.getOriginalImage(card); - if (image != null && image instanceof BufferedImage) { + if (image instanceof BufferedImage) { // XXX: scaled to fit width bigCard.setCard(card.getId(), EnlargeMode.NORMAL, image, new ArrayList<>(), false); } else { diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index 4d69a16ce8..344e62c1b6 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -617,7 +617,7 @@ public class MageActionCallback implements ActionCallback { } private void displayCardInfo(MageCard mageCard, Image image, BigCard bigCard) { - if (image != null && image instanceof BufferedImage) { + if (image instanceof BufferedImage) { // XXX: scaled to fit width bigCard.setCard(mageCard.getOriginal().getId(), enlargeMode, image, mageCard.getOriginal().getRules(), mageCard.getOriginal().isToRotate()); // if it's an ability, show only the ability text as overlay diff --git a/Mage.Client/src/main/java/mage/client/util/Config.java b/Mage.Client/src/main/java/mage/client/util/Config.java index 9eb8751fd1..466f2ad08c 100644 --- a/Mage.Client/src/main/java/mage/client/util/Config.java +++ b/Mage.Client/src/main/java/mage/client/util/Config.java @@ -33,8 +33,8 @@ public final class Config { static { Properties p = new Properties(); - try { - p.load(new FileInputStream(new File("config/config.properties"))); + try(FileInputStream fis =new FileInputStream(new File("config/config.properties"))) { + p.load(fis); } catch (IOException ex) { logger.fatal("Config error ", ex); } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryItemEditor.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryItemEditor.java index b7f476bc27..75f6635324 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryItemEditor.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryItemEditor.java @@ -47,7 +47,7 @@ public class CountryItemEditor extends BasicComboBoxEditor { @Override public void setItem(Object item) { - if (item == null || !(item instanceof String[])) { + if (!(item instanceof String[])) { return; } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index a124d63fa0..9c670224dd 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -800,7 +800,7 @@ public abstract class CardPanel extends MagePermanent implements MouseListener, // this update removes the isChoosable mark from targetCardsInLibrary // so only done for permanents because it's needed to redraw counters in different size, if window size was changed // no perfect solution yet (maybe also other not wanted effects for PermanentView objects) - if (updateCard != null && (updateCard instanceof PermanentView)) { + if ((updateCard instanceof PermanentView)) { update(updateCard); } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java index 6f55636670..c8a403dc3d 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java @@ -121,16 +121,14 @@ public class CardPluginImpl implements CardPlugin { @Override public MagePermanent getMagePermanent(PermanentView permanent, Dimension dimension, UUID gameId, ActionCallback callback, boolean canBeFoil, boolean loadImage) { CardPanel cardPanel = makePanel(permanent, gameId, loadImage, callback, false, dimension); - boolean implemented = permanent.getRarity() != Rarity.NA; - cardPanel.setShowCastingCost(implemented); + cardPanel.setShowCastingCost(true); return cardPanel; } @Override public MagePermanent getMageCard(CardView cardView, Dimension dimension, UUID gameId, ActionCallback callback, boolean canBeFoil, boolean loadImage) { CardPanel cardPanel = makePanel(cardView, gameId, loadImage, callback, false, dimension); - boolean implemented = cardView.getRarity() != null && cardView.getRarity() != Rarity.NA; - cardPanel.setShowCastingCost(implemented); + cardPanel.setShowCastingCost(true); return cardPanel; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java index fbd58ee16c..86f80a6fea 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java @@ -231,8 +231,9 @@ public enum MythicspoilerComSource implements CardImageSource { supportedSets.add("DOM"); supportedSets.add("BBD"); supportedSets.add("M19"); -// supportedSets.add("C18"); -// supportedSets.add("CM2"); + supportedSets.add("C18"); + supportedSets.add("CM2"); + supportedSets.add("GRN"); sets = new LinkedHashMap<>(); setsAliases = new HashMap<>(); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSource.java index 6dbc42c5c7..29b907198c 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSource.java @@ -129,7 +129,10 @@ public enum ScryfallImageSource implements CardImageSource { supportedSets.add("WWK"); supportedSets.add("DDE"); supportedSets.add("ROE"); + // duels of the planewalkers: supportedSets.add("DPA"); + supportedSets.add("DPAP"); + // supportedSets.add("ARC"); supportedSets.add("M11"); supportedSets.add("V10"); @@ -230,6 +233,10 @@ public enum ScryfallImageSource implements CardImageSource { supportedSets.add("CM2"); supportedSets.add("M19"); supportedSets.add("GS1"); + supportedSets.add("GRN"); + // + supportedSets.add("EURO"); + supportedSets.add("GPX"); } @Override @@ -244,6 +251,15 @@ public enum ScryfallImageSource implements CardImageSource { String baseUrl = null; String alternativeUrl = null; + // direct links to images (non localization) + if (baseUrl == null) { + String linkCode = card.getSet() + "/" + card.getName(); + if (directDownloadLinks.containsKey(linkCode)) { + baseUrl = directDownloadLinks.get(linkCode); + alternativeUrl = null; + } + } + // special card number like "103a" already compatible if (baseUrl == null && card.isCollectorIdWithStr()) { baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet()) + "/" @@ -329,6 +345,40 @@ public enum ScryfallImageSource implements CardImageSource { put("MPS-AKH", "mp2"); put("MBP", "pmei"); put("WMCQ", "pwcq"); + put("EURO", "pelp"); + put("GPX", "pgpx"); + } + }; + + private static final Map<String, String> directDownloadLinks = new HashMap<String, String>() { + { + // direct links to download images for special cards + + // Duels of the Planeswalkers Promos -- xmage uses one set (DPAP), but scryfall store it by years + // 2009 - https://scryfall.com/sets/pdtp + put("DPAP/Garruk Wildspeaker", "https://img.scryfall.com/cards/large/en/pdtp/1.jpg"); + // 2010 - https://scryfall.com/sets/pdp10 + put("DPAP/Liliana Vess", "https://img.scryfall.com/cards/large/en/pdp10/1.jpg"); + put("DPAP/Nissa Revane", "https://img.scryfall.com/cards/large/en/pdp10/2.jpg"); + // 2011 - https://scryfall.com/sets/pdp11 + put("DPAP/Frost Titan", "https://img.scryfall.com/cards/large/en/pdp11/1.jpg"); + put("DPAP/Grave Titan", "https://img.scryfall.com/cards/large/en/pdp11/2.jpg"); + put("DPAP/Inferno Titan", "https://img.scryfall.com/cards/large/en/pdp11/3.jpg"); + // 2012 - https://scryfall.com/sets/pdp12 + put("DPAP/Primordial Hydra", "https://img.scryfall.com/cards/large/en/pdp12/1.jpg"); + put("DPAP/Serra Avatar", "https://img.scryfall.com/cards/large/en/pdp12/2.jpg"); + put("DPAP/Vampire Nocturnus", "https://img.scryfall.com/cards/large/en/pdp12/3.jpg"); + // 2013 - https://scryfall.com/sets/pdp13 + put("DPAP/Bonescythe Sliver", "https://img.scryfall.com/cards/large/en/pdp13/1.jpg"); + put("DPAP/Ogre Battledriver", "https://img.scryfall.com/cards/large/en/pdp13/2.jpg"); + put("DPAP/Scavenging Ooze", "https://img.scryfall.com/cards/large/en/pdp13/3.jpg"); + // 2014 - https://scryfall.com/sets/pdp14 + put("DPAP/Soul of Ravnica", "https://img.scryfall.com/cards/large/en/pdp14/1.jpg"); + put("DPAP/Soul of Zendikar", "https://img.scryfall.com/cards/large/en/pdp14/2.jpg"); + + + // TODO: remove Grand Prix fix after scryfall fix image's link (that's link must be work: https://img.scryfall.com/cards/large/en/pgpx/2016b.jpg ) + put("GPX/Sword of Feast and Famine", "https://img.scryfall.com/cards/large/en/pgpx/1%E2%98%85.jpg"); } }; diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java index c482f17d4a..5d39a943f6 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java @@ -140,7 +140,7 @@ public enum WizardCardsImageSource implements CardImageSource { supportedSets.add("WWK"); supportedSets.add("DDE"); supportedSets.add("ROE"); - supportedSets.add("DPA"); + //supportedSets.add("DPA"); supportedSets.add("ARC"); supportedSets.add("M11"); supportedSets.add("V10"); diff --git a/Mage.Common/src/main/java/mage/remote/ActionData.java b/Mage.Common/src/main/java/mage/remote/ActionData.java index fb7c154186..c546ba2d24 100644 --- a/Mage.Common/src/main/java/mage/remote/ActionData.java +++ b/Mage.Common/src/main/java/mage/remote/ActionData.java @@ -39,7 +39,7 @@ public class ActionData { this.gameId = gameId; } - public class CustomExclusionStrategy implements ExclusionStrategy { + static class CustomExclusionStrategy implements ExclusionStrategy { // FIXME: Very crude way of whitelisting, as it applies to all levels of the JSON tree. private final java.util.Set<String> KEEP = new java.util.HashSet<>( diff --git a/Mage.Common/src/main/java/mage/remote/Connection.java b/Mage.Common/src/main/java/mage/remote/Connection.java index 6022fcad8d..ecc7dd4416 100644 --- a/Mage.Common/src/main/java/mage/remote/Connection.java +++ b/Mage.Common/src/main/java/mage/remote/Connection.java @@ -225,7 +225,7 @@ public class Connection { for (InterfaceAddress addr : iface.getInterfaceAddresses()) { if (addr != null) { InetAddress iaddr = addr.getAddress(); - if (iaddr != null && iaddr instanceof Inet4Address) { + if (iaddr instanceof Inet4Address) { return iaddr; } } diff --git a/Mage.Common/src/main/java/mage/utils/CompressUtil.java b/Mage.Common/src/main/java/mage/utils/CompressUtil.java index 39fa5fdf6d..eeef7533de 100644 --- a/Mage.Common/src/main/java/mage/utils/CompressUtil.java +++ b/Mage.Common/src/main/java/mage/utils/CompressUtil.java @@ -39,7 +39,7 @@ public final class CompressUtil { * @return Decompressed object */ public static Object decompress(Object data) { - if (data == null || !(data instanceof ZippedObject)) { + if (!(data instanceof ZippedObject)) { return data; } return ((ZippedObject) data).unzip(); diff --git a/Mage.Common/src/main/java/mage/utils/MageVersion.java b/Mage.Common/src/main/java/mage/utils/MageVersion.java index 48683734b5..ddd0fefe4a 100644 --- a/Mage.Common/src/main/java/mage/utils/MageVersion.java +++ b/Mage.Common/src/main/java/mage/utils/MageVersion.java @@ -14,7 +14,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 31; - public final static String MAGE_VERSION_MINOR_PATCH = "V1"; + public final static String MAGE_VERSION_MINOR_PATCH = "V3"; public final static String MAGE_VERSION_INFO = ""; private final int major; diff --git a/Mage.Common/src/main/java/mage/utils/properties/PropertiesUtil.java b/Mage.Common/src/main/java/mage/utils/properties/PropertiesUtil.java index a3c40b52a3..0a220e12fd 100644 --- a/Mage.Common/src/main/java/mage/utils/properties/PropertiesUtil.java +++ b/Mage.Common/src/main/java/mage/utils/properties/PropertiesUtil.java @@ -2,6 +2,7 @@ package mage.utils.properties; import org.apache.log4j.Logger; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -19,39 +20,36 @@ public final class PropertiesUtil { private static Properties properties = new Properties(); static { - InputStream in = PropertiesUtil.class.getResourceAsStream("/xmage.properties"); - if (in != null) { - try { - properties.load(in); - } catch (IOException e) { - logger.error("Couldn't load properties", e); - } - } else { + try (InputStream in = PropertiesUtil.class.getResourceAsStream("/xmage.properties")) { + properties.load(in); + } catch (FileNotFoundException fnfe) { logger.warn("No xmage.properties were found on classpath"); - + } catch (IOException e) { + logger.error("Couldn't load properties"); + e.printStackTrace(); } } - /** - * Hide constructor - */ + /** + * Hide constructor + */ private PropertiesUtil() { - } - - public static String getDBLogUrl() { - String url = properties.getProperty(PropertyKeys.KEY_DB_LOG_URL, LOG_JDBC_URL); - if (url != null) { - return url.trim(); } - return null; - } - public static String getDBFeedbackUrl() { - String url = properties.getProperty(PropertyKeys.KEY_DB_FEEDBACK_URL, FEEDBACK_JDBC_URL); - if (url != null) { - return url.trim(); + public static String getDBLogUrl () { + String url = properties.getProperty(PropertyKeys.KEY_DB_LOG_URL, LOG_JDBC_URL); + if (url != null) { + return url.trim(); + } + return null; + } + + public static String getDBFeedbackUrl () { + String url = properties.getProperty(PropertyKeys.KEY_DB_FEEDBACK_URL, FEEDBACK_JDBC_URL); + if (url != null) { + return url.trim(); + } + return null; } - return null; } -} diff --git a/Mage.Common/src/main/java/mage/view/CardView.java b/Mage.Common/src/main/java/mage/view/CardView.java index 077f7938dd..cdd9b22e66 100644 --- a/Mage.Common/src/main/java/mage/view/CardView.java +++ b/Mage.Common/src/main/java/mage/view/CardView.java @@ -512,7 +512,7 @@ public class CardView extends SimpleCardView { } if (this.rarity == null && object instanceof StackAbility) { StackAbility stackAbility = (StackAbility) object; - this.rarity = Rarity.NA; + this.rarity = Rarity.SPECIAL; this.rules = new ArrayList<>(); this.rules.add(stackAbility.getRule()); if (stackAbility.getZone() == Zone.COMMAND) { @@ -644,7 +644,7 @@ public class CardView extends SimpleCardView { this.frameColor = token.getFrameColor(null); this.frameStyle = token.getFrameStyle(); this.manaCost = token.getManaCost().getSymbols(); - this.rarity = Rarity.NA; + this.rarity = Rarity.SPECIAL; this.type = token.getTokenType(); this.tokenDescriptor = token.getTokenDescriptor(); this.tokenSetCode = token.getOriginalExpansionSetCode(); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AusHighlander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AusHighlander.java index 86a70116a2..112563f76d 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AusHighlander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AusHighlander.java @@ -76,8 +76,6 @@ public class AusHighlander extends Constructed { pointMap.put("True-Name Nemesis", 1); pointMap.put("Umezawa’s Jitte", 1); pointMap.put("Wasteland", 1); - pointMap.put("Wheel of Fortune", 1); - pointMap.put("Worldly Tutor", 1); pointMap.put("Yawgmoth’s Bargain", 1); } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/CanadianHighlander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/CanadianHighlander.java index 33a0714909..23f5c57f2f 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/CanadianHighlander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/CanadianHighlander.java @@ -21,7 +21,7 @@ public class CanadianHighlander extends Constructed { pointMap.put("Balance", 1); pointMap.put("Birthing Pod", 3); pointMap.put("Black Lotus", 7); - pointMap.put("Demonic Tutor", 4); + pointMap.put("Demonic Tutor", 3); pointMap.put("Dig Through Time", 1); pointMap.put("Enlightened Tutor", 1); pointMap.put("Fastbond", 1); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Premodern.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Premodern.java new file mode 100644 index 0000000000..9f8781d3cf --- /dev/null +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Premodern.java @@ -0,0 +1,79 @@ +package mage.deck; + +import mage.cards.decks.Constructed; + +/** + * + * @author jmharmon + */ + +public class Premodern extends Constructed { + + public Premodern() { + super("Constructed - Premodern"); + + // Legal sets + setCodes.add(mage.sets.FourthEdition.getInstance().getCode()); + setCodes.add(mage.sets.IceAge.getInstance().getCode()); + setCodes.add(mage.sets.Chronicles.getInstance().getCode()); + setCodes.add(mage.sets.Homelands.getInstance().getCode()); + setCodes.add(mage.sets.Alliances.getInstance().getCode()); + setCodes.add(mage.sets.Mirage.getInstance().getCode()); + setCodes.add(mage.sets.Visions.getInstance().getCode()); + setCodes.add(mage.sets.FifthEdition.getInstance().getCode()); + setCodes.add(mage.sets.Weatherlight.getInstance().getCode()); + setCodes.add(mage.sets.Tempest.getInstance().getCode()); + setCodes.add(mage.sets.Stronghold.getInstance().getCode()); + setCodes.add(mage.sets.UrzasSaga.getInstance().getCode()); + setCodes.add(mage.sets.UrzasLegacy.getInstance().getCode()); + setCodes.add(mage.sets.ClassicSixthEdition.getInstance().getCode()); + setCodes.add(mage.sets.UrzasDestiny.getInstance().getCode()); + setCodes.add(mage.sets.MercadianMasques.getInstance().getCode()); + setCodes.add(mage.sets.Nemesis.getInstance().getCode()); + setCodes.add(mage.sets.Prophecy.getInstance().getCode()); + setCodes.add(mage.sets.Invasion.getInstance().getCode()); + setCodes.add(mage.sets.Planeshift.getInstance().getCode()); + setCodes.add(mage.sets.SeventhEdition.getInstance().getCode()); + setCodes.add(mage.sets.Apocalypse.getInstance().getCode()); + setCodes.add(mage.sets.Odyssey.getInstance().getCode()); + setCodes.add(mage.sets.Torment.getInstance().getCode()); + setCodes.add(mage.sets.Judgment.getInstance().getCode()); + setCodes.add(mage.sets.Onslaught.getInstance().getCode()); + setCodes.add(mage.sets.Legions.getInstance().getCode()); + setCodes.add(mage.sets.Scourge.getInstance().getCode()); + + // Ban List + banned.add("Amulet of Quoz"); + banned.add("Balance"); + banned.add("Brainstorm"); + banned.add("Bronze Tablet"); + banned.add("Channel"); + banned.add("Demonic Consultation"); + banned.add("Earthcraft"); + banned.add("Entomb"); + banned.add("Flash"); + banned.add("Force of Will"); + banned.add("Frantic Search"); + banned.add("Goblin Recruiter"); + banned.add("Grim Monolith"); + banned.add("Jeweled Bird"); + banned.add("Mana Vault"); + banned.add("Memory Jar"); + banned.add("Mind Twist"); + banned.add("Mind's Desire"); + banned.add("Mystical Tutor"); + banned.add("Necropotence"); + banned.add("Rebirth"); + banned.add("Show and Tell"); + banned.add("Strip Mine"); + banned.add("Tempest Efreet"); + banned.add("Tendrils of Agony"); + banned.add("Time Spiral"); + banned.add("Timmerian Fiends"); + banned.add("Tolarian Academy"); + banned.add("Vampiric Tutor"); + banned.add("Windfall"); + banned.add("Worldgorger Dragon"); + banned.add("Yawgmoth's Will"); + } +} diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/optimizers/impl/LevelUpOptimizer.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/optimizers/impl/LevelUpOptimizer.java index c3c8934fa1..545851185a 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/optimizers/impl/LevelUpOptimizer.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/optimizers/impl/LevelUpOptimizer.java @@ -27,7 +27,7 @@ public class LevelUpOptimizer extends BaseTreeOptimizer { for (Ability ability : actions) { if (ability instanceof LevelUpAbility) { Permanent permanent = game.getPermanent(ability.getSourceId()); - if (permanent != null && permanent instanceof PermanentCard) { + if (permanent instanceof PermanentCard) { PermanentCard leveler = (PermanentCard) permanent; // check already existing Level counters and compare to maximum that make sense if (permanent.getCounters(game).getCount(CounterType.LEVEL) >= leveler.getMaxLevelCounters()) { diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 6ee934ff18..bab776da8f 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -157,6 +157,7 @@ <deckType name="Constructed - Old School 93/94 - Channel Fireball Rules" jar="mage-deck-constructed.jar" className="mage.deck.OldSchool9394CFB"/> <deckType name="Constructed - Old School 93/94 - EudoGames Rules" jar="mage-deck-constructed.jar" className="mage.deck.OldSchool9394EG"/> <deckType name="Constructed - Old School 93/94 - EC Rules" jar="mage-deck-constructed.jar" className="mage.deck.OldSchool9394EC"/> + <deckType name="Constructed - Premodern" jar="mage-deck-constructed.jar" className="mage.deck.Premodern"/> <deckType name="Constructed - Freeform" jar="mage-deck-constructed.jar" className="mage.deck.Freeform"/> <deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/> <deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/> @@ -184,4 +185,4 @@ <deckType name="Block Constructed Custom - Star Wars" jar="mage-deck-constructed.jar" className="mage.deck.StarWarsBlock"/> <deckType name="Limited" jar="mage-deck-limited.jar" className="mage.deck.Limited"/> </deckTypes> -</config> \ No newline at end of file +</config> diff --git a/Mage.Server/src/main/java/mage/server/MageServerImpl.java b/Mage.Server/src/main/java/mage/server/MageServerImpl.java index f6676754ef..899f113519 100644 --- a/Mage.Server/src/main/java/mage/server/MageServerImpl.java +++ b/Mage.Server/src/main/java/mage/server/MageServerImpl.java @@ -672,7 +672,7 @@ public class MageServerImpl implements MageServer { } catch (Exception ex) { handleException(ex); } - return null; + return Optional.empty(); } @Override diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 49511c959b..cd64c6086d 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -153,15 +153,15 @@ public final class Main { for (ExtensionPackage pkg : extensions) { Map<String, Class> draftCubes = pkg.getDraftCubes(); - for (String name : draftCubes.keySet()) { - logger.info("Loading extension: [" + name + "] " + draftCubes.get(name).toString()); - CubeFactory.instance.addDraftCube(name, draftCubes.get(name)); - } + draftCubes.forEach((name, draftCube) -> { + logger.info("Loading extension: [" + name + "] " + draftCube.toString()); + CubeFactory.instance.addDraftCube(name, draftCube); + }); Map<String, Class> deckTypes = pkg.getDeckTypes(); - for (String name : deckTypes.keySet()) { - logger.info("Loading extension: [" + name + "] " + deckTypes.get(name)); - DeckValidatorFactory.instance.addDeckType(name, deckTypes.get(name)); - } + deckTypes.forEach((name, deckType) -> { + logger.info("Loading extension: [" + name + "] " + deckType); + DeckValidatorFactory.instance.addDeckType(name, deckType); + }); } logger.info("Config - max seconds idle: " + config.getMaxSecondsIdle()); diff --git a/Mage.Server/src/main/java/mage/server/SessionManager.java b/Mage.Server/src/main/java/mage/server/SessionManager.java index 9b9a7fa07b..66d9c7d8e1 100644 --- a/Mage.Server/src/main/java/mage/server/SessionManager.java +++ b/Mage.Server/src/main/java/mage/server/SessionManager.java @@ -26,7 +26,7 @@ public enum SessionManager { logger.trace("Session with sessionId " + sessionId + " is not found"); return Optional.empty(); } - if (session.getUserId() != null && UserManager.instance.getUser(session.getUserId()) == null) { + if (session.getUserId() != null && !UserManager.instance.getUser(session.getUserId()).isPresent()) { logger.error("User for session " + sessionId + " with userId " + session.getUserId() + " is missing. Session removed."); // can happen if user from same host signs in multiple time with multiple clients, after he disconnects with one client disconnect(sessionId, DisconnectReason.ConnectingOtherInstance); diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index 58a0b695b8..1f4d9808cd 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -942,7 +942,7 @@ public class TableController { if (!(table.getState() == TableState.WAITING || table.getState() == TableState.STARTING || table.getState() == TableState.READY_TO_START)) { if (match == null) { logger.warn("- Match table with no match:"); - logger.warn("-- matchId:" + match.getId() + " [" + match.getName() + ']'); + logger.warn("-- matchId:" + match.getId() + " , table : " + table.getId()); // return false; } else if (match.isDoneSideboarding() && match.getGame() == null) { // no sideboarding and not active game -> match seems to hang (maybe the Draw bug) diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index a9593816c7..b3a1f6d7d1 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -266,13 +266,13 @@ public class GameController implements GameCallback { public void join(UUID userId) { UUID playerId = userPlayerMap.get(userId); - Optional<User> user = UserManager.instance.getUser(userId); - if (userId == null || playerId == null) { + if (playerId == null) { logger.fatal("Join game failed!"); logger.fatal("- gameId: " + game.getId()); logger.fatal("- userId: " + userId); return; } + Optional<User> user = UserManager.instance.getUser(userId); if (!user.isPresent()) { logger.fatal("User not found : " + userId); return; diff --git a/Mage.Server/src/main/java/mage/server/game/GameWorker.java b/Mage.Server/src/main/java/mage/server/game/GameWorker.java index de273e5cc1..e52f9d7cc8 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameWorker.java +++ b/Mage.Server/src/main/java/mage/server/game/GameWorker.java @@ -3,14 +3,14 @@ package mage.server.game; import java.util.UUID; import java.util.concurrent.Callable; + import mage.MageException; import mage.game.Game; import org.apache.log4j.Logger; /** - * - * @author BetaSteward_at_googlemail.com * @param <T> + * @author BetaSteward_at_googlemail.com */ public class GameWorker<T> implements Callable { @@ -40,12 +40,7 @@ public class GameWorker<T> implements Callable { } catch (Exception e) { LOGGER.fatal("GameWorker general exception [" + game.getId() + "] " + e.getMessage(), e); if (e instanceof NullPointerException) { - if (e.getStackTrace() == null) { - LOGGER.info("Stack trace is null"); - } else { - LOGGER.info("Null-Pointer-Exception: Stack trace"); - LOGGER.info(e.getStackTrace()); - } + LOGGER.info(e.getStackTrace()); } } catch (Error err) { LOGGER.fatal("GameWorker general error [" + game.getId() + "] " + err, err); diff --git a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java index 0d0941623e..395becdf94 100644 --- a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java @@ -408,7 +408,7 @@ public final class SystemUtil { Class<?> c = Class.forName("mage.game.permanent.token." + command.cardName); Constructor<?> cons = c.getConstructor(); Object token = cons.newInstance(); - if (token != null && token instanceof mage.game.permanent.token.Token) { + if (token instanceof mage.game.permanent.token.Token) { ((mage.game.permanent.token.Token) token).putOntoBattlefield(command.Amount, game, null, player.getId(), false, false); continue; } @@ -417,7 +417,7 @@ public final class SystemUtil { Class<?> c = Class.forName("mage.game.command.emblems." + command.cardName); Constructor<?> cons = c.getConstructor(); Object emblem = cons.newInstance(); - if (emblem != null && emblem instanceof mage.game.command.Emblem) { + if (emblem instanceof mage.game.command.Emblem) { ((mage.game.command.Emblem) emblem).setControllerId(player.getId()); game.addEmblem((mage.game.command.Emblem) emblem, null, player.getId()); continue; @@ -427,7 +427,7 @@ public final class SystemUtil { Class<?> c = Class.forName("mage.game.command.planes." + command.cardName); Constructor<?> cons = c.getConstructor(); Object plane = cons.newInstance(); - if (plane != null && plane instanceof mage.game.command.Plane) { + if (plane instanceof mage.game.command.Plane) { ((mage.game.command.Plane) plane).setControllerId(player.getId()); game.addPlane((mage.game.command.Plane) plane, null, player.getId()); continue; diff --git a/Mage.Sets/src/mage/cards/a/AffectionateIndrik.java b/Mage.Sets/src/mage/cards/a/AffectionateIndrik.java new file mode 100644 index 0000000000..da4b64f404 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AffectionateIndrik.java @@ -0,0 +1,56 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.FightTargetSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class AffectionateIndrik extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creature you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public AffectionateIndrik(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}"); + + this.subtype.add(SubType.BEAST); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Affectionate Indrik enters the battlefield, you may have it fight target creature you don't control. + Ability ability = new EntersBattlefieldTriggeredAbility( + new FightTargetSourceEffect() + .setText("you may have it fight " + + "target creature you don't control"), + true + ); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public AffectionateIndrik(final AffectionateIndrik card) { + super(card); + } + + @Override + public AffectionateIndrik copy() { + return new AffectionateIndrik(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AjaniAdversaryOfTyrants.java b/Mage.Sets/src/mage/cards/a/AjaniAdversaryOfTyrants.java index 2197d263dc..2453e3bea9 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniAdversaryOfTyrants.java +++ b/Mage.Sets/src/mage/cards/a/AjaniAdversaryOfTyrants.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; @@ -38,7 +38,7 @@ public final class AjaniAdversaryOfTyrants extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Put a +1/+1 counter on each of up to two target creatures. Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 1); diff --git a/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java b/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java index 8fd7ad95e2..0dfdd6a8bf 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java +++ b/Mage.Sets/src/mage/cards/a/AjaniCallerOfThePride.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; @@ -34,7 +34,7 @@ public final class AjaniCallerOfThePride extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Put a +1/+1 counter on up to one target creature. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("Put a +1/+1 counter on up to one target creature"); diff --git a/Mage.Sets/src/mage/cards/a/AjaniGoldmane.java b/Mage.Sets/src/mage/cards/a/AjaniGoldmane.java index 8c88c3da47..475b664b12 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniGoldmane.java +++ b/Mage.Sets/src/mage/cards/a/AjaniGoldmane.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effects; @@ -22,7 +22,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.players.Player; /** @@ -36,7 +35,7 @@ public final class AjaniGoldmane extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: You gain 2 life. this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1)); diff --git a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java index 33024b4d68..d60264cb68 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java +++ b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.counter.DistributeCountersEffect; @@ -46,7 +46,7 @@ public final class AjaniMentorOfHeroes extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Distribute three +1/+1 counters among one, two, or three target creatures you control Ability ability = new LoyaltyAbility(new DistributeCountersEffect(CounterType.P1P1, 3, false, "one, two, or three target creatures you control"), 1); diff --git a/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java b/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java index 7311bec714..7d95193116 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java +++ b/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; @@ -45,7 +45,7 @@ public final class AjaniSteadfast extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Until end of turn, up to one target creature gets +1/+1 and gains first strike, vigilance, and lifelink. Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/a/AjaniUnyielding.java b/Mage.Sets/src/mage/cards/a/AjaniUnyielding.java index 7154fa51ef..f7ba38516c 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniUnyielding.java +++ b/Mage.Sets/src/mage/cards/a/AjaniUnyielding.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.ExileAndGainLifeEqualPowerTargetEffect; import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; @@ -43,7 +43,7 @@ public final class AjaniUnyielding extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: Reveal the top three cards of your library. Put all nonland permanent cards revealed this way into your hand and the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(3, nonlandPermanentFilter, Zone.LIBRARY), 2)); diff --git a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java index d32725ebd4..00f6ca6c98 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java +++ b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect; @@ -33,7 +33,7 @@ public final class AjaniValiantProtector extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: Put two +1/+1 counters on up to one target creature. Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), 2); diff --git a/Mage.Sets/src/mage/cards/a/AjaniVengeant.java b/Mage.Sets/src/mage/cards/a/AjaniVengeant.java index bb77d4bd3c..b6d4b3b48a 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniVengeant.java +++ b/Mage.Sets/src/mage/cards/a/AjaniVengeant.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effects; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DestroyAllControlledTargetEffect; @@ -37,7 +37,7 @@ public final class AjaniVengeant extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Target permanent doesn't untap during its controller's next untap step. LoyaltyAbility ability1 = new LoyaltyAbility(new DontUntapInControllersNextUntapStepTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java index 13636ab6ca..8a28d2545e 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java +++ b/Mage.Sets/src/mage/cards/a/AjaniWiseCounselor.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; @@ -29,7 +29,7 @@ public final class AjaniWiseCounselor extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AJANI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: You gain 1 life for each creature you control. this.addAbility(new LoyaltyAbility(new GainLifeEffect( diff --git a/Mage.Sets/src/mage/cards/a/AlexiZephyrMage.java b/Mage.Sets/src/mage/cards/a/AlexiZephyrMage.java index 76cb80c183..3d9f281655 100644 --- a/Mage.Sets/src/mage/cards/a/AlexiZephyrMage.java +++ b/Mage.Sets/src/mage/cards/a/AlexiZephyrMage.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -14,12 +13,12 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.StaticFilters; import mage.target.TargetPermanent; import mage.target.common.TargetCardInHand; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @@ -40,7 +39,7 @@ public final class AlexiZephyrMage extends CardImpl { ability.addCost(new TapSourceCost()); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURES)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java b/Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java index 44168d26c0..8067fc0183 100644 --- a/Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java +++ b/Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java @@ -3,7 +3,7 @@ package mage.cards.a; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetForSourceEffect; @@ -48,7 +48,7 @@ public class AminatouTheFateShifter extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AMINATOU); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Draw a card, then put a card from your hand on top of your library. Ability ability = new LoyaltyAbility(new AminatouPlusEffect(), +1); diff --git a/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java b/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java index 37622e6c77..d8817ae467 100644 --- a/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java +++ b/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java @@ -62,7 +62,7 @@ class AnZerrinRuinsDontUntapEffect extends DontUntapInControllersUntapStepAllEff if (super.applies(event, source, game)) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.hasSubtype(ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game), game)) { + if (permanent.hasSubtype(ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game), game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java b/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java index a35ad846ac..d4f1f010f2 100644 --- a/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java +++ b/Mage.Sets/src/mage/cards/a/AngrathMinotaurPirate.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effects; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageAllControlledTargetEffect; @@ -39,7 +39,7 @@ public final class AngrathMinotaurPirate extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ANGRATH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Angrath, Minotaur Pirate deals 1 damage to target opponent and each creature that player controls. Effects effects1 = new Effects(); diff --git a/Mage.Sets/src/mage/cards/a/AngrathTheFlameChained.java b/Mage.Sets/src/mage/cards/a/AngrathTheFlameChained.java index 00c5d3028c..c37312ddb6 100644 --- a/Mage.Sets/src/mage/cards/a/AngrathTheFlameChained.java +++ b/Mage.Sets/src/mage/cards/a/AngrathTheFlameChained.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.LoseLifeOpponentsEffect; @@ -41,7 +41,7 @@ public final class AngrathTheFlameChained extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ANGRATH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Each opponent discards a card and loses 2 life. LoyaltyAbility ability = new LoyaltyAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), 1); diff --git a/Mage.Sets/src/mage/cards/a/ArboretumElemental.java b/Mage.Sets/src/mage/cards/a/ArboretumElemental.java new file mode 100644 index 0000000000..bef1966858 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArboretumElemental.java @@ -0,0 +1,40 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class ArboretumElemental extends CardImpl { + + public ArboretumElemental(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(7); + this.toughness = new MageInt(5); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + } + + public ArboretumElemental(final ArboretumElemental card) { + super(card); + } + + @Override + public ArboretumElemental copy() { + return new ArboretumElemental(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java index 0a0d05fd24..ee192097ff 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java @@ -64,7 +64,7 @@ class ConspyEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (controller != null && subType != null) { // Creature cards you own that aren't on the battlefield // in graveyard diff --git a/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java b/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java index 44c97f4d76..52fe2bd0c7 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java @@ -1,9 +1,6 @@ package mage.cards.a; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -15,24 +12,27 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.CreateTokenCopyTargetEffect; import mage.cards.Card; -import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.FilterCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.Target; +import mage.target.TargetCard; import mage.target.TargetPlayer; import mage.target.common.TargetCardInHand; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author TheElk801 */ public final class ArcaneArtisan extends CardImpl { @@ -46,10 +46,14 @@ public final class ArcaneArtisan extends CardImpl { this.toughness = new MageInt(3); // {2}{U}, {T}: Target player draws a card, then exiles a card from their hand. If a creature card is exiled this way, that player creates a token that's a copy of that card. - Ability ability = new SimpleActivatedAbility(new ArcaneArtisanCreateTokenEffect(), new ManaCostsImpl("{2}{U}")); + Ability ability = new SimpleActivatedAbility( + new ArcaneArtisanCreateTokenEffect(), + new ManaCostsImpl("{2}{U}") + ); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); + // When Arcane Artisan leaves the battlefield, exile all tokens created with it at the beginning of the next end step. this.addAbility(new ArcaneArtisanLeavesBattlefieldTriggeredAbility()); } @@ -66,13 +70,13 @@ public final class ArcaneArtisan extends CardImpl { class ArcaneArtisanCreateTokenEffect extends OneShotEffect { - ArcaneArtisanCreateTokenEffect() { + public ArcaneArtisanCreateTokenEffect() { super(Outcome.Benefit); this.staticText = "Target player draws a card, then exiles a card from their hand. " + "If a creature card is exiled this way, that player creates a token that's a copy of that card."; } - ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) { + public ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) { super(effect); } @@ -88,8 +92,8 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect { return false; } player.drawCards(1, game); - Target target = new TargetCardInHand(1, new FilterCard()); - if (!player.chooseTarget(Outcome.Exile, target, source, game)) { + TargetCard target = new TargetCardInHand(1, StaticFilters.FILTER_CARD); + if (!player.chooseTarget(Outcome.Exile, player.getHand(), target, source, game)) { return false; } Card card = game.getCard(target.getFirstTarget()); @@ -119,14 +123,14 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect { class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility { - ArcaneArtisanLeavesBattlefieldTriggeredAbility() { + public ArcaneArtisanLeavesBattlefieldTriggeredAbility() { super(Zone.BATTLEFIELD, null, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ArcaneArtisanExileEffect())), "", false ); } - ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) { + public ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) { super(ability); } @@ -143,12 +147,12 @@ class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggered class ArcaneArtisanExileEffect extends OneShotEffect { - ArcaneArtisanExileEffect() { + public ArcaneArtisanExileEffect() { super(Outcome.Benefit); this.staticText = "exile all tokens created with {this}."; } - ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) { + public ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) { super(effect); } diff --git a/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java new file mode 100644 index 0000000000..89fe19f8ee --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java @@ -0,0 +1,123 @@ +package mage.cards.a; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.watchers.Watcher; + +/** + * + * @author TheElk801 + */ +public final class ArclightPhoenix extends CardImpl { + + public ArclightPhoenix(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.PHOENIX); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // At the beginning of combat on your turn, if you cast 3 or more instants and/or sorceries this turn, you may return Arclight Phoenix from your graveyard to the battlefield. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfCombatTriggeredAbility( + Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToBattlefieldEffect(), + TargetController.YOU, true, false + ), ArclightPhoenixCondition.instance, + "At the beginning of combat on your turn, " + + "if you've cast three or more instant " + + "and sorcery spells this turn, you may return {this} " + + "from your graveyard to the battlefield." + ), new ArclightPhoenixWatcher()); + } + + public ArclightPhoenix(final ArclightPhoenix card) { + super(card); + } + + @Override + public ArclightPhoenix copy() { + return new ArclightPhoenix(this); + } +} + +enum ArclightPhoenixCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + ArclightPhoenixWatcher watcher + = (ArclightPhoenixWatcher) game.getState().getWatchers().get( + ArclightPhoenixWatcher.class.getSimpleName() + ); + return watcher != null && watcher.getInstantSorceryCount(source.getControllerId()) > 2; + } +} + +class ArclightPhoenixWatcher extends Watcher { + + private final Map<UUID, Integer> instantSorceryCount = new HashMap(); + + public ArclightPhoenixWatcher() { + super(ArclightPhoenixWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public ArclightPhoenixWatcher(final ArclightPhoenixWatcher watcher) { + super(watcher); + this.instantSorceryCount.putAll(watcher.instantSorceryCount); + } + + @Override + public ArclightPhoenixWatcher copy() { + return new ArclightPhoenixWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell == null || !spell.isInstantOrSorcery()) { + return; + } + this.instantSorceryCount.putIfAbsent(spell.getControllerId(), 0); + this.instantSorceryCount.compute( + spell.getControllerId(), (k, a) -> a + 1 + ); + } + } + + @Override + public void reset() { + super.reset(); + this.instantSorceryCount.clear(); + } + + public int getInstantSorceryCount(UUID playerId) { + return this.instantSorceryCount.getOrDefault(playerId, 0); + } +} diff --git a/Mage.Sets/src/mage/cards/a/ArlinnKord.java b/Mage.Sets/src/mage/cards/a/ArlinnKord.java index 73456139fc..65387beee3 100644 --- a/Mage.Sets/src/mage/cards/a/ArlinnKord.java +++ b/Mage.Sets/src/mage/cards/a/ArlinnKord.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.TransformSourceEffect; @@ -35,7 +35,7 @@ public final class ArlinnKord extends CardImpl { this.transformable = true; this.secondSideCardClazz = ArlinnEmbracedByTheMoon.class; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Until end of turn, up to one target creature gets +2/+2 and gains vigilance and haste. Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/a/ArtfulTakedown.java b/Mage.Sets/src/mage/cards/a/ArtfulTakedown.java new file mode 100644 index 0000000000..076db17cd7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArtfulTakedown.java @@ -0,0 +1,55 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class ArtfulTakedown extends CardImpl { + + private static final FilterCreaturePermanent filter1 + = new FilterCreaturePermanent("creature (to tap)"); + private static final FilterCreaturePermanent filter2 + = new FilterCreaturePermanent("creature (to shrink)"); + + public ArtfulTakedown(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{B}"); + + // Choose one or both — + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + + // • Tap target creature. + this.getSpellAbility().addEffect( + new TapTargetEffect().setText("target creature") + ); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter1)); + + // • Target creature gets -2/-4 until end of turn. + Mode mode = new Mode( + new BoostTargetEffect(-2, -4, Duration.EndOfTurn) + .setText("target creature gets -2/-4 until end of turn") + ); + mode.addTarget(new TargetCreaturePermanent(filter2)); + this.getSpellAbility().addMode(mode); + } + + public ArtfulTakedown(final ArtfulTakedown card) { + super(card); + } + + @Override + public ArtfulTakedown copy() { + return new ArtfulTakedown(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java index 4e8c867ee3..86ad83f7f4 100644 --- a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java +++ b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -6,6 +5,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.Cost; +import mage.abilities.costs.VariableCost; import mage.abilities.costs.VariableCostImpl; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapTargetCost; @@ -16,17 +16,21 @@ import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.SubType; import mage.constants.SuperType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.PowerPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.token.KnightToken; import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetadjustment.TargetAdjuster; /** * @@ -57,9 +61,8 @@ public final class AryelKnightOfWindgrace extends CardImpl { .setText("Destroy target creature with power X or less"), new ManaCostsImpl("{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new AryelTapXTargetCost()); - ability.setTargetAdjustment(TargetAdjustment.CREATURE_POWER_X_OR_LESS); + ability.setTargetAdjuster(AryelKnightOfWindgraceAdjuster.instance); this.addAbility(ability); - ability.getOriginalId(); } public AryelKnightOfWindgrace(final AryelKnightOfWindgrace card) { @@ -106,3 +109,19 @@ class AryelTapXTargetCost extends VariableCostImpl { return new TapTargetCost(target); } } + +enum AryelKnightOfWindgraceAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int value = 0; + for (VariableCost cost : ability.getCosts().getVariableCosts()) { + value = cost.getAmount(); + } + FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent("creature with power " + value + " or less"); + filterCreaturePermanent.add(new PowerPredicate(ComparisonType.FEWER_THAN, value + 1)); + ability.getTargets().clear(); + ability.addTarget(new TargetCreaturePermanent(filterCreaturePermanent)); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java index 98879879a7..8af731bee2 100644 --- a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java +++ b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java @@ -57,7 +57,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(permanent.getId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(permanent.getId(), game); if (subType != null) { for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); diff --git a/Mage.Sets/src/mage/cards/a/AshiokNightmareWeaver.java b/Mage.Sets/src/mage/cards/a/AshiokNightmareWeaver.java index b43affceb1..810e91e0aa 100644 --- a/Mage.Sets/src/mage/cards/a/AshiokNightmareWeaver.java +++ b/Mage.Sets/src/mage/cards/a/AshiokNightmareWeaver.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.ContinuousEffectImpl; @@ -35,7 +35,7 @@ public final class AshiokNightmareWeaver extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ASHIOK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Exile the top three cards of target opponent's library. LoyaltyAbility ability = new LoyaltyAbility(new AshiokNightmareWeaverExileEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/a/AssassinsTrophy.java b/Mage.Sets/src/mage/cards/a/AssassinsTrophy.java new file mode 100644 index 0000000000..0d3015285a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AssassinsTrophy.java @@ -0,0 +1,91 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class AssassinsTrophy extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("permanent an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public AssassinsTrophy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}{G}"); + + // Destroy target permanent an opponent controls. Its controller may search their library for a basic land card, put it onto the battlefield, then shuffle their library. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new AssassinsTrophyEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public AssassinsTrophy(final AssassinsTrophy card) { + super(card); + } + + @Override + public AssassinsTrophy copy() { + return new AssassinsTrophy(this); + } +} + +class AssassinsTrophyEffect extends OneShotEffect { + + public AssassinsTrophyEffect() { + super(Outcome.PutLandInPlay); + this.staticText = "Its controller may search their library " + + "for a basic land card, put it onto the battlefield, " + + "then shuffle their library"; + } + + public AssassinsTrophyEffect(final AssassinsTrophyEffect effect) { + super(effect); + } + + @Override + public AssassinsTrophyEffect copy() { + return new AssassinsTrophyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); + if (permanent != null) { + Player controller = game.getPlayer(permanent.getControllerId()); + if (controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", source, game)) { + TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND); + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } + } + controller.shuffleLibrary(source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/a/AssureAssemble.java b/Mage.Sets/src/mage/cards/a/AssureAssemble.java new file mode 100644 index 0000000000..dabe55520d --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AssureAssemble.java @@ -0,0 +1,56 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; +import mage.counters.CounterType; +import mage.game.permanent.token.ElfKnightToken; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class AssureAssemble extends SplitCard { + + public AssureAssemble(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G/W}{G/W}", "{4}{G}{W}", SpellAbilityType.SPLIT); + + // Assure + // Put a +1/+1 counter on target creature. It gains indestructible until end of turn. + this.getLeftHalfCard().getSpellAbility().addEffect( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()) + ); + this.getLeftHalfCard().getSpellAbility().addEffect( + new GainAbilityTargetEffect( + IndestructibleAbility.getInstance(), + Duration.EndOfTurn + ).setText("It gains indestructible until end of turn.") + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCreaturePermanent() + ); + + // Assemble + // Create three 2/2 green and white Elf Knight creature tokens with vigilance. + this.getRightHalfCard().getSpellAbility().addEffect( + new CreateTokenEffect(new ElfKnightToken(), 3) + ); + } + + public AssureAssemble(final AssureAssemble card) { + super(card); + } + + @Override + public AssureAssemble copy() { + return new AssureAssemble(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AttendantOfVraska.java b/Mage.Sets/src/mage/cards/a/AttendantOfVraska.java new file mode 100644 index 0000000000..78c6d325bb --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AttendantOfVraska.java @@ -0,0 +1,61 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author TheElk801 + */ +public final class AttendantOfVraska extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Vraska planeswalker"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new CardTypePredicate(CardType.PLANESWALKER)); + filter.add(new SubtypePredicate(SubType.VRASKA)); + } + + public AttendantOfVraska(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Attendant of Vraska dies, if you control a Vraska planeswalker, you gain life equal to Attendant of Vraska's power. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new DiesTriggeredAbility(new GainLifeEffect( + new SourcePermanentPowerCount() + ), false), new PermanentsOnTheBattlefieldCondition(filter), + "When {this} dies, if you control a Vraska planeswalker, " + + "you gain life equal to {this}'s power." + )); + } + + public AttendantOfVraska(final AttendantOfVraska card) { + super(card); + } + + @Override + public AttendantOfVraska copy() { + return new AttendantOfVraska(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AureliaExemplarOfJustice.java b/Mage.Sets/src/mage/cards/a/AureliaExemplarOfJustice.java new file mode 100644 index 0000000000..255859b4d3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AureliaExemplarOfJustice.java @@ -0,0 +1,103 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MentorAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class AureliaExemplarOfJustice extends CardImpl { + + public AureliaExemplarOfJustice(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ANGEL); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + + // At the beginning of combat on your turn, choose up to one target creature you control. Until end of turn, that creature gets +2/+0, gains trample if it's red, and gains vigilance if it's white. + Ability ability = new BeginningOfCombatTriggeredAbility( + new AureliaExemplarOfJusticeEffect(), + TargetController.YOU, false + ); + ability.addTarget(new TargetControlledCreaturePermanent(0, 1)); + this.addAbility(ability); + } + + public AureliaExemplarOfJustice(final AureliaExemplarOfJustice card) { + super(card); + } + + @Override + public AureliaExemplarOfJustice copy() { + return new AureliaExemplarOfJustice(this); + } +} + +class AureliaExemplarOfJusticeEffect extends OneShotEffect { + + public AureliaExemplarOfJusticeEffect() { + super(Outcome.Benefit); + this.staticText = "choose up to one target creature you control. " + + "Until end of turn, that creature gets +2/+0, " + + "gains trample if it's red, " + + "and gains vigilance if it's white."; + } + + public AureliaExemplarOfJusticeEffect(final AureliaExemplarOfJusticeEffect effect) { + super(effect); + } + + @Override + public AureliaExemplarOfJusticeEffect copy() { + return new AureliaExemplarOfJusticeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature == null) { + return false; + } + game.addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn), source); + if (creature.getColor(game).isRed()) { + game.addEffect(new GainAbilityTargetEffect( + TrampleAbility.getInstance(), Duration.EndOfTurn + ), source); + } + if (creature.getColor(game).isWhite()) { + game.addEffect(new GainAbilityTargetEffect( + VigilanceAbility.getInstance(), Duration.EndOfTurn + ), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java index 1bf9c3acac..b09ac13a39 100644 --- a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java +++ b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageControllerEffect; @@ -37,7 +37,7 @@ public final class AurraSingBaneOfJedi extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{R}"); this.subtype.add(SubType.AURRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1:You may have {this} deal 2 damage to target creature. If you don't, {this} deals 1 damage to you. Ability ability = new LoyaltyAbility(new AurraSingBaneOfJediEffect(), +1); diff --git a/Mage.Sets/src/mage/cards/b/BargingSergeant.java b/Mage.Sets/src/mage/cards/b/BargingSergeant.java new file mode 100644 index 0000000000..e6acf2e90e --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BargingSergeant.java @@ -0,0 +1,41 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class BargingSergeant extends CardImpl { + + public BargingSergeant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.MINOTAUR); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + } + + public BargingSergeant(final BargingSergeant card) { + super(card); + } + + @Override + public BargingSergeant copy() { + return new BargingSergeant(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BarrierOfBones.java b/Mage.Sets/src/mage/cards/b/BarrierOfBones.java new file mode 100644 index 0000000000..bde2f7fbf3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BarrierOfBones.java @@ -0,0 +1,44 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class BarrierOfBones extends CardImpl { + + public BarrierOfBones(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); + + this.subtype.add(SubType.SKELETON); + this.subtype.add(SubType.WALL); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // When Barrier of Bones enters the battlefield, surveil 1. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SurveilEffect(1), false + )); + } + + public BarrierOfBones(final BarrierOfBones card) { + super(card); + } + + @Override + public BarrierOfBones copy() { + return new BarrierOfBones(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BartizanBats.java b/Mage.Sets/src/mage/cards/b/BartizanBats.java new file mode 100644 index 0000000000..7f9efcaf93 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BartizanBats.java @@ -0,0 +1,36 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class BartizanBats extends CardImpl { + + public BartizanBats(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.BAT); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public BartizanBats(final BartizanBats card) { + super(card); + } + + @Override + public BartizanBats copy() { + return new BartizanBats(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BeaconBolt.java b/Mage.Sets/src/mage/cards/b/BeaconBolt.java new file mode 100644 index 0000000000..fe0ca03e89 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BeaconBolt.java @@ -0,0 +1,41 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class BeaconBolt extends CardImpl { + + public BeaconBolt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{R}"); + + // Beacon Bolt deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard. + this.getSpellAbility().addEffect(new DamageTargetEffect( + InstantSorceryExileGraveyardCount.instance + ).setText("{this} deals damage to target creature equal to " + + "the total number of instant and sorcery cards " + + "you own in exile and in your graveyard")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + } + + public BeaconBolt(final BeaconBolt card) { + super(card); + } + + @Override + public BeaconBolt copy() { + return new BeaconBolt(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java b/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java new file mode 100644 index 0000000000..0cd6c16ea0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java @@ -0,0 +1,226 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class BeamsplitterMage extends CardImpl { + + public BeamsplitterMage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{R}"); + + this.subtype.add(SubType.VEDALKEN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast an instant or sorcery spell that targets only Beamsplitter Mage, if you control one or more creatures that spell could target, choose one of those creatures. Copy that spell. The copy targets the chosen creature. + this.addAbility(new BeamsplitterMageTriggeredAbility()); + } + + public BeamsplitterMage(final BeamsplitterMage card) { + super(card); + } + + @Override + public BeamsplitterMage copy() { + return new BeamsplitterMage(this); + } +} + +class BeamsplitterMageTriggeredAbility extends TriggeredAbilityImpl { + + public BeamsplitterMageTriggeredAbility() { + super(Zone.BATTLEFIELD, new BeamsplitterMageEffect(), false); + } + + public BeamsplitterMageTriggeredAbility(final BeamsplitterMageTriggeredAbility ability) { + super(ability); + } + + @Override + public BeamsplitterMageTriggeredAbility copy() { + return new BeamsplitterMageTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.getControllerId())) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (!isControlledInstantOrSorcery(spell)) { + return false; + } + boolean targetsSource = false; + for (Ability ability : spell.getSpellAbilities()) { + for (UUID modeId : ability.getModes().getSelectedModes()) { + Mode mode = ability.getModes().get(modeId); + for (Target target : mode.getTargets()) { + if (!target.isNotTarget()) { + for (UUID targetId : target.getTargets()) { + if (targetId.equals(getSourceId())) { + targetsSource = true; + } else { + return false; + } + } + } + } + } + } + if (targetsSource) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); + return true; + } + } + return false; + } + + private boolean isControlledInstantOrSorcery(Spell spell) { + return spell != null + && (spell.isControlledBy(this.getControllerId())) + && (spell.isInstant() || spell.isSorcery()); + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell that targets " + + "only {this}, if you control one or more creatures " + + "that spell could target, choose one of those creatures. " + + "Copy that spell. The copy targets the chosen creature."; + } +} + +class BeamsplitterMageEffect extends OneShotEffect { + + public BeamsplitterMageEffect() { + super(Outcome.Detriment); + } + + public BeamsplitterMageEffect(final BeamsplitterMageEffect effect) { + super(effect); + } + + @Override + public BeamsplitterMageEffect copy() { + return new BeamsplitterMageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (spell != null && controller != null) { + // search the target that targets source + Target usedTarget = null; + setUsedTarget: + for (Ability ability : spell.getSpellAbilities()) { + for (UUID modeId : ability.getModes().getSelectedModes()) { + Mode mode = ability.getModes().get(modeId); + for (Target target : mode.getTargets()) { + if (!target.isNotTarget() && target.getFirstTarget().equals(source.getSourceId())) { + usedTarget = target.copy(); + usedTarget.clearChosen(); + break setUsedTarget; + } + } + } + } + if (usedTarget == null) { + return false; + } + FilterPermanent filter = new BeamsplitterMageFilter(usedTarget, source.getSourceId()); + Target target1 = new TargetPermanent(filter); + target1.setNotTarget(true); + if (controller.choose(outcome, target1, source.getSourceId(), game)) { + Permanent creature = game.getPermanent(target1.getFirstTarget()); + if (creature == null) { + return false; + } + Spell copy = spell.copySpell(source.getControllerId()); + game.getStack().push(copy); + setTarget: + for (UUID modeId : copy.getSpellAbility().getModes().getSelectedModes()) { + Mode mode = copy.getSpellAbility().getModes().get(modeId); + for (Target target : mode.getTargets()) { + if (target.getClass().equals(usedTarget.getClass())) { + target.clearChosen(); // For targets with Max > 1 we need to clear before the text is comapred + if (target.getMessage().equals(usedTarget.getMessage())) { + target.addTarget(creature.getId(), copy.getSpellAbility(), game, false); + break setTarget; + } + } + } + } + game.fireEvent(new GameEvent(GameEvent.EventType.COPIED_STACKOBJECT, copy.getId(), spell.getId(), source.getControllerId())); + String activateMessage = copy.getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); + } + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + activateMessage); + } + } + return true; + } + return false; + } +} + +class BeamsplitterMageFilter extends FilterControlledPermanent { + + private final Target target; + private final UUID notId; + + public BeamsplitterMageFilter(Target target, UUID notId) { + super("creature this spell could target"); + this.target = target; + this.notId = notId; + } + + public BeamsplitterMageFilter(final BeamsplitterMageFilter filter) { + super(filter); + this.target = filter.target; + this.notId = filter.notId; + } + + @Override + public BeamsplitterMageFilter copy() { + return new BeamsplitterMageFilter(this); + } + + @Override + public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { + return super.match(permanent, game) + && permanent.isCreature() + && !permanent.getId().equals(notId) + && target.canTarget(permanent.getId(), game); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BeastWhisperer.java b/Mage.Sets/src/mage/cards/b/BeastWhisperer.java new file mode 100644 index 0000000000..c96cecb6b3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BeastWhisperer.java @@ -0,0 +1,42 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class BeastWhisperer extends CardImpl { + + public BeastWhisperer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever you cast a creature spell, draw a card. + this.addAbility(new SpellCastControllerTriggeredAbility( + new DrawCardSourceControllerEffect(1), + StaticFilters.FILTER_SPELL_A_CREATURE, false + )); + } + + public BeastWhisperer(final BeastWhisperer card) { + super(card); + } + + @Override + public BeastWhisperer copy() { + return new BeastWhisperer(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/Berserk.java b/Mage.Sets/src/mage/cards/b/Berserk.java index f193dcae69..3d38da94d8 100644 --- a/Mage.Sets/src/mage/cards/b/Berserk.java +++ b/Mage.Sets/src/mage/cards/b/Berserk.java @@ -171,7 +171,7 @@ class BerserkDelayedDestroyEffect extends OneShotEffect { Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (permanent != null) { Watcher watcher = game.getState().getWatchers().get(AttackedThisTurnWatcher.class.getSimpleName()); - if (watcher != null && watcher instanceof AttackedThisTurnWatcher) { + if (watcher instanceof AttackedThisTurnWatcher) { if (((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game))) { return permanent.destroy(source.getSourceId(), game, false); } diff --git a/Mage.Sets/src/mage/cards/b/BladeInstructor.java b/Mage.Sets/src/mage/cards/b/BladeInstructor.java new file mode 100644 index 0000000000..125cc168d6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BladeInstructor.java @@ -0,0 +1,39 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * + * @author jmharmon + */ + +public final class BladeInstructor extends CardImpl { + + public BladeInstructor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Mentor + this.addAbility(new MentorAbility()); + } + + public BladeInstructor(final BladeInstructor card) { + super(card); + } + + @Override + public BladeInstructor copy() { + return new BladeInstructor(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java b/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java index a49e04f9d0..73e9ebfc46 100644 --- a/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java +++ b/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java @@ -1,9 +1,7 @@ - package mage.cards.b; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; @@ -13,12 +11,8 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; -import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; /** @@ -28,12 +22,12 @@ import mage.game.permanent.Permanent; public final class BladeOfTheBloodchief extends CardImpl { public BladeOfTheBloodchief(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); this.subtype.add(SubType.EQUIPMENT); // Whenever a creature dies, put a +1/+1 counter on equipped creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead. this.addAbility(new DiesCreatureTriggeredAbility(new BladeOfTheBloodchiefEffect(), false)); - + //Equip {1} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); } @@ -50,11 +44,14 @@ public final class BladeOfTheBloodchief extends CardImpl { class BladeOfTheBloodchiefEffect extends OneShotEffect { - BladeOfTheBloodchiefEffect() { + public BladeOfTheBloodchiefEffect() { super(Outcome.BoostCreature); + staticText = "put a +1/+1 counter on equipped creature. " + + "If equipped creature is a Vampire, " + + "put two +1/+1 counters on it instead."; } - BladeOfTheBloodchiefEffect(final BladeOfTheBloodchiefEffect ability) { + public BladeOfTheBloodchiefEffect(final BladeOfTheBloodchiefEffect ability) { super(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodOperative.java b/Mage.Sets/src/mage/cards/b/BloodOperative.java new file mode 100644 index 0000000000..b3cde09e0f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BloodOperative.java @@ -0,0 +1,97 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author LevelX2 + */ +public final class BloodOperative extends CardImpl { + + public BloodOperative(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // When Blood Operative enters the battlefield, you may exile target card from a graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), true); + ability.addTarget(new TargetCardInGraveyard()); + this.addAbility(ability); + + // Whenever you surveil, if Blood Operative is in your graveyard, you may pay 3 life. If you do, return Blood Operative to your hand. + this.addAbility(new BloodOperativeTriggeredAbility()); + } + + public BloodOperative(final BloodOperative card) { + super(card); + } + + @Override + public BloodOperative copy() { + return new BloodOperative(this); + } +} + +class BloodOperativeTriggeredAbility extends TriggeredAbilityImpl { + + public BloodOperativeTriggeredAbility() { + super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new PayLifeCost(3)), false); + } + + public BloodOperativeTriggeredAbility(final BloodOperativeTriggeredAbility ability) { + super(ability); + } + + @Override + public BloodOperativeTriggeredAbility copy() { + return new BloodOperativeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEILED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(getControllerId()); + } + + @Override + public boolean checkInterveningIfClause(Game game) { + Player controller = game.getPlayer(getControllerId()); + if (controller != null && controller.getGraveyard().contains(getSourceId())) { + return super.checkInterveningIfClause(game); + } + return false; + } + + @Override + public String getRule() { + return "Whenever you surveil, if {this} is in your graveyard, you may pay 3 life. If you do, return {this} to your hand."; + } +} diff --git a/Mage.Sets/src/mage/cards/b/BlowflyInfestation.java b/Mage.Sets/src/mage/cards/b/BlowflyInfestation.java index 82ee8fe770..77782f57c3 100644 --- a/Mage.Sets/src/mage/cards/b/BlowflyInfestation.java +++ b/Mage.Sets/src/mage/cards/b/BlowflyInfestation.java @@ -55,7 +55,7 @@ public final class BlowflyInfestation extends CardImpl { class BlowflyInfestationCondition implements Condition { - private static Permanent permanent; + private Permanent permanent; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/b/BookDevourer.java b/Mage.Sets/src/mage/cards/b/BookDevourer.java new file mode 100644 index 0000000000..cb48929f47 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BookDevourer.java @@ -0,0 +1,45 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardHandDrawSameNumberSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class BookDevourer extends CardImpl { + + public BookDevourer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}"); + + this.subtype.add(SubType.BEAST); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever Book Devourer deals combat damage to a player, you may discard all the cards in your hand. If you do, draw that many cards. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( + new DiscardHandDrawSameNumberSourceEffect() + .setText("discard all the cards in your hand. " + + "If you do, draw that many cards"), true + )); + } + + public BookDevourer(final BookDevourer card) { + super(card); + } + + @Override + public BookDevourer copy() { + return new BookDevourer(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BorosChallenger.java b/Mage.Sets/src/mage/cards/b/BorosChallenger.java new file mode 100644 index 0000000000..b05423b33f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BorosChallenger.java @@ -0,0 +1,49 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class BorosChallenger extends CardImpl { + + public BorosChallenger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Mentor + this.addAbility(new MentorAbility()); + + // {2}{R}{W}: Boros Challenger gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new ManaCostsImpl("{2}{R}{W}") + )); + } + + public BorosChallenger(final BorosChallenger card) { + super(card); + } + + @Override + public BorosChallenger copy() { + return new BorosChallenger(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BorosLocket.java b/Mage.Sets/src/mage/cards/b/BorosLocket.java new file mode 100644 index 0000000000..414476efcc --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BorosLocket.java @@ -0,0 +1,47 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.RedManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class BorosLocket extends CardImpl { + + public BorosLocket(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // {T}: Add {R} or {W}. + this.addAbility(new RedManaAbility()); + this.addAbility(new WhiteManaAbility()); + + // {R/W}{R/W}{R/W}{R/W}, {T}, Sacrifice Boros Locket: Draw two cards. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(2), + new ManaCostsImpl("{R/W}{R/W}{R/W}{R/W}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public BorosLocket(final BorosLocket card) { + super(card); + } + + @Override + public BorosLocket copy() { + return new BorosLocket(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BountyAgent.java b/Mage.Sets/src/mage/cards/b/BountyAgent.java new file mode 100644 index 0000000000..515c793040 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BountyAgent.java @@ -0,0 +1,70 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class BountyAgent extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("legendary permanent that's an artifact, creature, or enchantment"); + + static { + filter.add(new SupertypePredicate(SuperType.LEGENDARY)); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT) + )); + } + + public BountyAgent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // {T}, Sacrifice Bounty Agent: Destroy target legendary permanent that's an artifact, creature, or enchantment. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new DestroyTargetEffect(), + new TapSourceCost() + ); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public BountyAgent(final BountyAgent card) { + super(card); + } + + @Override + public BountyAgent copy() { + return new BountyAgent(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BountyOfMight.java b/Mage.Sets/src/mage/cards/b/BountyOfMight.java new file mode 100644 index 0000000000..d3f100192f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BountyOfMight.java @@ -0,0 +1,47 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; +import mage.target.targetpointer.ThirdTargetPointer; + +/** + * + * @author Ryan-Saklad + */ +public final class BountyOfMight extends CardImpl { + + public BountyOfMight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{G}{G}"); + + // Target creature gets +3/+3 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (1st)"))); + // Target creature gets +3/+3 until end of turn. + Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn).setText("<br>Target creature gets +3/+3 until end of turn."); + effect.setTargetPointer(new SecondTargetPointer()); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (2nd)"))); + // Target creature gets +3/+3 until end of turn. + effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn).setText("<br>Target creature gets +3/+3 until end of turn."); + effect.setTargetPointer(new ThirdTargetPointer()); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (3rd)"))); + } + + public BountyOfMight(final BountyOfMight card) { + super(card); + } + + @Override + public BountyOfMight copy() { + return new BountyOfMight(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BroodingSaurian.java b/Mage.Sets/src/mage/cards/b/BroodingSaurian.java index 135bbcff7c..9b71bf2e91 100644 --- a/Mage.Sets/src/mage/cards/b/BroodingSaurian.java +++ b/Mage.Sets/src/mage/cards/b/BroodingSaurian.java @@ -55,7 +55,7 @@ class BroodingSaurianControlEffect extends ContinuousEffectImpl { public BroodingSaurianControlEffect() { super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - this.staticText = "each player gains control of all nontoken permanents he or she owns"; + this.staticText = "each player gains control of all nontoken permanents they own"; } public BroodingSaurianControlEffect(final BroodingSaurianControlEffect effect) { diff --git a/Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java b/Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java index 6da9effd66..52e0b75f3c 100644 --- a/Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java +++ b/Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java @@ -1,6 +1,5 @@ package mage.cards.b; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfCombatTriggeredAbility; @@ -11,13 +10,7 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.SuperType; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.permanent.TokenPredicate; @@ -28,8 +21,9 @@ import mage.players.Player; import mage.target.common.TargetControlledPermanent; import mage.util.functions.EmptyApplyToPermanent; +import java.util.UUID; + /** - * * @author spjspj */ public final class BrudicladTelchorEngineer extends CardImpl { @@ -52,7 +46,7 @@ public final class BrudicladTelchorEngineer extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); // At the beginning of combat on your turn, create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token. - this.addAbility(new BeginningOfCombatTriggeredAbility(new BrudicladTelchorCombatffect(), TargetController.YOU, false)); + this.addAbility(new BeginningOfCombatTriggeredAbility(new BrudicladTelchorEngineerEffect(), TargetController.YOU, false)); } public BrudicladTelchorEngineer(final BrudicladTelchorEngineer card) { @@ -65,26 +59,26 @@ public final class BrudicladTelchorEngineer extends CardImpl { } } -class BrudicladTelchorCombatffect extends OneShotEffect { +class BrudicladTelchorEngineerEffect extends OneShotEffect { - private static final FilterControlledPermanent filter = new FilterControlledPermanent(" token you control. If you do, each other token you control becomes a copy of that token"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("token you control"); static { filter.add(new TokenPredicate()); } - public BrudicladTelchorCombatffect() { + public BrudicladTelchorEngineerEffect() { super(Outcome.Sacrifice); - this.staticText = " you may choose a token you control. If you do, each other token you control becomes a copy of that token"; + this.staticText = " create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token"; } - public BrudicladTelchorCombatffect(final BrudicladTelchorCombatffect effect) { + public BrudicladTelchorEngineerEffect(final BrudicladTelchorEngineerEffect effect) { super(effect); } @Override - public BrudicladTelchorCombatffect copy() { - return new BrudicladTelchorCombatffect(this); + public BrudicladTelchorEngineerEffect copy() { + return new BrudicladTelchorEngineerEffect(this); } @Override @@ -95,7 +89,8 @@ class BrudicladTelchorCombatffect extends OneShotEffect { if (effect.apply(game, source)) { TargetControlledPermanent target = new TargetControlledPermanent(0, 1, filter, true); target.setNotTarget(true); - if (controller.choose(Outcome.Neutral, target, source.getSourceId(), game)) { + if (controller.chooseUse(outcome, "Select a token to copy?", source, game) + && controller.choose(Outcome.Neutral, target, source.getSourceId(), game)) { Permanent toCopyFromPermanent = game.getPermanent(target.getFirstTarget()); if (toCopyFromPermanent != null) { diff --git a/Mage.Sets/src/mage/cards/b/BurglarRat.java b/Mage.Sets/src/mage/cards/b/BurglarRat.java new file mode 100644 index 0000000000..f6efa16d72 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BurglarRat.java @@ -0,0 +1,44 @@ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; + +/** + * + * @author TheElk801 + */ +public final class BurglarRat extends CardImpl { + + public BurglarRat(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.RAT); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Burglar Rat enters the battlefield, each opponent discards a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DiscardEachPlayerEffect( + new StaticValue(1), false, + TargetController.OPPONENT + ) + )); + } + + public BurglarRat(final BurglarRat card) { + super(card); + } + + @Override + public BurglarRat copy() { + return new BurglarRat(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java new file mode 100644 index 0000000000..1585222ed7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java @@ -0,0 +1,235 @@ +package mage.cards.b; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPlayer; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.other.PlayerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; +import mage.watchers.Watcher; + +/** + * + * @author L_J + */ +public final class BurningCinderFuryOfCrimsonChaosFire extends CardImpl { + + public BurningCinderFuryOfCrimsonChaosFire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + + // Whenever any player taps a permanent, that player choose one of their opponents. The chosen player gains control of that permanent at the beginning of the next end step. + this.addAbility(new BurningCinderFuryOfCrimsonChaosFireAbility()); + + // At the beginning of each player’s end step, if that player didn’t tap any nonland permanents that turn, Burning Cinder Fury of Crimson Chaos Fire deals 3 damage to that player. + this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3).setText("{this} deals 3 damage to that player"), + TargetController.ANY, new BurningCinderFuryOfCrimsonChaosFireCondition(), false), new BurningCinderFuryOfCrimsonChaosFireWatcher()); + } + + public BurningCinderFuryOfCrimsonChaosFire(final BurningCinderFuryOfCrimsonChaosFire card) { + super(card); + } + + @Override + public BurningCinderFuryOfCrimsonChaosFire copy() { + return new BurningCinderFuryOfCrimsonChaosFire(this); + } +} + +class BurningCinderFuryOfCrimsonChaosFireAbility extends TriggeredAbilityImpl { + + public BurningCinderFuryOfCrimsonChaosFireAbility() { + super(Zone.BATTLEFIELD, new BurningCinderFuryOfCrimsonChaosFireEffect(), false); + } + + public BurningCinderFuryOfCrimsonChaosFireAbility(BurningCinderFuryOfCrimsonChaosFireAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + BurningCinderFuryOfCrimsonChaosFireEffect effect = (BurningCinderFuryOfCrimsonChaosFireEffect) this.getEffects().get(0); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.setFirstControllerId(permanent.getControllerId()); // it's necessary to remember the original controller, as the controller might change by the time the trigger resolves + return true; + } + return false; + } + + @Override + public BurningCinderFuryOfCrimsonChaosFireAbility copy() { + return new BurningCinderFuryOfCrimsonChaosFireAbility(this); + } + + @Override + public String getRule() { + return "Whenever any player taps a permanent, " + super.getRule(); + } +} + +class BurningCinderFuryOfCrimsonChaosFireEffect extends OneShotEffect { + + private UUID firstControllerId = null; + + public BurningCinderFuryOfCrimsonChaosFireEffect() { + super(Outcome.Detriment); + this.staticText = "that player choose one of their opponents. The chosen player gains control of that permanent at the beginning of the next end step"; + } + + public BurningCinderFuryOfCrimsonChaosFireEffect(final BurningCinderFuryOfCrimsonChaosFireEffect effect) { + super(effect); + this.firstControllerId = effect.firstControllerId; + } + + @Override + public BurningCinderFuryOfCrimsonChaosFireEffect copy() { + return new BurningCinderFuryOfCrimsonChaosFireEffect(this); + } + + public void setFirstControllerId(UUID newId) { + this.firstControllerId = newId; + } + + @Override + public boolean apply(Game game, Ability source) { + Player tappingPlayer = game.getPlayer(firstControllerId); + Permanent permanentToControl = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (tappingPlayer != null && permanentToControl != null) { + // Create opponent filter list manually because otherwise opponent check prevents controller of this to be valid + FilterPlayer filter = new FilterPlayer("opponent to control " + permanentToControl.getIdName()); + List<PlayerIdPredicate> opponentPredicates = new ArrayList<>(); + for (UUID opponentId : game.getOpponents(firstControllerId)) { + opponentPredicates.add(new PlayerIdPredicate(opponentId)); + } + filter.add(Predicates.or(opponentPredicates)); + Target target = new TargetPlayer(1, 1, true, filter); + target.setTargetController(firstControllerId); + target.setAbilityController(source.getControllerId()); + if (tappingPlayer.chooseTarget(outcome, target, source, game)) { + Player chosenOpponent = game.getPlayer(target.getFirstTarget()); + if (chosenOpponent != null) { + game.informPlayers(tappingPlayer.getLogName() + " chose " + chosenOpponent.getLogName() + " to gain control of " + permanentToControl.getLogName() + " at the beginning of the next end step"); + ContinuousEffect effect = new BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect(Duration.Custom, chosenOpponent.getId()); + effect.setTargetPointer(new FixedTarget(permanentToControl.getId())); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source); + return true; + } + } + } + return false; + } +} + +class BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect extends ContinuousEffectImpl { + + private UUID controller; + + public BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect(Duration duration, UUID controller) { + super(duration, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + this.controller = controller; + this.staticText = "the chosen player gains control of that permanent"; + } + + public BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect(final BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect effect) { + super(effect); + this.controller = effect.controller; + } + + @Override + public BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect copy() { + return new BurningCinderFuryOfCrimsonChaosFireCreatureGainControlEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (targetPointer != null) { + permanent = game.getPermanent(targetPointer.getFirst(game, source)); + } + if (permanent != null && controller != null) { + return permanent.changeControllerId(controller, game); + } + return false; + } +} + +class BurningCinderFuryOfCrimsonChaosFireCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + BurningCinderFuryOfCrimsonChaosFireWatcher watcher = (BurningCinderFuryOfCrimsonChaosFireWatcher) game.getState().getWatchers().get(BurningCinderFuryOfCrimsonChaosFireWatcher.class.getSimpleName()); + if (watcher != null) { + return !watcher.tappedNonlandThisTurn(game.getActivePlayerId()); + } + return false; + } + + public String toString() { + return "if that player didn’t tap any nonland permanents that turn"; + } +} + +class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher { + + private final Set<UUID> tappedActivePlayerIds = new HashSet<>(); + + public BurningCinderFuryOfCrimsonChaosFireWatcher() { + super(BurningCinderFuryOfCrimsonChaosFireWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public BurningCinderFuryOfCrimsonChaosFireWatcher(final BurningCinderFuryOfCrimsonChaosFireWatcher watcher) { + super(watcher); + this.tappedActivePlayerIds.addAll(watcher.tappedActivePlayerIds); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && !permanent.isLand()) { + tappedActivePlayerIds.add(permanent.getControllerId()); + } + } + } + + public boolean tappedNonlandThisTurn(UUID playerId) { + return tappedActivePlayerIds.contains(playerId); + } + + @Override + public void reset() { + tappedActivePlayerIds.clear(); + } + + @Override + public BurningCinderFuryOfCrimsonChaosFireWatcher copy() { + return new BurningCinderFuryOfCrimsonChaosFireWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BuzzingWhackADoodle.java b/Mage.Sets/src/mage/cards/b/BuzzingWhackADoodle.java index 48c26262d3..1c2b59519b 100644 --- a/Mage.Sets/src/mage/cards/b/BuzzingWhackADoodle.java +++ b/Mage.Sets/src/mage/cards/b/BuzzingWhackADoodle.java @@ -136,7 +136,7 @@ class WhackCondition extends IntCompareCondition { @Override protected int getInputValue(Game game, Ability source) { Object object = game.getState().getValue("whack" + source.getSourceId()); - if (object != null && object instanceof Boolean && (Boolean) object) { + if (object instanceof Boolean && (Boolean) object) { return 1; } return 0; @@ -157,7 +157,7 @@ class DoodleCondition extends IntCompareCondition { @Override protected int getInputValue(Game game, Ability source) { Object object = game.getState().getValue("doodle" + source.getSourceId()); - if (object != null && object instanceof Boolean && (Boolean) object) { + if (object instanceof Boolean && (Boolean) object) { return 1; } return 0; @@ -178,7 +178,7 @@ class BuzzCondition extends IntCompareCondition { @Override protected int getInputValue(Game game, Ability source) { Object object = game.getState().getValue("buzz" + source.getSourceId()); - if (object != null && object instanceof Boolean && (Boolean) object) { + if (object instanceof Boolean && (Boolean) object) { return 1; } return 0; diff --git a/Mage.Sets/src/mage/cards/c/CallToArms.java b/Mage.Sets/src/mage/cards/c/CallToArms.java index 41037e04ea..b577fb8583 100644 --- a/Mage.Sets/src/mage/cards/c/CallToArms.java +++ b/Mage.Sets/src/mage/cards/c/CallToArms.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -41,19 +40,22 @@ public final class CallToArms extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // As Call to Arms enters the battlefield, choose a color and an opponent. - Effect effect = new ChooseColorEffect(Outcome.Detriment); -// effect.setText("choose a color and an opponent"); - Ability ability = new AsEntersBattlefieldAbility(effect); - effect = new ChooseOpponentEffect(Outcome.Benefit); - effect.setText("then choose an opponent"); - ability.addEffect(effect); + Ability ability = new AsEntersBattlefieldAbility( + new ChooseColorEffect(Outcome.Detriment) + ); + ability.addEffect(new ChooseOpponentEffect( + Outcome.Benefit + ).setText("and an opponent")); this.addAbility(ability); // White creatures get +1/+1 as long as the chosen color is the most common color among nontoken permanents the chosen player controls but isn't tied for most common. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CallToArmsEffect())); + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new CallToArmsEffect() + )); // When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice Call to Arms. - this.addAbility(new SacAbility()); + this.addAbility(new CallToArmsStateTriggeredAbility()); } public CallToArms(final CallToArms card) { @@ -76,7 +78,9 @@ class CallToArmsEffect extends ContinuousEffectImpl { public CallToArmsEffect() { super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.Benefit); - staticText = "The chosen player's maximum hand size is four"; + staticText = "White creatures get +1/+1 as long as the chosen color " + + "is the most common color among nontoken permanents " + + "the chosen player controls but isn't tied for most common."; } public CallToArmsEffect(final CallToArmsEffect effect) { @@ -107,19 +111,19 @@ class CallToArmsEffect extends ContinuousEffectImpl { } } -class SacAbility extends StateTriggeredAbility { +class CallToArmsStateTriggeredAbility extends StateTriggeredAbility { - public SacAbility() { + public CallToArmsStateTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); } - public SacAbility(final SacAbility ability) { + public CallToArmsStateTriggeredAbility(final CallToArmsStateTriggeredAbility ability) { super(ability); } @Override - public SacAbility copy() { - return new SacAbility(this); + public CallToArmsStateTriggeredAbility copy() { + return new CallToArmsStateTriggeredAbility(this); } @Override @@ -139,7 +143,9 @@ class SacAbility extends StateTriggeredAbility { @Override public String getRule() { - return "When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice {this}"; + return "When the chosen color isn't the most common color " + + "among nontoken permanents the chosen player controls " + + "or is tied for most common, sacrifice {this}"; } } diff --git a/Mage.Sets/src/mage/cards/c/Camaraderie.java b/Mage.Sets/src/mage/cards/c/Camaraderie.java new file mode 100644 index 0000000000..9baba360db --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Camaraderie.java @@ -0,0 +1,72 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class Camaraderie extends CardImpl { + + public Camaraderie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{W}"); + + // You gain X life and draw X cards, where X is the number of creatures you control. Creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new CamaraderieEffect()); + } + + public Camaraderie(final Camaraderie card) { + super(card); + } + + @Override + public Camaraderie copy() { + return new Camaraderie(this); + } +} + +class CamaraderieEffect extends OneShotEffect { + + public CamaraderieEffect() { + super(Outcome.Benefit); + this.staticText = "You gain X life and draw X cards, " + + "where X is the number of creatures you control. " + + "Creatures you control get +1/+1 until end of turn."; + } + + public CamaraderieEffect(final CamaraderieEffect effect) { + super(effect); + } + + @Override + public CamaraderieEffect copy() { + return new CamaraderieEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int xValue = game.getBattlefield().count( + StaticFilters.FILTER_CONTROLLED_CREATURE, + source.getSourceId(), source.getControllerId(), game + ); + player.gainLife(xValue, game, source); + player.drawCards(xValue, game); + game.addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/c/CandelabraOfTawnos.java b/Mage.Sets/src/mage/cards/c/CandelabraOfTawnos.java index 706014033a..38462201be 100644 --- a/Mage.Sets/src/mage/cards/c/CandelabraOfTawnos.java +++ b/Mage.Sets/src/mage/cards/c/CandelabraOfTawnos.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -11,10 +10,10 @@ import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @@ -31,7 +30,7 @@ public final class CandelabraOfTawnos extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CandlelightVigil.java b/Mage.Sets/src/mage/cards/c/CandlelightVigil.java new file mode 100644 index 0000000000..db7151ceee --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CandlelightVigil.java @@ -0,0 +1,59 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Ryan-Saklad + */ +public final class CandlelightVigil extends CardImpl { + + public CandlelightVigil(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +3/+2 and has vigilance. + Effect effect = new BoostEnchantedEffect(3, 2, Duration.WhileOnBattlefield); + effect.setText("Enchanted creature gets +3/+2"); + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has vigilance"); + ability2.addEffect(effect); + this.addAbility(ability2); + + } + + public CandlelightVigil(final CandlelightVigil card) { + super(card); + } + + @Override + public CandlelightVigil copy() { + return new CandlelightVigil(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CankerousThirst.java b/Mage.Sets/src/mage/cards/c/CankerousThirst.java index ff27ec3a8d..724a37456d 100644 --- a/Mage.Sets/src/mage/cards/c/CankerousThirst.java +++ b/Mage.Sets/src/mage/cards/c/CankerousThirst.java @@ -1,11 +1,10 @@ - package mage.cards.c; import java.util.UUID; -import mage.abilities.condition.LockedInCondition; +import mage.abilities.Ability; import mage.abilities.condition.common.ManaWasSpentCondition; -import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; @@ -13,8 +12,13 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.SecondTargetPointer; +import mage.target.targetpointer.FixedTarget; import mage.watchers.common.ManaSpentToCastWatcher; /** @@ -28,19 +32,9 @@ public final class CankerousThirst extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B/G}"); // If {B} was spent to cast Cankerous Thirst, you may have target creature get -3/-3 until end of turn. If {G} was spent to cast Cankerous Thirst, you may have target creature get +3/+3 until end of turn. - this.getSpellAbility().addEffect(new ConditionalContinuousEffect( - new BoostTargetEffect(-3, -3, Duration.EndOfTurn), - new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.B)), - "If {B} was spent to cast {this}, you may have target creature get -3/-3 until end of turn")); - - ContinuousEffect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); - effect.setTargetPointer(new SecondTargetPointer()); - this.getSpellAbility().addEffect(new ConditionalContinuousEffect( - effect, - new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.G)), - "If {G} was spent to cast {this}, you may have target creature get +3/+3 until end of turn")); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new CankerousThirstEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (1th effect -3/-3)"))); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (2nd effect +3/+3)"))); this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {B}{G} was spent.)</i>")); this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher()); } @@ -55,3 +49,45 @@ public final class CankerousThirst extends CardImpl { } } + +class CankerousThirstEffect extends OneShotEffect { + + public CankerousThirstEffect() { + super(Outcome.Benefit); + this.staticText = "If {B} was spent to cast {this}, you may have target creature get -3/-3 until end of turn. If {G} was spent to cast {this}, you may have target creature get +3/+3 until end of turn"; + } + + public CankerousThirstEffect(final CankerousThirstEffect effect) { + super(effect); + } + + @Override + public CankerousThirstEffect copy() { + return new CankerousThirstEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (new ManaWasSpentCondition(ColoredManaSymbol.B).apply(game, source)) { + Permanent targetCreature1 = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (targetCreature1 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature1.getIdName() + " get -3/-3 until end of turn?", source, game)) { + ContinuousEffect effect = new BoostTargetEffect(-3, -3, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(targetCreature1, game)); + game.addEffect(effect, source); + } + } + if (new ManaWasSpentCondition(ColoredManaSymbol.G).apply(game, source)) { + Permanent targetCreature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (targetCreature2 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature2.getIdName() + " get +3/+3 until end of turn?", source, game)) { + ContinuousEffect effect = new BoostTargetEffect(+3, +3, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(targetCreature2, game)); + game.addEffect(effect, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/c/CaptureSphere.java b/Mage.Sets/src/mage/cards/c/CaptureSphere.java new file mode 100644 index 0000000000..57225284db --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CaptureSphere.java @@ -0,0 +1,57 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.constants.SubType; +import mage.abilities.keyword.FlashAbility; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class CaptureSphere extends CardImpl { + + public CaptureSphere(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + + this.subtype.add(SubType.AURA); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Capture Sphere enters the battlefield, tap enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + + // Enchanted creature doesn't untap during its controller's untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + } + + public CaptureSphere(final CaptureSphere card) { + super(card); + } + + @Override + public CaptureSphere copy() { + return new CaptureSphere(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CavernOfSouls.java b/Mage.Sets/src/mage/cards/c/CavernOfSouls.java index 41c2bea64a..e1a5f5a2a1 100644 --- a/Mage.Sets/src/mage/cards/c/CavernOfSouls.java +++ b/Mage.Sets/src/mage/cards/c/CavernOfSouls.java @@ -64,7 +64,7 @@ class CavernOfSoulsManaBuilder extends ConditionalManaBuilder { @Override public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { creatureType = subType; } diff --git a/Mage.Sets/src/mage/cards/c/CentaurPeacemaker.java b/Mage.Sets/src/mage/cards/c/CentaurPeacemaker.java new file mode 100644 index 0000000000..d99c19d977 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CentaurPeacemaker.java @@ -0,0 +1,73 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public final class CentaurPeacemaker extends CardImpl { + + public CentaurPeacemaker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + + this.subtype.add(SubType.CENTAUR); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Centaur Mediator enters the battlefield, each player gains 4 life. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new CentaurMediatorEffect() + )); + } + + public CentaurPeacemaker(final CentaurPeacemaker card) { + super(card); + } + + @Override + public CentaurPeacemaker copy() { + return new CentaurPeacemaker(this); + } +} + +class CentaurMediatorEffect extends OneShotEffect { + + public CentaurMediatorEffect() { + super(Outcome.GainLife); + staticText = "each player gains 4 life."; + } + + public CentaurMediatorEffect(final CentaurMediatorEffect effect) { + super(effect); + } + + @Override + public CentaurMediatorEffect copy() { + return new CentaurMediatorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.getState().getPlayersInRange( + source.getControllerId(), game + ).stream().map((playerId) -> game.getPlayer(playerId)).filter( + (player) -> (player != null) + ).forEachOrdered((player) -> { + player.gainLife(4, game, source); + }); + return true; + } + +} diff --git a/Mage.Sets/src/mage/cards/c/ChainOfSilence.java b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java index 92d48f1e29..b9848d13ba 100644 --- a/Mage.Sets/src/mage/cards/c/ChainOfSilence.java +++ b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java @@ -81,7 +81,7 @@ class ChainOfSilenceEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); - if (newStackObject != null && newStackObject instanceof Spell) { + if (newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/c/ChainOfVapor.java b/Mage.Sets/src/mage/cards/c/ChainOfVapor.java index f5abf3ace4..d6b94d8838 100644 --- a/Mage.Sets/src/mage/cards/c/ChainOfVapor.java +++ b/Mage.Sets/src/mage/cards/c/ChainOfVapor.java @@ -78,7 +78,7 @@ class ChainOfVaporEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); - if (newStackObject != null && newStackObject instanceof Spell) { + if (newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/c/ChainStasis.java b/Mage.Sets/src/mage/cards/c/ChainStasis.java index f49ea83cc0..295f1bffa1 100644 --- a/Mage.Sets/src/mage/cards/c/ChainStasis.java +++ b/Mage.Sets/src/mage/cards/c/ChainStasis.java @@ -80,7 +80,7 @@ class ChainStasisEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); - if (newStackObject != null && newStackObject instanceof Spell) { + if (newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/c/ChamberSentry.java b/Mage.Sets/src/mage/cards/c/ChamberSentry.java new file mode 100644 index 0000000000..60c1182502 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChamberSentry.java @@ -0,0 +1,132 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.VariableCostImpl; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author jmharmon + */ +public final class ChamberSentry extends CardImpl { + + public ChamberSentry(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{X}"); + + this.subtype.add(SubType.CONSTRUCT); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Chamber Sentry enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true), + "with a +1/+1 counter on it for each color of mana spent to cast it")); + + // {X}, {T}, Remove X +1/+1 counters from Chamber Sentry: It deals X damage to any target. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()) + .setText("It deals X damage to any target"), + new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new ChamberSentryRemoveVariableCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability); + + // {W}{U}{B}{R}{G}: Return Chamber Sentry from your graveyard to your hand. + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{W}{U}{B}{R}{G}"))); + } + + public ChamberSentry(final ChamberSentry card) { + super(card); + } + + @Override + public ChamberSentry copy() { + return new ChamberSentry(this); + } +} + +class ChamberSentryRemoveVariableCountersSourceCost extends VariableCostImpl { + + protected int minimalCountersToPay = 0; + private String counterName; + + public ChamberSentryRemoveVariableCountersSourceCost(Counter counter) { + this(counter, 0); + } + + public ChamberSentryRemoveVariableCountersSourceCost(Counter counter, String text) { + this(counter, 0, text); + } + + public ChamberSentryRemoveVariableCountersSourceCost(Counter counter, int minimalCountersToPay) { + this(counter, minimalCountersToPay, ""); + } + + public ChamberSentryRemoveVariableCountersSourceCost(Counter counter, int minimalCountersToPay, String text) { + super(counter.getName() + " counters to remove"); + this.minimalCountersToPay = minimalCountersToPay; + this.counterName = counter.getName(); + if (text == null || text.isEmpty()) { + this.text = "Remove X " + counterName + " counters from {this}"; + } else { + this.text = text; + } + } + + public ChamberSentryRemoveVariableCountersSourceCost(final ChamberSentryRemoveVariableCountersSourceCost cost) { + super(cost); + this.minimalCountersToPay = cost.minimalCountersToPay; + this.counterName = cost.counterName; + } + + @Override + public ChamberSentryRemoveVariableCountersSourceCost copy() { + return new ChamberSentryRemoveVariableCountersSourceCost(this); + } + + @Override + public Cost getFixedCostsFromAnnouncedValue(int xValue) { + return new RemoveCountersSourceCost(new Counter(counterName, xValue)); + } + + @Override + public int getMinValue(Ability source, Game game) { + return minimalCountersToPay; + } + + @Override + public int getMaxValue(Ability source, Game game) { + int maxValue = 0; + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + maxValue = permanent.getCounters(game).getCount(counterName); + } + return maxValue; + } + + @Override + public int announceXValue(Ability source, Game game) { + return source.getManaCostsToPay().getX(); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChanceForGlory.java b/Mage.Sets/src/mage/cards/c/ChanceForGlory.java new file mode 100644 index 0000000000..ab8c37fb8a --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChanceForGlory.java @@ -0,0 +1,36 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * + * @author TheElk801 + */ +public final class ChanceForGlory extends CardImpl { + + public ChanceForGlory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{W}"); + + // Creatures you control gain indestructible. Take an extra turn after this one. At the beginning of that turn's end step, you lose the game. + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + IndestructibleAbility.getInstance(), Duration.EndOfGame + ).setText("Creatures you control gain indestructible")); + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect(true)); + } + + public ChanceForGlory(final ChanceForGlory card) { + super(card); + } + + @Override + public ChanceForGlory copy() { + return new ChanceForGlory(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChandraAblaze.java b/Mage.Sets/src/mage/cards/c/ChandraAblaze.java index 6ba9aa3842..e2cefa5d39 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraAblaze.java +++ b/Mage.Sets/src/mage/cards/c/ChandraAblaze.java @@ -7,7 +7,7 @@ import mage.MageObjectReference; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardAllEffect; @@ -41,7 +41,7 @@ public final class ChandraAblaze extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Discard a card. If a red card is discarded this way, Chandra Ablaze deals 4 damage to any target. LoyaltyAbility ability = new LoyaltyAbility(new ChandraAblazeEffect1(), 1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraBoldPyromancer.java b/Mage.Sets/src/mage/cards/c/ChandraBoldPyromancer.java index 16feda737c..c15234a2de 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraBoldPyromancer.java +++ b/Mage.Sets/src/mage/cards/c/ChandraBoldPyromancer.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effects; import mage.abilities.effects.mana.BasicManaEffect; import mage.abilities.effects.common.DamageAllControlledTargetEffect; @@ -30,7 +30,7 @@ public final class ChandraBoldPyromancer extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Add {R}{R}. Chandra, Bold Pyromancer deals 2 damage to target player. Ability ability = new LoyaltyAbility(new BasicManaEffect(Mana.RedMana(2)), +1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraFlamecaller.java b/Mage.Sets/src/mage/cards/c/ChandraFlamecaller.java index 9ad4fd7eec..7de1fc1432 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraFlamecaller.java +++ b/Mage.Sets/src/mage/cards/c/ChandraFlamecaller.java @@ -5,7 +5,7 @@ import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -36,7 +36,7 @@ public final class ChandraFlamecaller extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Create two 3/1 red Elemental creature tokens with haste. Exile them at the beginning of the next end step. this.addAbility(new LoyaltyAbility(new ChandraElementalEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/c/ChandraNalaar.java b/Mage.Sets/src/mage/cards/c/ChandraNalaar.java index 34c5ef8841..fe44aa90a4 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraNalaar.java +++ b/Mage.Sets/src/mage/cards/c/ChandraNalaar.java @@ -4,7 +4,7 @@ package mage.cards.c; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -33,7 +33,7 @@ public final class ChandraNalaar extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); // +1: Chandra Nalaar deals 1 damage to target player or planeswalker. LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraPyrogenius.java b/Mage.Sets/src/mage/cards/c/ChandraPyrogenius.java index 900ad4bc2b..f764e35a3f 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraPyrogenius.java +++ b/Mage.Sets/src/mage/cards/c/ChandraPyrogenius.java @@ -3,7 +3,7 @@ package mage.cards.c; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effects; import mage.abilities.effects.common.DamageAllControlledTargetEffect; @@ -31,7 +31,7 @@ public final class ChandraPyrogenius extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Chandra, Pyrogenius deals 2 damage to each opponent. this.addAbility(new LoyaltyAbility(new DamagePlayersEffect(Outcome.Damage, new StaticValue(2), TargetController.OPPONENT), 2)); diff --git a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java index 4e5b7fe082..bccba20571 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java +++ b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java @@ -8,7 +8,7 @@ import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; @@ -38,7 +38,7 @@ public final class ChandraPyromaster extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Chandra, Pyromaster deals 1 damage to target player and 1 damage to up to one target creature that player controls. That creature can't block this turn. LoyaltyAbility ability1 = new LoyaltyAbility(new ChandraPyromasterEffect1(), 1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraRoaringFlame.java b/Mage.Sets/src/mage/cards/c/ChandraRoaringFlame.java index d234a953b0..3f08437c97 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraRoaringFlame.java +++ b/Mage.Sets/src/mage/cards/c/ChandraRoaringFlame.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; @@ -36,7 +36,7 @@ public final class ChandraRoaringFlame extends CardImpl { this.nightCard = true; this.transformable = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Chandra, Roaring Flame deals 2 damage to target player. LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), 1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java index 69cbe99358..905b6b4db1 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java @@ -4,7 +4,7 @@ package mage.cards.c; import java.util.UUID; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -33,7 +33,7 @@ public final class ChandraTheFirebrand extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Chandra, the Firebrand deals 1 damage to any target. LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); diff --git a/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java b/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java index 81a6e6c861..95fd6740e5 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java +++ b/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java @@ -6,7 +6,7 @@ import mage.MageObjectReference; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamagePlayersEffect; @@ -37,7 +37,7 @@ public final class ChandraTorchOfDefiance extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Exile the top card of your library. You may cast that card. If you don't, Chandra, Torch of Defiance deals 2 damage to each opponent. LoyaltyAbility ability = new LoyaltyAbility(new ChandraTorchOfDefianceEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/c/CharnelTroll.java b/Mage.Sets/src/mage/cards/c/CharnelTroll.java new file mode 100644 index 0000000000..07fb56ebac --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CharnelTroll.java @@ -0,0 +1,76 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class CharnelTroll extends CardImpl { + + public CharnelTroll(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + + this.subtype.add(SubType.TROLL); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // At the beginning of your upkeep, exile a creature card from your graveyard. If you do, put a +1/+1 counter on Morgue Troll. Otherwise sacrifice it. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + new SacrificeSourceEffect(), + new ExileFromGraveCost(new TargetCardInYourGraveyard( + StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD + )), false + ).setText("exile a creature card from your graveyard. " + + "If you do, put a +1/+1 counter on {this}." + + " Otherwise sacrifice it."), + TargetController.YOU, false + )); + + // {B}{G}, Discard a creature card: Put a +1/+1 counter on Morgue Troll. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + new ManaCostsImpl("{B}{G}") + ); + ability.addCost(new DiscardTargetCost( + new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A) + )); + this.addAbility(ability); + } + + public CharnelTroll(final CharnelTroll card) { + super(card); + } + + @Override + public CharnelTroll copy() { + return new CharnelTroll(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChemistersInsight.java b/Mage.Sets/src/mage/cards/c/ChemistersInsight.java new file mode 100644 index 0000000000..269208cd4c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChemistersInsight.java @@ -0,0 +1,34 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class ChemistersInsight extends CardImpl { + + public ChemistersInsight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}"); + + // Draw two cards. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + } + + public ChemistersInsight(final ChemistersInsight card) { + super(card); + } + + @Override + public ChemistersInsight copy() { + return new ChemistersInsight(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChimeOfNight.java b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java index b1ea89b6f3..5f3a207f0b 100644 --- a/Mage.Sets/src/mage/cards/c/ChimeOfNight.java +++ b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -46,6 +45,7 @@ public final class ChimeOfNight extends CardImpl { // When Chime of Night is put into a graveyard from the battlefield, destroy target nonblack creature. ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); } public ChimeOfNight(final ChimeOfNight card) { diff --git a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java index f49e01f459..31bb27a193 100644 --- a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java +++ b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java @@ -98,7 +98,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { // save the x value to be available for ETB replacement effect Object object = game.getState().getValue("spellX" + source.getSourceId()); Map<String, Integer> spellX; - if (object != null && object instanceof Map) { + if (object instanceof Map) { spellX = (Map<String, Integer>) object; } else { spellX = new HashMap<>(); diff --git a/Mage.Sets/src/mage/cards/c/CircuDimirLobotomist.java b/Mage.Sets/src/mage/cards/c/CircuDimirLobotomist.java index c2332bbfdd..84ec986fd2 100644 --- a/Mage.Sets/src/mage/cards/c/CircuDimirLobotomist.java +++ b/Mage.Sets/src/mage/cards/c/CircuDimirLobotomist.java @@ -1,7 +1,6 @@ package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.ObjectColor; @@ -13,13 +12,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SuperType; -import mage.constants.Zone; -import mage.filter.FilterPlayer; +import mage.constants.*; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.ExileZone; @@ -31,8 +24,9 @@ import mage.players.Player; import mage.target.TargetPlayer; import mage.util.CardUtil; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class CircuDimirLobotomist extends CardImpl { @@ -54,16 +48,16 @@ public final class CircuDimirLobotomist extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(3); - // 10/1/2005 The first two abilities target libraries, not players. - // Target Library not supported yet - used as workaround target player // Whenever you cast a blue spell, exile the top card of target library. Ability ability = new SpellCastControllerTriggeredAbility(new CircuDimirLobotomistEffect(), filterBlue, false); - ability.addTarget(new TargetPlayer(1, 1, true, new FilterPlayer("target library"))); + ability.addTarget(new TargetPlayer()); this.addAbility(ability); + // Whenever you cast a black spell, exile the top card of target library. ability = new SpellCastControllerTriggeredAbility(new CircuDimirLobotomistEffect(), filterBlack, false); - ability.addTarget(new TargetPlayer(1, 1, true, new FilterPlayer("target library"))); + ability.addTarget(new TargetPlayer()); this.addAbility(ability); + // Your opponents can't cast nonland cards with the same name as a card exiled with Circu, Dimir Lobotomist. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CircuDimirLobotomistRuleModifyingEffect())); } @@ -82,7 +76,7 @@ class CircuDimirLobotomistEffect extends OneShotEffect { public CircuDimirLobotomistEffect() { super(Outcome.Detriment); - this.staticText = "exile the top card of target library"; + this.staticText = "exile the top card of target player's library"; } public CircuDimirLobotomistEffect(final CircuDimirLobotomistEffect effect) { diff --git a/Mage.Sets/src/mage/cards/c/CircuitousRoute.java b/Mage.Sets/src/mage/cards/c/CircuitousRoute.java new file mode 100644 index 0000000000..0b77d6b659 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CircuitousRoute.java @@ -0,0 +1,52 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class CircuitousRoute extends CardImpl { + + private static final FilterCard filter + = new FilterCard("basic land cards and/or Gate cards"); + + static { + filter.add(Predicates.or( + Predicates.and( + new CardTypePredicate(CardType.LAND), + new SupertypePredicate(SuperType.BASIC) + ), new SubtypePredicate(SubType.GATE) + )); + } + + public CircuitousRoute(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Search your library for up to two basic lands and/or Gates and put them onto the battlefield tapped. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect( + new TargetCardInLibrary(0, 2, filter), true + )); + } + + public CircuitousRoute(final CircuitousRoute card) { + super(card); + } + + @Override + public CircuitousRoute copy() { + return new CircuitousRoute(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CitywatchSphinx.java b/Mage.Sets/src/mage/cards/c/CitywatchSphinx.java new file mode 100644 index 0000000000..3bfe96bc8d --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CitywatchSphinx.java @@ -0,0 +1,41 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class CitywatchSphinx extends CardImpl { + + public CitywatchSphinx(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}"); + + this.subtype.add(SubType.SPHINX); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Citywatch Sphinx dies, surveil 2. + this.addAbility(new DiesTriggeredAbility(new SurveilEffect(2))); + } + + public CitywatchSphinx(final CitywatchSphinx card) { + super(card); + } + + @Override + public CitywatchSphinx copy() { + return new CitywatchSphinx(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CitywideBust.java b/Mage.Sets/src/mage/cards/c/CitywideBust.java new file mode 100644 index 0000000000..3658e4ea0e --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CitywideBust.java @@ -0,0 +1,40 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ToughnessPredicate; + +/** + * + * @author TheElk801 + */ +public final class CitywideBust extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creatures with toughness 4 or greater"); + + static { + filter.add(new ToughnessPredicate(ComparisonType.MORE_THAN, 3)); + } + + public CitywideBust(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}"); + + // Destroy all creatures with toughness 4 or greater. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public CitywideBust(final CitywideBust card) { + super(card); + } + + @Override + public CitywideBust copy() { + return new CitywideBust(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CollarTheCulprit.java b/Mage.Sets/src/mage/cards/c/CollarTheCulprit.java new file mode 100644 index 0000000000..0551082ab3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CollarTheCulprit.java @@ -0,0 +1,42 @@ + +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * @author Ryan-Saklad + */ + +public final class CollarTheCulprit extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with toughness 4 or greater"); + + static { + filter.add(new ToughnessPredicate(ComparisonType.MORE_THAN, 3)); + } + + public CollarTheCulprit(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}"); + + // Destroy target creature with toughness 4 or greater. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public CollarTheCulprit(final CollarTheCulprit card) { + super(card); + } + + @Override + public CollarTheCulprit copy() { + return new CollarTheCulprit(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/c/CommandTheStorm.java b/Mage.Sets/src/mage/cards/c/CommandTheStorm.java new file mode 100644 index 0000000000..2ef8b95845 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CommandTheStorm.java @@ -0,0 +1,32 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class CommandTheStorm extends CardImpl { + + public CommandTheStorm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); + + // Govern the Storm deals 5 damage to target creature. + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public CommandTheStorm(final CommandTheStorm card) { + super(card); + } + + @Override + public CommandTheStorm copy() { + return new CommandTheStorm(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ConclaveCavalier.java b/Mage.Sets/src/mage/cards/c/ConclaveCavalier.java new file mode 100644 index 0000000000..f8035d718c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConclaveCavalier.java @@ -0,0 +1,45 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.ElfKnightToken; + +/** + * + * @author TheElk801 + */ +public final class ConclaveCavalier extends CardImpl { + + public ConclaveCavalier(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}{W}{W}"); + + this.subtype.add(SubType.CENTAUR); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // When Conclave Cavalier dies, create two green and white 2/2 Elf Knight creature tokens with vigilance. + this.addAbility(new DiesTriggeredAbility( + new CreateTokenEffect(new ElfKnightToken(), 2) + )); + } + + public ConclaveCavalier(final ConclaveCavalier card) { + super(card); + } + + @Override + public ConclaveCavalier copy() { + return new ConclaveCavalier(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ConclaveGuildmage.java b/Mage.Sets/src/mage/cards/c/ConclaveGuildmage.java new file mode 100644 index 0000000000..67b6aab842 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConclaveGuildmage.java @@ -0,0 +1,62 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; +import mage.game.permanent.token.ElfKnightToken; + +/** + * + * @author TheElk801 + */ +public final class ConclaveGuildmage extends CardImpl { + + public ConclaveGuildmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, {T}: Creatures you control gain trample until end of turn. + Ability ability = new SimpleActivatedAbility( + new GainAbilityControlledEffect( + TrampleAbility.getInstance(), + Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + ), new ManaCostsImpl("{G}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {5}{W}, {T}: Create a 2/2 green and white Elf Knight creature token with vigilance. + ability = new SimpleActivatedAbility( + new CreateTokenEffect(new ElfKnightToken()), + new ManaCostsImpl("{5}{W}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public ConclaveGuildmage(final ConclaveGuildmage card) { + super(card); + } + + @Override + public ConclaveGuildmage copy() { + return new ConclaveGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ConclaveTribunal.java b/Mage.Sets/src/mage/cards/c/ConclaveTribunal.java new file mode 100644 index 0000000000..d06e3d72f8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConclaveTribunal.java @@ -0,0 +1,55 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileUntilSourceLeavesEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class ConclaveTribunal extends CardImpl { + + private final static FilterNonlandPermanent filter = new FilterNonlandPermanent(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public ConclaveTribunal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // When Conclave Tribunal enters the battlefield, exile target nonland permanent an opponent controls until Conclave Tribunal leaves the battlefield. + Ability ability = new EntersBattlefieldTriggeredAbility( + new ExileUntilSourceLeavesEffect(filter.getMessage()) + ); + ability.addTarget(new TargetPermanent(filter)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect( + new OnLeaveReturnExiledToBattlefieldAbility()) + ); + this.addAbility(ability); + } + + public ConclaveTribunal(final ConclaveTribunal card) { + super(card); + } + + @Override + public ConclaveTribunal copy() { + return new ConclaveTribunal(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ConniveConcoct.java b/Mage.Sets/src/mage/cards/c/ConniveConcoct.java new file mode 100644 index 0000000000..8441c314a0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConniveConcoct.java @@ -0,0 +1,103 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class ConniveConcoct extends SplitCard { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creature with power 2 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); + } + + public ConniveConcoct(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U/B}{U/B}", "{3}{U}{B}", SpellAbilityType.SPLIT); + + // Connive + // Gain control of target creature with power 2 or less. + this.getLeftHalfCard().getSpellAbility().addEffect( + new GainControlTargetEffect(Duration.Custom) + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCreaturePermanent(filter) + ); + + // Concoct + // Surveil 3, then return a creature card from your graveyard to the battlefield. + this.getRightHalfCard().getSpellAbility().addEffect(new ConcoctEffect()); + } + + public ConniveConcoct(final ConniveConcoct card) { + super(card); + } + + @Override + public ConniveConcoct copy() { + return new ConniveConcoct(this); + } +} + +class ConcoctEffect extends OneShotEffect { + + private static final FilterCard filter + = new FilterCreatureCard("creature card in your graveyard"); + + public ConcoctEffect() { + super(Outcome.Benefit); + this.staticText = "Surveil 3, then return a creature card " + + "from your graveyard to the battlefield."; + } + + public ConcoctEffect(final ConcoctEffect effect) { + super(effect); + } + + @Override + public ConcoctEffect copy() { + return new ConcoctEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.surveil(3, source, game); + Target target = new TargetCardInYourGraveyard(filter); + target.setNotTarget(true); + if (player.choose(outcome, target, source.getSourceId(), game)) { + Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); + effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game)); + effect.apply(game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/c/Conspiracy.java b/Mage.Sets/src/mage/cards/c/Conspiracy.java index 1b305eff23..dcac9387fb 100644 --- a/Mage.Sets/src/mage/cards/c/Conspiracy.java +++ b/Mage.Sets/src/mage/cards/c/Conspiracy.java @@ -66,7 +66,7 @@ class ConspiracyEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (controller != null && subType != null) { // Creature cards you own that aren't on the battlefield // in graveyard diff --git a/Mage.Sets/src/mage/cards/c/CosmotronicWave.java b/Mage.Sets/src/mage/cards/c/CosmotronicWave.java new file mode 100644 index 0000000000..18574f5cac --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CosmotronicWave.java @@ -0,0 +1,41 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class CosmotronicWave extends CardImpl { + + private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent("creature your opponents control"); + + public CosmotronicWave(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); + + // Cosmotronic Wave deals 1 damage to each creature your opponents control. Creatures your opponents control can't block this turn. + this.getSpellAbility().addEffect(new DamageAllEffect(1, filter)); + this.getSpellAbility().addEffect(new CantBlockAllEffect( + StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, + Duration.EndOfTurn + )); + } + + public CosmotronicWave(final CosmotronicWave card) { + super(card); + } + + @Override + public CosmotronicWave copy() { + return new CosmotronicWave(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java b/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java index 3e5a023a7f..1c464ed180 100644 --- a/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java +++ b/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java @@ -61,7 +61,7 @@ class FilterCoverOfDarkness extends FilterCreaturePermanent { public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (super.match(permanent, sourceId, playerId, game)) { if (subType == null) { - subType = ChooseCreatureTypeEffect.getChoosenCreatureType(sourceId, game); + subType = ChooseCreatureTypeEffect.getChosenCreatureType(sourceId, game); if (subType == null) { return false; } diff --git a/Mage.Sets/src/mage/cards/c/CracklingDrake.java b/Mage.Sets/src/mage/cards/c/CracklingDrake.java new file mode 100644 index 0000000000..bfe02721df --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CracklingDrake.java @@ -0,0 +1,90 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class CracklingDrake extends CardImpl { + + public CracklingDrake(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}{R}{R}"); + + this.subtype.add(SubType.DRAKE); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Crackling Drake's power is equal to the total number of instant and sorcery cards you own in exile and in your graveyard. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetPowerSourceEffect( + InstantSorceryExileGraveyardCount.instance, Duration.EndOfGame + ).setText("{this}'s power is equal to the total number " + + "of instant and sorcery cards you own " + + "in exile and in your graveyard.") + )); + + // When Crackling Drake enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(1) + )); + } + + public CracklingDrake(final CracklingDrake card) { + super(card); + } + + @Override + public CracklingDrake copy() { + return new CracklingDrake(this); + } +} + +class CracklingDrakeCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player != null) { + return player.getGraveyard().count( + StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game + ) + game.getExile().getExileZone(player.getId()).count( + StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game + ); + } + return 0; + } + + @Override + public CracklingDrakeCount copy() { + return new CracklingDrakeCount(); + } + + @Override + public String getMessage() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/cards/c/CreepingChill.java b/Mage.Sets/src/mage/cards/c/CreepingChill.java new file mode 100644 index 0000000000..84aa12a754 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CreepingChill.java @@ -0,0 +1,74 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.common.ZoneChangeTriggeredAbility; +import mage.abilities.costs.common.ExileSourceFromGraveCost; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class CreepingChill extends CardImpl { + + public CreepingChill(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}"); + + // Creeping Chill deals 3 damage to each opponent and you gain 3 life. + this.getSpellAbility().addEffect( + new DamagePlayersEffect(3, TargetController.OPPONENT) + ); + this.getSpellAbility().addEffect( + new GainLifeEffect(3).setText("and you gain 3 life") + ); + + // When Creeping Chill is put into your graveyard from your library, you may exile it. If you do, Creeping Chill deals 3 damage to each opponent and you gain 3 life. + this.addAbility(new CreepingChillAbility()); + } + + public CreepingChill(final CreepingChill card) { + super(card); + } + + @Override + public CreepingChill copy() { + return new CreepingChill(this); + } +} + +class CreepingChillAbility extends ZoneChangeTriggeredAbility { + + public CreepingChillAbility() { + super( + Zone.LIBRARY, Zone.GRAVEYARD, + new DoIfCostPaid( + new DamagePlayersEffect(3, TargetController.OPPONENT), + new ExileSourceFromGraveCost() + ).addEffect(new GainLifeEffect(3)), + "", true + ); + } + + public CreepingChillAbility(final CreepingChillAbility ability) { + super(ability); + } + + @Override + public CreepingChillAbility copy() { + return new CreepingChillAbility(this); + } + + @Override + public String getRule() { + return "When {this} is put into your graveyard from your library, " + + "you may exile it. If you do, {this} deals 3 damage " + + "to each opponent and you gain 3 life."; + } +} diff --git a/Mage.Sets/src/mage/cards/c/CrushContraband.java b/Mage.Sets/src/mage/cards/c/CrushContraband.java new file mode 100644 index 0000000000..6cbe26f8db --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CrushContraband.java @@ -0,0 +1,45 @@ + +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author Ryan-Saklad + */ + +public final class CrushContraband extends CardImpl { + + public CrushContraband(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}"); + + // Choose one or both - Destroy target artifact; or Destroy target land. + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); + this.getSpellAbility().addEffect(new ExileTargetEffect()); + + Mode mode1 = new Mode(); + mode1.getTargets().add(new TargetEnchantmentPermanent()); + mode1.getEffects().add(new ExileTargetEffect()); + this.getSpellAbility().addMode(mode1); + + } + + public CrushContraband(final CrushContraband card) { + super(card); + } + + @Override + public CrushContraband copy() { + return new CrushContraband(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/d/DackFayden.java b/Mage.Sets/src/mage/cards/d/DackFayden.java index d6fe0597e3..f23dc1865e 100644 --- a/Mage.Sets/src/mage/cards/d/DackFayden.java +++ b/Mage.Sets/src/mage/cards/d/DackFayden.java @@ -3,7 +3,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -27,7 +27,7 @@ public final class DackFayden extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DACK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Target player draws two cards, then discards two cards. LoyaltyAbility ability = new LoyaltyAbility(new DrawCardTargetEffect(2), 1); diff --git a/Mage.Sets/src/mage/cards/d/DarettiIngeniousIconoclast.java b/Mage.Sets/src/mage/cards/d/DarettiIngeniousIconoclast.java index 8bad4d8f42..8abf13e932 100644 --- a/Mage.Sets/src/mage/cards/d/DarettiIngeniousIconoclast.java +++ b/Mage.Sets/src/mage/cards/d/DarettiIngeniousIconoclast.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenCopyTargetEffect; @@ -47,7 +47,7 @@ public final class DarettiIngeniousIconoclast extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DARETTI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Create a 1/1 colorless Construct artifact creature token with defender. LoyaltyAbility ability = new LoyaltyAbility(new CreateTokenEffect(new DarettiConstructToken()), 1); diff --git a/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java b/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java index 5a71881639..85a367404c 100644 --- a/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java +++ b/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -44,7 +44,7 @@ public final class DarettiScrapSavant extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DARETTI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Discard up to two cards, then draw that many cards. this.addAbility(new LoyaltyAbility(new DarettiDiscardDrawEffect(), 2)); diff --git a/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java b/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java new file mode 100644 index 0000000000..85a91830aa --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java @@ -0,0 +1,122 @@ +package mage.cards.d; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.Watcher; + +/** + * + * @author TheElk801 + */ +public final class DarkbladeAgent extends CardImpl { + + public DarkbladeAgent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // As long as you've surveilled this turn, Darkblade Agent has deathtouch and "Whenever this creature deals combat damage to a player, draw a card." + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + DeathtouchAbility.getInstance(), + Duration.WhileOnBattlefield + ), DarkbladeAgentCondition.instance, + "As long as you've surveilled this turn, " + + "{this} has deathtouch" + ) + ); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + new DealsCombatDamageToAPlayerTriggeredAbility( + new DrawCardSourceControllerEffect(1), false + ), Duration.WhileOnBattlefield + ), DarkbladeAgentCondition.instance, + "and \"Whenever this creature deals " + + "combat damage to a player, draw a card.\"" + )); + this.addAbility(ability, new DarkbladeAgentWatcher()); + } + + public DarkbladeAgent(final DarkbladeAgent card) { + super(card); + } + + @Override + public DarkbladeAgent copy() { + return new DarkbladeAgent(this); + } +} + +enum DarkbladeAgentCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + DarkbladeAgentWatcher watcher + = (DarkbladeAgentWatcher) game.getState().getWatchers().get( + DarkbladeAgentWatcher.class.getSimpleName() + ); + return watcher != null + && watcher.getSurveiledThisTurn(source.getControllerId()); + } +} + +class DarkbladeAgentWatcher extends Watcher { + + private final Set<UUID> surveiledThisTurn = new HashSet(); + + public DarkbladeAgentWatcher() { + super(DarkbladeAgentWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public DarkbladeAgentWatcher(final DarkbladeAgentWatcher watcher) { + super(watcher); + this.surveiledThisTurn.addAll(watcher.surveiledThisTurn); + } + + @Override + public DarkbladeAgentWatcher copy() { + return new DarkbladeAgentWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SURVEILED) { + this.surveiledThisTurn.add(event.getPlayerId()); + } + } + + @Override + public void reset() { + super.reset(); + this.surveiledThisTurn.clear(); + } + + public boolean getSurveiledThisTurn(UUID playerId) { + return this.surveiledThisTurn.contains(playerId); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DarthSidiousSithLord.java b/Mage.Sets/src/mage/cards/d/DarthSidiousSithLord.java index 875a208ace..27fe59e672 100644 --- a/Mage.Sets/src/mage/cards/d/DarthSidiousSithLord.java +++ b/Mage.Sets/src/mage/cards/d/DarthSidiousSithLord.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.SacrificeEffect; @@ -38,7 +38,7 @@ public final class DarthSidiousSithLord extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{4}{U}{B}{B}{R}"); this.subtype.add(SubType.SIDIOUS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +3: Destroy target noncreature permanent. Ability ability = new LoyaltyAbility(new DestroyTargetEffect(), +3); diff --git a/Mage.Sets/src/mage/cards/d/DarthTyranusCountOfSerenno.java b/Mage.Sets/src/mage/cards/d/DarthTyranusCountOfSerenno.java index 124c90a7b0..92b3e495ab 100644 --- a/Mage.Sets/src/mage/cards/d/DarthTyranusCountOfSerenno.java +++ b/Mage.Sets/src/mage/cards/d/DarthTyranusCountOfSerenno.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.SearchEffect; @@ -37,7 +37,7 @@ public final class DarthTyranusCountOfSerenno extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{1}{W}{U}{B}"); this.subtype.add(SubType.DOOKU); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Up to one target creature gets -6/-0 until your next turn. Effect effect = new BoostTargetEffect(-6, 0, Duration.UntilYourNextTurn); diff --git a/Mage.Sets/src/mage/cards/d/DawnOfHope.java b/Mage.Sets/src/mage/cards/d/DawnOfHope.java new file mode 100644 index 0000000000..c65faba3be --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DawnOfHope.java @@ -0,0 +1,49 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class DawnOfHope extends CardImpl { + + public DawnOfHope(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + + // Whenever you gain life, you may pay {2}. If you do, draw a card. + this.addAbility(new GainLifeControllerTriggeredAbility( + new DoIfCostPaid( + new DrawCardSourceControllerEffect(1), + new GenericManaCost(2)), false + )); + + // {3}{W}: Create a 1/1 white Soldier creature token with lifelink. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new CreateTokenEffect(new SoldierLifelinkToken()), + new ManaCostsImpl("{3}{W}") + )); + } + + public DawnOfHope(final DawnOfHope card) { + super(card); + } + + @Override + public DawnOfHope copy() { + return new DawnOfHope(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DazzlingLights.java b/Mage.Sets/src/mage/cards/d/DazzlingLights.java new file mode 100644 index 0000000000..eb398cf7e6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DazzlingLights.java @@ -0,0 +1,37 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class DazzlingLights extends CardImpl { + + public DazzlingLights(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); + + // Target creature gets -3/-0 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(-3, 0, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Surveil 2. + this.getSpellAbility().addEffect(new SurveilEffect(2)); + } + + public DazzlingLights(final DazzlingLights card) { + super(card); + } + + @Override + public DazzlingLights copy() { + return new DazzlingLights(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeadlyVisit.java b/Mage.Sets/src/mage/cards/d/DeadlyVisit.java new file mode 100644 index 0000000000..9e1c1be645 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeadlyVisit.java @@ -0,0 +1,36 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class DeadlyVisit extends CardImpl { + + public DeadlyVisit(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + + // Destroy target creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Surveil 2. + this.getSpellAbility().addEffect(new SurveilEffect(2)); + } + + public DeadlyVisit(final DeadlyVisit card) { + super(card); + } + + @Override + public DeadlyVisit copy() { + return new DeadlyVisit(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeafeningClarion.java b/Mage.Sets/src/mage/cards/d/DeafeningClarion.java new file mode 100644 index 0000000000..70dbbd52c8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeafeningClarion.java @@ -0,0 +1,50 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class DeafeningClarion extends CardImpl { + + public DeafeningClarion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{W}"); + + // Choose one or both — + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + + // • Deafening Clarion deals 3 damage to each creature. + this.getSpellAbility().addEffect(new DamageAllEffect( + 3, StaticFilters.FILTER_PERMANENT_CREATURE + )); + + // • Creatures you control gain lifelink until end of turn. + Mode mode = new Mode(); + mode.getEffects().add(new GainAbilityControlledEffect( + LifelinkAbility.getInstance(), + Duration.EndOfTurn, + StaticFilters.FILTER_PERMANENT_CREATURES + )); + this.getSpellAbility().addMode(mode); + } + + public DeafeningClarion(final DeafeningClarion card) { + super(card); + } + + @Override + public DeafeningClarion copy() { + return new DeafeningClarion(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java b/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java index 7fef07ec16..8e761b1c30 100644 --- a/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java +++ b/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java @@ -1,7 +1,7 @@ - package mage.cards.d; import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -10,10 +10,12 @@ import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; import mage.target.TargetSpell; +import mage.target.targetadjustment.TargetAdjuster; /** * @@ -31,7 +33,7 @@ public final class DeclarationOfNaught extends CardImpl { // {U}: Counter target spell with the chosen name. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}")); - ability.setTargetAdjustment(TargetAdjustment.CHOSEN_NAME); + ability.setTargetAdjuster(DeclarationOfNaughtAdjuster.instance); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); } @@ -45,3 +47,17 @@ public final class DeclarationOfNaught extends CardImpl { return new DeclarationOfNaught(this); } } + +enum DeclarationOfNaughtAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + ability.getTargets().clear(); + String chosenName = (String) game.getState().getValue(ability.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); + FilterSpell filterSpell = new FilterSpell("spell named " + chosenName); + filterSpell.add(new NamePredicate(chosenName)); + TargetSpell target = new TargetSpell(1, filterSpell); + ability.addTarget(target); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeepfireElemental.java b/Mage.Sets/src/mage/cards/d/DeepfireElemental.java index c5bcdd1dcc..59ec4f30aa 100644 --- a/Mage.Sets/src/mage/cards/d/DeepfireElemental.java +++ b/Mage.Sets/src/mage/cards/d/DeepfireElemental.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -11,12 +10,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XCMCPermanentAdjuster; /** * @@ -43,7 +42,7 @@ public final class DeepfireElemental extends CardImpl { // {X}{X}{1}: Destroy target artifact or creature with converted mana cost X. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}")); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_PERM); + ability.setTargetAdjuster(XCMCPermanentAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DeepwoodElder.java b/Mage.Sets/src/mage/cards/d/DeepwoodElder.java index 2262b266e3..0acd737bac 100644 --- a/Mage.Sets/src/mage/cards/d/DeepwoodElder.java +++ b/Mage.Sets/src/mage/cards/d/DeepwoodElder.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -17,12 +16,12 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.TargetAdjustment; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; import mage.target.targetpointer.FixedTarget; /** @@ -44,7 +43,7 @@ public final class DeepwoodElder extends CardImpl { ability.addCost(new TapSourceCost()); ability.addCost(new DiscardCardCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/Demotion.java b/Mage.Sets/src/mage/cards/d/Demotion.java new file mode 100644 index 0000000000..c3634273b8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/Demotion.java @@ -0,0 +1,51 @@ + +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.combat.CantBlockActivateAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Ryan-Saklad + */ + +public final class Demotion extends CardImpl { + + public Demotion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature can't block, and its activated abilities can't be activated. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockActivateAttachedEffect())); + + } + + public Demotion(final Demotion card) { + super(card); + } + + @Override + public Demotion copy() { + return new Demotion(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/d/DeviousCoverUp.java b/Mage.Sets/src/mage/cards/d/DeviousCoverUp.java new file mode 100644 index 0000000000..3bc89c7350 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeviousCoverUp.java @@ -0,0 +1,83 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetSpell; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.SecondTargetPointer; + +/** + * + * @author TheElk801 + */ +public final class DeviousCoverUp extends CardImpl { + + public DeviousCoverUp(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + + // Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell()); + + // You may shuffle up to four target cards from your graveyard into your library. + this.getSpellAbility().addEffect(new DeviousCoverUpEffect().setTargetPointer(new SecondTargetPointer())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 4)); + } + + public DeviousCoverUp(final DeviousCoverUp card) { + super(card); + } + + @Override + public DeviousCoverUp copy() { + return new DeviousCoverUp(this); + } +} + +class DeviousCoverUpEffect extends OneShotEffect { + + public DeviousCoverUpEffect() { + super(Outcome.Benefit); + this.staticText = "You may shuffle up to four target cards " + + "from your graveyard into your library."; + } + + public DeviousCoverUpEffect(final DeviousCoverUpEffect effect) { + super(effect); + } + + @Override + public DeviousCoverUpEffect copy() { + return new DeviousCoverUpEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || !controller.chooseUse(outcome, "Shuffle the targeted cards into your library?", source, game)) { + return false; + } + Cards cards = new CardsImpl(); + for (UUID targetId : targetPointer.getTargets(game, source)) { + Card card = game.getCard(targetId); + if (card != null) { + cards.add(card); + } + } + controller.putCardsOnTopOfLibrary(cards, game, source, false); + controller.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DevkarinDissident.java b/Mage.Sets/src/mage/cards/d/DevkarinDissident.java new file mode 100644 index 0000000000..95b4baaba7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DevkarinDissident.java @@ -0,0 +1,45 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class DevkarinDissident extends CardImpl { + + public DevkarinDissident(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {4}{G}: Devkarin Dissident gets +2/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new ManaCostsImpl("{4}{G}") + )); + } + + public DevkarinDissident(final DevkarinDissident card) { + super(card); + } + + @Override + public DevkarinDissident copy() { + return new DevkarinDissident(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DimirInformant.java b/Mage.Sets/src/mage/cards/d/DimirInformant.java new file mode 100644 index 0000000000..6dce338041 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DimirInformant.java @@ -0,0 +1,38 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class DimirInformant extends CardImpl { + + public DimirInformant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // When Dimir Informant enters the battlefield, surveil 2. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SurveilEffect(2), false)); + } + + public DimirInformant(final DimirInformant card) { + super(card); + } + + @Override + public DimirInformant copy() { + return new DimirInformant(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DimirLocket.java b/Mage.Sets/src/mage/cards/d/DimirLocket.java new file mode 100644 index 0000000000..8c6cdd347a --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DimirLocket.java @@ -0,0 +1,47 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class DimirLocket extends CardImpl { + + public DimirLocket(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // {T}: Add {U} or {B}. + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + + // {U/B}{U/B}{U/B}{U/B}, {T}, Sacrifice Dimir Locket: Draw two cards. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(2), + new ManaCostsImpl("{U/B}{U/B}{U/B}{U/B}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public DimirLocket(final DimirLocket card) { + super(card); + } + + @Override + public DimirLocket copy() { + return new DimirLocket(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DimirSpybug.java b/Mage.Sets/src/mage/cards/d/DimirSpybug.java new file mode 100644 index 0000000000..3897226b2b --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DimirSpybug.java @@ -0,0 +1,82 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author TheElk801 + */ +public final class DimirSpybug extends CardImpl { + + public DimirSpybug(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}"); + + this.subtype.add(SubType.INSECT); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Menace + this.addAbility(new MenaceAbility()); + + // Whenever you surveil, put a +1/+1 counter on Dimir Spybug. + this.addAbility(new DimirSpybugTriggeredAbility()); + } + + public DimirSpybug(final DimirSpybug card) { + super(card); + } + + @Override + public DimirSpybug copy() { + return new DimirSpybug(this); + } +} + +class DimirSpybugTriggeredAbility extends TriggeredAbilityImpl { + + public DimirSpybugTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect( + CounterType.P1P1.createInstance() + ), false); + } + + public DimirSpybugTriggeredAbility(final DimirSpybugTriggeredAbility ability) { + super(ability); + } + + @Override + public DimirSpybugTriggeredAbility copy() { + return new DimirSpybugTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEILED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()); + } + + @Override + public String getRule() { + return "Whenever you surveil, put a +1/+1 counter on {this}."; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DirectCurrent.java b/Mage.Sets/src/mage/cards/d/DirectCurrent.java new file mode 100644 index 0000000000..c79956efb8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DirectCurrent.java @@ -0,0 +1,37 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class DirectCurrent extends CardImpl { + + public DirectCurrent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); + + // Direct Current deals 2 damage to any target. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + + } + + public DirectCurrent(final DirectCurrent card) { + super(card); + } + + @Override + public DirectCurrent copy() { + return new DirectCurrent(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DiscoveryDispersal.java b/Mage.Sets/src/mage/cards/d/DiscoveryDispersal.java new file mode 100644 index 0000000000..6e57cee665 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DiscoveryDispersal.java @@ -0,0 +1,126 @@ +package mage.cards.d; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.filter.predicate.permanent.PermanentIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class DiscoveryDispersal extends SplitCard { + + public DiscoveryDispersal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.INSTANT}, "{1}{U/B}", "{3}{U}{B}", SpellAbilityType.SPLIT); + + // Discovery + // Surveil 2, then draw a card. + this.getLeftHalfCard().getSpellAbility().addEffect( + new SurveilEffect(2).setText("Surveil 2,") + ); + this.getLeftHalfCard().getSpellAbility().addEffect( + new DrawCardSourceControllerEffect(1 + ).setText("then draw a card. <i>(To surveil 2, " + + "look at the top two cards of your library, " + + "then put any number of them into your graveyard " + + "and the rest on top of your library " + + "in any order.)</i>") + ); + + // Dispersal + // Each opponent returns a nonland permanent they control with the highest converted mana cost among permanents they control to its owner’s hand, then discards a card. + this.getRightHalfCard().getSpellAbility().addEffect(new DispersalEffect()); + } + + public DiscoveryDispersal(final DiscoveryDispersal card) { + super(card); + } + + @Override + public DiscoveryDispersal copy() { + return new DiscoveryDispersal(this); + } +} + +class DispersalEffect extends OneShotEffect { + + public DispersalEffect() { + super(Outcome.Benefit); + this.staticText = "Each opponent returns a nonland permanent " + + "they control with the highest converted mana cost " + + "among permanents they control to its owner’s hand, " + + "then discards a card."; + } + + public DispersalEffect(final DispersalEffect effect) { + super(effect); + } + + @Override + public DispersalEffect copy() { + return new DispersalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Set<PermanentIdPredicate> permsToReturn = new HashSet(); + for (UUID opponentId : game.getOpponents(player.getId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent == null) { + continue; + } + int highestCMC = 0; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { + if (permanent != null && !permanent.isLand()) { + highestCMC = Math.max(highestCMC, permanent.getConvertedManaCost()); + } + } + FilterPermanent filter = new FilterNonlandPermanent("permanent you control with converted mana cost " + highestCMC); + filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, highestCMC)); + filter.add(new ControllerIdPredicate(opponentId)); + Target target = new TargetPermanent(1, 1, filter, true); + if (opponent.choose(outcome, target, source.getSourceId(), game)) { + if (target.getFirstTarget() == null) { + continue; + } + permsToReturn.add(new PermanentIdPredicate(target.getFirstTarget())); + } + } + FilterPermanent filter = new FilterPermanent(); + filter.add(Predicates.or(permsToReturn)); + new ReturnToHandFromBattlefieldAllEffect(filter).apply(game, source); + new DiscardEachPlayerEffect( + new StaticValue(1), false, TargetController.OPPONENT + ).apply(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DisinformationCampaign.java b/Mage.Sets/src/mage/cards/d/DisinformationCampaign.java new file mode 100644 index 0000000000..ab9a61804f --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DisinformationCampaign.java @@ -0,0 +1,80 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author TheElk801 + */ +public final class DisinformationCampaign extends CardImpl { + + public DisinformationCampaign(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{B}"); + + // When Disinformation Campaign enters the battlefield, you draw a card and each opponent discards a card. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(1).setText("you draw a card") + ); + ability.addEffect(new DiscardEachPlayerEffect( + new StaticValue(1), false, TargetController.OPPONENT + ).setText("and each opponent discards a card")); + this.addAbility(ability); + + // Whenever you surveil, return Disinformation Campaign to its owner's hand. + this.addAbility(new DisinformationCampaignTriggeredAbility()); + } + + public DisinformationCampaign(final DisinformationCampaign card) { + super(card); + } + + @Override + public DisinformationCampaign copy() { + return new DisinformationCampaign(this); + } +} + +class DisinformationCampaignTriggeredAbility extends TriggeredAbilityImpl { + + public DisinformationCampaignTriggeredAbility() { + super(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), false); + } + + public DisinformationCampaignTriggeredAbility(final DisinformationCampaignTriggeredAbility ability) { + super(ability); + } + + @Override + public DisinformationCampaignTriggeredAbility copy() { + return new DisinformationCampaignTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEILED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()); + } + + @Override + public String getRule() { + return "Whenever you surveil, return {this} to its owner's hand."; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DistrictGuide.java b/Mage.Sets/src/mage/cards/d/DistrictGuide.java new file mode 100644 index 0000000000..aea9713b75 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DistrictGuide.java @@ -0,0 +1,61 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class DistrictGuide extends CardImpl { + + private static final FilterCard filter + = new FilterCard("basic land card or Gate card"); + + static { + filter.add(Predicates.or( + Predicates.and( + new CardTypePredicate(CardType.LAND), + new SupertypePredicate(SuperType.BASIC) + ), new SubtypePredicate(SubType.GATE) + )); + } + + public DistrictGuide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When District Guide enters the battlefield, you may search your library for a basic land card or Gate card, reveal it, put it into your hand, then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SearchLibraryPutInHandEffect( + new TargetCardInLibrary(filter), true, true + ), true + )); + } + + public DistrictGuide(final DistrictGuide card) { + super(card); + } + + @Override + public DistrictGuide copy() { + return new DistrictGuide(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DivineVisitation.java b/Mage.Sets/src/mage/cards/d/DivineVisitation.java new file mode 100644 index 0000000000..f7914a8e97 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DivineVisitation.java @@ -0,0 +1,85 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.CopyEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import mage.game.permanent.token.AngelVigilanceToken; + +/** + * + * @author TheElk801 + */ +public final class DivineVisitation extends CardImpl { + + public DivineVisitation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}"); + + // TODO: This implementation is not entirely correct, see https://twitter.com/EliShffrn/status/1042145606582591490 + // If one or more creature tokens would be created under your control, that many 4/4 white Angel creature tokens with flying and vigilance are created instead. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new DivineVisitationEffect() + )); + } + + public DivineVisitation(final DivineVisitation card) { + super(card); + } + + @Override + public DivineVisitation copy() { + return new DivineVisitation(this); + } +} + +class DivineVisitationEffect extends ReplacementEffectImpl { + + public DivineVisitationEffect() { + super(Duration.WhileOnBattlefield, Outcome.Copy, false); + staticText = "If one or more creature tokens would be created " + + "under your control, that many 4/4 white Angel creature " + + "tokens with flying and vigilance are created instead."; + } + + public DivineVisitationEffect(DivineVisitationEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent perm = ((EntersTheBattlefieldEvent) event).getTarget(); + return perm != null + && perm.isCreature() + && perm instanceof PermanentToken + && perm.isControlledBy(source.getControllerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + game.addEffect(new CopyEffect(Duration.Custom, new AngelVigilanceToken(), event.getTargetId()), source); + return false; + } + + @Override + public DivineVisitationEffect copy() { + return new DivineVisitationEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/d/DomriRade.java b/Mage.Sets/src/mage/cards/d/DomriRade.java index 43de8f9a5a..b561ebf554 100644 --- a/Mage.Sets/src/mage/cards/d/DomriRade.java +++ b/Mage.Sets/src/mage/cards/d/DomriRade.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -37,7 +37,7 @@ public final class DomriRade extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DOMRI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Look at the top card of your library. If it's a creature card, you may reveal it and put it into your hand. this.addAbility(new LoyaltyAbility(new DomriRadeEffect1(), 1)); diff --git a/Mage.Sets/src/mage/cards/d/DoomCannon.java b/Mage.Sets/src/mage/cards/d/DoomCannon.java index 7fb9aada5c..3414f1ebe7 100644 --- a/Mage.Sets/src/mage/cards/d/DoomCannon.java +++ b/Mage.Sets/src/mage/cards/d/DoomCannon.java @@ -70,7 +70,7 @@ class DoomCannonFilter extends FilterControlledCreaturePermanent { @Override public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (super.match(permanent, sourceId, playerId, game)) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(sourceId, game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(sourceId, game); if (subType != null && permanent.hasSubtype(subType, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/d/DoomWhisperer.java b/Mage.Sets/src/mage/cards/d/DoomWhisperer.java new file mode 100644 index 0000000000..cb8176b27b --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DoomWhisperer.java @@ -0,0 +1,49 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class DoomWhisperer extends CardImpl { + + public DoomWhisperer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add(SubType.NIGHTMARE); + this.subtype.add(SubType.DEMON); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Pay 2 life: Surveil 2. + this.addAbility(new SimpleActivatedAbility( + new SurveilEffect(2), new PayLifeCost(2) + )); + } + + public DoomWhisperer(final DoomWhisperer card) { + super(card); + } + + @Override + public DoomWhisperer copy() { + return new DoomWhisperer(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java b/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java index 5f196a1205..b7d72e91a1 100644 --- a/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java +++ b/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java @@ -71,7 +71,7 @@ class AddCounterAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(getSourceId(), game); if (subType != null) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null diff --git a/Mage.Sets/src/mage/cards/d/DouserOfLights.java b/Mage.Sets/src/mage/cards/d/DouserOfLights.java new file mode 100644 index 0000000000..cc4b449eb5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DouserOfLights.java @@ -0,0 +1,32 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class DouserOfLights extends CardImpl { + + public DouserOfLights(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); + + this.subtype.add(SubType.HORROR); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + } + + public DouserOfLights(final DouserOfLights card) { + super(card); + } + + @Override + public DouserOfLights copy() { + return new DouserOfLights(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DovinBaan.java b/Mage.Sets/src/mage/cards/d/DovinBaan.java index 2ce9f26775..670251eca7 100644 --- a/Mage.Sets/src/mage/cards/d/DovinBaan.java +++ b/Mage.Sets/src/mage/cards/d/DovinBaan.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -35,7 +35,7 @@ public final class DovinBaan extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DOVIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Until your next turn, up to one target creature gets -3/-0 and its activated abilities can't be activated. Effect effect = new BoostTargetEffect(-3, 0, Duration.UntilYourNextTurn); diff --git a/Mage.Sets/src/mage/cards/d/DreamEater.java b/Mage.Sets/src/mage/cards/d/DreamEater.java new file mode 100644 index 0000000000..9c80945297 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DreamEater.java @@ -0,0 +1,129 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.SendOptionUsedEventEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class DreamEater extends CardImpl { + + public DreamEater(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); + + this.subtype.add(SubType.NIGHTMARE); + this.subtype.add(SubType.SPHINX); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Dream Eater enters the battlefield, surveil 4. When you do, you may return target nonland permanent an opponent controls to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility( + new SurveilEffect(4) + ); + ability.addEffect(new DreamEaterCreateReflexiveTriggerEffect()); + this.addAbility(ability); + } + + public DreamEater(final DreamEater card) { + super(card); + } + + @Override + public DreamEater copy() { + return new DreamEater(this); + } +} + +class DreamEaterCreateReflexiveTriggerEffect extends OneShotEffect { + + public DreamEaterCreateReflexiveTriggerEffect() { + super(Outcome.Benefit); + this.staticText = "When you do, you may return target " + + "nonland permanent an opponent controls to its owner's hand."; + } + + public DreamEaterCreateReflexiveTriggerEffect(final DreamEaterCreateReflexiveTriggerEffect effect) { + super(effect); + } + + @Override + public DreamEaterCreateReflexiveTriggerEffect copy() { + return new DreamEaterCreateReflexiveTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.addDelayedTriggeredAbility(new DreamEaterReflexiveTriggeredAbility(), source); + return new SendOptionUsedEventEffect().apply(game, source); + } +} + +class DreamEaterReflexiveTriggeredAbility extends DelayedTriggeredAbility { + + private static final FilterPermanent filter + = new FilterNonlandPermanent("nonland permanent an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public DreamEaterReflexiveTriggeredAbility() { + super(new ReturnToHandTargetEffect()); + this.addTarget(new TargetPermanent(filter)); + this.optional = true; + } + + public DreamEaterReflexiveTriggeredAbility(final DreamEaterReflexiveTriggeredAbility ability) { + super(ability); + } + + @Override + public DreamEaterReflexiveTriggeredAbility copy() { + return new DreamEaterReflexiveTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.OPTION_USED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && event.getSourceId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "When you surveil 4, you may return target nonland permanent " + + "an opponent controls to its owner's hand."; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DrownedSecrets.java b/Mage.Sets/src/mage/cards/d/DrownedSecrets.java new file mode 100644 index 0000000000..50c5e63527 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DrownedSecrets.java @@ -0,0 +1,46 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author TheElk801 + */ +public final class DrownedSecrets extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a blue spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public DrownedSecrets(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + + // Whenever you cast a blue spell, target player puts the top two cards if their library into their graveyard. + Ability ability = new SpellCastControllerTriggeredAbility( + new PutLibraryIntoGraveTargetEffect(2), filter, false + ); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DrownedSecrets(final DrownedSecrets card) { + super(card); + } + + @Override + public DrownedSecrets copy() { + return new DrownedSecrets(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/ElectrostaticField.java b/Mage.Sets/src/mage/cards/e/ElectrostaticField.java new file mode 100644 index 0000000000..39347660ea --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ElectrostaticField.java @@ -0,0 +1,46 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class ElectrostaticField extends CardImpl { + + public ElectrostaticField(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.WALL); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // When you cast an instant or sorcery spell, Electrostatic Field deals 1 damage to each opponent. + this.addAbility(new SpellCastControllerTriggeredAbility( + new DamagePlayersEffect(1, TargetController.OPPONENT), + StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false + )); + } + + public ElectrostaticField(final ElectrostaticField card) { + super(card); + } + + @Override + public ElectrostaticField copy() { + return new ElectrostaticField(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/ElspethKnightErrant.java b/Mage.Sets/src/mage/cards/e/ElspethKnightErrant.java index abc7288aa0..b433e83cf2 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethKnightErrant.java +++ b/Mage.Sets/src/mage/cards/e/ElspethKnightErrant.java @@ -3,7 +3,7 @@ package mage.cards.e; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; import mage.abilities.effects.common.CreateTokenEffect; @@ -19,7 +19,6 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.game.command.emblems.ElspethKnightErrantEmblem; import mage.game.permanent.token.SoldierToken; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; import mage.target.common.TargetCreaturePermanent; @@ -34,7 +33,7 @@ public final class ElspethKnightErrant extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ELSPETH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Create a 1/1 white Soldier creature token. Token token = new SoldierToken(); diff --git a/Mage.Sets/src/mage/cards/e/ElspethSunsChampion.java b/Mage.Sets/src/mage/cards/e/ElspethSunsChampion.java index 3bb4c406bc..f051edf298 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethSunsChampion.java +++ b/Mage.Sets/src/mage/cards/e/ElspethSunsChampion.java @@ -3,7 +3,7 @@ package mage.cards.e; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -35,7 +35,7 @@ public final class ElspethSunsChampion extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ELSPETH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Create three 1/1 white Soldier creature tokens. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), 1)); diff --git a/Mage.Sets/src/mage/cards/e/ElspethTirel.java b/Mage.Sets/src/mage/cards/e/ElspethTirel.java index 83d10e977f..ed76463bb3 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethTirel.java +++ b/Mage.Sets/src/mage/cards/e/ElspethTirel.java @@ -4,7 +4,7 @@ package mage.cards.e; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; @@ -31,7 +31,7 @@ public final class ElspethTirel extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ELSPETH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); this.addAbility(new LoyaltyAbility(new ElspethTirelFirstEffect(), 2)); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), -2)); diff --git a/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java b/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java index 61fddd83fe..f3ad6f7e24 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java +++ b/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java @@ -70,7 +70,7 @@ class ElvishRejuvenatorEffect extends OneShotEffect { cards.addAll(controller.getLibrary().getTopCards(game, 5)); if (!cards.isEmpty()) { TargetCard target = new TargetCard( - Zone.LIBRARY, + 0, 1, Zone.LIBRARY, new FilterLandCard("land card to put on the battlefield") ); if (controller.choose(Outcome.PutCardInPlay, cards, target, game)) { diff --git a/Mage.Sets/src/mage/cards/e/EmberwildeCaliph.java b/Mage.Sets/src/mage/cards/e/EmberwildeCaliph.java new file mode 100644 index 0000000000..8b2091a5a8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EmberwildeCaliph.java @@ -0,0 +1,125 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.AttacksEachCombatStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class EmberwildeCaliph extends CardImpl { + + public EmberwildeCaliph(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}"); + + this.subtype.add(SubType.DJINN); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Emberwilde Caliph attacks each combat if able. + this.addAbility(new AttacksEachCombatStaticAbility()); + + // Whenever Emberwilde Caliph deals damage, you lose that much life. + this.addAbility(new EmberwildeCaliphTriggeredAbility()); + } + + public EmberwildeCaliph(final EmberwildeCaliph card) { + super(card); + } + + @Override + public EmberwildeCaliph copy() { + return new EmberwildeCaliph(this); + } +} + +class EmberwildeCaliphTriggeredAbility extends TriggeredAbilityImpl { + + public EmberwildeCaliphTriggeredAbility() { + super(Zone.BATTLEFIELD, new EmberwildeCaliphEffect(), false); + } + + public EmberwildeCaliphTriggeredAbility(final EmberwildeCaliphTriggeredAbility ability) { + super(ability); + } + + @Override + public EmberwildeCaliphTriggeredAbility copy() { + return new EmberwildeCaliphTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_CREATURE + || event.getType() == GameEvent.EventType.DAMAGED_PLAYER + || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals damage, you lose that much life."; + } +} + +class EmberwildeCaliphEffect extends OneShotEffect { + + public EmberwildeCaliphEffect() { + super(Outcome.LoseLife); + } + + public EmberwildeCaliphEffect(final EmberwildeCaliphEffect effect) { + super(effect); + } + + @Override + public EmberwildeCaliphEffect copy() { + return new EmberwildeCaliphEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + controller.loseLife(amount, game, false); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/e/EmmaraSoulOfTheAccord.java b/Mage.Sets/src/mage/cards/e/EmmaraSoulOfTheAccord.java new file mode 100644 index 0000000000..e427b623eb --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EmmaraSoulOfTheAccord.java @@ -0,0 +1,43 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class EmmaraSoulOfTheAccord extends CardImpl { + + public EmmaraSoulOfTheAccord(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Emmara, Soul of the Accord becomes tapped, create a 1/1 white Soldier creature token with lifelink. + this.addAbility(new BecomesTappedSourceTriggeredAbility( + new CreateTokenEffect(new SoldierLifelinkToken()) + )); + } + + public EmmaraSoulOfTheAccord(final EmmaraSoulOfTheAccord card) { + super(card); + } + + @Override + public EmmaraSoulOfTheAccord copy() { + return new EmmaraSoulOfTheAccord(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/EngineeredExplosives.java b/Mage.Sets/src/mage/cards/e/EngineeredExplosives.java index def0376ffc..936d838767 100644 --- a/Mage.Sets/src/mage/cards/e/EngineeredExplosives.java +++ b/Mage.Sets/src/mage/cards/e/EngineeredExplosives.java @@ -70,7 +70,7 @@ class EngineeredExplosivesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { MageObject engineeredExplosives = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if(engineeredExplosives != null && engineeredExplosives instanceof Permanent){ + if(engineeredExplosives instanceof Permanent){ int count = ((Permanent)engineeredExplosives).getCounters(game).getCount(CounterType.CHARGE); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if(permanent.getConvertedManaCost() == count){ diff --git a/Mage.Sets/src/mage/cards/e/EnhancedSurveillance.java b/Mage.Sets/src/mage/cards/e/EnhancedSurveillance.java new file mode 100644 index 0000000000..2e0b263015 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EnhancedSurveillance.java @@ -0,0 +1,113 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class EnhancedSurveillance extends CardImpl { + + public EnhancedSurveillance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + + // You may look at an additional two cards each time you surveil. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new EnhancedSurveillanceReplacementEffect() + )); + + // Exile Enhanced Surveillance: Shuffle your graveyard into your library. + this.addAbility(new SimpleActivatedAbility( + new EnhancedSurveillanceShuffleEffect(), new ExileSourceCost() + )); + } + + public EnhancedSurveillance(final EnhancedSurveillance card) { + super(card); + } + + @Override + public EnhancedSurveillance copy() { + return new EnhancedSurveillance(this); + } +} + +class EnhancedSurveillanceReplacementEffect extends ReplacementEffectImpl { + + public EnhancedSurveillanceReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "You may look at an additional " + + "two cards each time you surveil."; + } + + public EnhancedSurveillanceReplacementEffect(final EnhancedSurveillanceReplacementEffect effect) { + super(effect); + } + + @Override + public EnhancedSurveillanceReplacementEffect copy() { + return new EnhancedSurveillanceReplacementEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEIL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(source.getControllerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(event.getAmount() + 2); + return false; + } +} + +class EnhancedSurveillanceShuffleEffect extends OneShotEffect { + + public EnhancedSurveillanceShuffleEffect() { + super(Outcome.Neutral); + this.staticText = "Shuffle your graveyard into your library"; + } + + public EnhancedSurveillanceShuffleEffect(final EnhancedSurveillanceShuffleEffect effect) { + super(effect); + } + + @Override + public EnhancedSurveillanceShuffleEffect copy() { + return new EnhancedSurveillanceShuffleEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (Card card : controller.getGraveyard().getCards(game)) { + controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); + } + controller.shuffleLibrary(source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java b/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java index 01c303b520..8f149ba496 100644 --- a/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java +++ b/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java @@ -73,6 +73,6 @@ enum HadAnotherCreatureEnterTheBattlefieldCondition implements Condition { PermanentsEnteredBattlefieldWatcher watcher = (PermanentsEnteredBattlefieldWatcher) game.getState().getWatchers().get(PermanentsEnteredBattlefieldWatcher.class.getSimpleName()); return sourcePermanent != null && watcher != null - && watcher.AnotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(sourcePermanent, game); + && watcher.anotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(sourcePermanent, game); } } diff --git a/Mage.Sets/src/mage/cards/e/ErraticCyclops.java b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java new file mode 100644 index 0000000000..c947544e2d --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java @@ -0,0 +1,89 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; + +/** + * + * @author TheElk801 + */ +public final class ErraticCyclops extends CardImpl { + + public ErraticCyclops(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.CYCLOPS); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(0); + this.toughness = new MageInt(8); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever you cast an instant or sorcery spell, Erratic Cyclops gets +X/+0 until end of turn, where X is that spell's converted mana cost. + this.addAbility(new ErraticCyclopsTriggeredAbility()); + } + + public ErraticCyclops(final ErraticCyclops card) { + super(card); + } + + @Override + public ErraticCyclops copy() { + return new ErraticCyclops(this); + } +} + +class ErraticCyclopsTriggeredAbility extends TriggeredAbilityImpl { + + public ErraticCyclopsTriggeredAbility() { + super(Zone.BATTLEFIELD, null, false); + } + + public ErraticCyclopsTriggeredAbility(final ErraticCyclopsTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.isControlledBy(controllerId) + && spell.isInstantOrSorcery()) { + this.getEffects().clear(); + this.addEffect(new BoostSourceEffect( + spell.getConvertedManaCost(), 0, Duration.EndOfTurn + )); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell, " + + "{this} gets +X/+0 until end of turn, " + + "where X is that spell's converted mana cost"; + } + + @Override + public ErraticCyclopsTriggeredAbility copy() { + return new ErraticCyclopsTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/ErstwhileTrooper.java b/Mage.Sets/src/mage/cards/e/ErstwhileTrooper.java new file mode 100644 index 0000000000..0714681883 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ErstwhileTrooper.java @@ -0,0 +1,58 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.target.common.TargetCardInHand; + +/** + * + * @author TheElk801 + */ +public final class ErstwhileTrooper extends CardImpl { + + public ErstwhileTrooper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Discard a creature card: Erstwhile Trooper gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn. + Ability ability = new LimitedTimesPerTurnActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect( + 2, 2, Duration.EndOfTurn + ).setText("{this} gets +2/+2"), + new DiscardTargetCost(new TargetCardInHand( + StaticFilters.FILTER_CARD_CREATURE_A + )) + ); + ability.addEffect(new GainAbilitySourceEffect( + TrampleAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains trample until end of turn")); + this.addAbility(ability); + } + + public ErstwhileTrooper(final ErstwhileTrooper card) { + super(card); + } + + @Override + public ErstwhileTrooper copy() { + return new ErstwhileTrooper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/EssenceFlux.java b/Mage.Sets/src/mage/cards/e/EssenceFlux.java index f2802fc6b1..8364d113e6 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceFlux.java +++ b/Mage.Sets/src/mage/cards/e/EssenceFlux.java @@ -77,7 +77,7 @@ class EssenceFluxEffect extends OneShotEffect { cardsToBattlefield.add(targetId); } else { Card card = game.getCard(targetId); - if (card != null && card instanceof MeldCard) { + if (card instanceof MeldCard) { MeldCard meldCard = (MeldCard) card; Card topCard = meldCard.getTopHalfCard(); Card bottomCard = meldCard.getBottomHalfCard(); diff --git a/Mage.Sets/src/mage/cards/e/EstridTheMasked.java b/Mage.Sets/src/mage/cards/e/EstridTheMasked.java index 485d0ea89a..9cc5c30fc4 100644 --- a/Mage.Sets/src/mage/cards/e/EstridTheMasked.java +++ b/Mage.Sets/src/mage/cards/e/EstridTheMasked.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; @@ -47,7 +47,7 @@ public final class EstridTheMasked extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ESTRID); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Untap each enchanted permanent you control. this.addAbility(new LoyaltyAbility(new UntapAllControllerEffect( diff --git a/Mage.Sets/src/mage/cards/e/EtrataTheSilencer.java b/Mage.Sets/src/mage/cards/e/EtrataTheSilencer.java new file mode 100644 index 0000000000..8d28bb9cca --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EtrataTheSilencer.java @@ -0,0 +1,157 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.filter.predicate.permanent.CounterPredicate; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class EtrataTheSilencer extends CardImpl { + + public EtrataTheSilencer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Etrata, the Silencer can't be blocked. + this.addAbility(new CantBeBlockedSourceAbility()); + + // Whenever Etrata deals combat damage to a player, exile target creature that player controls and put a hit counter on that card. That player loses the game if they own three or more exiled card with hit counters on them. Etrata's owner shuffles Etrata into their library. + this.addAbility(new EtrataTheSilencerTriggeredAbility()); + } + + public EtrataTheSilencer(final EtrataTheSilencer card) { + super(card); + } + + @Override + public EtrataTheSilencer copy() { + return new EtrataTheSilencer(this); + } +} + +class EtrataTheSilencerTriggeredAbility extends TriggeredAbilityImpl { + + public EtrataTheSilencerTriggeredAbility() { + super(Zone.BATTLEFIELD, new EtrataTheSilencerEffect()); + } + + public EtrataTheSilencerTriggeredAbility(final EtrataTheSilencerTriggeredAbility ability) { + super(ability); + } + + @Override + public EtrataTheSilencerTriggeredAbility copy() { + return new EtrataTheSilencerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + Player opponent = game.getPlayer(event.getPlayerId()); + if (opponent != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); + filter.add(new ControllerIdPredicate(opponent.getId())); + this.getTargets().clear(); + this.addTarget(new TargetCreaturePermanent(filter)); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, " + + "exile target creature that player controls " + + "and put a hit counter on that card. " + + "That player loses the game if they own three or more " + + "exiled cards with hit counters on them. " + + "{this}'s owner shuffles {this} into their library"; + } +} + +class EtrataTheSilencerEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(new CounterPredicate(CounterType.HIT)); + } + + public EtrataTheSilencerEffect() { + super(Outcome.Benefit); + } + + public EtrataTheSilencerEffect(final EtrataTheSilencerEffect effect) { + super(effect); + } + + @Override + public EtrataTheSilencerEffect copy() { + return new EtrataTheSilencerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature == null) { + return false; + } + Player controller = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(creature.getControllerId()); + if (controller == null || player == null) { + return false; + } + controller.moveCards(creature, Zone.EXILED, source, game); + Card card = game.getCard(source.getFirstTarget()); + if (card != null) { + card.addCounters(CounterType.HIT.createInstance(), source, game); + } + int cardsFound = 0; + for (Card exiledCard : game.getExile().getAllCards(game)) { + if (exiledCard.getCounters(game).getCount(CounterType.HIT) > 1 && exiledCard.getOwnerId().equals(player.getId())) { + cardsFound++; + } + } + if (cardsFound > 2) { + player.lost(game); + } + return new ShuffleIntoLibrarySourceEffect().apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/e/ExpansionExplosion.java b/Mage.Sets/src/mage/cards/e/ExpansionExplosion.java new file mode 100644 index 0000000000..88cd4ef9f9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ExpansionExplosion.java @@ -0,0 +1,92 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.filter.FilterSpell; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.TargetSpell; +import mage.target.common.TargetAnyTarget; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class ExpansionExplosion extends SplitCard { + + private static final FilterSpell filter = new FilterInstantOrSorcerySpell("instant or sorcery spell with converted mana cost 4 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 5)); + } + + public ExpansionExplosion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U/R}{U/R}", "{X}{U}{U}{R}{R}", SpellAbilityType.SPLIT); + + // Expansion + // Copy target instant or sorcery spell with converted mana cost 4 or less. You may choose new targets for the copy. + this.getLeftHalfCard().getSpellAbility().addEffect(new CopyTargetSpellEffect()); + this.getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filter)); + + // Explosion + // Explosion deals X damage to any target. Target player draws X cards. + this.getRightHalfCard().getSpellAbility().addEffect(new ExplosionEffect()); + this.getRightHalfCard().getSpellAbility().addTarget(new TargetAnyTarget()); + this.getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer()); + } + + public ExpansionExplosion(final ExpansionExplosion card) { + super(card); + } + + @Override + public ExpansionExplosion copy() { + return new ExpansionExplosion(this); + } +} + +class ExplosionEffect extends OneShotEffect { + + public ExplosionEffect() { + super(Outcome.Benefit); + this.staticText = "{this} deals X damage to any target. " + + "Target player draws X cards."; + } + + public ExplosionEffect(final ExplosionEffect effect) { + super(effect); + } + + @Override + public ExplosionEffect copy() { + return new ExplosionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int xValue = source.getManaCostsToPay().getX(); + Effect effect = new DamageTargetEffect(new StaticValue(xValue), true, "", true); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); + effect.apply(game, source); + Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget()); + if (player != null) { + player.drawCards(xValue, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/e/ExperimentalFrenzy.java b/Mage.Sets/src/mage/cards/e/ExperimentalFrenzy.java new file mode 100644 index 0000000000..50dcb6b5a4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ExperimentalFrenzy.java @@ -0,0 +1,133 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.DestroySourceEffect; +import mage.abilities.effects.common.continuous.PlayTheTopCardEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class ExperimentalFrenzy extends CardImpl { + + public ExperimentalFrenzy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + + // You may look at the top card of your library any time. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new ExperimentalFrenzyTopCardEffect() + )); + + // You may play the top card of your library. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new PlayTheTopCardEffect() + )); + + // You can't play cards from your hand. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new ExperimentalFrenzyRestrictionEffect() + )); + + // {3}{R}: Destroy Experimental Frenzy. + this.addAbility(new SimpleActivatedAbility( + new DestroySourceEffect(), new ManaCostsImpl("{3}{R}") + )); + } + + public ExperimentalFrenzy(final ExperimentalFrenzy card) { + super(card); + } + + @Override + public ExperimentalFrenzy copy() { + return new ExperimentalFrenzy(this); + } +} + +class ExperimentalFrenzyTopCardEffect extends ContinuousEffectImpl { + + public ExperimentalFrenzyTopCardEffect() { + super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + staticText = "You may look at the top card of your library any time."; + } + + public ExperimentalFrenzyTopCardEffect(final ExperimentalFrenzyTopCardEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return true; + } + Card topCard = controller.getLibrary().getFromTop(game); + if (topCard == null) { + return true; + } + MageObject obj = source.getSourceObject(game); + if (obj == null) { + return true; + } + controller.lookAtCards("Top card of " + obj.getIdName() + " controller's library", topCard, game); + return true; + } + + @Override + public ExperimentalFrenzyTopCardEffect copy() { + return new ExperimentalFrenzyTopCardEffect(this); + } +} + +class ExperimentalFrenzyRestrictionEffect extends ContinuousRuleModifyingEffectImpl { + + public ExperimentalFrenzyRestrictionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "You can't play cards from your hand"; + } + + public ExperimentalFrenzyRestrictionEffect(final ExperimentalFrenzyRestrictionEffect effect) { + super(effect); + } + + @Override + public ExperimentalFrenzyRestrictionEffect copy() { + return new ExperimentalFrenzyRestrictionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.PLAY_LAND + || event.getType() == GameEvent.EventType.CAST_SPELL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(source.getControllerId()) + && game.getState().getZone(event.getSourceId()) == Zone.HAND; + } +} diff --git a/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java b/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java index 841c4906ab..81603a49a8 100644 --- a/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java +++ b/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java @@ -71,6 +71,7 @@ class ExplosiveRevelationEffect extends OneShotEffect { toReveal.add(card); if (!card.isLand()) { nonLandCard = card; + break; } } // reveal cards diff --git a/Mage.Sets/src/mage/cards/f/FearlessHalberdier.java b/Mage.Sets/src/mage/cards/f/FearlessHalberdier.java new file mode 100644 index 0000000000..c066ad4cbb --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FearlessHalberdier.java @@ -0,0 +1,33 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class FearlessHalberdier extends CardImpl { + + public FearlessHalberdier(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + } + + public FearlessHalberdier(final FearlessHalberdier card) { + super(card); + } + + @Override + public FearlessHalberdier copy() { + return new FearlessHalberdier(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/FeldonsCane.java b/Mage.Sets/src/mage/cards/f/FeldonsCane.java index d343b48226..18ffbb30a5 100644 --- a/Mage.Sets/src/mage/cards/f/FeldonsCane.java +++ b/Mage.Sets/src/mage/cards/f/FeldonsCane.java @@ -45,7 +45,7 @@ class FeldonsCaneEffect extends OneShotEffect { FeldonsCaneEffect() { super(Outcome.Neutral); - this.staticText = "Shuffles your graveyard into your library"; + this.staticText = "Shuffle your graveyard into your library"; } FeldonsCaneEffect(final FeldonsCaneEffect effect) { diff --git a/Mage.Sets/src/mage/cards/f/FindFinality.java b/Mage.Sets/src/mage/cards/f/FindFinality.java new file mode 100644 index 0000000000..7ce296f017 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FindFinality.java @@ -0,0 +1,103 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class FindFinality extends SplitCard { + + private static final FilterCard filter + = new FilterCreatureCard("creature cards from your graveyard"); + + public FindFinality(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B/G}{B/G}", "{4}{B}{G}", SpellAbilityType.SPLIT); + + // Find + // Return up to two target creature cards from your graveyard to your hand. + this.getLeftHalfCard().getSpellAbility().addEffect( + new ReturnFromGraveyardToHandTargetEffect() + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCardInYourGraveyard(0, 2, filter) + ); + + // Finality + // You may put two +1/+1 counters on a creature you control. Then all creatures get -4/-4 until end of turn. + this.getRightHalfCard().getSpellAbility().addEffect( + new FinalityEffect() + ); + } + + public FindFinality(final FindFinality card) { + super(card); + } + + @Override + public FindFinality copy() { + return new FindFinality(this); + } +} + +class FinalityEffect extends OneShotEffect { + + public FinalityEffect() { + super(Outcome.Benefit); + this.staticText = "You may put two +1/+1 counters " + + "on a creature you control. " + + "Then all creatures get -4/-4 until end of turn."; + } + + public FinalityEffect(final FinalityEffect effect) { + super(effect); + } + + @Override + public FinalityEffect copy() { + return new FinalityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Target target = new TargetControlledCreaturePermanent(0, 1); + if (player.choose( + Outcome.BoostCreature, target, source.getSourceId(), game + )) { + Effect effect = new AddCountersTargetEffect( + CounterType.P1P1.createInstance(2) + ); + effect.setTargetPointer(new FixedTarget( + target.getFirstTarget(), game + )); + effect.apply(game, source); + } + game.addEffect(new BoostAllEffect(-4, -4, Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/f/FireUrchin.java b/Mage.Sets/src/mage/cards/f/FireUrchin.java new file mode 100644 index 0000000000..1dcb78b503 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FireUrchin.java @@ -0,0 +1,46 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class FireUrchin extends CardImpl { + + public FireUrchin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever you cast an instant or sorcery spell, Fire Urchin gets +1/+0 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility( + new BoostSourceEffect(1, 0, Duration.EndOfTurn), + StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false + )); + } + + public FireUrchin(final FireUrchin card) { + super(card); + } + + @Override + public FireUrchin copy() { + return new FireUrchin(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/FiremindsResearch.java b/Mage.Sets/src/mage/cards/f/FiremindsResearch.java new file mode 100644 index 0000000000..ac54bd979c --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FiremindsResearch.java @@ -0,0 +1,65 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class FiremindsResearch extends CardImpl { + + public FiremindsResearch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}"); + + // Whenever you cast an instant or sorcery spell, put a charge counter on Firemind's Research. + this.addAbility(new SpellCastControllerTriggeredAbility( + new AddCountersSourceEffect( + CounterType.CHARGE.createInstance() + ), new FilterInstantOrSorcerySpell(), false + )); + + // {1}{U}, Remove two charge counters from Firemind's Research: Draw a card. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), + new ManaCostsImpl("{1}{U}") + ); + ability.addCost(new RemoveCountersSourceCost( + CounterType.CHARGE.createInstance(2) + )); + this.addAbility(ability); + + // {1}{R}, Remove five charge counters from Firemind's Research: It deals 5 damage to any target. + ability = new SimpleActivatedAbility( + new DamageTargetEffect(5, "it"), + new ManaCostsImpl("{1}{R}") + ); + ability.addCost(new RemoveCountersSourceCost( + CounterType.CHARGE.createInstance(5) + )); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability); + } + + public FiremindsResearch(final FiremindsResearch card) { + super(card); + } + + @Override + public FiremindsResearch copy() { + return new FiremindsResearch(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java b/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java index 9c4dcf83fc..3d396bc564 100644 --- a/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java +++ b/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java @@ -87,7 +87,7 @@ class FiresongAndSunspeakerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object instanceof Spell) { + if (object instanceof Spell) { if (event.getTargetId().equals(this.getControllerId()) && object.getColor(game).contains(ObjectColor.WHITE) && (object.isInstant() diff --git a/Mage.Sets/src/mage/cards/f/FlightOfEquenauts.java b/Mage.Sets/src/mage/cards/f/FlightOfEquenauts.java new file mode 100644 index 0000000000..57c3e93547 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlightOfEquenauts.java @@ -0,0 +1,41 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class FlightOfEquenauts extends CardImpl { + + public FlightOfEquenauts(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public FlightOfEquenauts(final FlightOfEquenauts card) { + super(card); + } + + @Override + public FlightOfEquenauts copy() { + return new FlightOfEquenauts(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/FlowerFlourish.java b/Mage.Sets/src/mage/cards/f/FlowerFlourish.java new file mode 100644 index 0000000000..47df1408bc --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlowerFlourish.java @@ -0,0 +1,62 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class FlowerFlourish extends SplitCard { + + private static final FilterCard filter + = new FilterCard("basic Forest or Plains card"); + + static { + filter.add(new SupertypePredicate(SuperType.BASIC)); + filter.add(Predicates.or( + new SubtypePredicate(SubType.FOREST), + new SubtypePredicate(SubType.PLAINS) + )); + } + + public FlowerFlourish(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G/W}", "{4}{G}{W}", SpellAbilityType.SPLIT); + + // Flower + // Search your library for a basic Forest or Plains card, reveal it, put it into your hand, then shuffle your library. + this.getLeftHalfCard().getSpellAbility().addEffect( + new SearchLibraryPutInHandEffect( + new TargetCardInLibrary(filter), true, true + ) + ); + + // Flourish + // Creatures you control get +2/+2 until end of turn. + this.getRightHalfCard().getSpellAbility().addEffect( + new BoostControlledEffect(2, 2, Duration.EndOfTurn) + ); + } + + public FlowerFlourish(final FlowerFlourish card) { + super(card); + } + + @Override + public FlowerFlourish copy() { + return new FlowerFlourish(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java b/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java index 06678f2232..3f1471760d 100644 --- a/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java +++ b/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java @@ -151,7 +151,7 @@ class ForbiddenCryptPutIntoYourGraveyardReplacementEffect extends ReplacementEff Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent == null || !(permanent instanceof PermanentToken)) { + if (!(permanent instanceof PermanentToken)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/f/ForceProjection.java b/Mage.Sets/src/mage/cards/f/ForceProjection.java index a29ec11982..6770afe6c7 100644 --- a/Mage.Sets/src/mage/cards/f/ForceProjection.java +++ b/Mage.Sets/src/mage/cards/f/ForceProjection.java @@ -1,7 +1,6 @@ package mage.cards.f; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.TriggeredAbility; import mage.abilities.common.BecomesTargetTriggeredAbility; @@ -15,13 +14,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; -import mage.constants.Zone; import mage.filter.FilterSpell; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; /** @@ -32,7 +29,6 @@ public final class ForceProjection extends CardImpl { public ForceProjection(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{U}"); - // Create a token that is a copy of target creature you control except that it is an Illusion in addition to its other types and gains "When this creature becomes the target of a spell, sacrifice it." this.getSpellAbility().addEffect(new ForceProjectionEffect()); @@ -56,8 +52,8 @@ class ForceProjectionEffect extends OneShotEffect { public ForceProjectionEffect() { super(Outcome.Copy); - this.staticText = "Create a token that is a copy of target creature you control except that it is an Illusion " + - "in addition to its other types and gains \"When this creature becomes the target of a spell, sacrifice it.\""; + this.staticText = "Create a token that is a copy of target creature you control except that it is an Illusion " + + "in addition to its other types and gains \"When this creature becomes the target of a spell, sacrifice it.\""; } public ForceProjectionEffect(final ForceProjectionEffect effect) { diff --git a/Mage.Sets/src/mage/cards/f/ForsakenWastes.java b/Mage.Sets/src/mage/cards/f/ForsakenWastes.java index 0939aab170..6fb1308f39 100644 --- a/Mage.Sets/src/mage/cards/f/ForsakenWastes.java +++ b/Mage.Sets/src/mage/cards/f/ForsakenWastes.java @@ -73,7 +73,7 @@ class ForsakenWastesTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && event.getTargetId().equals(this.getSourceId())&& eventSourceObject instanceof Spell ) { + if (event.getTargetId().equals(this.getSourceId()) && eventSourceObject instanceof Spell) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/f/FreshFacedRecruit.java b/Mage.Sets/src/mage/cards/f/FreshFacedRecruit.java new file mode 100644 index 0000000000..429a6d77e0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FreshFacedRecruit.java @@ -0,0 +1,53 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class FreshFacedRecruit extends CardImpl { + + public FreshFacedRecruit(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R/W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // As long as it's your turn, Fresh-Faced Recruit has first strike. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + FirstStrikeAbility.getInstance(), + Duration.WhileOnBattlefield + ), MyTurnCondition.instance, + "As long as it's your turn, " + + "{this} has first strike." + ) + )); + } + + public FreshFacedRecruit(final FreshFacedRecruit card) { + super(card); + } + + @Override + public FreshFacedRecruit copy() { + return new FreshFacedRecruit(this); + } +} diff --git a/Mage.Sets/src/mage/cards/f/FreyaliseLlanowarsFury.java b/Mage.Sets/src/mage/cards/f/FreyaliseLlanowarsFury.java index 068d053d12..63b81378fc 100644 --- a/Mage.Sets/src/mage/cards/f/FreyaliseLlanowarsFury.java +++ b/Mage.Sets/src/mage/cards/f/FreyaliseLlanowarsFury.java @@ -4,7 +4,7 @@ package mage.cards.f; import mage.ObjectColor; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -39,7 +39,7 @@ public final class FreyaliseLlanowarsFury extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.FREYALISE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Create a 1/1 green Elf Druid creature token with "{T}: Add {G}." this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FreyaliseLlanowarsFuryToken()), 2)); diff --git a/Mage.Sets/src/mage/cards/g/GOTOJAIL.java b/Mage.Sets/src/mage/cards/g/GOTOJAIL.java index bd29803529..a7977281ff 100644 --- a/Mage.Sets/src/mage/cards/g/GOTOJAIL.java +++ b/Mage.Sets/src/mage/cards/g/GOTOJAIL.java @@ -150,7 +150,7 @@ class GoToJailUpkeepEffect extends OneShotEffect { Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); - if (sourceObject != null && sourceObject instanceof Permanent && permanent != null) { + if (sourceObject instanceof Permanent && permanent != null) { UUID opponentId = (UUID) game.getState().getValue(sourceObject.getId().toString() + ChooseOpponentEffect.VALUE_KEY); Player opponent = game.getPlayer(opponentId); diff --git a/Mage.Sets/src/mage/cards/g/GarrisonSergeant.java b/Mage.Sets/src/mage/cards/g/GarrisonSergeant.java new file mode 100644 index 0000000000..5a2c7738f1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GarrisonSergeant.java @@ -0,0 +1,61 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author TheElk801 + */ +public final class GarrisonSergeant extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(new SubtypePredicate(SubType.GATE)); + } + + public GarrisonSergeant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{W}"); + + this.subtype.add(SubType.VIASHINO); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Garrison Sergeant has double strike as long as you control a Gate. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + DoubleStrikeAbility.getInstance(), + Duration.WhileOnBattlefield + ), new PermanentsOnTheBattlefieldCondition(filter), + "{this} has double strike as long as you control a Gate." + ) + )); + } + + public GarrisonSergeant(final GarrisonSergeant card) { + super(card); + } + + @Override + public GarrisonSergeant copy() { + return new GarrisonSergeant(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GarrukApexPredator.java b/Mage.Sets/src/mage/cards/g/GarrukApexPredator.java index a3e536d660..58e8d5284b 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukApexPredator.java +++ b/Mage.Sets/src/mage/cards/g/GarrukApexPredator.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -43,7 +43,7 @@ public final class GarrukApexPredator extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Destroy another target planeswalker. LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java index d206045a73..501ee35462 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java +++ b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.ObjectColor; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; @@ -35,7 +35,7 @@ public final class GarrukCallerOfBeasts extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Reveal the top 5 cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("creature cards"), Zone.LIBRARY), 1)); diff --git a/Mage.Sets/src/mage/cards/g/GarrukPrimalHunter.java b/Mage.Sets/src/mage/cards/g/GarrukPrimalHunter.java index 7b3409d937..680b42dc5c 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukPrimalHunter.java +++ b/Mage.Sets/src/mage/cards/g/GarrukPrimalHunter.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -36,7 +36,7 @@ public final class GarrukPrimalHunter extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Create a 3/3 green Beast creature token. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), 1)); diff --git a/Mage.Sets/src/mage/cards/g/GarrukRelentless.java b/Mage.Sets/src/mage/cards/g/GarrukRelentless.java index 3041ebace1..53c06b3518 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukRelentless.java +++ b/Mage.Sets/src/mage/cards/g/GarrukRelentless.java @@ -1,48 +1,44 @@ package mage.cards.g; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.SuperType; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfToken; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** * @author nantuko */ public final class GarrukRelentless extends CardImpl { public GarrukRelentless(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); this.transformable = true; this.secondSideCardClazz = GarrukTheVeilCursed.class; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // When Garruk Relentless has two or fewer loyalty counters on him, transform him. this.addAbility(new TransformAbility()); - this.addAbility(new GarrukRelentlessTriggeredAbility()); + this.addAbility(new GarrukRelentlessStateTrigger()); // 0: Garruk Relentless deals 3 damage to target creature. That creature deals damage equal to its power to him LoyaltyAbility ability1 = new LoyaltyAbility(new GarrukRelentlessDamageEffect(), 0); @@ -64,40 +60,30 @@ public final class GarrukRelentless extends CardImpl { } } -class GarrukRelentlessTriggeredAbility extends TriggeredAbilityImpl { +class GarrukRelentlessStateTrigger extends StateTriggeredAbility { - public GarrukRelentlessTriggeredAbility() { - super(Zone.BATTLEFIELD, new TransformSourceEffect(true), false); + public GarrukRelentlessStateTrigger() { + super(Zone.BATTLEFIELD, new TransformSourceEffect(true)); } - public GarrukRelentlessTriggeredAbility(GarrukRelentlessTriggeredAbility ability) { + public GarrukRelentlessStateTrigger(final GarrukRelentlessStateTrigger ability) { super(ability); } @Override - public GarrukRelentlessTriggeredAbility copy() { - return new GarrukRelentlessTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DAMAGED_PLANESWALKER; + public GarrukRelentlessStateTrigger copy() { + return new GarrukRelentlessStateTrigger(this); } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getTargetId().equals(sourceId)) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null && !permanent.isTransformed() && permanent.getCounters(game).getCount(CounterType.LOYALTY) <= 2) { - return true; - } - } - return false; + Permanent permanent = game.getPermanent(getSourceId()); + return permanent != null && permanent.getCounters(game).getCount(CounterType.LOYALTY) < 3; } @Override public String getRule() { - return "When Garruk Relentless has two or fewer loyalty counters on him, transform him."; + return "When {this} has two or fewer loyalty counters on him, transform him."; } } @@ -105,7 +91,7 @@ class GarrukRelentlessDamageEffect extends OneShotEffect { public GarrukRelentlessDamageEffect() { super(Outcome.Damage); - staticText = "Garruk Relentless deals 3 damage to target creature. That creature deals damage equal to its power to him"; + staticText = "{this} deals 3 damage to target creature. That creature deals damage equal to its power to him"; } public GarrukRelentlessDamageEffect(GarrukRelentlessDamageEffect effect) { diff --git a/Mage.Sets/src/mage/cards/g/GarrukWildspeaker.java b/Mage.Sets/src/mage/cards/g/GarrukWildspeaker.java index ed33dfd677..ea38f29d9e 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukWildspeaker.java +++ b/Mage.Sets/src/mage/cards/g/GarrukWildspeaker.java @@ -3,7 +3,7 @@ package mage.cards.g; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; import mage.abilities.effects.common.CreateTokenEffect; @@ -34,7 +34,7 @@ public final class GarrukWildspeaker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GARRUK); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Untap two target lands. LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/g/GatekeeperGargoyle.java b/Mage.Sets/src/mage/cards/g/GatekeeperGargoyle.java new file mode 100644 index 0000000000..bc1dc58488 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GatekeeperGargoyle.java @@ -0,0 +1,57 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author TheElk801 + */ +public final class GatekeeperGargoyle extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(new SubtypePredicate(SubType.GATE)); + } + + public GatekeeperGargoyle(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + + this.subtype.add(SubType.GARGOYLE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Gargoyle Guardian enters the battlefield with a +1/+1 counter on it for each Gate you control. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect( + CounterType.P1P1.createInstance(), + new PermanentsOnBattlefieldCount(filter), true + ), "with a +1/+1 counter on it for each Gate you control" + )); + } + + public GatekeeperGargoyle(final GatekeeperGargoyle card) { + super(card); + } + + @Override + public GatekeeperGargoyle copy() { + return new GatekeeperGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GatewayPlaza.java b/Mage.Sets/src/mage/cards/g/GatewayPlaza.java new file mode 100644 index 0000000000..882a7de195 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GatewayPlaza.java @@ -0,0 +1,47 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class GatewayPlaza extends CardImpl { + + public GatewayPlaza(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.subtype.add(SubType.GATE); + + // Gateway Plaza enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Gateway Plaza enters the battlefield, sacrifice it unless you pay {1}. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SacrificeSourceUnlessPaysEffect( + new GenericManaCost(1) + ), false + )); + + // {T}: Add one mana of any color. + this.addAbility(new AnyColorManaAbility()); + } + + public GatewayPlaza(final GatewayPlaza card) { + super(card); + } + + @Override + public GatewayPlaza copy() { + return new GatewayPlaza(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GenerousStray.java b/Mage.Sets/src/mage/cards/g/GenerousStray.java new file mode 100644 index 0000000000..6657cb089c --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GenerousStray.java @@ -0,0 +1,39 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class GenerousStray extends CardImpl { + + public GenerousStray(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.CAT); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // When Generous Stray enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(1) + )); + } + + public GenerousStray(final GenerousStray card) { + super(card); + } + + @Override + public GenerousStray copy() { + return new GenerousStray(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GenesisHydra.java b/Mage.Sets/src/mage/cards/g/GenesisHydra.java index 1a9527827f..be84c1942d 100644 --- a/Mage.Sets/src/mage/cards/g/GenesisHydra.java +++ b/Mage.Sets/src/mage/cards/g/GenesisHydra.java @@ -71,7 +71,7 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Object obj = getValue(CastSourceTriggeredAbility.SOURCE_CAST_SPELL_ABILITY); - if (controller != null && obj != null && obj instanceof SpellAbility) { + if (controller != null && obj instanceof SpellAbility) { int count = ((SpellAbility) obj).getManaCostsToPay().getX(); if (count > 0) { Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, count)); diff --git a/Mage.Sets/src/mage/cards/g/GethLordOfTheVault.java b/Mage.Sets/src/mage/cards/g/GethLordOfTheVault.java index 313fd418ca..ce931358a9 100644 --- a/Mage.Sets/src/mage/cards/g/GethLordOfTheVault.java +++ b/Mage.Sets/src/mage/cards/g/GethLordOfTheVault.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -15,14 +14,16 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.SuperType; -import mage.constants.TargetAdjustment; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.other.OwnerPredicate; import mage.game.Game; import mage.players.Player; -import mage.target.common.TargetCardInOpponentsGraveyard; +import mage.target.common.TargetCardInGraveyard; +import mage.target.targetadjustment.XCMCGraveyardAdjuster; /** * @author nantuko @@ -32,6 +33,7 @@ public final class GethLordOfTheVault extends CardImpl { private static final FilterCard filter = new FilterCard("artifact or creature card with converted mana cost X from an opponent's graveyard"); static { + filter.add(new OwnerPredicate(TargetController.OPPONENT)); filter.add(Predicates.or( new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); @@ -50,8 +52,8 @@ public final class GethLordOfTheVault extends CardImpl { // {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped. // Then that player puts the top X cards of their library into their graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}")); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_GY_CARD); - ability.addTarget(new TargetCardInOpponentsGraveyard(filter)); + ability.setTargetAdjuster(XCMCGraveyardAdjuster.instance); + ability.addTarget(new TargetCardInGraveyard(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/Ghoultree.java b/Mage.Sets/src/mage/cards/g/Ghoultree.java index e815e948cd..63a9982da0 100644 --- a/Mage.Sets/src/mage/cards/g/Ghoultree.java +++ b/Mage.Sets/src/mage/cards/g/Ghoultree.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -27,7 +26,7 @@ public final class Ghoultree extends CardImpl { this.toughness = new MageInt(10); // Ghoultree costs {1} less to cast for each creature card in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SourceCostReductionForEachCardInGraveyardEffect(new FilterCreatureCard()))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SourceCostReductionForEachCardInGraveyardEffect(StaticFilters.FILTER_CARD_CREATURE))); } public Ghoultree(final Ghoultree card) { diff --git a/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java index a6e73e91fe..c7a55a17e5 100644 --- a/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java +++ b/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -20,7 +20,6 @@ import mage.constants.SuperType; import mage.game.command.emblems.GideonAllyOfZendikarEmblem; import mage.game.permanent.token.KnightAllyToken; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; /** * @@ -33,7 +32,7 @@ public final class GideonAllyOfZendikar extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GIDEON); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), "planeswalker", Duration.EndOfTurn), 1); diff --git a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java index 9507206424..79b4801059 100644 --- a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java +++ b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; @@ -27,7 +27,6 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.target.common.TargetCreaturePermanent; /** @@ -52,7 +51,7 @@ public final class GideonBattleForged extends CardImpl { this.nightCard = true; this.transformable = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able. LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2); diff --git a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java index f4afdfc3a7..2b479ffe99 100644 --- a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java +++ b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.LockedInDynamicValue; import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount; @@ -26,7 +26,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.target.common.TargetOpponent; /** @@ -40,7 +39,7 @@ public final class GideonChampionOfJustice extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GIDEON); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls. LoyaltyAbility ability1 = new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/cards/g/GideonJura.java b/Mage.Sets/src/mage/cards/g/GideonJura.java index d4890e3114..d18f502891 100644 --- a/Mage.Sets/src/mage/cards/g/GideonJura.java +++ b/Mage.Sets/src/mage/cards/g/GideonJura.java @@ -5,7 +5,7 @@ import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -43,7 +43,7 @@ public final class GideonJura extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GIDEON); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); // +2: During target opponent's next turn, creatures that player controls attack Gideon Jura if able. LoyaltyAbility ability1 = new LoyaltyAbility(new GideonJuraEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java b/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java index 324f922d3f..3123d40b2c 100644 --- a/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java +++ b/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; import mage.abilities.effects.common.TapAllEffect; @@ -21,7 +21,6 @@ import mage.constants.SuperType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterOpponentsCreaturePermanent; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; /** * @@ -35,7 +34,7 @@ public final class GideonMartialParagon extends CardImpl { this.subtype.add(SubType.GIDEON); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Untap all creatures you control. Those creatures get +1/+1 until end of turn. LoyaltyAbility ability = new LoyaltyAbility(new UntapAllEffect(new FilterControlledCreaturePermanent()), 2); diff --git a/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java b/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java index bdb15746be..46fe7dcc16 100644 --- a/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java +++ b/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; @@ -19,7 +19,6 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.game.command.emblems.GideonOfTheTrialsEmblem; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.target.TargetPermanent; /** @@ -34,7 +33,7 @@ public final class GideonOfTheTrials extends CardImpl { this.subtype.add(SubType.GIDEON); //Starting Loyalty: 3 - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Until your next turn, prevent all damage target permanent would deal. Effect effect = new PreventDamageByTargetEffect(Duration.UntilYourNextTurn); diff --git a/Mage.Sets/src/mage/cards/g/GirdForBattle.java b/Mage.Sets/src/mage/cards/g/GirdForBattle.java new file mode 100644 index 0000000000..7b2338edf1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GirdForBattle.java @@ -0,0 +1,35 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class GirdForBattle extends CardImpl { + + public GirdForBattle(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}"); + + // Put a +1/+1 counter on each of up to two target creatures. + this.getSpellAbility().addEffect(new AddCountersTargetEffect( + CounterType.P1P1.createInstance() + ).setText("Put a +1/+1 counter on each of up to two target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + } + + public GirdForBattle(final GirdForBattle card) { + super(card); + } + + @Override + public GirdForBattle copy() { + return new GirdForBattle(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GlaiveOfTheGuildpact.java b/Mage.Sets/src/mage/cards/g/GlaiveOfTheGuildpact.java new file mode 100644 index 0000000000..632d3e4f30 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GlaiveOfTheGuildpact.java @@ -0,0 +1,69 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author TheElk801 + */ +public final class GlaiveOfTheGuildpact extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent("Gate you control"); + + static { + filter.add(new SubtypePredicate(SubType.GATE)); + } + + public GlaiveOfTheGuildpact(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature gets +1/+0 for each Gate you control and has vigilance and menace. + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new BoostEquippedEffect( + new PermanentsOnBattlefieldCount(filter), + new StaticValue(0) + ) + ); + ability.addEffect(new GainAbilityAttachedEffect( + VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT + ).setText("and has vigilance")); + ability.addEffect(new GainAbilityAttachedEffect( + new MenaceAbility(), AttachmentType.EQUIPMENT + ).setText("and menace")); + this.addAbility(ability); + + // Equip {3} + this.addAbility(new EquipAbility(3)); + } + + public GlaiveOfTheGuildpact(final GlaiveOfTheGuildpact card) { + super(card); + } + + @Override + public GlaiveOfTheGuildpact copy() { + return new GlaiveOfTheGuildpact(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GlowsporeShaman.java b/Mage.Sets/src/mage/cards/g/GlowsporeShaman.java new file mode 100644 index 0000000000..c069371c39 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GlowsporeShaman.java @@ -0,0 +1,90 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.common.FilterLandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GlowsporeShaman extends CardImpl { + + public GlowsporeShaman(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // When Glowspore Shaman enters the battlefield, put the top three cards of your library into your graveyard. You may put a land card from your graveyard on top of your library. + Ability ability = new EntersBattlefieldTriggeredAbility( + new PutTopCardOfLibraryIntoGraveControllerEffect(3), false + ); + ability.addEffect(new GlowsporeShamanEffect()); + this.addAbility(ability); + } + + public GlowsporeShaman(final GlowsporeShaman card) { + super(card); + } + + @Override + public GlowsporeShaman copy() { + return new GlowsporeShaman(this); + } +} + +class GlowsporeShamanEffect extends OneShotEffect { + + public static final FilterLandCard filter + = new FilterLandCard("a land card from your graveyard"); + + public GlowsporeShamanEffect() { + super(Outcome.Benefit); + this.staticText = "You may put a land card from your graveyard " + + "on top of your library."; + } + + public GlowsporeShamanEffect(final GlowsporeShamanEffect effect) { + super(effect); + } + + @Override + public GlowsporeShamanEffect copy() { + return new GlowsporeShamanEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Target target = new TargetCardInYourGraveyard(0, 1, filter, true); + if (player.chooseUse(outcome, "Put a land card on top of your library?", source, game) + && player.choose(outcome, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + return player.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoblinBanneret.java b/Mage.Sets/src/mage/cards/g/GoblinBanneret.java new file mode 100644 index 0000000000..8491d47225 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GoblinBanneret.java @@ -0,0 +1,49 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class GoblinBanneret extends CardImpl { + + public GoblinBanneret(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); + + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Mentor + this.addAbility(new MentorAbility()); + + // {1}{R}: Goblin Banneret gets +2/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(2, 0, Duration.EndOfTurn), + new ManaCostsImpl("{1}{R}") + )); + } + + public GoblinBanneret(final GoblinBanneret card) { + super(card); + } + + @Override + public GoblinBanneret copy() { + return new GoblinBanneret(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoblinCratermaker.java b/Mage.Sets/src/mage/cards/g/GoblinCratermaker.java new file mode 100644 index 0000000000..bfd07f08b7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GoblinCratermaker.java @@ -0,0 +1,68 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class GoblinCratermaker extends CardImpl { + + private static final FilterPermanent filter + = new FilterNonlandPermanent("colorless nonland permanent"); + + static { + filter.add(new ColorlessPredicate()); + } + + public GoblinCratermaker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}, Sacrifice Goblin Cratermaker: Choose one — + // • Goblin Cratermaker deals 2 damage to target creature. + Ability ability = new SimpleActivatedAbility( + new DamageTargetEffect(2), new GenericManaCost(1) + ); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + + // • Destroy target colorless nonland permanent. + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter)); + + ability.addMode(mode); + this.addAbility(ability); + } + + public GoblinCratermaker(final GoblinCratermaker card) { + super(card); + } + + @Override + public GoblinCratermaker copy() { + return new GoblinCratermaker(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoblinLocksmith.java b/Mage.Sets/src/mage/cards/g/GoblinLocksmith.java new file mode 100644 index 0000000000..9fa25f47df --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GoblinLocksmith.java @@ -0,0 +1,51 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author TheElk801 + */ +public final class GoblinLocksmith extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creatures with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public GoblinLocksmith(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Goblin Locksmith attacks, creatures with defender can't block this turn. + this.addAbility(new AttacksTriggeredAbility( + new CantBlockAllEffect(filter, Duration.EndOfTurn), false + )); + } + + public GoblinLocksmith(final GoblinLocksmith card) { + super(card); + } + + @Override + public GoblinLocksmith copy() { + return new GoblinLocksmith(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoblinRacketeer.java b/Mage.Sets/src/mage/cards/g/GoblinRacketeer.java index caadb9f8da..a4c3c44b11 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinRacketeer.java +++ b/Mage.Sets/src/mage/cards/g/GoblinRacketeer.java @@ -2,6 +2,7 @@ package mage.cards.g; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -16,7 +17,6 @@ import mage.game.Game; import mage.target.common.TargetCreaturePermanent; /** - * * @author TheElk801 */ public final class GoblinRacketeer extends CardImpl { @@ -35,6 +35,7 @@ public final class GoblinRacketeer extends CardImpl { Ability ability = new AttacksTriggeredAbility(new GoadTargetEffect(), true, "Whenever {this} attacks, you may goad target creature defending player controls"); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); originalId = ability.getOriginalId(); + this.addAbility(ability); } public GoblinRacketeer(final GoblinRacketeer card) { diff --git a/Mage.Sets/src/mage/cards/g/GolgariFindbroker.java b/Mage.Sets/src/mage/cards/g/GolgariFindbroker.java new file mode 100644 index 0000000000..e95d580c61 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GolgariFindbroker.java @@ -0,0 +1,49 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.common.FilterPermanentCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class GolgariFindbroker extends CardImpl { + + private static final FilterCard filter + = new FilterPermanentCard("permanent card from your graveyard"); + + public GolgariFindbroker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{G}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Golgari Findbroker enters the battlefield, return target permanent card from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility( + new ReturnFromGraveyardToHandTargetEffect(), false + ); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + public GolgariFindbroker(final GolgariFindbroker card) { + super(card); + } + + @Override + public GolgariFindbroker copy() { + return new GolgariFindbroker(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GolgariLocket.java b/Mage.Sets/src/mage/cards/g/GolgariLocket.java new file mode 100644 index 0000000000..6c0df6fc01 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GolgariLocket.java @@ -0,0 +1,47 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class GolgariLocket extends CardImpl { + + public GolgariLocket(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // {T}: Add {B} or {G}. + this.addAbility(new BlackManaAbility()); + this.addAbility(new GreenManaAbility()); + + // {B/G}{B/G}{B/G}{B/G}, {T}, Sacrifice Golgari Locket: Draw two cards. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(2), + new ManaCostsImpl("{B/G}{B/G}{B/G}{B/G}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public GolgariLocket(final GolgariLocket card) { + super(card); + } + + @Override + public GolgariLocket copy() { + return new GolgariLocket(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GolgariRaiders.java b/Mage.Sets/src/mage/cards/g/GolgariRaiders.java new file mode 100644 index 0000000000..c6e60fe183 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GolgariRaiders.java @@ -0,0 +1,57 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class GolgariRaiders extends CardImpl { + + public GolgariRaiders(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Undergrowth — Golgari Raiders enters the battlefield with a +1/+1 counter on it for each creature card in your graveyard. + Ability ability = new EntersBattlefieldAbility( + new AddCountersSourceEffect( + CounterType.P1P1.createInstance(0), + new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ), true + ), "with a +1/+1 counter on it " + + "for each creature card in your graveyard" + ); + ability.setAbilityWord(AbilityWord.UNDERGROWTH); + this.addAbility(ability); + } + + public GolgariRaiders(final GolgariRaiders card) { + super(card); + } + + @Override + public GolgariRaiders copy() { + return new GolgariRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GorillaShaman.java b/Mage.Sets/src/mage/cards/g/GorillaShaman.java index ee101c183b..f99db1acd9 100644 --- a/Mage.Sets/src/mage/cards/g/GorillaShaman.java +++ b/Mage.Sets/src/mage/cards/g/GorillaShaman.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -11,12 +10,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XCMCPermanentAdjuster; /** * @@ -41,7 +40,7 @@ public final class GorillaShaman extends CardImpl { // {X}{X}{1}: Destroy target noncreature artifact with converted mana cost X. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}")); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_PERM); + ability.setTargetAdjuster(XCMCPermanentAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GrapplingSundew.java b/Mage.Sets/src/mage/cards/g/GrapplingSundew.java new file mode 100644 index 0000000000..961af9c160 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GrapplingSundew.java @@ -0,0 +1,55 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class GrapplingSundew extends CardImpl { + + public GrapplingSundew(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.PLANT); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // {4}{G}: Grappling Sundew gains indestructible until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), + Duration.EndOfTurn + ), new ManaCostsImpl("{4}{G}") + )); + } + + public GrapplingSundew(final GrapplingSundew card) { + super(card); + } + + @Override + public GrapplingSundew copy() { + return new GrapplingSundew(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java index a51594e9a7..b712d2c869 100644 --- a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java +++ b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java @@ -32,7 +32,7 @@ public final class GraveScrabbler extends CardImpl { //you may return target creature card from a graveyard to its owner's hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"))); - this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MadnessAbility.GetCondition(), + this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MadnessAbility.getCondition(), "When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand.")); } diff --git a/Mage.Sets/src/mage/cards/g/GraviticPunch.java b/Mage.Sets/src/mage/cards/g/GraviticPunch.java new file mode 100644 index 0000000000..cfd36819b7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GraviticPunch.java @@ -0,0 +1,73 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class GraviticPunch extends CardImpl { + + public GraviticPunch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); + + // Target creature you control deals damage equal to its power to target player. + this.getSpellAbility().addEffect(new GraviticPunchEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + + } + + public GraviticPunch(final GraviticPunch card) { + super(card); + } + + @Override + public GraviticPunch copy() { + return new GraviticPunch(this); + } +} + +class GraviticPunchEffect extends OneShotEffect { + + public GraviticPunchEffect() { + super(Outcome.Benefit); + this.staticText = "Target creature you control deals damage " + + "equal to its power to target player."; + } + + public GraviticPunchEffect(final GraviticPunchEffect effect) { + super(effect); + } + + @Override + public GraviticPunchEffect copy() { + return new GraviticPunchEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent controlledCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget()); + if (player == null || controlledCreature == null) { + return false; + } + player.damage(controlledCreature.getPower().getValue(), controlledCreature.getId(), game, false, true); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/g/GruesomeMenagerie.java b/Mage.Sets/src/mage/cards/g/GruesomeMenagerie.java new file mode 100644 index 0000000000..6f90713868 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GruesomeMenagerie.java @@ -0,0 +1,109 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class GruesomeMenagerie extends CardImpl { + + public GruesomeMenagerie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + + // Choose a creature card with converted mana cost 1 in your graveyard, then do the same for creature cards with converted mana costs 2 and 3. Return those cards to the battlefield. + this.getSpellAbility().addEffect(new GruesomeMenagerieEffect()); + } + + public GruesomeMenagerie(final GruesomeMenagerie card) { + super(card); + } + + @Override + public GruesomeMenagerie copy() { + return new GruesomeMenagerie(this); + } +} + +class GruesomeMenagerieEffect extends OneShotEffect { + + private static final FilterCard filter1 + = new FilterCreatureCard("creature card with converted mana cost 1"); + private static final FilterCard filter2 + = new FilterCreatureCard("creature card with converted mana cost 2"); + private static final FilterCard filter3 + = new FilterCreatureCard("creature card with converted mana cost 3"); + + static { + filter1.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 1)); + filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 2)); + filter3.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, 3)); + } + + public GruesomeMenagerieEffect() { + super(Outcome.Benefit); + this.staticText = "Choose a creature card with converted mana cost 1 " + + "in your graveyard, then do the same for creature cards " + + "with converted mana costs 2 and 3. " + + "Return those cards to the battlefield."; + } + + public GruesomeMenagerieEffect(final GruesomeMenagerieEffect effect) { + super(effect); + } + + @Override + public GruesomeMenagerieEffect copy() { + return new GruesomeMenagerieEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(); + Target target; + target = new TargetCardInYourGraveyard(filter1); + if (player.choose(outcome, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + cards.add(card); + } + } + target = new TargetCardInYourGraveyard(filter2); + if (player.choose(outcome, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + cards.add(card); + } + } + target = new TargetCardInYourGraveyard(filter3); + if (player.choose(outcome, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + cards.add(card); + } + } + return player.moveCards(cards, Zone.BATTLEFIELD, source, game); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GuildSummit.java b/Mage.Sets/src/mage/cards/g/GuildSummit.java new file mode 100644 index 0000000000..a6d18e5a06 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GuildSummit.java @@ -0,0 +1,106 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class GuildSummit extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Gate"); + + static { + filter.add(new SubtypePredicate(SubType.GATE)); + } + + public GuildSummit(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + + // When Guild Summit enters the battlefield, you may tap any number of untapped Gates you control. Draw a card for each Gate tapped this way. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new GuildSummitEffect(), true + )); + + // Whenever a Gate enters the battlefield under your control, draw a card. + this.addAbility(new EntersBattlefieldControlledTriggeredAbility( + new DrawCardSourceControllerEffect(1), filter + )); + } + + public GuildSummit(final GuildSummit card) { + super(card); + } + + @Override + public GuildSummit copy() { + return new GuildSummit(this); + } +} + +class GuildSummitEffect extends OneShotEffect { + + private static final FilterPermanent filter + = new FilterPermanent("untapped Gates you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate(SubType.GATE)); + } + + public GuildSummitEffect() { + super(Outcome.GainLife); + staticText = "you may tap any number of untapped Gates you control. " + + "Draw a card for each Gate tapped this way"; + } + + public GuildSummitEffect(GuildSummitEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int tappedAmount = 0; + Player you = game.getPlayer(source.getControllerId()); + TargetPermanent target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true); + if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) { + for (UUID creature : target.getTargets()) { + if (creature != null) { + game.getPermanent(creature).tap(game); + tappedAmount++; + } + } + } + if (tappedAmount > 0) { + you.drawCards(tappedAmount, game); + return true; + } + return false; + } + + @Override + public GuildSummitEffect copy() { + return new GuildSummitEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/g/GuildmagesForum.java b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java new file mode 100644 index 0000000000..1a1792352e --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java @@ -0,0 +1,142 @@ +package mage.cards.g; + +import java.util.UUID; +import mage.MageObject; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.mana.AnyColorManaAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.WatcherScope; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ +public final class GuildmagesForum extends CardImpl { + + public GuildmagesForum(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + // {T}: Add {C}. + this.addAbility(new ColorlessManaAbility()); + + // {1}, {T}: Add one mana of any color. If that mana is spent on a multicolored creature spell, that creature enters the battlefield with an additional +1/+1 counter on it. + Ability ability = new AnyColorManaAbility(new GenericManaCost(1), true); + ability.getEffects().get(0).setText("Add one mana of any color. If that mana is spent on a multicolored creature spell, that creature enters the battlefield with an additional +1/+1 counter on it"); + ability.addCost(new TapSourceCost()); + this.addAbility(ability, new GuildmagesForumWatcher(ability)); + } + + public GuildmagesForum(final GuildmagesForum card) { + super(card); + } + + @Override + public GuildmagesForum copy() { + return new GuildmagesForum(this); + } +} + +class GuildmagesForumWatcher extends Watcher { + + private final Ability source; + + GuildmagesForumWatcher(Ability source) { + super("GuildmagesForumWatcher", WatcherScope.CARD); + this.source = source; + } + + GuildmagesForumWatcher(final GuildmagesForumWatcher watcher) { + super(watcher); + this.source = watcher.source; + } + + @Override + public GuildmagesForumWatcher copy() { + return new GuildmagesForumWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.MANA_PAID) { + MageObject target = game.getObject(event.getTargetId()); + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId()) + && target != null && target.isCreature() && target.getColor(game).isMulticolored() + && event.getFlag()) { + if (target instanceof Spell) { + game.getState().addEffect(new GuildmagesForumEntersBattlefieldEffect( + new MageObjectReference(((Spell) target).getSourceId(), target.getZoneChangeCounter(game), game)), source); + } + } + } + } + + @Override + public void reset() { + super.reset(); + } + +} + +class GuildmagesForumEntersBattlefieldEffect extends ReplacementEffectImpl { + + private final MageObjectReference mor; + + public GuildmagesForumEntersBattlefieldEffect(MageObjectReference mor) { + super(Duration.EndOfTurn, Outcome.BoostCreature); + this.staticText = "If that mana is spent on a multicolored creature spell, that creature enters the battlefield with an additional +1/+1 counter on it"; + this.mor = mor; + } + + public GuildmagesForumEntersBattlefieldEffect(GuildmagesForumEntersBattlefieldEffect effect) { + super(effect); + this.mor = effect.mor; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + return permanent != null && mor.refersTo(permanent, game); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); + if (target != null) { + target.addCounters(CounterType.P1P1.createInstance(), source, game, event.getAppliedEffects()); + } + return false; + } + + @Override + public GuildmagesForumEntersBattlefieldEffect copy() { + return new GuildmagesForumEntersBattlefieldEffect(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HaazdaMarshal.java b/Mage.Sets/src/mage/cards/h/HaazdaMarshal.java new file mode 100644 index 0000000000..fde0b16130 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HaazdaMarshal.java @@ -0,0 +1,75 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class HaazdaMarshal extends CardImpl { + + public HaazdaMarshal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Haazda Marshal and at least two other creatures attack, create a 1/1 white Solider creature token with lifelink. + this.addAbility(new HaazdaMarshalTriggeredAbility()); + } + + public HaazdaMarshal(final HaazdaMarshal card) { + super(card); + } + + @Override + public HaazdaMarshal copy() { + return new HaazdaMarshal(this); + } +} + +class HaazdaMarshalTriggeredAbility extends TriggeredAbilityImpl { + + public HaazdaMarshalTriggeredAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new SoldierLifelinkToken())); + } + + public HaazdaMarshalTriggeredAbility(final HaazdaMarshalTriggeredAbility ability) { + super(ability); + } + + @Override + public HaazdaMarshalTriggeredAbility copy() { + return new HaazdaMarshalTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return game.getCombat().getAttackers().size() >= 3 + && game.getCombat().getAttackers().contains(this.sourceId); + } + + @Override + public String getRule() { + return "Whenever {this} and at least two other creatures attack, " + + "create a 1/1 white Solider creature token with lifelink."; + } +} diff --git a/Mage.Sets/src/mage/cards/h/HammerDropper.java b/Mage.Sets/src/mage/cards/h/HammerDropper.java new file mode 100644 index 0000000000..12a936e0b0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HammerDropper.java @@ -0,0 +1,37 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class HammerDropper extends CardImpl { + + public HammerDropper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); + + this.subtype.add(SubType.GIANT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(5); + this.toughness = new MageInt(2); + + // Mentor + this.addAbility(new MentorAbility()); + } + + public HammerDropper(final HammerDropper card) { + super(card); + } + + @Override + public HammerDropper copy() { + return new HammerDropper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HatcherySpider.java b/Mage.Sets/src/mage/cards/h/HatcherySpider.java new file mode 100644 index 0000000000..916d6bff05 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HatcherySpider.java @@ -0,0 +1,121 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.constants.SubType; +import mage.abilities.keyword.ReachAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class HatcherySpider extends CardImpl { + + public HatcherySpider(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + + this.subtype.add(SubType.SPIDER); + this.power = new MageInt(5); + this.toughness = new MageInt(7); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Undergrowth — When you cast this spell, reveal the top X cards of your library, where X is the number of creature cards in your graveyard. You may put a green permanent card with converted mana cost X or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order. + this.addAbility(new CastSourceTriggeredAbility( + new HatcherySpiderEffect(), false, + "<i>Undergrowth</i> — " + )); + } + + public HatcherySpider(final HatcherySpider card) { + super(card); + } + + @Override + public HatcherySpider copy() { + return new HatcherySpider(this); + } +} + +class HatcherySpiderEffect extends OneShotEffect { + + public HatcherySpiderEffect() { + super(Outcome.Benefit); + this.staticText = "reveal the top X cards of your library, " + + "where X is the number of creature cards in your graveyard. " + + "You may put a green permanent card with converted mana cost " + + "X or less from among them onto the battlefield. " + + "Put the rest on the bottom of your library " + + "in a random order."; + } + + public HatcherySpiderEffect(final HatcherySpiderEffect effect) { + super(effect); + } + + @Override + public HatcherySpiderEffect copy() { + return new HatcherySpiderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int xValue = new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ).calculate(game, source, this); + FilterCard filter = new FilterPermanentCard( + "green permanent card with converted mana cost " + + xValue + " or less" + ); + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(new ConvertedManaCostPredicate( + ComparisonType.FEWER_THAN, xValue + 1 + )); + TargetCard target = new TargetCardInLibrary(filter); + Cards cards = new CardsImpl( + player.getLibrary().getTopCards(game, xValue) + ); + if (player.chooseUse(outcome, "Put a card onto the battlefield?", source, game) + && player.choose(outcome, cards, target, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null + && player.moveCards(card, Zone.BATTLEFIELD, source, game)) { + cards.remove(card); + } + } + while (!cards.isEmpty()) { + Card card = cards.getRandom(game); + player.getLibrary().putOnBottom(card, game); + cards.remove(card); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/h/HealersHawk.java b/Mage.Sets/src/mage/cards/h/HealersHawk.java new file mode 100644 index 0000000000..1afd0886b0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HealersHawk.java @@ -0,0 +1,42 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * + * @author jmharmon + */ + +public final class HealersHawk extends CardImpl { + + public HealersHawk(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); + + this.subtype.add(SubType.BIRD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + } + + public HealersHawk(final HealersHawk card) { + super(card); + } + + @Override + public HealersHawk copy() { + return new HealersHawk(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HearthKami.java b/Mage.Sets/src/mage/cards/h/HearthKami.java index 0d2eeb8b9b..0d09cdf93d 100644 --- a/Mage.Sets/src/mage/cards/h/HearthKami.java +++ b/Mage.Sets/src/mage/cards/h/HearthKami.java @@ -1,4 +1,3 @@ - package mage.cards.h; import java.util.UUID; @@ -12,11 +11,11 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XCMCPermanentAdjuster; /** * @author Loki @@ -40,7 +39,7 @@ public final class HearthKami extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_PERM); + ability.setTargetAdjuster(XCMCPermanentAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HellkiteWhelp.java b/Mage.Sets/src/mage/cards/h/HellkiteWhelp.java new file mode 100644 index 0000000000..3baa8970d3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HellkiteWhelp.java @@ -0,0 +1,57 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class HellkiteWhelp extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("creature defending player controls"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(new DefendingPlayerControlsPredicate()); + } + + public HellkiteWhelp(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Hellkite Whelp attacks, it deals 1 damage to target creature defending player controls. + Ability ability = new AttacksTriggeredAbility( + new DamageTargetEffect(1, "it"), false + ); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public HellkiteWhelp(final HellkiteWhelp card) { + super(card); + } + + @Override + public HellkiteWhelp copy() { + return new HellkiteWhelp(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HiredPoisoner.java b/Mage.Sets/src/mage/cards/h/HiredPoisoner.java new file mode 100644 index 0000000000..13a1d2a9f2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HiredPoisoner.java @@ -0,0 +1,37 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class HiredPoisoner extends CardImpl { + + public HiredPoisoner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + } + + public HiredPoisoner(final HiredPoisoner card) { + super(card); + } + + @Override + public HiredPoisoner copy() { + return new HiredPoisoner(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java index 0a31b9a4fb..5df2aeefb8 100644 --- a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java +++ b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java @@ -184,7 +184,7 @@ class HopeOfGhirapurCombatDamageWatcher extends Watcher { public boolean playerGotCombatDamage(UUID objectId, UUID playerId, Game game) { StackObject stackObject = game.getState().getStack().getStackObject(objectId); MageObjectReference mor; - if (stackObject != null && stackObject instanceof StackAbility) { + if (stackObject instanceof StackAbility) { // This is neccessary because the source object was sacrificed as cost and the correct zone change counter for target calid check can only be get from stack mor = new MageObjectReference(objectId, ((StackAbility) stackObject).getSourceObjectZoneChangeCounter(), game); } else { diff --git a/Mage.Sets/src/mage/cards/h/HouseGuildmage.java b/Mage.Sets/src/mage/cards/h/HouseGuildmage.java new file mode 100644 index 0000000000..d416597337 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HouseGuildmage.java @@ -0,0 +1,57 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class HouseGuildmage extends CardImpl { + + public HouseGuildmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{U}, {T}: Target creature doesn't untap during its controller's next untap step. + Ability ability = new SimpleActivatedAbility( + new DontUntapInControllersNextUntapStepTargetEffect(), + new ManaCostsImpl("{1}{U}") + ); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {2}{B}, {T}: Surveil 2. + ability = new SimpleActivatedAbility( + new SurveilEffect(2), + new ManaCostsImpl("{2}{B}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public HouseGuildmage(final HouseGuildmage card) { + super(card); + } + + @Override + public HouseGuildmage copy() { + return new HouseGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HuatliDinosaurKnight.java b/Mage.Sets/src/mage/cards/h/HuatliDinosaurKnight.java index eeb550f491..1dce1556a2 100644 --- a/Mage.Sets/src/mage/cards/h/HuatliDinosaurKnight.java +++ b/Mage.Sets/src/mage/cards/h/HuatliDinosaurKnight.java @@ -4,7 +4,7 @@ package mage.cards.h; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DamageWithPowerTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; @@ -45,7 +45,7 @@ public final class HuatliDinosaurKnight extends CardImpl { addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUATLI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: Put two +1/+1 counters on up to one target Dinosaur you control. Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)) diff --git a/Mage.Sets/src/mage/cards/h/HuatliRadiantChampion.java b/Mage.Sets/src/mage/cards/h/HuatliRadiantChampion.java index 68ac6efba4..d873f78870 100644 --- a/Mage.Sets/src/mage/cards/h/HuatliRadiantChampion.java +++ b/Mage.Sets/src/mage/cards/h/HuatliRadiantChampion.java @@ -3,7 +3,7 @@ package mage.cards.h; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; @@ -30,7 +30,7 @@ public final class HuatliRadiantChampion extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUATLI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Put a loyalty counter on Huatli, Radiant Champion for each creature you control. this.addAbility(new LoyaltyAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0), diff --git a/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java b/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java index 4bf79da295..2cc5bf6d79 100644 --- a/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java +++ b/Mage.Sets/src/mage/cards/h/HuatliWarriorPoet.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.Mode; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -26,7 +26,6 @@ import mage.constants.SuperType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.DinosaurToken; -import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreaturePermanentAmount; import mage.target.targetpointer.FixedTarget; @@ -43,7 +42,7 @@ public final class HuatliWarriorPoet extends CardImpl { addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUATLI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: You gain life equal to the greatest power among creatures you control. this.addAbility(new LoyaltyAbility(new GainLifeEffect(new GreatestPowerAmongControlledCreaturesValue(), "You gain life equal to the greatest power among creatures you control"), 2)); diff --git a/Mage.Sets/src/mage/cards/h/HuntedWitness.java b/Mage.Sets/src/mage/cards/h/HuntedWitness.java new file mode 100644 index 0000000000..33c60a3177 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HuntedWitness.java @@ -0,0 +1,40 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class HuntedWitness extends CardImpl { + + public HuntedWitness(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); + + this.subtype.add(SubType.HUMAN); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Hunted Witness dies, create a 1/1 white Soldier creature token with lifelink. + this.addAbility(new DiesTriggeredAbility( + new CreateTokenEffect(new SoldierLifelinkToken()) + )); + } + + public HuntedWitness(final HuntedWitness card) { + super(card); + } + + @Override + public HuntedWitness copy() { + return new HuntedWitness(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/Hypothesizzle.java b/Mage.Sets/src/mage/cards/h/Hypothesizzle.java new file mode 100644 index 0000000000..f866ac8f02 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/Hypothesizzle.java @@ -0,0 +1,106 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.SendOptionUsedEventEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class Hypothesizzle extends CardImpl { + + public Hypothesizzle(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{R}"); + + // Draw two cards. Then you may discard a nonland card. When you do, Hypothesizzle deals 4 damage to target creature. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); + this.getSpellAbility().addEffect(new DoIfCostPaid( + new HypothesizzleCreateReflexiveTriggerEffect(), + new DiscardCardCost(StaticFilters.FILTER_CARD_A_NON_LAND), + "Discard a nonland card to deal 4 damage?" + ).setText("Then you may discard a nonland card. " + + "When you do, {this} deals 4 damage to target creature.")); + } + + public Hypothesizzle(final Hypothesizzle card) { + super(card); + } + + @Override + public Hypothesizzle copy() { + return new Hypothesizzle(this); + } +} + +class HypothesizzleCreateReflexiveTriggerEffect extends OneShotEffect { + + public HypothesizzleCreateReflexiveTriggerEffect() { + super(Outcome.Benefit); + this.staticText = "When you do, it deals 4 damage to target creature"; + } + + public HypothesizzleCreateReflexiveTriggerEffect(final HypothesizzleCreateReflexiveTriggerEffect effect) { + super(effect); + } + + @Override + public HypothesizzleCreateReflexiveTriggerEffect copy() { + return new HypothesizzleCreateReflexiveTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.addDelayedTriggeredAbility(new HypothesizzleReflexiveTriggeredAbility(), source); + return new SendOptionUsedEventEffect().apply(game, source); + } +} + +class HypothesizzleReflexiveTriggeredAbility extends DelayedTriggeredAbility { + + public HypothesizzleReflexiveTriggeredAbility() { + super(new DamageTargetEffect(4), Duration.OneUse, true); + this.addTarget(new TargetCreaturePermanent()); + } + + public HypothesizzleReflexiveTriggeredAbility(final HypothesizzleReflexiveTriggeredAbility ability) { + super(ability); + } + + @Override + public HypothesizzleReflexiveTriggeredAbility copy() { + return new HypothesizzleReflexiveTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.OPTION_USED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && event.getSourceId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "When you discard a nonland card, " + + "{this} deals 4 damage to target creature"; + } +} diff --git a/Mage.Sets/src/mage/cards/i/IceCauldron.java b/Mage.Sets/src/mage/cards/i/IceCauldron.java index e0adbe1386..9a340d91e9 100644 --- a/Mage.Sets/src/mage/cards/i/IceCauldron.java +++ b/Mage.Sets/src/mage/cards/i/IceCauldron.java @@ -158,7 +158,7 @@ class IceCauldronCastFromExileEffect extends AsThoughEffectImpl { class IceCauldronNoteManaEffect extends OneShotEffect { - private static String manaUsedString; + private String manaUsedString; public IceCauldronNoteManaEffect() { super(Outcome.Benefit); @@ -167,6 +167,7 @@ class IceCauldronNoteManaEffect extends OneShotEffect { public IceCauldronNoteManaEffect(final IceCauldronNoteManaEffect effect) { super(effect); + manaUsedString = effect.manaUsedString; } @Override @@ -190,8 +191,8 @@ class IceCauldronNoteManaEffect extends OneShotEffect { class IceCauldronAddManaEffect extends ManaEffect { - private static Mana storedMana; - private static MageObjectReference exiledCardMor; + private Mana storedMana; + private MageObjectReference exiledCardMor; IceCauldronAddManaEffect() { super(); @@ -200,6 +201,8 @@ class IceCauldronAddManaEffect extends ManaEffect { IceCauldronAddManaEffect(IceCauldronAddManaEffect effect) { super(effect); + storedMana = effect.storedMana.copy(); + exiledCardMor = effect.exiledCardMor; } @Override @@ -265,7 +268,7 @@ class IceCauldronManaCondition implements Condition { public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { Card card = game.getCard(source.getSourceId()); - if (card != null && exiledCard != null && card.equals(exiledCard)) { + if (card != null && card.equals(exiledCard)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/i/ImperviousGreatwurm.java b/Mage.Sets/src/mage/cards/i/ImperviousGreatwurm.java new file mode 100644 index 0000000000..bcc6553b6d --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/ImperviousGreatwurm.java @@ -0,0 +1,42 @@ +package mage.cards.i; + +import mage.abilities.keyword.ConvokeAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.MageInt; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * + * @author Rystan + */ + +public final class ImperviousGreatwurm extends CardImpl { + + public ImperviousGreatwurm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}{G}"); + this.subtype.add(SubType.WURM); + + this.power = new MageInt(16); + this.toughness = new MageInt(16); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + } + + public ImperviousGreatwurm(final ImperviousGreatwurm card) { + super(card); + } + + @Override + public ImperviousGreatwurm copy() { + return new ImperviousGreatwurm(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/InescapableBlaze.java b/Mage.Sets/src/mage/cards/i/InescapableBlaze.java new file mode 100644 index 0000000000..2aa756c1ba --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InescapableBlaze.java @@ -0,0 +1,36 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.common.CantBeCounteredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class InescapableBlaze extends CardImpl { + + public InescapableBlaze(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}{R}"); + + // This spell can't be countered. + this.addAbility(new CantBeCounteredAbility().setRuleAtTheTop(true)); + + // Inescapable Flame deals 6 damage to any target. + this.getSpellAbility().addEffect(new DamageTargetEffect(6)); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + } + + public InescapableBlaze(final InescapableBlaze card) { + super(card); + } + + @Override + public InescapableBlaze copy() { + return new InescapableBlaze(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/InspiringUnicorn.java b/Mage.Sets/src/mage/cards/i/InspiringUnicorn.java new file mode 100644 index 0000000000..dd1d9a9e56 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InspiringUnicorn.java @@ -0,0 +1,40 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * + * @author TheElk801 + */ +public final class InspiringUnicorn extends CardImpl { + + public InspiringUnicorn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + + this.subtype.add(SubType.UNICORN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Inspiring Unicorn attacks, creatures you control get +1/+1 until end of turn. + this.addAbility(new AttacksTriggeredAbility( + new BoostControlledEffect(1, 1, Duration.EndOfTurn), false + )); + } + + public InspiringUnicorn(final InspiringUnicorn card) { + super(card); + } + + @Override + public InspiringUnicorn copy() { + return new InspiringUnicorn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/IntegrityIntervention.java b/Mage.Sets/src/mage/cards/i/IntegrityIntervention.java new file mode 100644 index 0000000000..f258e069e8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IntegrityIntervention.java @@ -0,0 +1,54 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; +import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class IntegrityIntervention extends SplitCard { + + public IntegrityIntervention(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R/W}", "{2}{R}{W}", SpellAbilityType.SPLIT); + + // Integrity + // Target creature gets +2/+2 until end of turn. + this.getLeftHalfCard().getSpellAbility().addEffect( + new BoostTargetEffect(2, 2, Duration.EndOfTurn) + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCreaturePermanent() + ); + + // Intervention + // Intervention deals 3 damage to any target and you gain 3 life. + this.getRightHalfCard().getSpellAbility().addEffect( + new DamageTargetEffect(3).setText("Intervention deals 3 damage to any target") + ); + this.getRightHalfCard().getSpellAbility().addEffect( + new GainLifeEffect(3).setText("and you gain 3 life") + ); + this.getRightHalfCard().getSpellAbility().addTarget( + new TargetAnyTarget() + ); + } + + public IntegrityIntervention(final IntegrityIntervention card) { + super(card); + } + + @Override + public IntegrityIntervention copy() { + return new IntegrityIntervention(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/IntrusivePackbeast.java b/Mage.Sets/src/mage/cards/i/IntrusivePackbeast.java new file mode 100644 index 0000000000..622ac416ae --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IntrusivePackbeast.java @@ -0,0 +1,45 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class IntrusivePackbeast extends CardImpl { + + public IntrusivePackbeast(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); + + this.subtype.add(SubType.BEAST); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // When Intrusive Packbeast enters the battlefield, tap up to two target creatures your opponents control. + Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect()); + ability.addTarget(new TargetOpponentsCreaturePermanent(0, 2)); + this.addAbility(ability); + } + + public IntrusivePackbeast(final IntrusivePackbeast card) { + super(card); + } + + @Override + public IntrusivePackbeast copy() { + return new IntrusivePackbeast(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/InvertInvent.java b/Mage.Sets/src/mage/cards/i/InvertInvent.java new file mode 100644 index 0000000000..fbeccdf652 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InvertInvent.java @@ -0,0 +1,135 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SwitchPowerToughnessTargetEffect; +import mage.cards.Card; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class InvertInvent extends SplitCard { + + public InvertInvent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U/R}", "{4}{U}{R}", SpellAbilityType.SPLIT); + + // Invert + // Switch the power and toughness of each of up to two target creatures until end of turn. + this.getLeftHalfCard().getSpellAbility().addEffect(new InvertEffect()); + this.getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + + // Invent + // Search your library for an instant card and/or a sorcery card, reveal them, put them into your hand, then shuffle your library. + this.getRightHalfCard().getSpellAbility().addEffect(new InventEffect()); + } + + public InvertInvent(final InvertInvent card) { + super(card); + } + + @Override + public InvertInvent copy() { + return new InvertInvent(this); + } +} + +class InvertEffect extends OneShotEffect { + + public InvertEffect() { + super(Outcome.Benefit); + this.staticText = "Switch the power and toughness of " + + "each of up to two target creatures until end of turn."; + } + + public InvertEffect(final InvertEffect effect) { + super(effect); + } + + @Override + public InvertEffect copy() { + return new InvertEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetId : targetPointer.getTargets(game, source)) { + ContinuousEffect effect = new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(targetId, game)); + game.addEffect(effect, source); + } + return true; + } +} + +class InventEffect extends OneShotEffect { + + private static final FilterCard filter1 = new FilterCard("instant card"); + private static final FilterCard filter2 = new FilterCard("sorcery card"); + + static { + filter1.add(new CardTypePredicate(CardType.INSTANT)); + filter2.add(new CardTypePredicate(CardType.SORCERY)); + } + + public InventEffect() { + super(Outcome.Benefit); + this.staticText = "Search your library for an instant card " + + "and/or a sorcery card, reveal them, " + + "put them into your hand, then shuffle your library."; + } + + public InventEffect(final InventEffect effect) { + super(effect); + } + + @Override + public InventEffect copy() { + return new InventEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(); + TargetCardInLibrary target = new TargetCardInLibrary(filter1); + if (player.searchLibrary(target, game, false)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + cards.add(card); + } + } + target = new TargetCardInLibrary(filter2); + if (player.searchLibrary(target, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + cards.add(card); + } + } + player.revealCards(source, cards, game); + player.moveCards(cards, Zone.HAND, source, game); + player.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/i/Ionize.java b/Mage.Sets/src/mage/cards/i/Ionize.java new file mode 100644 index 0000000000..ac7a6c3d46 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/Ionize.java @@ -0,0 +1,71 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author TheElk801 + */ +public final class Ionize extends CardImpl { + + public Ionize(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{R}"); + + // Counter target spell. Ionize deals 2 damage to that spell's controller. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new IonizeEffect()); + } + + public Ionize(final Ionize card) { + super(card); + } + + @Override + public Ionize copy() { + return new Ionize(this); + } +} + +class IonizeEffect extends OneShotEffect { + + public IonizeEffect() { + super(Outcome.Benefit); + this.staticText = "Counter target spell. " + + "{this} deals 2 damage to that spell's controller."; + } + + public IonizeEffect(final IonizeEffect effect) { + super(effect); + } + + @Override + public IonizeEffect copy() { + return new IonizeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean result = false; + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (spell != null) { + Player spellController = game.getPlayer(spell.getControllerId()); + + result = game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + if (spellController != null) { + spellController.damage(2, source.getSourceId(), game, false, true); + } + } + return result; + } +} diff --git a/Mage.Sets/src/mage/cards/i/IzoniThousandEyed.java b/Mage.Sets/src/mage/cards/i/IzoniThousandEyed.java new file mode 100644 index 0000000000..05c796b2fe --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IzoniThousandEyed.java @@ -0,0 +1,72 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.permanent.token.IzoniInsectToken; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author TheElk801 + */ +public final class IzoniThousandEyed extends CardImpl { + + public IzoniThousandEyed(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Undergrowth — When Izoni, Thousand-Eyed enters the battlefield, create a 1/1 black and green Insect creature token for each creature card in your graveyard. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new CreateTokenEffect( + new IzoniInsectToken(), + new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ) + ), false, "<i>Undergrowth</i> — " + )); + + // {B}{G}, Sacrifice another creature: You gain 1 life and draw a card. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new GainLifeEffect(1), + new ManaCostsImpl("{B}{G}") + ); + ability.addEffect( + new DrawCardSourceControllerEffect(1).setText("and draw a card") + ); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent( + StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE + ))); + this.addAbility(ability); + } + + public IzoniThousandEyed(final IzoniThousandEyed card) { + super(card); + } + + @Override + public IzoniThousandEyed copy() { + return new IzoniThousandEyed(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/IzzetLocket.java b/Mage.Sets/src/mage/cards/i/IzzetLocket.java new file mode 100644 index 0000000000..8ab86878e6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IzzetLocket.java @@ -0,0 +1,47 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class IzzetLocket extends CardImpl { + + public IzzetLocket(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // {T}: Add {U} or {R}. + this.addAbility(new BlueManaAbility()); + this.addAbility(new RedManaAbility()); + + // {U/R}{U/R}{U/R}{U/R}, {T}, Sacrifice Izzet Locket: Draw two cards. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(2), + new ManaCostsImpl("{U/R}{U/R}{U/R}{U/R}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public IzzetLocket(final IzzetLocket card) { + super(card); + } + + @Override + public IzzetLocket copy() { + return new IzzetLocket(this); + } +} diff --git a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java index efd444476f..09ebb7644e 100644 --- a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java @@ -8,7 +8,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; @@ -50,7 +50,7 @@ public final class JaceArchitectOfThought extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn. this.addAbility(new LoyaltyAbility(new JaceArchitectOfThoughtStartEffect1(), 1)); diff --git a/Mage.Sets/src/mage/cards/j/JaceBeleren.java b/Mage.Sets/src/mage/cards/j/JaceBeleren.java index 984abe7453..03be57089d 100644 --- a/Mage.Sets/src/mage/cards/j/JaceBeleren.java +++ b/Mage.Sets/src/mage/cards/j/JaceBeleren.java @@ -3,7 +3,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DrawCardAllEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; @@ -25,7 +25,7 @@ public final class JaceBeleren extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Each player draws a card. this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2)); diff --git a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java index e5b52f876d..f4bd134f43 100644 --- a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java +++ b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java @@ -7,7 +7,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DrawDiscardControllerEffect; @@ -38,7 +38,7 @@ public final class JaceCunningCastaway extends CardImpl { addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card. this.addAbility(new LoyaltyAbility(new JaceCunningCastawayEffect1(), 1)); diff --git a/Mage.Sets/src/mage/cards/j/JaceIngeniousMindMage.java b/Mage.Sets/src/mage/cards/j/JaceIngeniousMindMage.java index 23e7d33494..19068d72ec 100644 --- a/Mage.Sets/src/mage/cards/j/JaceIngeniousMindMage.java +++ b/Mage.Sets/src/mage/cards/j/JaceIngeniousMindMage.java @@ -4,7 +4,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; @@ -29,7 +29,7 @@ public final class JaceIngeniousMindMage extends CardImpl { addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Draw a card. this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1)); diff --git a/Mage.Sets/src/mage/cards/j/JaceMemoryAdept.java b/Mage.Sets/src/mage/cards/j/JaceMemoryAdept.java index 6bd0ceee32..dea93de4fa 100644 --- a/Mage.Sets/src/mage/cards/j/JaceMemoryAdept.java +++ b/Mage.Sets/src/mage/cards/j/JaceMemoryAdept.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.Mode; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; @@ -28,7 +28,7 @@ public final class JaceMemoryAdept extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Draw a card. Target player puts the top card of their library into their graveyard. LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); diff --git a/Mage.Sets/src/mage/cards/j/JaceTelepathUnbound.java b/Mage.Sets/src/mage/cards/j/JaceTelepathUnbound.java index 14e02e4074..e9504663f3 100644 --- a/Mage.Sets/src/mage/cards/j/JaceTelepathUnbound.java +++ b/Mage.Sets/src/mage/cards/j/JaceTelepathUnbound.java @@ -4,7 +4,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; @@ -47,7 +47,7 @@ public final class JaceTelepathUnbound extends CardImpl { this.nightCard = true; this.transformable = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Up to one target creature gets -2/-0 until your next turn. Effect effect = new BoostTargetEffect(-2, 0, Duration.UntilYourNextTurn); diff --git a/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java b/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java index bf09d70717..089eb70003 100644 --- a/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java +++ b/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java @@ -2,7 +2,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -38,7 +38,7 @@ public final class JaceTheLivingGuildpact extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Look at the top two cards of your library. Put one of them into your graveyard. Effect effect = new LookLibraryAndPickControllerEffect( diff --git a/Mage.Sets/src/mage/cards/j/JaceTheMindSculptor.java b/Mage.Sets/src/mage/cards/j/JaceTheMindSculptor.java index 67f7da7865..a823f6d030 100644 --- a/Mage.Sets/src/mage/cards/j/JaceTheMindSculptor.java +++ b/Mage.Sets/src/mage/cards/j/JaceTheMindSculptor.java @@ -4,7 +4,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.BrainstormEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -33,7 +33,7 @@ public final class JaceTheMindSculptor extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Look at the top card of target player's library. You may put that card on the bottom of that player's library. LoyaltyAbility ability1 = new LoyaltyAbility(new JaceTheMindSculptorEffect1(), 2); diff --git a/Mage.Sets/src/mage/cards/j/JaceUnravelerOfSecrets.java b/Mage.Sets/src/mage/cards/j/JaceUnravelerOfSecrets.java index c54f4d29cd..befc49112b 100644 --- a/Mage.Sets/src/mage/cards/j/JaceUnravelerOfSecrets.java +++ b/Mage.Sets/src/mage/cards/j/JaceUnravelerOfSecrets.java @@ -4,7 +4,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -31,7 +31,7 @@ public final class JaceUnravelerOfSecrets extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Scry 1, then draw a card. Ability ability = new LoyaltyAbility(new ScryEffect(1), 1); diff --git a/Mage.Sets/src/mage/cards/j/JalumGrifter.java b/Mage.Sets/src/mage/cards/j/JalumGrifter.java new file mode 100644 index 0000000000..170fcb2cd0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JalumGrifter.java @@ -0,0 +1,142 @@ + +package mage.cards.j; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetCard; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author L_J + */ +public final class JalumGrifter extends CardImpl { + + public JalumGrifter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{R}"); + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DEVIL); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // {1}{R}, {T}: Shuffle Jalum Grifter and two lands you control face down. Target opponent chooses one of those cards. Turn the cards face up. If they chose Jalum Grifter, sacrifice it. Otherwise, destroy target permanent. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JalumGrifterEffect(), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetOpponent()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public JalumGrifter(final JalumGrifter card) { + super(card); + } + + @Override + public JalumGrifter copy() { + return new JalumGrifter(this); + } +} + +class JalumGrifterEffect extends OneShotEffect { + + public JalumGrifterEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Shuffle {this} and two lands you control face down. Target opponent chooses one of those cards. Turn the cards face up. If they chose {this}, sacrifice it. Otherwise, destroy target permanent"; + } + + public JalumGrifterEffect(final JalumGrifterEffect effect) { + super(effect); + } + + @Override + public JalumGrifterEffect copy() { + return new JalumGrifterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + + Player controller = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget()); + if (controller != null && opponent != null) { + List<Card> shellGamePile = new ArrayList<>(); + Card sourceCard = game.getCard(source.getSourceId()); + if (sourceCard != null) { + sourceCard = sourceCard.copy(); + sourceCard.setFaceDown(true, game); + shellGamePile.add(sourceCard); + game.informPlayers(controller.getLogName() + " turns " + sourceCard.getLogName() + " face down"); + } + + Target target = new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent(), true); + if (target.canChoose(source.getSourceId(), controller.getId(), game)) { + while (!target.isChosen() && target.canChoose(controller.getId(), game) && controller.canRespond()) { + controller.chooseTarget(outcome, target, source, game); + } + } + + for (UUID cardId: target.getTargets()) { + Card card = game.getCard(cardId); + if (card != null) { + card = card.copy(); + card.setFaceDown(true, game); + shellGamePile.add(card); + game.informPlayers(controller.getLogName() + " turns " + card.getLogName() + " face down"); + } + } + if (shellGamePile.isEmpty()) { + return true; + } + Collections.shuffle(shellGamePile); + game.informPlayers(controller.getLogName() + " shuffles the face-down pile"); + TargetCard targetCard = new TargetCard(Zone.HAND, new FilterCard()); + CardsImpl cards = new CardsImpl(); + cards.addAll(shellGamePile); + if (opponent.choose(Outcome.Sacrifice, cards, targetCard, game)) { + Card card = game.getCard(targetCard.getFirstTarget()); + if (card != null) { + card.setFaceDown(false, game); + game.informPlayers(opponent.getLogName() + " reveals " + card.getLogName()); + if (card.getId().equals(sourceCard.getId())) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null) { + sourcePermanent.sacrifice(source.getSourceId(), game); + } + } else { + Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (permanent != null) { + permanent.destroy(source.getSourceId(), game, false); + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/j/JayaBallard.java b/Mage.Sets/src/mage/cards/j/JayaBallard.java index a0a40ce78f..7d7e86c13e 100644 --- a/Mage.Sets/src/mage/cards/j/JayaBallard.java +++ b/Mage.Sets/src/mage/cards/j/JayaBallard.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.mana.AddConditionalManaEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -35,7 +35,7 @@ public final class JayaBallard extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.JAYA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Add {R}{R}{R}. Spend this mana only to cast instant or sorcery spells. this.addAbility(new LoyaltyAbility(new AddConditionalManaEffect(Mana.RedMana(3), new InstantOrSorcerySpellManaBuilder()), 1)); diff --git a/Mage.Sets/src/mage/cards/j/JeweledAmulet.java b/Mage.Sets/src/mage/cards/j/JeweledAmulet.java index 03605a3105..203b634bdd 100644 --- a/Mage.Sets/src/mage/cards/j/JeweledAmulet.java +++ b/Mage.Sets/src/mage/cards/j/JeweledAmulet.java @@ -60,7 +60,7 @@ public final class JeweledAmulet extends CardImpl { class JeweledAmuletAddCounterEffect extends OneShotEffect { - private static String manaUsedString; + private String manaUsedString; public JeweledAmuletAddCounterEffect() { super(Outcome.Benefit); @@ -69,6 +69,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect { public JeweledAmuletAddCounterEffect(final JeweledAmuletAddCounterEffect effect) { super(effect); + manaUsedString = effect.manaUsedString; } @Override @@ -93,7 +94,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect { class JeweledAmuletAddManaEffect extends ManaEffect { - private static Mana storedMana; + private Mana storedMana; JeweledAmuletAddManaEffect() { super(); @@ -102,6 +103,7 @@ class JeweledAmuletAddManaEffect extends ManaEffect { JeweledAmuletAddManaEffect(JeweledAmuletAddManaEffect effect) { super(effect); + storedMana = effect.storedMana; } @Override diff --git a/Mage.Sets/src/mage/cards/j/JiangYanggu.java b/Mage.Sets/src/mage/cards/j/JiangYanggu.java index baea575ed9..39f6babd29 100644 --- a/Mage.Sets/src/mage/cards/j/JiangYanggu.java +++ b/Mage.Sets/src/mage/cards/j/JiangYanggu.java @@ -4,7 +4,7 @@ package mage.cards.j; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.condition.InvertCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -43,7 +43,7 @@ public final class JiangYanggu extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.YANGGU); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Target creature gets +2/+2 until end of turn. Ability ability = new LoyaltyAbility(new BoostTargetEffect(2, 2, Duration.EndOfTurn), 1); diff --git a/Mage.Sets/src/mage/cards/j/JoinShields.java b/Mage.Sets/src/mage/cards/j/JoinShields.java new file mode 100644 index 0000000000..f2aac62ca9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JoinShields.java @@ -0,0 +1,45 @@ +package mage.cards.j; + +import java.util.UUID; +import mage.abilities.effects.common.UntapAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class JoinShields extends CardImpl { + + public JoinShields(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{W}"); + + // Untap all creatures you control. They gain hexproof and indestructible until end of turn. + this.getSpellAbility().addEffect(new UntapAllEffect( + StaticFilters.FILTER_CONTROLLED_CREATURES + )); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + HexproofAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + ).setText("They gain hexproof")); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + ).setText("and indestructible until end of turn")); + } + + public JoinShields(final JoinShields card) { + super(card); + } + + @Override + public JoinShields copy() { + return new JoinShields(this); + } +} diff --git a/Mage.Sets/src/mage/cards/j/JusticeStrike.java b/Mage.Sets/src/mage/cards/j/JusticeStrike.java new file mode 100644 index 0000000000..db01871ddb --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JusticeStrike.java @@ -0,0 +1,62 @@ +package mage.cards.j; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class JusticeStrike extends CardImpl { + + public JusticeStrike(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{W}"); + + // Target creature deals damage to itself equal to its power. + this.getSpellAbility().addEffect(new JusticeStrikeEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public JusticeStrike(final JusticeStrike card) { + super(card); + } + + @Override + public JusticeStrike copy() { + return new JusticeStrike(this); + } +} + +class JusticeStrikeEffect extends OneShotEffect { + + public JusticeStrikeEffect() { + super(Outcome.Benefit); + this.staticText = "Target creature deals damage to itself equal to its power."; + } + + public JusticeStrikeEffect(final JusticeStrikeEffect effect) { + super(effect); + } + + @Override + public JusticeStrikeEffect copy() { + return new JusticeStrikeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + return permanent.damage(permanent.getPower().getValue(), permanent.getId(), game, false, true) > 0; + } +} diff --git a/Mage.Sets/src/mage/cards/k/KarnLiberated.java b/Mage.Sets/src/mage/cards/k/KarnLiberated.java index dc7a656eab..2cecf73c70 100644 --- a/Mage.Sets/src/mage/cards/k/KarnLiberated.java +++ b/Mage.Sets/src/mage/cards/k/KarnLiberated.java @@ -8,7 +8,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.cards.Card; @@ -44,7 +44,7 @@ public final class KarnLiberated extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{7}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KARN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); // +4: Target player exiles a card from their hand. LoyaltyAbility ability1 = new LoyaltyAbility(new KarnPlayerExileEffect(), 4); diff --git a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java index 7fc485e715..c0a7719c65 100644 --- a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java +++ b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java @@ -8,7 +8,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.Card; @@ -43,7 +43,7 @@ public final class KarnScionOfUrza extends CardImpl { addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KARN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it. LoyaltyAbility ability1 = new LoyaltyAbility(new KarnPlus1Effect(), 1); diff --git a/Mage.Sets/src/mage/cards/k/KayaGhostAssassin.java b/Mage.Sets/src/mage/cards/k/KayaGhostAssassin.java index eb691fcef9..62b4c1298b 100644 --- a/Mage.Sets/src/mage/cards/k/KayaGhostAssassin.java +++ b/Mage.Sets/src/mage/cards/k/KayaGhostAssassin.java @@ -4,7 +4,7 @@ package mage.cards.k; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -41,7 +41,7 @@ public final class KayaGhostAssassin extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KAYA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // 0: Exile Kaya, Ghost Assassin or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep. // You lose 2 life. diff --git a/Mage.Sets/src/mage/cards/k/KeeperOfTheLens.java b/Mage.Sets/src/mage/cards/k/KeeperOfTheLens.java index 69e367d07a..bffa37ce84 100644 --- a/Mage.Sets/src/mage/cards/k/KeeperOfTheLens.java +++ b/Mage.Sets/src/mage/cards/k/KeeperOfTheLens.java @@ -1,7 +1,6 @@ package mage.cards.k; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -12,11 +11,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.other.FaceDownPredicate; import mage.filter.predicate.permanent.ControllerPredicate; @@ -25,21 +20,22 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class KeeperOfTheLens extends CardImpl { public KeeperOfTheLens(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}"); this.subtype.add(SubType.GOLEM); this.power = new MageInt(1); this.toughness = new MageInt(2); // You may look at face-down creatures you don't control. // TODO: this should be a static abilitie and not use activated abilities (because it could than be restriced) - this.addAbility(new KeeperOfTheLensLookFaceDownAbility()); + this.addAbility(new KeeperOfTheLensLookFaceDownAbility()); } public KeeperOfTheLens(final KeeperOfTheLens card) { @@ -82,7 +78,7 @@ class KeeperOfTheLensLookFaceDownEffect extends OneShotEffect { public KeeperOfTheLensLookFaceDownEffect() { super(Outcome.Benefit); - this.staticText = "You may look at face-down creatures you don't control"; + this.staticText = "You may look at face-down creatures you don't control any time"; } public KeeperOfTheLensLookFaceDownEffect(final KeeperOfTheLensLookFaceDownEffect effect) { @@ -96,7 +92,7 @@ class KeeperOfTheLensLookFaceDownEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player controller= game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); MageObject mageObject = game.getObject(source.getSourceId()); if (controller == null || mageObject == null) { return false; diff --git a/Mage.Sets/src/mage/cards/k/KindredCharge.java b/Mage.Sets/src/mage/cards/k/KindredCharge.java index 1f15370a37..7702fbfbb7 100644 --- a/Mage.Sets/src/mage/cards/k/KindredCharge.java +++ b/Mage.Sets/src/mage/cards/k/KindredCharge.java @@ -69,7 +69,7 @@ class KindredChargeEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type"); filter.add(new SubtypePredicate(subType)); diff --git a/Mage.Sets/src/mage/cards/k/KindredSummons.java b/Mage.Sets/src/mage/cards/k/KindredSummons.java index e317062a4c..7854b94e6a 100644 --- a/Mage.Sets/src/mage/cards/k/KindredSummons.java +++ b/Mage.Sets/src/mage/cards/k/KindredSummons.java @@ -70,7 +70,7 @@ class KindredSummonsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType == null) { return false; } diff --git a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java index 8bcb891186..d42bd45c4a 100644 --- a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java +++ b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -44,7 +44,7 @@ public final class KioraMasterOfTheDepths extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KIORA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Untap up to one target creature and up to one target land. LoyaltyAbility ability1 = new LoyaltyAbility(new KioraUntapEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/k/KioraTheCrashingWave.java b/Mage.Sets/src/mage/cards/k/KioraTheCrashingWave.java index d490179f71..9e80d8f280 100644 --- a/Mage.Sets/src/mage/cards/k/KioraTheCrashingWave.java +++ b/Mage.Sets/src/mage/cards/k/KioraTheCrashingWave.java @@ -4,7 +4,7 @@ package mage.cards.k; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.PreventionEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -43,7 +43,7 @@ public final class KioraTheCrashingWave extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KIORA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(2)); // +1: Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls. LoyaltyAbility ability = new LoyaltyAbility(new KioraPreventionEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/k/KnightOfAutumn.java b/Mage.Sets/src/mage/cards/k/KnightOfAutumn.java new file mode 100644 index 0000000000..b8197f4fb8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KnightOfAutumn.java @@ -0,0 +1,61 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class KnightOfAutumn extends CardImpl { + + public KnightOfAutumn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + + this.subtype.add(SubType.DRYAD); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Knight of Autumn enters the battlefield, choose one — + // • Put two +1/+1 counters on Knight of Autumn. + Ability ability = new EntersBattlefieldTriggeredAbility( + new AddCountersSourceEffect( + CounterType.P1P1.createInstance(2) + ), false + ); + + // • Destroy target artifact or enchantment. + Mode mode = new Mode(new DestroyTargetEffect()); + mode.addTarget(new TargetPermanent( + StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT + )); + ability.addMode(mode); + + // • You gain 4 life. + ability.addMode(new Mode(new GainLifeEffect(4))); + this.addAbility(ability); + } + + public KnightOfAutumn(final KnightOfAutumn card) { + super(card); + } + + @Override + public KnightOfAutumn copy() { + return new KnightOfAutumn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/k/KnightOfTheMists.java b/Mage.Sets/src/mage/cards/k/KnightOfTheMists.java index b5caaf8666..f2eb1cd069 100644 --- a/Mage.Sets/src/mage/cards/k/KnightOfTheMists.java +++ b/Mage.Sets/src/mage/cards/k/KnightOfTheMists.java @@ -47,6 +47,7 @@ public final class KnightOfTheMists extends CardImpl { // When Knight of the Mists enters the battlefield, you may pay {U}. If you don't, destroy target Knight and it can't be regenerated. Ability ability = new EntersBattlefieldTriggeredAbility(new KnightOfTheMistsEffect()); ability.addTarget(new TargetCreaturePermanent(filter)); + addAbility(ability); } public KnightOfTheMists(final KnightOfTheMists card) { diff --git a/Mage.Sets/src/mage/cards/k/KothOfTheHammer.java b/Mage.Sets/src/mage/cards/k/KothOfTheHammer.java index 7112a951b9..557c50aaa5 100644 --- a/Mage.Sets/src/mage/cards/k/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/cards/k/KothOfTheHammer.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.mana.DynamicManaEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -24,7 +24,6 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.command.emblems.KothOfTheHammerEmblem; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.target.common.TargetLandPermanent; /** @@ -46,7 +45,7 @@ public final class KothOfTheHammer extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KOTH); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Untap target Mountain. It becomes a 4/4 red Elemental creature until end of turn. It's still a land. Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/k/KraulForagers.java b/Mage.Sets/src/mage/cards/k/KraulForagers.java new file mode 100644 index 0000000000..46f375ee32 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KraulForagers.java @@ -0,0 +1,43 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.common.FilterCreatureCard; + +/** + * + * @author TheElk801 + */ +public final class KraulForagers extends CardImpl { + + public KraulForagers(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); + + this.subtype.add(SubType.INSECT); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Undergrowth — When Kraul Foragers enters the battlefield, you gain 1 life for each creature card in your graveyard. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new GainLifeEffect(new CardsInControllerGraveyardCount(new FilterCreatureCard())), + false, "<i>Undergrowth</i> — " + )); + } + + public KraulForagers(final KraulForagers card) { + super(card); + } + + @Override + public KraulForagers copy() { + return new KraulForagers(this); + } +} diff --git a/Mage.Sets/src/mage/cards/k/KraulHarpooner.java b/Mage.Sets/src/mage/cards/k/KraulHarpooner.java new file mode 100644 index 0000000000..5e63d8ff12 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KraulHarpooner.java @@ -0,0 +1,106 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.SubType; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class KraulHarpooner extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creature with flying you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public KraulHarpooner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.INSECT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Undergrowth — When Kraul Harpooner enters the battlefield, choose up to one target creature with flying you don't control. Kraul Harpooner gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard, then you may have Kraul Harpooner fight that creature. + Ability ability = new EntersBattlefieldTriggeredAbility( + new KraulHarpoonerEffect(), false, + "<i>Undergrowth</i> — " + ); + ability.addTarget(new TargetPermanent(0, 1, filter, false)); + this.addAbility(ability); + } + + public KraulHarpooner(final KraulHarpooner card) { + super(card); + } + + @Override + public KraulHarpooner copy() { + return new KraulHarpooner(this); + } +} + +class KraulHarpoonerEffect extends OneShotEffect { + + public KraulHarpoonerEffect() { + super(Outcome.Benefit); + this.staticText = "choose up to one target creature with flying " + + "you don't control. {this} gets +X/+0 until end of turn, " + + "where X is the number of creature cards in your graveyard, " + + "then you may have {this} fight that creature."; + } + + public KraulHarpoonerEffect(final KraulHarpoonerEffect effect) { + super(effect); + } + + @Override + public KraulHarpoonerEffect copy() { + return new KraulHarpoonerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourcePerm = game.getPermanent(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + if (sourcePerm == null || player == null) { + return false; + } + int xValue = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); + game.addEffect(new BoostSourceEffect(xValue, 0, Duration.EndOfTurn), source); + game.applyEffects(); + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature == null || !player.chooseUse(outcome, "Have " + sourcePerm.getLogName() + " fight " + creature.getLogName() + "?", source, game)) { + return true; + } + return creature.fight(sourcePerm, source, game); + } +} diff --git a/Mage.Sets/src/mage/cards/k/KraulRaider.java b/Mage.Sets/src/mage/cards/k/KraulRaider.java new file mode 100644 index 0000000000..74fd9eb2eb --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KraulRaider.java @@ -0,0 +1,37 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class KraulRaider extends CardImpl { + + public KraulRaider(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.INSECT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Menace + this.addAbility(new MenaceAbility()); + } + + public KraulRaider(final KraulRaider card) { + super(card); + } + + @Override + public KraulRaider copy() { + return new KraulRaider(this); + } +} diff --git a/Mage.Sets/src/mage/cards/k/KraulSwarm.java b/Mage.Sets/src/mage/cards/k/KraulSwarm.java new file mode 100644 index 0000000000..64b86f8ebe --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KraulSwarm.java @@ -0,0 +1,56 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.target.common.TargetCardInHand; + +/** + * + * @author TheElk801 + */ +public final class KraulSwarm extends CardImpl { + + public KraulSwarm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); + + this.subtype.add(SubType.INSECT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {2}{B}, Discard a creature card: Return Kraul Swarm from your graveyard to your hand. + Ability ability = new SimpleActivatedAbility( + Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToHandEffect(), + new ManaCostsImpl("{2}{B}") + ); + ability.addCost(new DiscardTargetCost( + new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A) + )); + this.addAbility(ability); + } + + public KraulSwarm(final KraulSwarm card) { + super(card); + } + + @Override + public KraulSwarm copy() { + return new KraulSwarm(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LabyrinthGuardian.java b/Mage.Sets/src/mage/cards/l/LabyrinthGuardian.java index bbc39d2bad..691561a52f 100644 --- a/Mage.Sets/src/mage/cards/l/LabyrinthGuardian.java +++ b/Mage.Sets/src/mage/cards/l/LabyrinthGuardian.java @@ -74,7 +74,7 @@ class LabyrinthGuardianTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && event.getTargetId().equals(this.getSourceId()) && eventSourceObject instanceof Spell) { + if (event.getTargetId().equals(this.getSourceId()) && eventSourceObject instanceof Spell) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/l/LavaCoil.java b/Mage.Sets/src/mage/cards/l/LavaCoil.java new file mode 100644 index 0000000000..218daefe6d --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LavaCoil.java @@ -0,0 +1,34 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.ExileTargetIfDiesEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class LavaCoil extends CardImpl { + + public LavaCoil(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); + + // Lava Coil deals 4 damage to target creature. If that creature would die this turn, exile it instead. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public LavaCoil(final LavaCoil card) { + super(card); + } + + @Override + public LavaCoil copy() { + return new LavaCoil(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java b/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java new file mode 100644 index 0000000000..a8bf016ec6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java @@ -0,0 +1,157 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.Card; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentCard; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetadjustment.TargetAdjuster; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author TheElk801 + */ +public final class LazavTheMultifarious extends CardImpl { + + public LazavTheMultifarious(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.SHAPESHIFTER); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // When Lazav, the Multifarious enters the battlefield, surveil 1. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SurveilEffect(1), false + )); + + // {X}: Lazav, the Multifarious becomes a copy of target creature card in your graveyard with converted mana cost X, except its name is Lazav, the Multifarious, it's legendary in addition to its other types, and it has this ability. + Ability ability = new SimpleActivatedAbility( + new LazavTheMultifariousEffect(), + new ManaCostsImpl("{X}") + ); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); + this.addAbility(ability); + } + + public LazavTheMultifarious(final LazavTheMultifarious card) { + super(card); + } + + @Override + public LazavTheMultifarious copy() { + return new LazavTheMultifarious(this); + } +} + +enum LazavTheMultifariousAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterCard filterCard = new FilterCreatureCard("creature card with converted mana cost " + xValue + " in your graveyard"); + filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetCardInYourGraveyard(filterCard)); + } +} + +class LazavTheMultifariousEffect extends OneShotEffect { + + LazavTheMultifariousEffect() { + super(Outcome.Copy); + staticText = "{this} becomes a copy of target creature card " + + "in your graveyard with converted mana cost X, " + + "except its name is Lazav, the Multifarious, " + + "it's legendary in addition to its other types, " + + "and it has this ability"; + } + + LazavTheMultifariousEffect(final LazavTheMultifariousEffect effect) { + super(effect); + } + + @Override + public LazavTheMultifariousEffect copy() { + return new LazavTheMultifariousEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent lazavTheMultifarious = game.getPermanent(source.getSourceId()); + Permanent newBluePrint = null; + if (controller != null + && lazavTheMultifarious != null) { + Card copyFromCard = game.getCard(source.getFirstTarget()); + if (copyFromCard != null) { + newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game); + newBluePrint.assignNewId(); + ApplyToPermanent applier = new LazavTheMultifariousApplier(); + applier.apply(game, newBluePrint, source, lazavTheMultifarious.getId()); + CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavTheMultifarious.getId()); + copyEffect.newId(); + copyEffect.setApplier(applier); + Ability newAbility = source.copy(); + copyEffect.init(newAbility, game); + game.addEffect(copyEffect, newAbility); + } + return true; + } + return false; + } +} + +class LazavTheMultifariousApplier extends ApplyToPermanent { + + @Override + public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { + Ability ability = new SimpleActivatedAbility( + new LazavTheMultifariousEffect(), + new ManaCostsImpl("{X}") + ); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); + permanent.getAbilities().add(ability); + permanent.setName("Lazav, the Multifarious"); + permanent.addSuperType(SuperType.LEGENDARY); + return true; + } + + @Override + public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) { + Ability ability = new SimpleActivatedAbility( + new LazavTheMultifariousEffect(), + new ManaCostsImpl("{X}") + ); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); + mageObject.getAbilities().add(ability); + mageObject.setName("Lazav, the Multifarious"); + mageObject.addSuperType(SuperType.LEGENDARY); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/l/LeagueGuildmage.java b/Mage.Sets/src/mage/cards/l/LeagueGuildmage.java new file mode 100644 index 0000000000..885e0d9327 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LeagueGuildmage.java @@ -0,0 +1,86 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.TargetController; +import mage.filter.FilterSpell; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.target.TargetSpell; +import mage.target.targetadjustment.TargetAdjuster; + +/** + * + * @author TheElk801 + */ +public final class LeagueGuildmage extends CardImpl { + + private static final FilterSpell filter = new FilterInstantOrSorcerySpell("instant or sorcery you control with converted mana cost X"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public LeagueGuildmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {3}{U}, {T}: Draw a card. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), + new ManaCostsImpl("{3}{U}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {X}{R}, {T}: Copy target instant or sorcery spell you control with converted mana cost X. You may choose new targets for the copy. + ability = new SimpleActivatedAbility( + new CopyTargetSpellEffect(), + new ManaCostsImpl("{X}{R}") + ); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetSpell(filter)); + ability.setTargetAdjuster(LeagueGuildmageAdjuster.instance); + this.addAbility(ability); + } + + public LeagueGuildmage(final LeagueGuildmage card) { + super(card); + } + + @Override + public LeagueGuildmage copy() { + return new LeagueGuildmage(this); + } +} + +enum LeagueGuildmageAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterSpell spellFilter = new FilterInstantOrSorcerySpell("instant or sorcery you control with converted mana cost " + xValue); + spellFilter.add(new ControllerPredicate(TargetController.YOU)); + spellFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); + ability.getTargets().clear(); + ability.addTarget(new TargetSpell(spellFilter)); + } +} diff --git a/Mage.Sets/src/mage/cards/l/Leapfrog.java b/Mage.Sets/src/mage/cards/l/Leapfrog.java new file mode 100644 index 0000000000..8e1006f697 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/Leapfrog.java @@ -0,0 +1,83 @@ +package mage.cards.l; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author TheElk801 + */ +public final class Leapfrog extends CardImpl { + + public Leapfrog(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add(SubType.FROG); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Leapfrog has flying as long as you've cast an instant or sorcery spell this turn. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + FlyingAbility.getInstance(), + Duration.WhileOnBattlefield + ), LeapfrogCondition.instance, + "{this} has flying as long as you've cast " + + "an instant or sorcery spell this turn." + ) + ), new SpellsCastWatcher()); + } + + public Leapfrog(final Leapfrog card) { + super(card); + } + + @Override + public Leapfrog copy() { + return new Leapfrog(this); + } +} + +enum LeapfrogCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + SpellsCastWatcher watcher + = (SpellsCastWatcher) game.getState().getWatchers().get( + SpellsCastWatcher.class.getSimpleName() + ); + if (watcher == null) { + return false; + } + List<Spell> spells = watcher.getSpellsCastThisTurn(source.getControllerId()); + if (spells == null) { + return false; + } + for (Spell spell : spells) { + if (!spell.getSourceId().equals(source.getSourceId()) + && spell.isInstantOrSorcery()) { + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/l/LedevChampion.java b/Mage.Sets/src/mage/cards/l/LedevChampion.java new file mode 100644 index 0000000000..8c5d59ecae --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LedevChampion.java @@ -0,0 +1,109 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.game.permanent.token.SoldierLifelinkToken; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class LedevChampion extends CardImpl { + + public LedevChampion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Ledev Champion attacks, you may tap any number of untapped creatures you control. Ledev Champion gets +1/+1 until end of turn for each creature tapped this way. + this.addAbility(new AttacksTriggeredAbility( + new LedevChampionEffect(), false + )); + + // {3}{G}{W}: Create a 1/1 white soldier creature token with lifelink. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new CreateTokenEffect(new SoldierLifelinkToken()), + new ManaCostsImpl("{3}{G}{W}") + )); + } + + public LedevChampion(final LedevChampion card) { + super(card); + } + + @Override + public LedevChampion copy() { + return new LedevChampion(this); + } +} + +class LedevChampionEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creatures you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TappedPredicate())); + } + + public LedevChampionEffect() { + super(Outcome.GainLife); + staticText = "you may tap any number of untapped creatures you control. " + + "{this} gets +1/+1 until end of turn for each creature tapped this way."; + } + + public LedevChampionEffect(LedevChampionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int tappedAmount = 0; + TargetCreaturePermanent target = new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, true); + if (target.canChoose(source.getControllerId(), game) + && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) { + for (UUID creature : target.getTargets()) { + if (creature != null) { + game.getPermanent(creature).tap(game); + tappedAmount++; + } + } + } + if (tappedAmount > 0) { + game.addEffect(new BoostSourceEffect(tappedAmount, tappedAmount, Duration.EndOfTurn), source); + return true; + } + return false; + } + + @Override + public LedevChampionEffect copy() { + return new LedevChampionEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/l/LedevGuardian.java b/Mage.Sets/src/mage/cards/l/LedevGuardian.java new file mode 100644 index 0000000000..b5624e13f1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LedevGuardian.java @@ -0,0 +1,37 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class LedevGuardian extends CardImpl { + + public LedevGuardian(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Convoke + this.addAbility(new ConvokeAbility()); + } + + public LedevGuardian(final LedevGuardian card) { + super(card); + } + + @Override + public LedevGuardian copy() { + return new LedevGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LegacysAllure.java b/Mage.Sets/src/mage/cards/l/LegacysAllure.java index 162c2fc5f3..acf4bbe6ec 100644 --- a/Mage.Sets/src/mage/cards/l/LegacysAllure.java +++ b/Mage.Sets/src/mage/cards/l/LegacysAllure.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.UUID; @@ -11,13 +10,17 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Duration; -import mage.constants.TargetAdjustment; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetadjustment.TargetAdjuster; /** * @author LevelX2 @@ -36,7 +39,7 @@ public final class LegacysAllure extends CardImpl { // Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true), new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent(0, 0, filter, false)); - ability.setTargetAdjustment(TargetAdjustment.TREASURE_COUNTER_POWER); + ability.setTargetAdjuster(LegacysAllureAdjuster.instance); this.addAbility(ability); } @@ -49,3 +52,19 @@ public final class LegacysAllure extends CardImpl { return new LegacysAllure(this); } } + +enum LegacysAllureAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); + if (sourcePermanent != null) { + int xValue = sourcePermanent.getCounters(game).getCount(CounterType.TREASURE); + FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with power less than or equal to " + xValue); + filter2.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetCreaturePermanent(filter2)); + } + } +} diff --git a/Mage.Sets/src/mage/cards/l/LegionGuildmage.java b/Mage.Sets/src/mage/cards/l/LegionGuildmage.java new file mode 100644 index 0000000000..f0ef468537 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LegionGuildmage.java @@ -0,0 +1,67 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class LegionGuildmage extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("another creature"); + + static { + filter.add(new AnotherPredicate()); + } + + public LegionGuildmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {5}{R}, {T}: Legion Guildmage deals 3 damage to each opponent. + Ability ability = new SimpleActivatedAbility( + new DamagePlayersEffect(3, TargetController.OPPONENT), + new ManaCostsImpl("{5}{R}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {2}{W}, {T}: Tap another target creature. + ability = new SimpleActivatedAbility( + new TapTargetEffect("another target creature"), + new ManaCostsImpl("{2}{W}") + ); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public LegionGuildmage(final LegionGuildmage card) { + super(card); + } + + @Override + public LegionGuildmage copy() { + return new LegionGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LegionWarboss.java b/Mage.Sets/src/mage/cards/l/LegionWarboss.java new file mode 100644 index 0000000000..7b345ffd3c --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LegionWarboss.java @@ -0,0 +1,121 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.StaticAbility; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.GoblinToken; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class LegionWarboss extends CardImpl { + + public LegionWarboss(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Mentor + this.addAbility(new MentorAbility()); + + // At the beginning of combat on your turn, create a 1/1 red Goblin creature token. That token gains haste until end of turn and attacks this combat if able. + this.addAbility(new BeginningOfCombatTriggeredAbility( + new LegionWarbossEffect(), + TargetController.YOU, false + )); + } + + public LegionWarboss(final LegionWarboss card) { + super(card); + } + + @Override + public LegionWarboss copy() { + return new LegionWarboss(this); + } +} + +class LegionWarbossEffect extends OneShotEffect { + + public LegionWarbossEffect() { + super(Outcome.Benefit); + staticText = "create a 1/1 red Goblin creature token. " + + "That token gains haste until end of turn " + + "and attacks this combat if able"; + } + + public LegionWarbossEffect(final LegionWarbossEffect effect) { + super(effect); + } + + @Override + public LegionWarbossEffect copy() { + return new LegionWarbossEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + CreateTokenEffect effect = new CreateTokenEffect(new GoblinToken()); + effect.apply(game, source); + effect.getLastAddedTokenIds().stream().map((tokenId) -> { + ContinuousEffect continuousEffect = new GainAbilityTargetEffect( + HasteAbility.getInstance(), Duration.EndOfTurn + ); + continuousEffect.setTargetPointer(new FixedTarget(tokenId, game)); + return continuousEffect; + }).forEachOrdered((continuousEffect) -> { + game.addEffect(continuousEffect, source); + }); + effect.getLastAddedTokenIds().stream().map((tokenId) -> { + ContinuousEffect continuousEffect = new GainAbilityTargetEffect( + new LegionWarbossAbility(), Duration.EndOfCombat + ); + continuousEffect.setTargetPointer(new FixedTarget(tokenId, game)); + return continuousEffect; + }).forEachOrdered((continuousEffect) -> { + game.addEffect(continuousEffect, source); + }); + return true; + } +} + +class LegionWarbossAbility extends StaticAbility { + + public LegionWarbossAbility() { + super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect( + Duration.WhileOnBattlefield, true + ).setText("this creature attacks this combat if able")); + } + + public LegionWarbossAbility(LegionWarbossAbility ability) { + super(ability); + } + + @Override + public LegionWarbossAbility copy() { + return new LegionWarbossAbility(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LightOfTheLegion.java b/Mage.Sets/src/mage/cards/l/LightOfTheLegion.java new file mode 100644 index 0000000000..c9581e3949 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LightOfTheLegion.java @@ -0,0 +1,58 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author TheElk801 + */ +public final class LightOfTheLegion extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledCreaturePermanent("white creature you control"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public LightOfTheLegion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + + this.subtype.add(SubType.ANGEL); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + + // When Light of the Legion dies, put a +1/+1 counter on each white creature you control. + this.addAbility(new DiesTriggeredAbility(new AddCountersAllEffect( + CounterType.P1P1.createInstance(), filter + ))); + } + + public LightOfTheLegion(final LightOfTheLegion card) { + super(card); + } + + @Override + public LightOfTheLegion copy() { + return new LightOfTheLegion(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LilianaDeathWielder.java b/Mage.Sets/src/mage/cards/l/LilianaDeathWielder.java index 5b9441bce9..b5479ee159 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaDeathWielder.java +++ b/Mage.Sets/src/mage/cards/l/LilianaDeathWielder.java @@ -4,7 +4,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; @@ -40,7 +40,7 @@ public final class LilianaDeathWielder extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Put a -1/-1 counter on up to one target creature. LoyaltyAbility ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(1)), 2); diff --git a/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java b/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java index 67bfda10b6..15b9dd6eb4 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java +++ b/Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java @@ -3,7 +3,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; @@ -39,7 +39,7 @@ public final class LilianaDeathsMajesty extends CardImpl { this.subtype.add(SubType.LILIANA); //Starting Loyalty: 5 - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Create a 2/2 black Zombie creature token. Put the top two cards of your library into your graveyard. LoyaltyAbility ability = new LoyaltyAbility(new CreateTokenEffect(new ZombieToken()), 1); diff --git a/Mage.Sets/src/mage/cards/l/LilianaDefiantNecromancer.java b/Mage.Sets/src/mage/cards/l/LilianaDefiantNecromancer.java index b27e8ce73d..f6a0956905 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaDefiantNecromancer.java +++ b/Mage.Sets/src/mage/cards/l/LilianaDefiantNecromancer.java @@ -4,7 +4,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.common.GetEmblemEffect; @@ -44,7 +44,7 @@ public final class LilianaDefiantNecromancer extends CardImpl { this.nightCard = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Each player discards a card. this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(1, false), 2)); diff --git a/Mage.Sets/src/mage/cards/l/LilianaOfTheDarkRealms.java b/Mage.Sets/src/mage/cards/l/LilianaOfTheDarkRealms.java index eec4019313..5f8d2b5eed 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/cards/l/LilianaOfTheDarkRealms.java @@ -4,7 +4,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; @@ -39,7 +39,7 @@ public final class LilianaOfTheDarkRealms extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Search your library for a Swamp card, reveal it, and put it into your hand. Then shuffle your library. this.addAbility(new LoyaltyAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), 1)); diff --git a/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java b/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java index db15b2a74d..88d49d3ec9 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java +++ b/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; @@ -35,7 +35,7 @@ public final class LilianaOfTheVeil extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Each player discards a card. this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/l/LilianaTheLastHope.java b/Mage.Sets/src/mage/cards/l/LilianaTheLastHope.java index d3c2e20b86..91fc2bcefc 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaTheLastHope.java +++ b/Mage.Sets/src/mage/cards/l/LilianaTheLastHope.java @@ -4,7 +4,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -37,7 +37,7 @@ public final class LilianaTheLastHope extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Up to one target creature gets -2/-1 until your next turn. Effect effect = new BoostTargetEffect(-2, -1, Duration.UntilYourNextTurn); diff --git a/Mage.Sets/src/mage/cards/l/LilianaTheNecromancer.java b/Mage.Sets/src/mage/cards/l/LilianaTheNecromancer.java index 9023347f94..90fdc0b1ec 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaTheNecromancer.java +++ b/Mage.Sets/src/mage/cards/l/LilianaTheNecromancer.java @@ -3,7 +3,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; @@ -39,7 +39,7 @@ public final class LilianaTheNecromancer extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Target player loses 2 life. Ability ability = new LoyaltyAbility(new LoseLifeTargetEffect(2), 1); diff --git a/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java b/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java index 6d569e1012..f131e898ac 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java +++ b/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java @@ -4,7 +4,7 @@ import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.AsThoughEffectImpl; @@ -40,7 +40,7 @@ public final class LilianaUntouchedByDeath extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Put the top three cards of your library into your graveyard. If at least one of them is a Zombie card, each opponent loses 2 life and you gain 2 life. this.addAbility(new LoyaltyAbility(new LilianaUntouchedByDeathEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/l/LilianaVess.java b/Mage.Sets/src/mage/cards/l/LilianaVess.java index 1de4e24808..63f4bf5d78 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaVess.java +++ b/Mage.Sets/src/mage/cards/l/LilianaVess.java @@ -3,7 +3,7 @@ package mage.cards.l; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; @@ -36,7 +36,7 @@ public final class LilianaVess extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LILIANA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Target player discards a card. LoyaltyAbility ability1 = new LoyaltyAbility(new DiscardTargetEffect(1), 1); ability1.addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/l/LinessaZephyrMage.java b/Mage.Sets/src/mage/cards/l/LinessaZephyrMage.java index 8b3b4e9360..17167aa7b9 100644 --- a/Mage.Sets/src/mage/cards/l/LinessaZephyrMage.java +++ b/Mage.Sets/src/mage/cards/l/LinessaZephyrMage.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.UUID; @@ -16,7 +15,6 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.SuperType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; @@ -29,6 +27,7 @@ import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; +import mage.target.targetadjustment.XCMCPermanentAdjuster; /** * @@ -55,7 +54,7 @@ public final class LinessaZephyrMage extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}{U}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_PERM); + ability.setTargetAdjuster(XCMCPermanentAdjuster.instance); this.addAbility(ability); // Grandeur - Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner's hand, then repeats this process for an artifact, an enchantment, and a land. diff --git a/Mage.Sets/src/mage/cards/l/LordWindgrace.java b/Mage.Sets/src/mage/cards/l/LordWindgrace.java index 3cbd21e70f..a4126678c5 100644 --- a/Mage.Sets/src/mage/cards/l/LordWindgrace.java +++ b/Mage.Sets/src/mage/cards/l/LordWindgrace.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -42,7 +42,7 @@ public final class LordWindgrace extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.WINDGRACE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Discard a card, then draw a card. If a land card is discarded this way, draw an additional card. this.addAbility(new LoyaltyAbility(new LordWindgraceEffect(), 2)); diff --git a/Mage.Sets/src/mage/cards/l/LotlethGiant.java b/Mage.Sets/src/mage/cards/l/LotlethGiant.java new file mode 100644 index 0000000000..f87c98c1f1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LotlethGiant.java @@ -0,0 +1,48 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.target.common.TargetOpponent; + +/** + * + * @author TheElk801 + */ +public final class LotlethGiant extends CardImpl { + + public LotlethGiant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.GIANT); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Undergrowth — When Lotleth Giant enters the battlefield, it deals 1 damage to target opponent for each creature card in your graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DamageTargetEffect(new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ), "it"), false, "<i>Undergrowth</i> — " + ); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public LotlethGiant(final LotlethGiant card) { + super(card); + } + + @Override + public LotlethGiant copy() { + return new LotlethGiant(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LoxodonRestorer.java b/Mage.Sets/src/mage/cards/l/LoxodonRestorer.java new file mode 100644 index 0000000000..32476ca1a8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LoxodonRestorer.java @@ -0,0 +1,44 @@ +package mage.cards.l; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class LoxodonRestorer extends CardImpl { + + public LoxodonRestorer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + + this.subtype.add(SubType.ELEPHANT); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // When Loxodon Restorer enters the battlefield, you gain 4 life. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new GainLifeEffect(4), false + )); + } + + public LoxodonRestorer(final LoxodonRestorer card) { + super(card); + } + + @Override + public LoxodonRestorer copy() { + return new LoxodonRestorer(this); + } +} diff --git a/Mage.Sets/src/mage/cards/l/LudevicNecroAlchemist.java b/Mage.Sets/src/mage/cards/l/LudevicNecroAlchemist.java index c813ab3c37..9499bda49e 100644 --- a/Mage.Sets/src/mage/cards/l/LudevicNecroAlchemist.java +++ b/Mage.Sets/src/mage/cards/l/LudevicNecroAlchemist.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.Objects; @@ -33,7 +32,8 @@ public final class LudevicNecroAlchemist extends CardImpl { this.toughness = new MageInt(4); // At the beginning of each player's end step, that player may draw a card if a player other than you lost life this turn. - this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LudevicNecroAlchemistEffect(), TargetController.ANY, new LudevicNecroAlchemistCondition(), false)); + this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, + new LudevicNecroAlchemistEffect(), TargetController.EACH_PLAYER, new LudevicNecroAlchemistCondition(), false)); // Partner this.addAbility(PartnerAbility.getInstance()); @@ -54,11 +54,10 @@ class LudevicNecroAlchemistCondition implements Condition { @Override public boolean apply(Game game, Ability source) { PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get(PlayerLostLifeWatcher.class.getSimpleName()); - UUID player = game.getActivePlayerId(); PlayerList playerList = game.getState().getPlayerList().copy(); - Player currentPlayer = null; + Player currentPlayer; UUID sourcePlayerId = source.getControllerId(); - Player firstPlayer = null; + Player firstPlayer; if (playerList == null) { return false; } @@ -77,6 +76,7 @@ class LudevicNecroAlchemistCondition implements Condition { return false; } + @Override public String toString() { return "if a player other than you lost life this turn"; } @@ -86,7 +86,7 @@ class LudevicNecroAlchemistEffect extends OneShotEffect { public LudevicNecroAlchemistEffect() { super(Outcome.DrawCard); - staticText = "that player may draw a card if a player other than you lost life this turn"; + staticText = "that player may draw a card"; } public LudevicNecroAlchemistEffect(final LudevicNecroAlchemistEffect effect) { diff --git a/Mage.Sets/src/mage/cards/l/LukeSkywalkerTheLastJedi.java b/Mage.Sets/src/mage/cards/l/LukeSkywalkerTheLastJedi.java index 37f18bdf53..c5bbb81d94 100644 --- a/Mage.Sets/src/mage/cards/l/LukeSkywalkerTheLastJedi.java +++ b/Mage.Sets/src/mage/cards/l/LukeSkywalkerTheLastJedi.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.PutOnLibraryTargetEffect; @@ -16,7 +16,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.counters.CounterType; import mage.filter.FilterPermanent; -import mage.filter.StaticFilters; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.command.emblems.LukeSkywalkerEmblem; @@ -40,7 +39,7 @@ public final class LukeSkywalkerTheLastJedi extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.LUKE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Put two +1/+1 counters on up to one target creature. Ability ability1 = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), 2); diff --git a/Mage.Sets/src/mage/cards/m/MagesContest.java b/Mage.Sets/src/mage/cards/m/MagesContest.java index bf7b44a7c1..c095a5da5b 100644 --- a/Mage.Sets/src/mage/cards/m/MagesContest.java +++ b/Mage.Sets/src/mage/cards/m/MagesContest.java @@ -68,11 +68,11 @@ class MagesContestEffect extends OneShotEffect { Player winner = you; Player currentPlayer = spellController; do { - if (currentPlayer != null && currentPlayer.canRespond()) { + if (currentPlayer.canRespond()) { int newBid = 0; if (!currentPlayer.isHuman()) { // make AI evaluate value of the spell to decide on bidding, should be reworked - int maxBid = Math.min(RandomUtil.nextInt(Math.max(currentPlayer.getLife(), 0)) + RandomUtil.nextInt(spell.getConvertedManaCost()), currentPlayer.getLife()); + int maxBid = Math.min(RandomUtil.nextInt(Math.max(currentPlayer.getLife(), 1)) + RandomUtil.nextInt(Math.max(spell.getConvertedManaCost(), 1)), currentPlayer.getLife()); if (highBid + 1 < maxBid) { newBid = highBid + 1; } diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java b/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java index 5f190e369d..7907d01b9d 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheCandelabra.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -13,10 +12,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @author duncant @@ -37,7 +36,7 @@ public final class MagusOfTheCandelabra extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/ManiacalRage.java b/Mage.Sets/src/mage/cards/m/ManiacalRage.java index db69796019..703a675416 100644 --- a/Mage.Sets/src/mage/cards/m/ManiacalRage.java +++ b/Mage.Sets/src/mage/cards/m/ManiacalRage.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -21,19 +20,20 @@ import mage.target.common.TargetCreaturePermanent; public final class ManiacalRage extends CardImpl { public ManiacalRage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.subtype.add(SubType.AURA); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + // Enchanted creature gets +2/+2 and can't block. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAttachedEffect(AttachmentType.AURA))); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)); + ability.addEffect(new CantBlockAttachedEffect(AttachmentType.AURA).setText("and can't block")); + this.addAbility(ability); } public ManiacalRage(final ManiacalRage card) { diff --git a/Mage.Sets/src/mage/cards/m/MaraudingMaulhorn.java b/Mage.Sets/src/mage/cards/m/MaraudingMaulhorn.java index f807e29147..389a96dd0f 100644 --- a/Mage.Sets/src/mage/cards/m/MaraudingMaulhorn.java +++ b/Mage.Sets/src/mage/cards/m/MaraudingMaulhorn.java @@ -2,22 +2,20 @@ package mage.cards.m; import java.util.UUID; + import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalRequirementEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.ComparisonType; -import mage.constants.Duration; +import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; /** - * * @author jeffwadsworth */ public final class MaraudingMaulhorn extends CardImpl { @@ -29,7 +27,7 @@ public final class MaraudingMaulhorn extends CardImpl { } public MaraudingMaulhorn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(5); @@ -40,6 +38,7 @@ public final class MaraudingMaulhorn extends CardImpl { new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true), new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 1)); effect.setText("{this} attacks each combat if able unless you control a creature named Advocate of the Beast"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } public MaraudingMaulhorn(final MaraudingMaulhorn card) { diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java b/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java new file mode 100644 index 0000000000..b15c38640f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheMultitudes.java @@ -0,0 +1,39 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class MarchOfTheMultitudes extends CardImpl { + + public MarchOfTheMultitudes(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}{W}{W}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Create X 1/1 white Soldier creature tokens with lifelink. + this.getSpellAbility().addEffect(new CreateTokenEffect( + new SoldierLifelinkToken(), + new ManacostVariableValue() + )); + } + + public MarchOfTheMultitudes(final MarchOfTheMultitudes card) { + super(card); + } + + @Override + public MarchOfTheMultitudes copy() { + return new MarchOfTheMultitudes(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MarkOfAsylum.java b/Mage.Sets/src/mage/cards/m/MarkOfAsylum.java index 8249e5af57..64af2f0f62 100644 --- a/Mage.Sets/src/mage/cards/m/MarkOfAsylum.java +++ b/Mage.Sets/src/mage/cards/m/MarkOfAsylum.java @@ -1,7 +1,6 @@ package mage.cards.m; -import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.PreventAllNonCombatDamageToAllEffect; import mage.cards.CardImpl; @@ -9,23 +8,26 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreatureInPlay; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author jeffwadsworth */ public final class MarkOfAsylum extends CardImpl { - - private static final FilterControlledCreatureInPlay filter = new FilterControlledCreatureInPlay("creatures you control"); - - public MarkOfAsylum(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + public MarkOfAsylum(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // Prevent all noncombat damage that would be dealt to creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllNonCombatDamageToAllEffect(Duration.WhileOnBattlefield, filter))); - + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new PreventAllNonCombatDamageToAllEffect( + Duration.WhileOnBattlefield, + StaticFilters.FILTER_CONTROLLED_CREATURES + ) + )); } public MarkOfAsylum(final MarkOfAsylum card) { diff --git a/Mage.Sets/src/mage/cards/m/MausoleumSecrets.java b/Mage.Sets/src/mage/cards/m/MausoleumSecrets.java new file mode 100644 index 0000000000..ba1d00f609 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MausoleumSecrets.java @@ -0,0 +1,75 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author TheElk801 + */ +public final class MausoleumSecrets extends CardImpl { + + public MausoleumSecrets(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); + + // Undergrowth — Search your library for a black card with converted mana cost equal to or less than the number of creature cards in your graveyard, reveal it, put it into your hand, then shuffle your library. + this.getSpellAbility().addEffect(new MausoleumSecretsEffect()); + } + + public MausoleumSecrets(final MausoleumSecrets card) { + super(card); + } + + @Override + public MausoleumSecrets copy() { + return new MausoleumSecrets(this); + } +} + +class MausoleumSecretsEffect extends OneShotEffect { + + public MausoleumSecretsEffect() { + super(Outcome.Benefit); + this.staticText = "<i>Undergrowth</i> — Search your library " + + "for a black card with converted mana cost less than " + + "or equal to the number of creature cards in your graveyard, " + + "reveal it, put it into your hand, then shuffle your library."; + } + + public MausoleumSecretsEffect(final MausoleumSecretsEffect effect) { + super(effect); + } + + @Override + public MausoleumSecretsEffect copy() { + return new MausoleumSecretsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int critterCount = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); + FilterCard filter = new FilterCard("a black card with converted mana cost less than or equal to " + critterCount); + filter.add(new ColorPredicate(ObjectColor.BLACK)); + filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, critterCount + 1)); + return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MaximizeAltitude.java b/Mage.Sets/src/mage/cards/m/MaximizeAltitude.java new file mode 100644 index 0000000000..308b860ad5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MaximizeAltitude.java @@ -0,0 +1,45 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class MaximizeAltitude extends CardImpl { + + public MaximizeAltitude(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}"); + + // Target creature gets +1/+1 and flying until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect( + 1, 1, Duration.EndOfTurn + ).setText("Target creature gets +1/+1")); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains flying until end of turn")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + + } + + public MaximizeAltitude(final MaximizeAltitude card) { + super(card); + } + + @Override + public MaximizeAltitude copy() { + return new MaximizeAltitude(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MaximizeVelocity.java b/Mage.Sets/src/mage/cards/m/MaximizeVelocity.java new file mode 100644 index 0000000000..ed6912350b --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MaximizeVelocity.java @@ -0,0 +1,45 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class MaximizeVelocity extends CardImpl { + + public MaximizeVelocity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}"); + + // Target creature gets +1/+1 and gains haste until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect( + 1, 1, Duration.EndOfTurn + ).setText("Target creature gets +1/+1")); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect( + HasteAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains haste until end of turn")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + + } + + public MaximizeVelocity(final MaximizeVelocity card) { + super(card); + } + + @Override + public MaximizeVelocity copy() { + return new MaximizeVelocity(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java b/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java index 32170f2ac6..d88bb2b928 100644 --- a/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java +++ b/Mage.Sets/src/mage/cards/m/MeletisCharlatan.java @@ -71,7 +71,7 @@ class MeletisCharlatanCopyTargetSpellEffect extends OneShotEffect { if (spell != null) { StackObject newStackObject = spell.createCopyOnStack(game, source, spell.getControllerId(), true); Player player = game.getPlayer(spell.getControllerId()); - if (player != null && newStackObject != null && newStackObject instanceof Spell) { + if (player != null && newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/m/MephiticVapors.java b/Mage.Sets/src/mage/cards/m/MephiticVapors.java new file mode 100644 index 0000000000..ec478c8d4a --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MephiticVapors.java @@ -0,0 +1,35 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * + * @author TheElk801 + */ +public final class MephiticVapors extends CardImpl { + + public MephiticVapors(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); + + // All creatures get -1/-1 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn)); + + // Surveil 2. + this.getSpellAbility().addEffect(new SurveilEffect(2)); + } + + public MephiticVapors(final MephiticVapors card) { + super(card); + } + + @Override + public MephiticVapors copy() { + return new MephiticVapors(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MetallicMimic.java b/Mage.Sets/src/mage/cards/m/MetallicMimic.java index 9dfcca6887..2fbc1bc0d9 100644 --- a/Mage.Sets/src/mage/cards/m/MetallicMimic.java +++ b/Mage.Sets/src/mage/cards/m/MetallicMimic.java @@ -80,7 +80,7 @@ class MetallicMimicReplacementEffect extends ReplacementEffectImpl { && enteringCreature.isControlledBy(source.getControllerId()) && enteringCreature.isCreature() && !event.getTargetId().equals(source.getSourceId())) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); return subType != null && enteringCreature.hasSubtype(subType, game); } return false; diff --git a/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java b/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java index 562ca786fa..0b77db9540 100644 --- a/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java +++ b/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java @@ -91,7 +91,7 @@ class MetzaliTowerOfTriumphEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Watcher watcher = game.getState().getWatchers().get(AttackedThisTurnWatcher.class.getSimpleName()); - if (watcher != null && watcher instanceof AttackedThisTurnWatcher) { + if (watcher instanceof AttackedThisTurnWatcher) { Set<MageObjectReference> attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures(); List<Permanent> available = new ArrayList<>(); for (MageObjectReference mor : attackedThisTurn) { diff --git a/Mage.Sets/src/mage/cards/m/MidnightReaper.java b/Mage.Sets/src/mage/cards/m/MidnightReaper.java new file mode 100644 index 0000000000..5af4535203 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MidnightReaper.java @@ -0,0 +1,60 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TokenPredicate; + +/** + * + * @author TheElk801 + */ +public final class MidnightReaper extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("nontoken creature you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TokenPredicate())); + } + + public MidnightReaper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever a nontoken creature you control dies, Midnight Reaper deals 1 damage to you and you draw a card. + Ability ability = new DiesCreatureTriggeredAbility( + new DamageControllerEffect(1), false, filter + ); + ability.addEffect( + new DrawCardSourceControllerEffect(1) + .setText("and you draw a card") + ); + this.addAbility(ability); + } + + public MidnightReaper(final MidnightReaper card) { + super(card); + } + + @Override + public MidnightReaper copy() { + return new MidnightReaper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MilitiaBugler.java b/Mage.Sets/src/mage/cards/m/MilitiaBugler.java index dc13cdc4cf..ec464a3aa2 100644 --- a/Mage.Sets/src/mage/cards/m/MilitiaBugler.java +++ b/Mage.Sets/src/mage/cards/m/MilitiaBugler.java @@ -20,7 +20,7 @@ import mage.filter.predicate.mageobject.PowerPredicate; */ public final class MilitiaBugler extends CardImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("creature card with power 2 or less"); + private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card with power 2 or less"); static { filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); diff --git a/Mage.Sets/src/mage/cards/m/MinamoSightbender.java b/Mage.Sets/src/mage/cards/m/MinamoSightbender.java index b20ca6ff0d..dc001957da 100644 --- a/Mage.Sets/src/mage/cards/m/MinamoSightbender.java +++ b/Mage.Sets/src/mage/cards/m/MinamoSightbender.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -11,13 +10,17 @@ import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; import mage.target.Target; import mage.target.TargetPermanent; +import mage.target.targetadjustment.TargetAdjuster; /** * @@ -42,7 +45,7 @@ public final class MinamoSightbender extends CardImpl { // {X}, {T}: Target creature with power X or less can't be blocked this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new ManaCostsImpl("{X}")); Target target = new TargetPermanent(filter); - ability.setTargetAdjustment(TargetAdjustment.X_POWER_LEQ); + ability.setTargetAdjuster(MinamoSightbenderAdjuster.instance); ability.addTarget(target); ability.addCost(new TapSourceCost()); this.addAbility(ability); @@ -58,3 +61,16 @@ public final class MinamoSightbender extends CardImpl { return new MinamoSightbender(this); } } + +enum MinamoSightbenderAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterPermanent permanentFilter = new FilterCreaturePermanent("creature with power " + xValue + " or less"); + permanentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetPermanent(permanentFilter)); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MiraculousRecovery.java b/Mage.Sets/src/mage/cards/m/MiraculousRecovery.java index 5cbb1201d2..6e03b826a5 100644 --- a/Mage.Sets/src/mage/cards/m/MiraculousRecovery.java +++ b/Mage.Sets/src/mage/cards/m/MiraculousRecovery.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -10,10 +9,9 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; /** @@ -23,13 +21,13 @@ import mage.target.common.TargetCardInYourGraveyard; public final class MiraculousRecovery extends CardImpl { public MiraculousRecovery(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{W}"); // Return target creature card from your graveyard to the battlefield. Put a +1/+1 counter on it. this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); - Target target = new TargetCardInYourGraveyard(new FilterCreatureCard()); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard( + StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD + )); this.getSpellAbility().addEffect(new MiraculousRecoveryEffect()); } @@ -64,7 +62,7 @@ class MiraculousRecoveryEffect extends OneShotEffect { // targetPointer can't be used because target moved from graveyard to battlefield Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { - permanent.addCounters(CounterType.P1P1.createInstance(), source, game); + permanent.addCounters(CounterType.P1P1.createInstance(), source, game); } return false; } diff --git a/Mage.Sets/src/mage/cards/m/MirrorGolem.java b/Mage.Sets/src/mage/cards/m/MirrorGolem.java index 96aa5fb00e..c5e918fd2f 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorGolem.java +++ b/Mage.Sets/src/mage/cards/m/MirrorGolem.java @@ -9,11 +9,10 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.Card; -import mage.constants.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.*; import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.ExileZone; import mage.game.Game; @@ -30,7 +29,7 @@ public final class MirrorGolem extends CardImpl { public MirrorGolem(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); - + this.subtype.add(SubType.GOLEM); this.power = new MageInt(3); this.toughness = new MageInt(4); @@ -109,18 +108,18 @@ class MirrorGolemEffect extends ContinuousEffectImpl { return false; } - for (UUID imprinted : sourceObject.getImprinted()){ - if (imprinted != null && exileZone.contains(imprinted)){ + for (UUID imprinted : sourceObject.getImprinted()) { + if (imprinted != null && exileZone.contains(imprinted)) { Card card = game.getCard(imprinted); if (card != null) { - for (CardType cardType : card.getCardType()){ + for (CardType cardType : card.getCardType()) { FilterCard filterCard; - if (cardType.equals(CardType.SORCERY)){ + if (cardType.equals(CardType.SORCERY)) { filterCard = new FilterCard("sorceries"); - } else if (cardType.equals(CardType.TRIBAL)){ + } else if (cardType.equals(CardType.TRIBAL)) { filterCard = new FilterCard("tribal"); } else { - filterCard = new FilterCard(cardType.toString()+"s"); + filterCard = new FilterCard(cardType.toString() + "s"); } filterCard.add(new CardTypePredicate(cardType)); sourceObject.addAbility(new ProtectionAbility(filterCard)); @@ -135,4 +134,4 @@ class MirrorGolemEffect extends ContinuousEffectImpl { public MirrorGolemEffect copy() { return new MirrorGolemEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/m/MishrasHelix.java b/Mage.Sets/src/mage/cards/m/MishrasHelix.java index 3a9a6d23ee..7bad595163 100644 --- a/Mage.Sets/src/mage/cards/m/MishrasHelix.java +++ b/Mage.Sets/src/mage/cards/m/MishrasHelix.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -11,10 +10,10 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @@ -30,7 +29,7 @@ public final class MishrasHelix extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MissionBriefing.java b/Mage.Sets/src/mage/cards/m/MissionBriefing.java new file mode 100644 index 0000000000..128cecbc49 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MissionBriefing.java @@ -0,0 +1,165 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class MissionBriefing extends CardImpl { + + public MissionBriefing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}"); + + // Surveil 2, then choose an instant or sorcery card in your graveyard. You may cast that card this turn. If that card would be put into your graveyard this turn, exile it instead. + this.getSpellAbility().addEffect(new MissionBriefingEffect()); + } + + public MissionBriefing(final MissionBriefing card) { + super(card); + } + + @Override + public MissionBriefing copy() { + return new MissionBriefing(this); + } +} + +class MissionBriefingEffect extends OneShotEffect { + + public static final FilterCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"); + + public MissionBriefingEffect() { + super(Outcome.Benefit); + this.staticText = "Surveil 2, then choose an instant or sorcery card " + + "in your graveyard. You may cast that card this turn. " + + "If that card would be put into your graveyard this turn, " + + "exile it instead."; + } + + public MissionBriefingEffect(final MissionBriefingEffect effect) { + super(effect); + } + + @Override + public MissionBriefingEffect copy() { + return new MissionBriefingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.surveil(2, source, game); + Target target = new TargetCardInYourGraveyard(filter); + if (!player.choose(outcome, target, source.getSourceId(), game)) { + return false; + } + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + ContinuousEffect effect = new MissionBriefingCastFromGraveyardEffect(); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + game.addEffect(effect, source); + effect = new MissionBriefingReplacementEffect(card.getId()); + game.addEffect(effect, source); + return true; + } + return false; + } +} + +class MissionBriefingCastFromGraveyardEffect extends AsThoughEffectImpl { + + public MissionBriefingCastFromGraveyardEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + } + + public MissionBriefingCastFromGraveyardEffect(final MissionBriefingCastFromGraveyardEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public MissionBriefingCastFromGraveyardEffect copy() { + return new MissionBriefingCastFromGraveyardEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return objectId.equals(this.getTargetPointer().getFirst(game, source)) + && affectedControllerId.equals(source.getControllerId()); + } +} + +class MissionBriefingReplacementEffect extends ReplacementEffectImpl { + + private final UUID cardId; + + public MissionBriefingReplacementEffect(UUID cardId) { + super(Duration.EndOfTurn, Outcome.Exile); + this.cardId = cardId; + staticText = "If that card would be put into your graveyard this turn, " + + "exile it instead"; + } + + public MissionBriefingReplacementEffect(final MissionBriefingReplacementEffect effect) { + super(effect); + this.cardId = effect.cardId; + } + + @Override + public MissionBriefingReplacementEffect copy() { + return new MissionBriefingReplacementEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + Card card = game.getCard(this.cardId); + if (controller != null && card != null) { + controller.moveCardsToExile(card, source, game, true, null, ""); + return true; + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTargetId().equals(this.cardId); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MistveilPlains.java b/Mage.Sets/src/mage/cards/m/MistveilPlains.java index bc811b0d1c..f564de722b 100644 --- a/Mage.Sets/src/mage/cards/m/MistveilPlains.java +++ b/Mage.Sets/src/mage/cards/m/MistveilPlains.java @@ -1,7 +1,6 @@ package mage.cards.m; -import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; @@ -14,29 +13,28 @@ import mage.abilities.mana.WhiteManaAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.ComparisonType; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; +import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class MistveilPlains extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control two or more white permanents"); + static { filter.add(new ColorPredicate(ObjectColor.WHITE)); } public MistveilPlains(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); this.subtype.add(SubType.PLAINS); // <i>({tap}: Add {W}.)</i> @@ -47,10 +45,11 @@ public final class MistveilPlains extends CardImpl { // {W}, {tap}: Put target card from your graveyard on the bottom of your library. Activate this ability only if you control two or more white permanents. Ability ability = new ActivateIfConditionActivatedAbility( - Zone.BATTLEFIELD, - new MistveilPlainsGraveyardToLibraryEffect(), - new ManaCostsImpl("{W}"), - new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1)); + Zone.BATTLEFIELD, + new MistveilPlainsGraveyardToLibraryEffect(), + new ManaCostsImpl("{W}"), + new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1) + ); ability.addTarget(new TargetCardInYourGraveyard()); ability.addCost(new TapSourceCost()); this.addAbility(ability); @@ -85,10 +84,12 @@ class MistveilPlainsGraveyardToLibraryEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { - return card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + Card card = game.getCard(source.getFirstTarget()); + Player player = game.getPlayer(source.getControllerId()); + if (card == null || player == null || + game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { + return false; } - return false; + return player.putCardsOnBottomOfLibrary(card, game, source, false); } } diff --git a/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java b/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java new file mode 100644 index 0000000000..019527dd74 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java @@ -0,0 +1,251 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.cards.*; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MnemonicBetrayal extends CardImpl { + + public MnemonicBetrayal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{B}"); + + // Exile all cards from all opponents' graveyards. You may cast those cards this turn, and you may spend mana as though it were mana of any type to cast those spells. At the beginning of the next end step, if any of those cards remain exiled, return them to their owner's graveyards. + this.getSpellAbility().addEffect(new MnemonicBetrayalExileEffect()); + + // Exile Mnemonic Betrayal. + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + } + + public MnemonicBetrayal(final MnemonicBetrayal card) { + super(card); + } + + @Override + public MnemonicBetrayal copy() { + return new MnemonicBetrayal(this); + } +} + +class MnemonicBetrayalExileEffect extends OneShotEffect { + + public MnemonicBetrayalExileEffect() { + super(Outcome.Benefit); + this.staticText = "Exile all cards from all opponents' graveyards. " + + "You may cast those cards this turn, " + + "and you may spend mana as though it were mana of any type " + + "to cast those spells. At the beginning of the next end step, " + + "if any of those cards remain exiled, " + + "return them to their owner's graveyards"; + } + + public MnemonicBetrayalExileEffect(final MnemonicBetrayalExileEffect effect) { + super(effect); + } + + @Override + public MnemonicBetrayalExileEffect copy() { + return new MnemonicBetrayalExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Cards cards = new CardsImpl(); + Map<UUID, Integer> cardMap = new HashMap(); + for (UUID playerId : game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(playerId); + if (player != null) { + cards.addAll(player.getGraveyard()); + } + } + for (Card card : cards.getCards(game)) { + cardMap.put(card.getId(), card.getZoneChangeCounter(game)); + game.addEffect(new MnemonicBetrayalCastFromExileEffect(card, game), source); + game.addEffect(new MnemonicBetrayalAnyColorEffect(card, game), source); + } + controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), source.getSourceObjectIfItStillExists(game).getName()); + game.addDelayedTriggeredAbility(new MnemonicBetrayalDelayedTriggeredAbility(cards, cardMap), source); + return true; + } +} + +class MnemonicBetrayalCastFromExileEffect extends AsThoughEffectImpl { + + private final Card card; + private final int zoneCounter; + + public MnemonicBetrayalCastFromExileEffect(Card card, Game game) { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); + this.card = card; + this.zoneCounter = card.getZoneChangeCounter(game) + 1; + } + + public MnemonicBetrayalCastFromExileEffect(final MnemonicBetrayalCastFromExileEffect effect) { + super(effect); + this.card = effect.card; + this.zoneCounter = effect.zoneCounter; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public MnemonicBetrayalCastFromExileEffect copy() { + return new MnemonicBetrayalCastFromExileEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (card.getZoneChangeCounter(game) != zoneCounter) { + this.discard(); + return false; + } + return objectId.equals(card.getId()) + && card.getZoneChangeCounter(game) == zoneCounter + && affectedControllerId.equals(source.getControllerId()); + } +} + +class MnemonicBetrayalAnyColorEffect extends AsThoughEffectImpl { + + private final Card card; + private final int zoneCounter; + + public MnemonicBetrayalAnyColorEffect(Card card, Game game) { + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.Custom, Outcome.Benefit); + this.card = card; + this.zoneCounter = card.getZoneChangeCounter(game) + 1; + } + + public MnemonicBetrayalAnyColorEffect(final MnemonicBetrayalAnyColorEffect effect) { + super(effect); + this.card = effect.card; + this.zoneCounter = effect.zoneCounter; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public MnemonicBetrayalAnyColorEffect copy() { + return new MnemonicBetrayalAnyColorEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (card.getZoneChangeCounter(game) != zoneCounter) { + this.discard(); + return false; + } + return objectId.equals(card.getId()) + && card.getZoneChangeCounter(game) == zoneCounter + && affectedControllerId.equals(source.getControllerId()); + } +} + +class MnemonicBetrayalDelayedTriggeredAbility extends DelayedTriggeredAbility { + + private final Cards cards; + private final Map<UUID, Integer> cardMap = new HashMap(); + + public MnemonicBetrayalDelayedTriggeredAbility(Cards cards, Map<UUID, Integer> cardMap) { + super(new MnemonicBetrayalReturnEffect(cards, cardMap)); + this.triggerOnlyOnce = true; + this.cards = cards; + this.cardMap.putAll(cardMap); + } + + public MnemonicBetrayalDelayedTriggeredAbility(final MnemonicBetrayalDelayedTriggeredAbility ability) { + super(ability); + this.cards = ability.cards.copy(); + this.cardMap.putAll(ability.cardMap); + } + + @Override + public MnemonicBetrayalDelayedTriggeredAbility copy() { + return new MnemonicBetrayalDelayedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.END_TURN_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return true; + } + + @Override + public boolean checkInterveningIfClause(Game game) { + return cards.stream().anyMatch((cardId) -> (game.getState().getZone(cardId) == Zone.EXILED + && game.getState().getZoneChangeCounter(cardId) == cardMap.getOrDefault(cardId, -5) + 1)); + } + + @Override + public String getRule() { + return "At the beginning of the next end step, " + + "if any of those cards remain exiled, " + + "return them to their owner's graveyards."; + } +} + +class MnemonicBetrayalReturnEffect extends OneShotEffect { + + private final Cards cards; + private final Map<UUID, Integer> cardMap = new HashMap(); + + public MnemonicBetrayalReturnEffect(Cards cards, Map<UUID, Integer> cardMap) { + super(Outcome.Benefit); + this.cards = cards; + this.cardMap.putAll(cardMap); + } + + public MnemonicBetrayalReturnEffect(final MnemonicBetrayalReturnEffect effect) { + super(effect); + this.cards = effect.cards.copy(); + this.cardMap.putAll(effect.cardMap); + } + + @Override + public MnemonicBetrayalReturnEffect copy() { + return new MnemonicBetrayalReturnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cardsToReturn = new CardsImpl(); + for (Card card : cards.getCards(game)) { + if (game.getState().getZone(card.getId()) == Zone.EXILED + && card.getZoneChangeCounter(game) == cardMap.getOrDefault(card.getId(), -5) + 1) { + cardsToReturn.add(card); + } + } + return player.moveCards(cardsToReturn, Zone.GRAVEYARD, source, game); + } +} diff --git a/Mage.Sets/src/mage/cards/m/Molderhulk.java b/Mage.Sets/src/mage/cards/m/Molderhulk.java new file mode 100644 index 0000000000..9f65632312 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/Molderhulk.java @@ -0,0 +1,59 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.cost.SourceCostReductionForEachCardInGraveyardEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.common.FilterLandCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class Molderhulk extends CardImpl { + + private static final FilterCard filter + = new FilterLandCard("land card from your graveyard"); + + public Molderhulk(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{B}{G}"); + + this.subtype.add(SubType.FUNGUS); + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Undergrowth — This spell costs {1} less to cast for each creature card in your graveyard. + Ability ability = new SimpleStaticAbility(Zone.ALL, new SourceCostReductionForEachCardInGraveyardEffect(StaticFilters.FILTER_CARD_CREATURE)); + ability.setAbilityWord(AbilityWord.UNDERGROWTH); + this.addAbility(ability); + + // When Molderhulk enters the battlefield, return target land card from your graveyard to the battlefield. + ability = new EntersBattlefieldTriggeredAbility( + new ReturnFromGraveyardToBattlefieldTargetEffect(), false + ); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + public Molderhulk(final Molderhulk card) { + super(card); + } + + @Override + public Molderhulk copy() { + return new Molderhulk(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MoodmarkPainter.java b/Mage.Sets/src/mage/cards/m/MoodmarkPainter.java new file mode 100644 index 0000000000..f114b04ed0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MoodmarkPainter.java @@ -0,0 +1,64 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class MoodmarkPainter extends CardImpl { + + public MoodmarkPainter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Undergrowth — When Moodmark Painter enters the battlefield, target creature gains menace and gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard. + DynamicValue xValue = new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ); + Ability ability = new EntersBattlefieldTriggeredAbility( + new GainAbilityTargetEffect( + new MenaceAbility(), + Duration.EndOfTurn + ).setText("target creature gains menace"), + false, "<i>Undergrowth</i> — " + ); + ability.addEffect(new BoostTargetEffect( + xValue, new StaticValue(0), + Duration.EndOfTurn, true + ).setText("and gets +X/+0 until end of turn, " + + "where X is the number of creature cards in your graveyard") + ); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MoodmarkPainter(final MoodmarkPainter card) { + super(card); + } + + @Override + public MoodmarkPainter copy() { + return new MoodmarkPainter(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MuYanling.java b/Mage.Sets/src/mage/cards/m/MuYanling.java index 04b3846758..f44cd02c01 100644 --- a/Mage.Sets/src/mage/cards/m/MuYanling.java +++ b/Mage.Sets/src/mage/cards/m/MuYanling.java @@ -4,7 +4,7 @@ package mage.cards.m; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; @@ -34,7 +34,7 @@ public final class MuYanling extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.YANLING); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Target creature can't be blocked this turn. LoyaltyAbility ability = new LoyaltyAbility(new CantBeBlockedTargetEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/m/MurmuringMystic.java b/Mage.Sets/src/mage/cards/m/MurmuringMystic.java new file mode 100644 index 0000000000..e68836883f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MurmuringMystic.java @@ -0,0 +1,43 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.BirdIllusionToken; + +/** + * + * @author TheElk801 + */ +public final class MurmuringMystic extends CardImpl { + + public MurmuringMystic(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(5); + + // Whenever you cast an instant or sorcery spell, create a 1/1 blue Bird Illusion creature token with flying. + this.addAbility(new SpellCastControllerTriggeredAbility( + new CreateTokenEffect(new BirdIllusionToken()), + StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY, false + )); + } + + public MurmuringMystic(final MurmuringMystic card) { + super(card); + } + + @Override + public MurmuringMystic copy() { + return new MurmuringMystic(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MuseDrake.java b/Mage.Sets/src/mage/cards/m/MuseDrake.java new file mode 100644 index 0000000000..fda50bc5a9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MuseDrake.java @@ -0,0 +1,43 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class MuseDrake extends CardImpl { + + public MuseDrake(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.DRAKE); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Muse Drake enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(1) + )); + } + + public MuseDrake(final MuseDrake card) { + super(card); + } + + @Override + public MuseDrake copy() { + return new MuseDrake(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NahiriTheHarbinger.java b/Mage.Sets/src/mage/cards/n/NahiriTheHarbinger.java index 6ca0c67b22..c0dd70f67e 100644 --- a/Mage.Sets/src/mage/cards/n/NahiriTheHarbinger.java +++ b/Mage.Sets/src/mage/cards/n/NahiriTheHarbinger.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.effects.ContinuousEffect; @@ -59,7 +59,7 @@ public final class NahiriTheHarbinger extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NAHIRI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: You may discard a card. If you do, draw a card. this.addAbility(new LoyaltyAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new DiscardCardCost()), 2)); diff --git a/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java b/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java index 2719500019..4a93fc8937 100644 --- a/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java +++ b/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -24,7 +24,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.KorSoldierToken; import mage.game.permanent.token.NahiriTheLithomancerEquipmentToken; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.Target; @@ -43,7 +42,7 @@ public final class NahiriTheLithomancer extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NAHIRI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Create a 1/1 white Kor Soldier creature token. You may attach an Equipment you control to it. this.addAbility(new LoyaltyAbility(new NahiriTheLithomancerFirstAbilityEffect(), 2)); diff --git a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java index afcaa7a0c1..0779b55bc2 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java @@ -6,7 +6,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -43,7 +43,7 @@ public final class NarsetTranscendent extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NARSET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); // +1: Look at the top card of your library. If it's a noncreature, nonland card, you may reveal it and put it into your hand. this.addAbility(new LoyaltyAbility(new NarsetTranscendentEffect1(), 1)); diff --git a/Mage.Sets/src/mage/cards/n/NecroticWound.java b/Mage.Sets/src/mage/cards/n/NecroticWound.java new file mode 100644 index 0000000000..a7369e2dce --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NecroticWound.java @@ -0,0 +1,48 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.ExileTargetIfDiesEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class NecroticWound extends CardImpl { + + public NecroticWound(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); + + // Undergrowth — Target creature gets -X/-X until end of turn, where X is the number of creature cards in your graveyard. If that creature would die this turn, exile it instead. + DynamicValue xValue = new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE, -1 + ); + this.getSpellAbility().addEffect( + new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true) + .setText("Target creature gets -X/-X until end of turn, " + + "where X is the number " + + "of creature cards in your graveyard.") + ); + this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().setAbilityWord(AbilityWord.UNDERGROWTH); + } + + public NecroticWound(final NecroticWound card) { + super(card); + } + + @Override + public NecroticWound copy() { + return new NecroticWound(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NeverHappened.java b/Mage.Sets/src/mage/cards/n/NeverHappened.java new file mode 100644 index 0000000000..e497c5e8dd --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NeverHappened.java @@ -0,0 +1,91 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterNonlandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetOpponent; + +/** + * + * @author TheElk801 + */ +public final class NeverHappened extends CardImpl { + + public NeverHappened(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); + + // Target opponent reveals their hand. You choose a nonland card from that player's graveyard or hand and exile it. + this.getSpellAbility().addEffect(new NeverHappenedEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public NeverHappened(final NeverHappened card) { + super(card); + } + + @Override + public NeverHappened copy() { + return new NeverHappened(this); + } +} + +class NeverHappenedEffect extends OneShotEffect { + + public NeverHappenedEffect() { + super(Outcome.Benefit); + this.staticText = "Target opponent reveals their hand. " + + "You choose a nonland card from that player's graveyard " + + "or hand and exile it."; + } + + public NeverHappenedEffect(final NeverHappenedEffect effect) { + super(effect); + } + + @Override + public NeverHappenedEffect copy() { + return new NeverHappenedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getFirstTarget()); + if (controller == null || opponent == null) { + return false; + } + opponent.revealCards(source, opponent.getHand(), game); + TargetCard target; + Cards cards; + if (controller.chooseUse(outcome, "Exile a card from hand or graveyard?", null, "Hand", "Graveyard", source, game)) { + FilterCard filter = new FilterNonlandCard("nonland card in " + opponent.getName() + "'s hand"); + target = new TargetCard(Zone.HAND, filter); + target.setNotTarget(true); + cards = opponent.getHand(); + } else { + FilterCard filter = new FilterNonlandCard("nonland card in " + opponent.getName() + "'s graveyard"); + target = new TargetCard(Zone.GRAVEYARD, filter); + target.setNotTarget(true); + cards = opponent.getGraveyard(); + } + if (controller.choose(outcome, cards, target, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + controller.moveCards(card, Zone.EXILED, source, game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java index 6f4f0c5119..af68ba9102 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; @@ -44,7 +44,7 @@ public final class NicolBolasGodPharaoh extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.BOLAS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); // +2: Target opponent exiles cards from the top of their library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost. LoyaltyAbility ability = new LoyaltyAbility(new NicolBolasGodPharaohPlusTwoEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasPlaneswalker.java b/Mage.Sets/src/mage/cards/n/NicolBolasPlaneswalker.java index ba43fe13c5..b9e0111c7d 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasPlaneswalker.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasPlaneswalker.java @@ -3,7 +3,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.SacrificeEffect; @@ -39,7 +39,7 @@ public final class NicolBolasPlaneswalker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.BOLAS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +3: Destroy target noncreature permanent. LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 3); diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java b/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java index 825c0d5c41..51ac41ea42 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java @@ -3,7 +3,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -51,7 +51,7 @@ public final class NicolBolasTheArisen extends CardImpl { this.nightCard = true; this.transformable = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); // +2: Draw two cards. this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(2), 2)); diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasTheDeceiver.java b/Mage.Sets/src/mage/cards/n/NicolBolasTheDeceiver.java index 7da742c5d8..fa50e526ab 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasTheDeceiver.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasTheDeceiver.java @@ -4,7 +4,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -34,7 +34,7 @@ public final class NicolBolasTheDeceiver extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{5}{U}{B}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.BOLAS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +3: Each opponent loses 3 life unless that player sacrifices a nonland permanent or discards a card. this.addAbility(new LoyaltyAbility(new NicolBolasTheDeceiverFirstEffect(), 3)); diff --git a/Mage.Sets/src/mage/cards/n/NightveilPredator.java b/Mage.Sets/src/mage/cards/n/NightveilPredator.java new file mode 100644 index 0000000000..acdb6dd8cb --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NightveilPredator.java @@ -0,0 +1,44 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class NightveilPredator extends CardImpl { + + public NightveilPredator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}{B}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + } + + public NightveilPredator(final NightveilPredator card) { + super(card); + } + + @Override + public NightveilPredator copy() { + return new NightveilPredator(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NightveilSprite.java b/Mage.Sets/src/mage/cards/n/NightveilSprite.java new file mode 100644 index 0000000000..6495bfe954 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NightveilSprite.java @@ -0,0 +1,42 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class NightveilSprite extends CardImpl { + + public NightveilSprite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); + + this.subtype.add(SubType.FAERIE); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Nightveil Faerie attacks, surveil 1. + this.addAbility(new AttacksTriggeredAbility(new SurveilEffect(1), false)); + } + + public NightveilSprite(final NightveilSprite card) { + super(card); + } + + @Override + public NightveilSprite copy() { + return new NightveilSprite(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java b/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java index 5fb9075221..1629683674 100644 --- a/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java +++ b/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java @@ -4,7 +4,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -43,7 +43,7 @@ public final class NissaGenesisMage extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); //+2: Untap up to two target creatures and up to two target lands. Ability ability = new LoyaltyAbility(new UntapTargetEffect(false).setText("Untap up to two target creatures and up to two target lands"), +2); diff --git a/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java b/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java index 886bbbf870..375be16f43 100644 --- a/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java +++ b/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java @@ -7,7 +7,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; @@ -40,7 +40,7 @@ public final class NissaNaturesArtisan extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +3: You gain 3 life. this.addAbility(new LoyaltyAbility(new GainLifeEffect(3), 3)); diff --git a/Mage.Sets/src/mage/cards/n/NissaRevane.java b/Mage.Sets/src/mage/cards/n/NissaRevane.java index 66679a8d57..707127196e 100644 --- a/Mage.Sets/src/mage/cards/n/NissaRevane.java +++ b/Mage.Sets/src/mage/cards/n/NissaRevane.java @@ -4,7 +4,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; @@ -39,7 +39,7 @@ public final class NissaRevane extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{2}{G}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(2)); LoyaltyAbility ability1 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, nissasChosenFilter)), 1); this.addAbility(ability1); diff --git a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java index bf09e73362..5940a4b0ac 100644 --- a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java +++ b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java @@ -4,7 +4,7 @@ package mage.cards.n; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -37,7 +37,7 @@ public final class NissaSageAnimist extends CardImpl { this.nightCard = true; - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand. this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/n/NissaVitalForce.java b/Mage.Sets/src/mage/cards/n/NissaVitalForce.java index 5832d40d25..42555bb7d7 100644 --- a/Mage.Sets/src/mage/cards/n/NissaVitalForce.java +++ b/Mage.Sets/src/mage/cards/n/NissaVitalForce.java @@ -4,7 +4,7 @@ package mage.cards.n; import java.util.UUID; import mage.MageInt; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -22,7 +22,6 @@ import mage.filter.common.FilterPermanentCard; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.command.emblems.NissaVitalForceEmblem; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetLandPermanent; @@ -43,7 +42,7 @@ public final class NissaVitalForce extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Untap target land you control. Until your next turn, it becomes a 5/5 Elemental creature with haste. It's still a land. LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/n/NissaVoiceOfZendikar.java b/Mage.Sets/src/mage/cards/n/NissaVoiceOfZendikar.java index e8468a64e6..b1e29389dc 100644 --- a/Mage.Sets/src/mage/cards/n/NissaVoiceOfZendikar.java +++ b/Mage.Sets/src/mage/cards/n/NissaVoiceOfZendikar.java @@ -3,7 +3,7 @@ package mage.cards.n; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; @@ -39,7 +39,7 @@ public final class NissaVoiceOfZendikar extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Create a 0/1 green Plant creature token. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new PlantToken()), 1)); diff --git a/Mage.Sets/src/mage/cards/n/NissaWorldwaker.java b/Mage.Sets/src/mage/cards/n/NissaWorldwaker.java index 78a62b955b..d4bb863132 100644 --- a/Mage.Sets/src/mage/cards/n/NissaWorldwaker.java +++ b/Mage.Sets/src/mage/cards/n/NissaWorldwaker.java @@ -4,7 +4,7 @@ package mage.cards.n; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -20,7 +20,6 @@ import mage.filter.common.FilterControlledLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; -import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCardInLibrary; @@ -41,7 +40,7 @@ public final class NissaWorldwaker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NISSA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Target land you control becomes a 4/4 Elemental creature with trample. It's still a land. LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom), 1); diff --git a/Mage.Sets/src/mage/cards/n/NivMizzetParun.java b/Mage.Sets/src/mage/cards/n/NivMizzetParun.java new file mode 100644 index 0000000000..8cfccd5137 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NivMizzetParun.java @@ -0,0 +1,63 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CantBeCounteredAbility; +import mage.abilities.common.DrawCardControllerTriggeredAbility; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class NivMizzetParun extends CardImpl { + + public NivMizzetParun(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}{U}{R}{R}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DRAGON); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // This spell can't be countered. + this.addAbility(new CantBeCounteredAbility()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you draw a card, Niv-Mizzet, Parun deals 1 damage to any target. + Ability ability = new DrawCardControllerTriggeredAbility( + new DamageTargetEffect(1), false + ); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability); + + // Whenever a player casts an instant or sorcery spell, you draw a card. + this.addAbility(new SpellCastAllTriggeredAbility( + new DrawCardSourceControllerEffect(1).setText("you draw a card"), + StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false + )); + } + + public NivMizzetParun(final NivMizzetParun card) { + super(card); + } + + @Override + public NivMizzetParun copy() { + return new NivMizzetParun(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NotionRain.java b/Mage.Sets/src/mage/cards/n/NotionRain.java new file mode 100644 index 0000000000..c478038d13 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NotionRain.java @@ -0,0 +1,39 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class NotionRain extends CardImpl { + + public NotionRain(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{B}"); + + // Surveil 2, then draw two cards. Rain of Notions deals 2 damage to you. + this.getSpellAbility().addEffect( + new SurveilEffect(2).setText("Surveil 2") + ); + this.getSpellAbility().addEffect( + new DrawCardSourceControllerEffect(2) + .setText(", then draw two cards") + ); + this.getSpellAbility().addEffect(new DamageControllerEffect(2)); + } + + public NotionRain(final NotionRain card) { + super(card); + } + + @Override + public NotionRain copy() { + return new NotionRain(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NullhideFerox.java b/Mage.Sets/src/mage/cards/n/NullhideFerox.java new file mode 100644 index 0000000000..3f8a27f35f --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NullhideFerox.java @@ -0,0 +1,128 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DiscardOntoBattlefieldEffect; +import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class NullhideFerox extends CardImpl { + + public NullhideFerox(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + + this.subtype.add(SubType.BEAST); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + + // You can't cast noncreature spells. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new NullhideFeroxCantCastEffect() + )); + + // {2}: Nullhide Ferox loses all abilities until end of turn. Any player may activate this ability. + ActivatedAbility ability = new SimpleActivatedAbility( + new NullhideFeroxLoseAbilitiesEffect(), new GenericManaCost(2) + ); + ability.setMayActivate(TargetController.ANY); + this.addAbility(ability); + + // If a spell or ability an opponent controls causes you to discard Nullhide Ferox, put it onto the battlefield instead of putting it into your graveyard. + this.addAbility(new SimpleStaticAbility( + Zone.HAND, new DiscardOntoBattlefieldEffect() + )); + } + + public NullhideFerox(final NullhideFerox card) { + super(card); + } + + @Override + public NullhideFerox copy() { + return new NullhideFerox(this); + } +} + +class NullhideFeroxCantCastEffect extends ContinuousRuleModifyingEffectImpl { + + public NullhideFeroxCantCastEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "You can't cast noncreature spells"; + } + + public NullhideFeroxCantCastEffect(final NullhideFeroxCantCastEffect effect) { + super(effect); + } + + @Override + public NullhideFeroxCantCastEffect copy() { + return new NullhideFeroxCantCastEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CAST_SPELL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getPlayerId().equals(source.getControllerId())) { + Card card = game.getCard(event.getSourceId()); + return card != null && !card.isCreature(); + } + return false; + } + +} + +class NullhideFeroxLoseAbilitiesEffect extends OneShotEffect { + + public NullhideFeroxLoseAbilitiesEffect() { + super(Outcome.Benefit); + this.staticText = "{this} loses all abilities until end of turn. Any player may activate this ability"; + } + + public NullhideFeroxLoseAbilitiesEffect(final NullhideFeroxLoseAbilitiesEffect effect) { + super(effect); + } + + @Override + public NullhideFeroxLoseAbilitiesEffect copy() { + return new NullhideFeroxLoseAbilitiesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + ContinuousEffect effect = new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); + game.addEffect(effect, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java b/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java index 2d52830907..35cbeedc1d 100644 --- a/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java +++ b/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java @@ -1,7 +1,6 @@ package mage.cards.n; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -14,11 +13,13 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; import mage.watchers.common.SpellsCastWatcher; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class NullstoneGargoyle extends CardImpl { @@ -53,7 +54,7 @@ class NullstoneGargoyleTriggeredAbility extends TriggeredAbilityImpl { super(Zone.BATTLEFIELD, new CounterTargetEffect(), false); } - public NullstoneGargoyleTriggeredAbility(NullstoneGargoyleTriggeredAbility ability) { + public NullstoneGargoyleTriggeredAbility(final NullstoneGargoyleTriggeredAbility ability) { super(ability); } @@ -69,6 +70,10 @@ class NullstoneGargoyleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getSpell(event.getTargetId()); + if (spell.isCreature()) { + return false; + } SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getSimpleName()); if (watcher != null && watcher.getNumberOfNonCreatureSpells() == 1) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/o/ObNixilisOfTheBlackOath.java b/Mage.Sets/src/mage/cards/o/ObNixilisOfTheBlackOath.java index c1b328c80e..77c5200a32 100644 --- a/Mage.Sets/src/mage/cards/o/ObNixilisOfTheBlackOath.java +++ b/Mage.Sets/src/mage/cards/o/ObNixilisOfTheBlackOath.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -32,7 +32,7 @@ public final class ObNixilisOfTheBlackOath extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NIXILIS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Each opponent loses 1 life. You gain life equal to the life lost this way. this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2)); diff --git a/Mage.Sets/src/mage/cards/o/ObNixilisReignited.java b/Mage.Sets/src/mage/cards/o/ObNixilisReignited.java index 7fa12d9dd1..5bea48f7f8 100644 --- a/Mage.Sets/src/mage/cards/o/ObNixilisReignited.java +++ b/Mage.Sets/src/mage/cards/o/ObNixilisReignited.java @@ -3,7 +3,7 @@ package mage.cards.o; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -29,7 +29,7 @@ public final class ObNixilisReignited extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NIXILIS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: You draw a card and you lose 1 life. Effect effect = new DrawCardSourceControllerEffect(1); diff --git a/Mage.Sets/src/mage/cards/o/ObNixilisUnshackled.java b/Mage.Sets/src/mage/cards/o/ObNixilisUnshackled.java index 56f21b1b8e..5dc2140673 100644 --- a/Mage.Sets/src/mage/cards/o/ObNixilisUnshackled.java +++ b/Mage.Sets/src/mage/cards/o/ObNixilisUnshackled.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -25,14 +24,15 @@ import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** - * * @author emerald000 */ public final class ObNixilisUnshackled extends CardImpl { public ObNixilisUnshackled(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DEMON); @@ -41,13 +41,13 @@ public final class ObNixilisUnshackled extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Trample this.addAbility(TrampleAbility.getInstance()); - + // Whenever an opponent searches their library, that player sacrifices a creature and loses 10 life. this.addAbility(new ObNixilisUnshackledTriggeredAbility()); - + // Whenever another creature dies, put at +1/+1 counter on Ob Nixilis, Unshackled. this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, true)); } @@ -63,15 +63,15 @@ public final class ObNixilisUnshackled extends CardImpl { } class ObNixilisUnshackledTriggeredAbility extends TriggeredAbilityImpl { - - ObNixilisUnshackledTriggeredAbility() { + + public ObNixilisUnshackledTriggeredAbility() { super(Zone.BATTLEFIELD, new ObNixilisUnshackledEffect(), false); } - - ObNixilisUnshackledTriggeredAbility(final ObNixilisUnshackledTriggeredAbility ability) { + + public ObNixilisUnshackledTriggeredAbility(final ObNixilisUnshackledTriggeredAbility ability) { super(ability); } - + @Override public ObNixilisUnshackledTriggeredAbility copy() { return new ObNixilisUnshackledTriggeredAbility(this); @@ -81,17 +81,18 @@ class ObNixilisUnshackledTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.LIBRARY_SEARCHED; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { Player controller = game.getPlayer(this.getControllerId()); - if (controller != null && game.isOpponent(controller, event.getTargetId())) { + if (controller != null && game.isOpponent(controller, event.getTargetId()) + && event.getTargetId().equals(event.getPlayerId())) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } return false; } - + @Override public String getRule() { return "Whenever an opponent searches their library, that player sacrifices a creature and loses 10 life."; @@ -99,23 +100,23 @@ class ObNixilisUnshackledTriggeredAbility extends TriggeredAbilityImpl { } class ObNixilisUnshackledEffect extends SacrificeEffect { - + static private final FilterPermanent filter = new FilterControlledCreaturePermanent("creature"); - - ObNixilisUnshackledEffect() { + + public ObNixilisUnshackledEffect() { super(filter, 1, "that player"); this.staticText = "that player sacrifices a creature and loses 10 life"; } - - ObNixilisUnshackledEffect(final ObNixilisUnshackledEffect effect) { + + public ObNixilisUnshackledEffect(final ObNixilisUnshackledEffect effect) { super(effect); } - + @Override public ObNixilisUnshackledEffect copy() { return new ObNixilisUnshackledEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); diff --git a/Mage.Sets/src/mage/cards/o/ObeliskOfUrd.java b/Mage.Sets/src/mage/cards/o/ObeliskOfUrd.java index 83dd0a6bad..7a3269d833 100644 --- a/Mage.Sets/src/mage/cards/o/ObeliskOfUrd.java +++ b/Mage.Sets/src/mage/cards/o/ObeliskOfUrd.java @@ -66,7 +66,7 @@ class ObeliskOfUrdBoostEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (perm.hasSubtype(subType, game)) { diff --git a/Mage.Sets/src/mage/cards/o/ObiWanKenobi.java b/Mage.Sets/src/mage/cards/o/ObiWanKenobi.java index 907ca43eae..6343c6ef0c 100644 --- a/Mage.Sets/src/mage/cards/o/ObiWanKenobi.java +++ b/Mage.Sets/src/mage/cards/o/ObiWanKenobi.java @@ -4,7 +4,7 @@ package mage.cards.o; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.TapTargetEffect; @@ -29,7 +29,7 @@ public final class ObiWanKenobi extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{U}"); this.subtype.add(SubType.OBI_WAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1:Up to one target creature you control gains vigilance and protection from color of your choice until end of turn. Effect effect = new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/o/OchranAssassin.java b/Mage.Sets/src/mage/cards/o/OchranAssassin.java new file mode 100644 index 0000000000..8e97cb8026 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OchranAssassin.java @@ -0,0 +1,45 @@ +package mage.cards.o; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class OchranAssassin extends CardImpl { + + public OchranAssassin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // All creatures able to block Ochran Assassin do so. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new MustBeBlockedByAllSourceEffect() + )); + } + + public OchranAssassin(final OchranAssassin card) { + super(card); + } + + @Override + public OchranAssassin copy() { + return new OchranAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OmnispellAdept.java b/Mage.Sets/src/mage/cards/o/OmnispellAdept.java new file mode 100644 index 0000000000..d9c700d531 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OmnispellAdept.java @@ -0,0 +1,101 @@ +package mage.cards.o; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInHand; + +/** + * + * @author TheElk801 + */ +public final class OmnispellAdept extends CardImpl { + + public OmnispellAdept(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // {2}{U}, {T}: You may cast an instant or sorcery card from your hand without paying its mana cost. + Ability ability = new SimpleActivatedAbility( + new OmnispellAdeptEffect(), new ManaCostsImpl("{2}{U}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public OmnispellAdept(final OmnispellAdept card) { + super(card); + } + + @Override + public OmnispellAdept copy() { + return new OmnispellAdept(this); + } +} + +class OmnispellAdeptEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your hand"); + + public OmnispellAdeptEffect() { + super(Outcome.PlayForFree); + this.staticText = "you may cast an instant or sorcery card from your hand without paying its mana cost"; + } + + public OmnispellAdeptEffect(final OmnispellAdeptEffect effect) { + super(effect); + } + + @Override + public OmnispellAdeptEffect copy() { + return new OmnispellAdeptEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Target target = new TargetCardInHand(filter); + if (target.canChoose(source.getSourceId(), controller.getId(), game) + && controller.chooseUse(outcome, "Cast an instant or sorcery card from your hand without paying its mana cost?", source, game)) { + Card cardToCast = null; + boolean cancel = false; + while (controller.canRespond() && !cancel) { + if (controller.chooseTarget(outcome, target, source, game)) { + cardToCast = game.getCard(target.getFirstTarget()); + if (cardToCast != null && cardToCast.getSpellAbility().canChooseTarget(game)) { + cancel = true; + } + } else { + cancel = true; + } + } + if (cardToCast != null) { + controller.cast(cardToCast.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game)); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/o/OreskosExplorer.java b/Mage.Sets/src/mage/cards/o/OreskosExplorer.java index af6f1bc292..ceda298514 100644 --- a/Mage.Sets/src/mage/cards/o/OreskosExplorer.java +++ b/Mage.Sets/src/mage/cards/o/OreskosExplorer.java @@ -12,7 +12,7 @@ import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.*; -import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterLandCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; @@ -83,7 +83,7 @@ class OreskosExplorerEffect extends OneShotEffect { } } if (landsToSearch > 0) { - FilterBasicLandCard filterPlains = new FilterBasicLandCard("up to " + landsToSearch + " Plains cards"); + FilterLandCard filterPlains = new FilterLandCard("up to " + landsToSearch + " Plains cards"); filterPlains.add(new ControllerPredicate(TargetController.YOU)); filterPlains.add(new SubtypePredicate(SubType.PLAINS)); TargetCardInLibrary target = new TargetCardInLibrary(0, landsToSearch, filterPlains); diff --git a/Mage.Sets/src/mage/cards/o/OrneryGoblin.java b/Mage.Sets/src/mage/cards/o/OrneryGoblin.java new file mode 100644 index 0000000000..7e56c1249a --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OrneryGoblin.java @@ -0,0 +1,40 @@ +package mage.cards.o; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class OrneryGoblin extends CardImpl { + + public OrneryGoblin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Ornery Goblin blocks or becomes blocked by a creature, Ornery Goblin deals 1 damage to that creature. + this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility( + new DamageTargetEffect(1, true, "that creature"), false + )); + } + + public OrneryGoblin(final OrneryGoblin card) { + super(card); + } + + @Override + public OrneryGoblin copy() { + return new OrneryGoblin(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PacksFavor.java b/Mage.Sets/src/mage/cards/p/PacksFavor.java new file mode 100644 index 0000000000..8fe4c69a04 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PacksFavor.java @@ -0,0 +1,39 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class PacksFavor extends CardImpl { + + public PacksFavor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Target creature gets +3/+3 until end of turn. + this.getSpellAbility().addEffect( + new BoostTargetEffect(3, 3, Duration.EndOfTurn) + ); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public PacksFavor(final PacksFavor card) { + super(card); + } + + @Override + public PacksFavor copy() { + return new PacksFavor(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/ParhelionPatrol.java b/Mage.Sets/src/mage/cards/p/ParhelionPatrol.java new file mode 100644 index 0000000000..8116644418 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/ParhelionPatrol.java @@ -0,0 +1,45 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class ParhelionPatrol extends CardImpl { + + public ParhelionPatrol(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + } + + public ParhelionPatrol(final ParhelionPatrol card) { + super(card); + } + + @Override + public ParhelionPatrol copy() { + return new ParhelionPatrol(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PasswallAdept.java b/Mage.Sets/src/mage/cards/p/PasswallAdept.java new file mode 100644 index 0000000000..ceb38fad51 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PasswallAdept.java @@ -0,0 +1,48 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class PasswallAdept extends CardImpl { + + public PasswallAdept(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {2}{U}: Target creature can't be blocked this turn. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new CantBeBlockedTargetEffect(), + new ManaCostsImpl("{2}{U}") + ); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PasswallAdept(final PasswallAdept card) { + super(card); + } + + @Override + public PasswallAdept copy() { + return new PasswallAdept(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PauseForReflection.java b/Mage.Sets/src/mage/cards/p/PauseForReflection.java new file mode 100644 index 0000000000..cb347f93ed --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PauseForReflection.java @@ -0,0 +1,35 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * + * @author TheElk801 + */ +public final class PauseForReflection extends CardImpl { + + public PauseForReflection(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Precent all combat damage that would be dealt this turn. + this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true)); + } + + public PauseForReflection(final PauseForReflection card) { + super(card); + } + + @Override + public PauseForReflection copy() { + return new PauseForReflection(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java b/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java index 0ef7b2de1c..7c10dd1271 100644 --- a/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java +++ b/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java @@ -70,7 +70,7 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { UUID targetId = event.getTargetId(); MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); - if (card != null && card instanceof Permanent && !(card instanceof PermanentToken)) { + if (card instanceof Permanent && !(card instanceof PermanentToken)) { Permanent permanent = (Permanent) card; ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD diff --git a/Mage.Sets/src/mage/cards/p/PeltCollector.java b/Mage.Sets/src/mage/cards/p/PeltCollector.java new file mode 100644 index 0000000000..7ef8ae3b5f --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PeltCollector.java @@ -0,0 +1,145 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class PeltCollector extends CardImpl { + + public PeltCollector(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector. + this.addAbility(new PeltCollectorAbility()); + + // As long as Pelt Collector has three or more +1/+1 counters on it, it has trample. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + TrampleAbility.getInstance(), + Duration.WhileOnBattlefield + ), new SourceHasCounterCondition(CounterType.P1P1, 3), + "As long as {this} has three or more +1/+1 " + + "counters on it, it has trample." + ) + )); + } + + public PeltCollector(final PeltCollector card) { + super(card); + } + + @Override + public PeltCollector copy() { + return new PeltCollector(this); + } +} + +class PeltCollectorAbility extends TriggeredAbilityImpl { + + public PeltCollectorAbility() { + super(Zone.BATTLEFIELD, new PeltCollectorEffect()); + } + + public PeltCollectorAbility(PeltCollectorAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) + || (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).isDiesEvent()) ; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getSourceId())) { + return false; + } + Permanent triggeringCreature = game.getPermanentOrLKIBattlefield(event.getTargetId()); + Permanent sourceCreature = game.getPermanent(this.getSourceId()); + if (isPowerGreater(sourceCreature, triggeringCreature) + && triggeringCreature.isCreature() + && triggeringCreature.isControlledBy(this.getControllerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + return false; + } + + public static boolean isPowerGreater(Permanent sourceCreature, Permanent newCreature) { + return sourceCreature != null && newCreature != null + && newCreature.getPower().getValue() + > sourceCreature.getPower().getValue(); + } + + @Override + public String getRule() { + return "Whenever another creature you control enters the battlefield " + + "or dies, if that creature's power is greater than {this}'s, " + + "put a +1/+1 counter on {this}."; + } + + @Override + public PeltCollectorAbility copy() { + return new PeltCollectorAbility(this); + } +} + +class PeltCollectorEffect extends OneShotEffect { + + public PeltCollectorEffect() { + super(Outcome.BoostCreature); + } + + public PeltCollectorEffect(final PeltCollectorEffect effect) { + super(effect); + } + + @Override + public PeltCollectorEffect copy() { + return new PeltCollectorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent triggeringCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (!PeltCollectorAbility.isPowerGreater(sourceCreature, triggeringCreature)) { + return false; + } + return new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PemminsAura.java b/Mage.Sets/src/mage/cards/p/PemminsAura.java index 2e6ec49aeb..89139bc99d 100644 --- a/Mage.Sets/src/mage/cards/p/PemminsAura.java +++ b/Mage.Sets/src/mage/cards/p/PemminsAura.java @@ -100,7 +100,7 @@ class PemminsAuraBoostEnchantedEffect extends OneShotEffect { choice.setMessage("Select how to boost"); choice.getChoices().add(CHOICE_1); choice.getChoices().add(CHOICE_2); - if (!controller.choose(outcome, choice, game)) { + if (controller.choose(outcome, choice, game)) { if (choice.getChoice().equals(CHOICE_1)) { game.addEffect(new BoostEnchantedEffect(+1, -1, Duration.EndOfTurn), source); } else { diff --git a/Mage.Sets/src/mage/cards/p/PentarchPaladin.java b/Mage.Sets/src/mage/cards/p/PentarchPaladin.java index dffc4b86d0..4e27796c3e 100644 --- a/Mage.Sets/src/mage/cards/p/PentarchPaladin.java +++ b/Mage.Sets/src/mage/cards/p/PentarchPaladin.java @@ -1,8 +1,8 @@ - package mage.cards.p; import java.util.UUID; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -19,7 +19,11 @@ import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.target.TargetPermanent; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.constants.TargetAdjustment; +import mage.constants.ComparisonType; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.targetadjustment.TargetAdjuster; /** * @@ -27,7 +31,7 @@ import mage.constants.TargetAdjustment; */ public final class PentarchPaladin extends CardImpl { - FilterPermanent filter = new FilterPermanent("permanent of the chosen color."); + private static final FilterPermanent filter = new FilterPermanent("permanent of the chosen color."); public PentarchPaladin(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}{W}"); @@ -47,7 +51,7 @@ public final class PentarchPaladin extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{W}{W}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.CHOSEN_COLOR); + ability.setTargetAdjuster(PentarchPaladinAdjuster.instance); this.addAbility(ability); } @@ -60,3 +64,21 @@ public final class PentarchPaladin extends CardImpl { return new PentarchPaladin(this); } } + +enum PentarchPaladinAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + ObjectColor chosenColor = (ObjectColor) game.getState().getValue(ability.getSourceId() + "_color"); + ability.getTargets().clear(); + FilterPermanent filter = new FilterPermanent("permanent of the chosen color."); + if (chosenColor != null) { + filter.add(new ColorPredicate(chosenColor)); + } else { + filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, -5));// Pretty sure this is always false + } + TargetPermanent oldTargetPermanent = new TargetPermanent(filter); + ability.addTarget(oldTargetPermanent); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java b/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java index 545e778711..eb4d598ecf 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java @@ -99,7 +99,7 @@ class PhyrexianProcessorCreateTokenEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { String key = CardUtil.getCardZoneString("lifePaid", source.getSourceId(), game); Object object = game.getState().getValue(key); - if(object != null && object instanceof Integer) { + if(object instanceof Integer) { int lifePaid = (int) object; MinionToken token = new MinionToken(); token.getPower().modifyBaseValue(lifePaid); diff --git a/Mage.Sets/src/mage/cards/p/PilferingImp.java b/Mage.Sets/src/mage/cards/p/PilferingImp.java new file mode 100644 index 0000000000..5b0340b6c3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PilferingImp.java @@ -0,0 +1,59 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.target.common.TargetOpponent; + +/** + * + * @author TheElk801 + */ +public final class PilferingImp extends CardImpl { + + public PilferingImp(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); + + this.subtype.add(SubType.IMP); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {1}{B}, {T}, Sacrifice Pilfering Imp: Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility( + Zone.BATTLEFIELD, + new DiscardCardYouChooseTargetEffect( + StaticFilters.FILTER_CARD_NON_LAND, + TargetController.OPPONENT + ), new ManaCostsImpl("{1}{B}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public PilferingImp(final PilferingImp card) { + super(card); + } + + @Override + public PilferingImp copy() { + return new PilferingImp(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PillarOfOrigins.java b/Mage.Sets/src/mage/cards/p/PillarOfOrigins.java index 99502464e1..80b830551c 100644 --- a/Mage.Sets/src/mage/cards/p/PillarOfOrigins.java +++ b/Mage.Sets/src/mage/cards/p/PillarOfOrigins.java @@ -53,7 +53,7 @@ class PillarOfOriginsManaBuilder extends ConditionalManaBuilder { @Override public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) { - creatureType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + creatureType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { diff --git a/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java b/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java new file mode 100644 index 0000000000..e362ad9416 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java @@ -0,0 +1,85 @@ +package mage.cards.p; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author TheElk801 + */ +public final class PistonFistCyclops extends CardImpl { + + public PistonFistCyclops(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U/R}{U/R}"); + + this.subtype.add(SubType.CYCLOPS); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // As long as you've cast an instant or sorcery spell this turn, Piston-Fist Cyclops can attack as though it didn't have defender. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect( + Duration.WhileOnBattlefield + ), PistonFistCyclopsCondition.instance) + .setText("As long as you've cast an instant or sorcery spell this turn, " + + "{this} can attack as though it didn't have defender") + ), + new SpellsCastWatcher()); + } + + public PistonFistCyclops(final PistonFistCyclops card) { + super(card); + } + + @Override + public PistonFistCyclops copy() { + return new PistonFistCyclops(this); + } +} + +enum PistonFistCyclopsCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + SpellsCastWatcher watcher + = (SpellsCastWatcher) game.getState().getWatchers().get( + SpellsCastWatcher.class.getSimpleName() + ); + if (watcher == null) { + return false; + } + List<Spell> spells = watcher.getSpellsCastThisTurn(source.getControllerId()); + if (spells == null) { + return false; + } + for (Spell spell : spells) { + if (!spell.getSourceId().equals(source.getSourceId()) + && spell.isInstantOrSorcery()) { + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/p/PitilessGorgon.java b/Mage.Sets/src/mage/cards/p/PitilessGorgon.java new file mode 100644 index 0000000000..62a499ddd6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PitilessGorgon.java @@ -0,0 +1,36 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class PitilessGorgon extends CardImpl { + + public PitilessGorgon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B/G}{B/G}"); + + this.subtype.add(SubType.GORGON); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + } + + public PitilessGorgon(final PitilessGorgon card) { + super(card); + } + + @Override + public PitilessGorgon copy() { + return new PitilessGorgon(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/Plaguebearer.java b/Mage.Sets/src/mage/cards/p/Plaguebearer.java index 05edb43572..a9dec0874b 100644 --- a/Mage.Sets/src/mage/cards/p/Plaguebearer.java +++ b/Mage.Sets/src/mage/cards/p/Plaguebearer.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -12,13 +11,13 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XCMCPermanentAdjuster; /** * @@ -42,7 +41,7 @@ public final class Plaguebearer extends CardImpl { // {X}{X}{B}: Destroy target nonblack creature with converted mana cost X. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{B}")); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_PERM); + ability.setTargetAdjuster(XCMCPermanentAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/Plaguecrafter.java b/Mage.Sets/src/mage/cards/p/Plaguecrafter.java new file mode 100644 index 0000000000..39eaf6eb38 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/Plaguecrafter.java @@ -0,0 +1,116 @@ +package mage.cards.p; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author themogwi + */ +public final class Plaguecrafter extends CardImpl { + + public Plaguecrafter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Plaguecrafter enters the battlefield. + // Each player sacrifices a creature or planeswalker. + // Each player who can't discards a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new PlaguecrafterEffect())); + } + + public Plaguecrafter(final Plaguecrafter card) { + super(card); + } + + @Override + public Plaguecrafter copy() { + return new Plaguecrafter(this); + } +} + +class PlaguecrafterEffect extends OneShotEffect { + + public PlaguecrafterEffect() { + super(Outcome.Benefit); + this.staticText = "each player sacrifices a creature or planeswalker. " + + "Each player who can't discards a card."; + } + + public PlaguecrafterEffect(final PlaguecrafterEffect effect) { + super(effect); + } + + @Override + public PlaguecrafterEffect copy() { + return new PlaguecrafterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + + List<UUID> perms = new ArrayList<>(); + List<UUID> cantSac = new ArrayList<>(); + + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + FilterControlledPermanent filter = new FilterControlledPermanent(); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.PLANESWALKER))); + TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); + if (target.canChoose(player.getId(), game)) { + while (!target.isChosen() && player.canRespond()) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } + perms.addAll(target.getTargets()); + } else { + cantSac.add(playerId); + } + } + } + + for (UUID permID : perms) { + Permanent permanent = game.getPermanent(permID); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + } + } + + for (UUID playerId : cantSac) { + Effect discardEffect = new DiscardTargetEffect(1); + discardEffect.setTargetPointer(new FixedTarget(playerId, game)); + discardEffect.apply(game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/p/PortcullisVine.java b/Mage.Sets/src/mage/cards/p/PortcullisVine.java new file mode 100644 index 0000000000..3d72e9e4d6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PortcullisVine.java @@ -0,0 +1,64 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author TheElk801 + */ +public final class PortcullisVine extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledCreaturePermanent("a creature with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public PortcullisVine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); + + this.subtype.add(SubType.PLANT); + this.subtype.add(SubType.WALL); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {2}, {T}, Sacrifice a creature with defender: Draw a card. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), new GenericManaCost(2) + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost( + new TargetControlledPermanent(filter) + )); + this.addAbility(ability); + } + + public PortcullisVine(final PortcullisVine card) { + super(card); + } + + @Override + public PortcullisVine copy() { + return new PortcullisVine(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PrecisionBolt.java b/Mage.Sets/src/mage/cards/p/PrecisionBolt.java new file mode 100644 index 0000000000..ae221c978a --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PrecisionBolt.java @@ -0,0 +1,32 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class PrecisionBolt extends CardImpl { + + public PrecisionBolt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); + + // Precision Bolt deals 3 damage to any target. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + } + + public PrecisionBolt(final PrecisionBolt card) { + super(card); + } + + @Override + public PrecisionBolt copy() { + return new PrecisionBolt(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PrecognitionField.java b/Mage.Sets/src/mage/cards/p/PrecognitionField.java index 2f9b600f94..46ab2eac8f 100644 --- a/Mage.Sets/src/mage/cards/p/PrecognitionField.java +++ b/Mage.Sets/src/mage/cards/p/PrecognitionField.java @@ -1,7 +1,6 @@ package mage.cards.p; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -17,6 +16,8 @@ import mage.constants.*; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * @author rscoates */ @@ -50,7 +51,7 @@ class PrecognitionFieldTopCardRevealedEffect extends ContinuousEffectImpl { public PrecognitionFieldTopCardRevealedEffect() { super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - staticText = "You may look at the top card of your library. (You may do this at any time.)"; + staticText = "You may look at the top card of your library any time."; } public PrecognitionFieldTopCardRevealedEffect(final PrecognitionFieldTopCardRevealedEffect effect) { diff --git a/Mage.Sets/src/mage/cards/p/Preordain.java b/Mage.Sets/src/mage/cards/p/Preordain.java index 519fd4a4f4..4eae38cd40 100644 --- a/Mage.Sets/src/mage/cards/p/Preordain.java +++ b/Mage.Sets/src/mage/cards/p/Preordain.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -18,8 +17,17 @@ public final class Preordain extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}"); // Scry 2, then draw a card. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.) - this.getSpellAbility().addEffect(new ScryEffect(2)); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect( + new ScryEffect(2).setText("Scry 2, ") + ); + this.getSpellAbility().addEffect( + new DrawCardSourceControllerEffect(1) + .setText("then draw a card. <i>(To scry 2, " + + "look at the top two cards of your library, " + + "then put any number of them on the " + + "bottom of your library and the rest on " + + "top in any order.)</i>") + ); } public Preordain(final Preordain card) { diff --git a/Mage.Sets/src/mage/cards/p/PriceOfFame.java b/Mage.Sets/src/mage/cards/p/PriceOfFame.java new file mode 100644 index 0000000000..79f7737b9e --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PriceOfFame.java @@ -0,0 +1,76 @@ +package mage.cards.p; + +import java.util.Iterator; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.StackObject; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class PriceOfFame extends CardImpl { + + public PriceOfFame(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}"); + + // This spell costs {2} less to cast if it targets a legendary creature. + this.addAbility(new SimpleStaticAbility(Zone.STACK, + new SpellCostReductionSourceEffect(2, PriceOfFameCondition.instance)) + .setRuleAtTheTop(true)); + + // Destroy target creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Surveil 2. + this.getSpellAbility().addEffect(new SurveilEffect(2)); + } + + public PriceOfFame(final PriceOfFame card) { + super(card); + } + + @Override + public PriceOfFame copy() { + return new PriceOfFame(this); + } +} + +enum PriceOfFameCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + StackObject sourceSpell = game.getStack().getStackObject(source.getSourceId()); + if (sourceSpell != null) { + Iterator<Target> targets = sourceSpell.getStackAbility().getTargets().iterator(); + while (targets.hasNext()) { + Permanent permanent = game.getPermanentOrLKIBattlefield(targets.next().getFirstTarget()); + if (permanent != null && permanent.isCreature() && permanent.isLegendary()) { + return true; + } + } + } + return false; + } + + @Override + public String toString() { + return "it targets a legendary creature"; + } + +} diff --git a/Mage.Sets/src/mage/cards/p/PrimordialMist.java b/Mage.Sets/src/mage/cards/p/PrimordialMist.java index ee917e9486..364db608db 100644 --- a/Mage.Sets/src/mage/cards/p/PrimordialMist.java +++ b/Mage.Sets/src/mage/cards/p/PrimordialMist.java @@ -121,7 +121,7 @@ class PrimordialMistCastFromExileEffect extends AsThoughEffectImpl { public PrimordialMistCastFromExileEffect() { super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); - staticText = "Exile a face-down permanent you control face-up. You may play the card from exile"; + staticText = "Exile a face-down permanent you control face up: You may play that card this turn."; } public PrimordialMistCastFromExileEffect(final PrimordialMistCastFromExileEffect effect) { diff --git a/Mage.Sets/src/mage/cards/p/ProtectiveSphere.java b/Mage.Sets/src/mage/cards/p/ProtectiveSphere.java index 67657fa545..aae9d64c1b 100644 --- a/Mage.Sets/src/mage/cards/p/ProtectiveSphere.java +++ b/Mage.Sets/src/mage/cards/p/ProtectiveSphere.java @@ -52,8 +52,8 @@ public final class ProtectiveSphere extends CardImpl { class ProtectiveSphereEffect extends PreventionEffectImpl { private final TargetSource target; - private static Mana manaUsed; - private static List<ObjectColor> colorsOfChosenSource = new ArrayList<>(); + private Mana manaUsed; + private List<ObjectColor> colorsOfChosenSource = new ArrayList<>(); public ProtectiveSphereEffect() { super(Duration.EndOfTurn, Integer.MAX_VALUE, false, false); @@ -64,6 +64,8 @@ class ProtectiveSphereEffect extends PreventionEffectImpl { public ProtectiveSphereEffect(final ProtectiveSphereEffect effect) { super(effect); this.target = effect.target.copy(); + manaUsed = effect.manaUsed.copy(); + colorsOfChosenSource = effect.colorsOfChosenSource; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java b/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java index 78ed585a42..1e85aba50d 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java +++ b/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java @@ -85,7 +85,7 @@ class PsychicRebuttalEffect extends OneShotEffect { && controller.chooseUse(Outcome.PlayForFree, "Copy " + spell.getName() + " (you may choose new targets for the copy)?", source, game)) { StackObject newStackObject = spell.createCopyOnStack(game, source, source.getControllerId(), true); - if (newStackObject != null && newStackObject instanceof Spell) { + if (newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/p/Pyroblast.java b/Mage.Sets/src/mage/cards/p/Pyroblast.java index 57fcd9944c..3c61105ebd 100644 --- a/Mage.Sets/src/mage/cards/p/Pyroblast.java +++ b/Mage.Sets/src/mage/cards/p/Pyroblast.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -20,19 +19,18 @@ import mage.target.TargetSpell; * @author Plopman */ public final class Pyroblast extends CardImpl { - - public Pyroblast(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}"); + public Pyroblast(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}"); // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); - + Mode mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); + mode.getEffects().add(new PyroblastDestroyTargetEffect()); mode.getTargets().add(new TargetPermanent()); - + this.getSpellAbility().addMode(mode); } @@ -64,7 +62,7 @@ class PyroblastCounterTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); - if(targetSpell != null && targetSpell.getColor(game).isBlue()){ + if (targetSpell != null && targetSpell.getColor(game).isBlue()) { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; @@ -77,21 +75,19 @@ class PyroblastCounterTargetEffect extends OneShotEffect { } +class PyroblastDestroyTargetEffect extends OneShotEffect { -class DestroyTargetEffect extends OneShotEffect { - - - public DestroyTargetEffect() { + public PyroblastDestroyTargetEffect() { super(Outcome.DestroyPermanent); } - public DestroyTargetEffect(final DestroyTargetEffect effect) { + public PyroblastDestroyTargetEffect(final PyroblastDestroyTargetEffect effect) { super(effect); } @Override - public DestroyTargetEffect copy() { - return new DestroyTargetEffect(this); + public PyroblastDestroyTargetEffect copy() { + return new PyroblastDestroyTargetEffect(this); } @Override diff --git a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java index 8c6055dc4b..6c6c1c9b4c 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java @@ -62,7 +62,7 @@ class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object instanceof Spell) { + if (object instanceof Spell) { if (((Spell) object).isControlledBy(source.getControllerId()) && (object.isInstant() || object.isSorcery())){ diff --git a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java index 99bc826350..9c7e5e2455 100644 --- a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java +++ b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java @@ -73,7 +73,7 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect { Map<String, UUID> exileIds; String valueKey = CardUtil.getObjectZoneString("exileIds", sourceObject, game); Object object = game.getState().getValue(valueKey); - if (object != null && object instanceof Map) { + if (object instanceof Map) { exileIds = (Map<String, UUID>) object; } else { exileIds = new HashMap<>(); @@ -123,7 +123,7 @@ class PyxisOfPandemoniumPutOntoBattlefieldEffect extends OneShotEffect { Map<String, UUID> exileIds; String valueKey = CardUtil.getObjectZoneString("exileIds", sourceObject, game); Object object = game.getState().getValue(valueKey); - if (object != null && object instanceof Map) { + if (object instanceof Map) { exileIds = (Map<String, UUID>) object; } else { return true; diff --git a/Mage.Sets/src/mage/cards/q/Quasiduplicate.java b/Mage.Sets/src/mage/cards/q/Quasiduplicate.java new file mode 100644 index 0000000000..d8036653cf --- /dev/null +++ b/Mage.Sets/src/mage/cards/q/Quasiduplicate.java @@ -0,0 +1,36 @@ +package mage.cards.q; + +import java.util.UUID; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class Quasiduplicate extends CardImpl { + + public Quasiduplicate(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{U}"); + + // Create a token that's a copy of target creature you control. + this.getSpellAbility().addEffect(new CreateTokenCopyTargetEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + } + + public Quasiduplicate(final Quasiduplicate card) { + super(card); + } + + @Override + public Quasiduplicate copy() { + return new Quasiduplicate(this); + } +} diff --git a/Mage.Sets/src/mage/cards/q/QuestForTheGoblinLord.java b/Mage.Sets/src/mage/cards/q/QuestForTheGoblinLord.java index 621b0a7387..80c2b92ca5 100644 --- a/Mage.Sets/src/mage/cards/q/QuestForTheGoblinLord.java +++ b/Mage.Sets/src/mage/cards/q/QuestForTheGoblinLord.java @@ -1,4 +1,3 @@ - package mage.cards.q; import java.util.UUID; @@ -26,7 +25,7 @@ public final class QuestForTheGoblinLord extends CardImpl { private static final String rule = "As long as {this} has five or more quest counters on it, creatures you control get +2/+0"; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - private static final FilterPermanent goblinFilter = new FilterControlledCreaturePermanent(); + private static final FilterPermanent goblinFilter = new FilterControlledCreaturePermanent("a Goblin"); static { filter.add(new ControllerPredicate(TargetController.YOU)); @@ -34,7 +33,7 @@ public final class QuestForTheGoblinLord extends CardImpl { } public QuestForTheGoblinLord(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}"); // Whenever a Goblin enters the battlefield under your control, you may put a quest counter on Quest for the Goblin Lord. this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), goblinFilter, true)); diff --git a/Mage.Sets/src/mage/cards/r/RadicalIdea.java b/Mage.Sets/src/mage/cards/r/RadicalIdea.java new file mode 100644 index 0000000000..d1413bcc3d --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RadicalIdea.java @@ -0,0 +1,34 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class RadicalIdea extends CardImpl { + + public RadicalIdea(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + } + + public RadicalIdea(final RadicalIdea card) { + super(card); + } + + @Override + public RadicalIdea copy() { + return new RadicalIdea(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java b/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java new file mode 100644 index 0000000000..cfbc4ecbba --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RalCallerOfStorms.java @@ -0,0 +1,57 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetAnyTargetAmount; + +/** + * + * @author TheElk801 + */ +public final class RalCallerOfStorms extends CardImpl { + + public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature your opponents control"); + + public RalCallerOfStorms(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.RAL); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); + + // +1: Draw a card. + this.addAbility(new LoyaltyAbility( + new DrawCardSourceControllerEffect(1), 1 + )); + + // -2: Ral, Caller of Storms deals 3 damage divided as you choose among one, two, or three targets. + Ability ability = new LoyaltyAbility(new DamageMultiEffect(3), -2); + ability.addTarget(new TargetAnyTargetAmount(3)); + this.addAbility(ability); + + // -7: Draw seven cards. Ral, Caller of Storms deals 7 damage to each creature your opponents control. + ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(7), -7); + ability.addEffect(new DamageAllEffect(7, filter)); + this.addAbility(ability); + } + + public RalCallerOfStorms(final RalCallerOfStorms card) { + super(card); + } + + @Override + public RalCallerOfStorms copy() { + return new RalCallerOfStorms(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java b/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java new file mode 100644 index 0000000000..7390e5066e --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java @@ -0,0 +1,66 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.command.emblems.RalIzzetViceroyEmblem; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class RalIzzetViceroy extends CardImpl { + + public RalIzzetViceroy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.RAL); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); + + // +1: Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard. + this.addAbility(new LoyaltyAbility( + new LookLibraryAndPickControllerEffect( + new StaticValue(2), false, new StaticValue(1), + StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false + ), 1 + )); + + // -3: Ral, Izzet Viceroy deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard. + Ability ability = new LoyaltyAbility(new DamageTargetEffect( + InstantSorceryExileGraveyardCount.instance + ).setText("{this} deals damage to target creature equal to " + + "the total number of instant and sorcery cards " + + "you own in exile and in your graveyard"), -3); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // -8: You get an emblem with "Whenever you cast an instant or sorcery spell, this emblem deals 4 damage to any target and you draw two cards." + this.addAbility(new LoyaltyAbility( + new GetEmblemEffect(new RalIzzetViceroyEmblem()), -8 + )); + } + + public RalIzzetViceroy(final RalIzzetViceroy card) { + super(card); + } + + @Override + public RalIzzetViceroy copy() { + return new RalIzzetViceroy(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RalZarek.java b/Mage.Sets/src/mage/cards/r/RalZarek.java index f49f45d507..2dfe8cf9b6 100644 --- a/Mage.Sets/src/mage/cards/r/RalZarek.java +++ b/Mage.Sets/src/mage/cards/r/RalZarek.java @@ -4,7 +4,7 @@ package mage.cards.r; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; @@ -42,7 +42,7 @@ public final class RalZarek extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.RAL); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Tap target permanent, then untap another target permanent. LoyaltyAbility ability1 = new LoyaltyAbility(new TapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/r/RalsDispersal.java b/Mage.Sets/src/mage/cards/r/RalsDispersal.java new file mode 100644 index 0000000000..4747d592aa --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RalsDispersal.java @@ -0,0 +1,44 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class RalsDispersal extends CardImpl { + + private final static FilterCard filter = new FilterCard("Ral, Caller of Storms"); + + static { + filter.add(new NamePredicate("Ral, Caller of Storms")); + } + + public RalsDispersal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); + + // Return target creature to its owner's hand. You may search you library and/or graveyard for a card named Ral, Caller of Storms, reveal it, and put it in to your hand. If you search your library this way, shuffle it. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect( + new SearchLibraryGraveyardPutInHandEffect(filter, false, true) + ); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public RalsDispersal(final RalsDispersal card) { + super(card); + } + + @Override + public RalsDispersal copy() { + return new RalsDispersal(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RalsStaticaster.java b/Mage.Sets/src/mage/cards/r/RalsStaticaster.java new file mode 100644 index 0000000000..d5b83f2540 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RalsStaticaster.java @@ -0,0 +1,67 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author TheElk801 + */ +public final class RalsStaticaster extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Ral planeswalker"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new CardTypePredicate(CardType.PLANESWALKER)); + filter.add(new SubtypePredicate(SubType.RAL)); + } + + public RalsStaticaster(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}"); + + this.subtype.add(SubType.VIASHINO); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever Ral's Staticaster attacks, if you control a Ral planeswalker, Ral's Staticaster gets +1/+0 for each card in your hand until end of turn. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new AttacksTriggeredAbility(new BoostSourceEffect( + new CardsInControllerHandCount(), new StaticValue(0), + Duration.EndOfTurn, true), false), + new PermanentsOnTheBattlefieldCondition(filter), + "Whenever {this} attacks, if you control a Ral planeswalker, " + + "{this} gets +1/+0 for each card in your hand until end of turn." + )); + } + + public RalsStaticaster(final RalsStaticaster card) { + super(card); + } + + @Override + public RalsStaticaster copy() { + return new RalsStaticaster(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RampagingMonument.java b/Mage.Sets/src/mage/cards/r/RampagingMonument.java new file mode 100644 index 0000000000..53658be875 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RampagingMonument.java @@ -0,0 +1,53 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class RampagingMonument extends CardImpl { + + public RampagingMonument(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Rampaging Monument enters the battlefield with three +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), + "{this} enters the battlefield with three +1/+1 counters on it" + )); + + // Whenever you cast a multicolored spell, put a +1/+1 counter on Rampaging Monument. + this.addAbility(new SpellCastControllerTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + StaticFilters.FILTER_SPELL_A_MULTICOLORED, false + )); + } + + public RampagingMonument(final RampagingMonument card) { + super(card); + } + + @Override + public RampagingMonument copy() { + return new RampagingMonument(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RealityScramble.java b/Mage.Sets/src/mage/cards/r/RealityScramble.java index f3f8096971..6eeacc43ed 100644 --- a/Mage.Sets/src/mage/cards/r/RealityScramble.java +++ b/Mage.Sets/src/mage/cards/r/RealityScramble.java @@ -38,7 +38,9 @@ public final class RealityScramble extends CardImpl { public RealityScramble(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); - // Put target permanent you own on the bottom of your library. Reveal cards from the top of your library until you reveal a card that shares a card type with that permanent. Put that card onto the battlefield and the rest on the bottom of your library in a random order. + // Put target permanent you own on the bottom of your library. Reveal cards from the top of your library + // until you reveal a card that shares a card type with that permanent. Put that card onto the battlefield + // and the rest on the bottom of your library in a random order. this.getSpellAbility().addEffect(new RealityScrambleEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); @@ -99,6 +101,9 @@ class RealityScrambleEffect extends OneShotEffect { break; } } + if (cardToPlay != null) { + break; + } } controller.revealCards(source, toReveal, game); if (cardToPlay != null) { diff --git a/Mage.Sets/src/mage/cards/r/Recantation.java b/Mage.Sets/src/mage/cards/r/Recantation.java index 55439bab5f..1bb9a36ce3 100644 --- a/Mage.Sets/src/mage/cards/r/Recantation.java +++ b/Mage.Sets/src/mage/cards/r/Recantation.java @@ -1,6 +1,6 @@ - package mage.cards.r; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -12,14 +12,12 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.target.TargetPermanent; - -import java.util.UUID; +import mage.target.targetadjustment.VerseCounterAdjuster; /** * @@ -40,7 +38,7 @@ public final class Recantation extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{U}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(0, 0, new FilterPermanent("up to X target permanents, where X is the number of verse counters on {this}."), false)); - ability.setTargetAdjustment(TargetAdjustment.VERSE_COUNTER_TARGETS); + ability.setTargetAdjuster(VerseCounterAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/ResplendentAngel.java b/Mage.Sets/src/mage/cards/r/ResplendentAngel.java index ef40284b69..86160a7236 100644 --- a/Mage.Sets/src/mage/cards/r/ResplendentAngel.java +++ b/Mage.Sets/src/mage/cards/r/ResplendentAngel.java @@ -20,7 +20,7 @@ import mage.constants.ComparisonType; import mage.constants.Duration; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.permanent.token.AngelToken2; +import mage.game.permanent.token.AngelVigilanceToken; import mage.watchers.common.PlayerGainedLifeWatcher; /** @@ -42,7 +42,7 @@ public final class ResplendentAngel extends CardImpl { // At the beginning of each end step, if you gained 5 or more life this turn, create a 4/4 white Angel creature token with flying and vigilance. this.addAbility(new BeginningOfEndStepTriggeredAbility( Zone.BATTLEFIELD, - new CreateTokenEffect(new AngelToken2()), + new CreateTokenEffect(new AngelVigilanceToken()), TargetController.ANY, new YouGainedLifeCondition(ComparisonType.MORE_THAN, 4), false diff --git a/Mage.Sets/src/mage/cards/r/ResponseResurgence.java b/Mage.Sets/src/mage/cards/r/ResponseResurgence.java new file mode 100644 index 0000000000..50ba39c10f --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/ResponseResurgence.java @@ -0,0 +1,64 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; +import mage.filter.StaticFilters; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author TheElk801 + */ +public final class ResponseResurgence extends SplitCard { + + public ResponseResurgence(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{R/W}{R/W}", "{3}{R}{W}", SpellAbilityType.SPLIT); + + // Response + // Response deals 5 damage to target attacking or blocking creature. + this.getLeftHalfCard().getSpellAbility().addEffect( + new DamageTargetEffect(5) + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetAttackingOrBlockingCreature() + ); + + // Resurgence + // Creatures you control gain first strike and vigilance until end of turn. After this main phase, there is an additional combat phase followed by an additional main phase. + this.getRightHalfCard().getSpellAbility().addEffect( + new GainAbilityControlledEffect( + FirstStrikeAbility.getInstance(), + Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURE + ).setText("Creatures you control gain first strike") + ); + this.getRightHalfCard().getSpellAbility().addEffect( + new GainAbilityControlledEffect( + VigilanceAbility.getInstance(), + Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURE + ).setText("and vigilance until end of turn") + ); + this.getRightHalfCard().getSpellAbility().addEffect( + new AddCombatAndMainPhaseEffect() + ); + } + + public ResponseResurgence(final ResponseResurgence card) { + super(card); + } + + @Override + public ResponseResurgence copy() { + return new ResponseResurgence(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RhizomeLurcher.java b/Mage.Sets/src/mage/cards/r/RhizomeLurcher.java new file mode 100644 index 0000000000..63c0c7913c --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RhizomeLurcher.java @@ -0,0 +1,51 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class RhizomeLurcher extends CardImpl { + + public RhizomeLurcher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + + this.subtype.add(SubType.FUNGUS); + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Undergrowth — Rhizome Lurcher enters the battlefield with a number of +1/+1 counters on it equal to the number of creature cards in your graveyard. + Ability ability = new EntersBattlefieldAbility( + new AddCountersSourceEffect( + CounterType.P1P1.createInstance(0), + new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ), true + ), null, "<i>Undergrowth</i> — {this} enters the battlefield with a number of +1/+1 counters on it equal to the number of creature cards in your graveyard.", + null + ); + this.addAbility(ability); + } + + public RhizomeLurcher(final RhizomeLurcher card) { + super(card); + } + + @Override + public RhizomeLurcher copy() { + return new RhizomeLurcher(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RidersOfGavony.java b/Mage.Sets/src/mage/cards/r/RidersOfGavony.java index da80ddce32..0fc541dfe5 100644 --- a/Mage.Sets/src/mage/cards/r/RidersOfGavony.java +++ b/Mage.Sets/src/mage/cards/r/RidersOfGavony.java @@ -81,7 +81,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { if (protectionFilter == null) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(permanent.getId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(permanent.getId(), game); if (subType != null) { protectionFilter = new FilterPermanent(subType.getDescription() + 's'); protectionFilter.add(new SubtypePredicate(subType)); diff --git a/Mage.Sets/src/mage/cards/r/RiptideReplicator.java b/Mage.Sets/src/mage/cards/r/RiptideReplicator.java index 3540b2d40a..2d4c1e5c7e 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideReplicator.java +++ b/Mage.Sets/src/mage/cards/r/RiptideReplicator.java @@ -23,7 +23,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.token.RiptideReplicatorToken; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; /** @@ -80,7 +79,7 @@ class RiptideReplicatorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType == null) { return false; } diff --git a/Mage.Sets/src/mage/cards/r/RiskFactor.java b/Mage.Sets/src/mage/cards/r/RiskFactor.java new file mode 100644 index 0000000000..593af6728f --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RiskFactor.java @@ -0,0 +1,74 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author TheElk801 + */ +public final class RiskFactor extends CardImpl { + + public RiskFactor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); + + // Target opponent may have Risk Factor deal 4 damage to them. If that player doesn't, you draw three cards. + this.getSpellAbility().addEffect(new RiskFactorEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + + } + + public RiskFactor(final RiskFactor card) { + super(card); + } + + @Override + public RiskFactor copy() { + return new RiskFactor(this); + } +} + +class RiskFactorEffect extends OneShotEffect { + + public RiskFactorEffect() { + super(Outcome.Benefit); + this.staticText = "Target opponent may have {this} deal 4 damage to them. " + + "If that player doesn't, you draw three cards."; + } + + public RiskFactorEffect(final RiskFactorEffect effect) { + super(effect); + } + + @Override + public RiskFactorEffect copy() { + return new RiskFactorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getFirstTarget()); + if (controller == null || opponent == null) { + return false; + } + if (opponent.chooseUse(outcome, "Do you choose to take the damage?", source, game)) { + opponent.damage(4, source.getSourceId(), game, false, true); + } else { + controller.drawCards(3, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/r/RitualOfSoot.java b/Mage.Sets/src/mage/cards/r/RitualOfSoot.java new file mode 100644 index 0000000000..bf5eb888b7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RitualOfSoot.java @@ -0,0 +1,42 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; + +/** + * + * @author TheElk801 + */ +public final class RitualOfSoot extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creatures with converted mana cost 3 or less"); + + static { + filter.add(new ConvertedManaCostPredicate( + ComparisonType.FEWER_THAN, 4 + )); + } + + public RitualOfSoot(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + + // Destroy all creatures with converted mana cost 3 or less. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public RitualOfSoot(final RitualOfSoot card) { + super(card); + } + + @Override + public RitualOfSoot copy() { + return new RitualOfSoot(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RocCharger.java b/Mage.Sets/src/mage/cards/r/RocCharger.java new file mode 100644 index 0000000000..d9b5f7911d --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RocCharger.java @@ -0,0 +1,61 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class RocCharger extends CardImpl { + + static final FilterAttackingCreature filter + = new FilterAttackingCreature("attacking creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public RocCharger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.subtype.add(SubType.BIRD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Roc Charger attacks, target attacking creature without flying gains flying until end of turn. + Ability ability = new AttacksTriggeredAbility( + new GainAbilityTargetEffect( + FlyingAbility.getInstance(), + Duration.EndOfTurn + ), false + ); + ability.addTarget(new TargetCreaturePermanent(filter)); + addAbility(ability); + } + + public RocCharger(final RocCharger card) { + super(card); + } + + @Override + public RocCharger copy() { + return new RocCharger(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RofellossGift.java b/Mage.Sets/src/mage/cards/r/RofellossGift.java new file mode 100644 index 0000000000..0b89988c67 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RofellossGift.java @@ -0,0 +1,101 @@ +package mage.cards.r; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RofellossGift extends CardImpl { + + public RofellossGift(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + // Reveal any number of green cards in your hand. Return an enchantment card from your graveyard to your hand for each card revealed this way. + this.getSpellAbility().addEffect(new RofellossGiftEffect()); + } + + public RofellossGift(final RofellossGift card) { + super(card); + } + + @Override + public RofellossGift copy() { + return new RofellossGift(this); + } +} + +class RofellossGiftEffect extends OneShotEffect { + + public static final FilterCard filter1 = new FilterCard("green cards in your hand"); + public static final FilterCard filter2 = new FilterCard("enchantment cards in your graveyard"); + + static { + filter1.add(new ColorPredicate(ObjectColor.GREEN)); + filter2.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + + public RofellossGiftEffect() { + super(Outcome.Benefit); + staticText = "Reveal any number of green cards in your hand. " + + "Return an enchantment card from your graveyard to your hand for each card revealed this way."; + } + + public RofellossGiftEffect(final RofellossGiftEffect effect) { + super(effect); + } + + @Override + public RofellossGiftEffect copy() { + return new RofellossGiftEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCardInHand targetCardInHand = new TargetCardInHand(0, Integer.MAX_VALUE, filter1); + if (!player.choose(outcome, player.getHand(), targetCardInHand, game)) { + return false; + } + Cards cards = new CardsImpl(); + for (UUID cardId : targetCardInHand.getTargets()) { + Card card = game.getCard(cardId); + if (card != null) { + cards.add(card); + } + } + player.revealCards(source, cards, game); + int enchantmentsToReturn = Math.min(player.getGraveyard().count(filter2, game), targetCardInHand.getTargets().size()); + TargetCardInYourGraveyard targetCardInYourGraveyard = new TargetCardInYourGraveyard(enchantmentsToReturn, filter2); + targetCardInYourGraveyard.setNotTarget(true); + if (!player.choose(outcome, targetCardInYourGraveyard, source.getSourceId(), game)) { + return false; + } + cards = new CardsImpl(); + for (UUID cardId : targetCardInYourGraveyard.getTargets()) { + Card card = game.getCard(cardId); + if (card != null) { + cards.add(card); + } + } + return player.moveCards(cards, Zone.HAND, source, game); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RootsOfLife.java b/Mage.Sets/src/mage/cards/r/RootsOfLife.java new file mode 100644 index 0000000000..419f1d6235 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RootsOfLife.java @@ -0,0 +1,67 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.ModeChoiceSourceCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ChooseModeEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author fubs + */ +public final class RootsOfLife extends CardImpl { + + private final static String ruleTrigger1 = "&bull Island — Whenever an Island an opponent controls becomes tapped, you gain 1 life"; + private final static String ruleTrigger2 = "&bull Swamp — Whenever a Swamp an opponent controls becomes tapped, you gain 1 life"; + + private static final FilterPermanent islandFilter = new FilterPermanent("an Island an opponent controls"); + private static final FilterPermanent swampFilter = new FilterPermanent("a Swamp an opponent controls"); + + static { + islandFilter.add(new SubtypePredicate(SubType.ISLAND)); + islandFilter.add(new ControllerPredicate(TargetController.OPPONENT)); + swampFilter.add(new SubtypePredicate(SubType.SWAMP)); + swampFilter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public RootsOfLife(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); + + // As Roots of Life enters the battlefield, choose Island or Swamp. + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Island or Swamp?", "Island", "Swamp"), null, + "As {this} enters the battlefield, choose Island or Swamp.", "")); + + // Whenever a land of the chosen type an opponent controls becomes tapped, you gain 1 life. + // * Island chosen + this.addAbility(new ConditionalTriggeredAbility( + new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, islandFilter), + new ModeChoiceSourceCondition("Island"), + ruleTrigger1)); + + // * Swamp chosen + this.addAbility(new ConditionalTriggeredAbility( + new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, swampFilter), + new ModeChoiceSourceCondition("Swamp"), + ruleTrigger2)); + } + + public RootsOfLife(final RootsOfLife card) { + super(card); + } + + @Override + public RootsOfLife copy() { + return new RootsOfLife(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RosemaneCentaur.java b/Mage.Sets/src/mage/cards/r/RosemaneCentaur.java new file mode 100644 index 0000000000..7142de3e94 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RosemaneCentaur.java @@ -0,0 +1,41 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class RosemaneCentaur extends CardImpl { + + public RosemaneCentaur(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{W}"); + + this.subtype.add(SubType.CENTAUR); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + } + + public RosemaneCentaur(final RosemaneCentaur card) { + super(card); + } + + @Override + public RosemaneCentaur copy() { + return new RosemaneCentaur(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RowanKenrith.java b/Mage.Sets/src/mage/cards/r/RowanKenrith.java index a3a6678dfd..a5ef32577d 100644 --- a/Mage.Sets/src/mage/cards/r/RowanKenrith.java +++ b/Mage.Sets/src/mage/cards/r/RowanKenrith.java @@ -6,7 +6,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.RequirementEffect; @@ -40,7 +40,7 @@ public final class RowanKenrith extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ROWAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: During target player's next turn, each creature that player controls attacks if able. LoyaltyAbility ability = new LoyaltyAbility(new RowanKenrithAttackEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/r/RubblebeltBoar.java b/Mage.Sets/src/mage/cards/r/RubblebeltBoar.java new file mode 100644 index 0000000000..e627e8674c --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RubblebeltBoar.java @@ -0,0 +1,44 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class RubblebeltBoar extends CardImpl { + + public RubblebeltBoar(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.BOAR); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Rubblebelt Boar enters the battlefield, target creature gets +2/+0 until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility( + new BoostTargetEffect(2, 0, Duration.EndOfTurn) + ); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public RubblebeltBoar(final RubblebeltBoar card) { + super(card); + } + + @Override + public RubblebeltBoar copy() { + return new RubblebeltBoar(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RumblingCrescendo.java b/Mage.Sets/src/mage/cards/r/RumblingCrescendo.java index 452c455ef9..931f9b6538 100644 --- a/Mage.Sets/src/mage/cards/r/RumblingCrescendo.java +++ b/Mage.Sets/src/mage/cards/r/RumblingCrescendo.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -13,13 +12,13 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.VerseCounterAdjuster; /** * @@ -46,7 +45,7 @@ public final class RumblingCrescendo extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(0, 0, filter, false)); - ability.setTargetAdjustment(TargetAdjustment.VERSE_COUNTER_TARGETS); + ability.setTargetAdjuster(VerseCounterAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java b/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java new file mode 100644 index 0000000000..aa58060ec1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java @@ -0,0 +1,68 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author TheElk801 + */ +public final class RunawaySteamKin extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a red spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public RunawaySteamKin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever you cast a red spell, if Runaway Steam-Kin has fewer than three +1/+1 counters on it, put a +1/+1 counter on Runaway Steam-Kin. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new SpellCastControllerTriggeredAbility( + new AddCountersSourceEffect( + CounterType.P1P1.createInstance() + ), filter, false + ), new SourceHasCounterCondition(CounterType.P1P1, 0, 2), + "Whenever you cast a red spell, " + + "if {this} has fewer than three +1/+1 counters on it, " + + "put a +1/+1 counter on {this}." + )); + + // Remove three +1/+1 counters from Runaway Steam-Kin: Add {R}{R}{R}. + this.addAbility(new SimpleManaAbility( + Zone.BATTLEFIELD, Mana.RedMana(3), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance(3)) + )); + } + + public RunawaySteamKin(final RunawaySteamKin card) { + super(card); + } + + @Override + public RunawaySteamKin copy() { + return new RunawaySteamKin(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RunedArch.java b/Mage.Sets/src/mage/cards/r/RunedArch.java index ea9d564202..0195c1977c 100644 --- a/Mage.Sets/src/mage/cards/r/RunedArch.java +++ b/Mage.Sets/src/mage/cards/r/RunedArch.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -14,11 +13,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ComparisonType; import mage.constants.Duration; -import mage.constants.TargetAdjustment; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.PowerPredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @@ -48,7 +47,7 @@ public final class RunedArch extends CardImpl { ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(filter)); - ability.setTargetAdjustment(TargetAdjustment.X_TARGETS); + ability.setTargetAdjuster(XTargetsAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SadisticAugermage.java b/Mage.Sets/src/mage/cards/s/SadisticAugermage.java index df51481b1d..f6b2d9d83f 100644 --- a/Mage.Sets/src/mage/cards/s/SadisticAugermage.java +++ b/Mage.Sets/src/mage/cards/s/SadisticAugermage.java @@ -2,8 +2,10 @@ package mage.cards.s; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; @@ -17,13 +19,12 @@ import mage.players.Player; import mage.target.common.TargetCardInHand; /** - * * @author LevelX2 */ public final class SadisticAugermage extends CardImpl { public SadisticAugermage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); @@ -31,7 +32,7 @@ public final class SadisticAugermage extends CardImpl { this.toughness = new MageInt(1); // When Sadistic Augermage dies, each player puts a card from their hand on top of their library. - this.getSpellAbility().addEffect(null); + this.addAbility(new DiesTriggeredAbility(new WidespreadPanicEffect())); } public SadisticAugermage(final SadisticAugermage card) { @@ -64,7 +65,7 @@ class WidespreadPanicEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { if (!player.getHand().isEmpty()) { @@ -76,7 +77,7 @@ class WidespreadPanicEffect extends OneShotEffect { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } - } + } } return true; } diff --git a/Mage.Sets/src/mage/cards/s/SaheeliRai.java b/Mage.Sets/src/mage/cards/s/SaheeliRai.java index fba7d00792..29dba31788 100644 --- a/Mage.Sets/src/mage/cards/s/SaheeliRai.java +++ b/Mage.Sets/src/mage/cards/s/SaheeliRai.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -42,7 +42,7 @@ public final class SaheeliRai extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SAHEELI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Scry 1. Saheeli Rai deals 1 damage to each opponent. Effect effect = new ScryEffect(1); diff --git a/Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java b/Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java index 4e31f691b7..4d577674f8 100644 --- a/Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java +++ b/Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.SpellAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenCopyTargetEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -37,7 +37,7 @@ public final class SaheeliTheGifted extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SAHEELI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Create a 1/1 colorless Servo artifact creature token. this.addAbility(new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/cards/s/SamutTheTested.java b/Mage.Sets/src/mage/cards/s/SamutTheTested.java index 485f3f046a..4555381986 100644 --- a/Mage.Sets/src/mage/cards/s/SamutTheTested.java +++ b/Mage.Sets/src/mage/cards/s/SamutTheTested.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageMultiEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -32,7 +32,7 @@ public final class SamutTheTested extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SAMUT); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Up to one target creature gains double strike until end of turn. Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanDragonsoul.java b/Mage.Sets/src/mage/cards/s/SarkhanDragonsoul.java index 565bbd7c7e..f75ea89ad5 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanDragonsoul.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanDragonsoul.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.DamageTargetEffect; @@ -37,7 +37,7 @@ public final class SarkhanDragonsoul extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Sarkhan, Dragonsoul deals 1 damage to each opponent and each creature your opponents control. Ability ability = new LoyaltyAbility(new DamagePlayersEffect(1, TargetController.OPPONENT), 2); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanFireblood.java b/Mage.Sets/src/mage/cards/s/SarkhanFireblood.java index f997638c23..c7dfe6717e 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanFireblood.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanFireblood.java @@ -2,7 +2,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.CreateTokenEffect; @@ -36,7 +36,7 @@ public final class SarkhanFireblood extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: You may discard a card. If you do, draw a card. this.addAbility(new LoyaltyAbility(new DoIfCostPaid( diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java index 76a04b4c8c..49b3957b0a 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java @@ -6,7 +6,7 @@ import mage.MageObjectReference; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -34,7 +34,7 @@ public final class SarkhanTheDragonspeaker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Until end of turn, Sarkhan, the Dragonspeaker becomes a legendary 4/4 red Dragon creature with flying, indestructible, and haste. this.addAbility(new LoyaltyAbility(new SarkhanTheDragonspeakerEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheMad.java b/Mage.Sets/src/mage/cards/s/SarkhanTheMad.java index 251e057fb3..921f4fd270 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheMad.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheMad.java @@ -6,7 +6,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; @@ -39,7 +39,7 @@ public final class SarkhanTheMad extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); this.addAbility(new LoyaltyAbility(new SarkhanTheMadRevealAndDrawEffect(), 0)); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java b/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java index c0c2fae900..af9e7fd473 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java @@ -7,7 +7,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; @@ -43,7 +43,7 @@ public final class SarkhanUnbroken extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Draw a card, then add one mana of any color. this.addAbility(new LoyaltyAbility(new SarkhanUnbrokenAbility1(), 1)); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanVol.java b/Mage.Sets/src/mage/cards/s/SarkhanVol.java index a48f190b61..92322a1616 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanVol.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanVol.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effects; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -35,7 +35,7 @@ public final class SarkhanVol extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SARKHAN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Creatures you control get +1/+1 and gain haste until end of turn. Effects effects1 = new Effects(); diff --git a/Mage.Sets/src/mage/cards/s/ScribNibblers.java b/Mage.Sets/src/mage/cards/s/ScribNibblers.java index 8f02f105d3..93806d4abd 100644 --- a/Mage.Sets/src/mage/cards/s/ScribNibblers.java +++ b/Mage.Sets/src/mage/cards/s/ScribNibblers.java @@ -75,7 +75,7 @@ class ScribNibblersEffect extends OneShotEffect { if (targetPlayer != null && targetPlayer.getLibrary().hasCards()) { Card card = targetPlayer.getLibrary().getFromTop(game); card.moveToExile(id, "Scrib Nibblers Exile", source.getSourceId(), game); - if (card != null && card.isLand()) { + if (card.isLand()) { you.gainLife(1, game, source); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SeaGodsRevenge.java b/Mage.Sets/src/mage/cards/s/SeaGodsRevenge.java index 04ae55ea09..16ed72aa72 100644 --- a/Mage.Sets/src/mage/cards/s/SeaGodsRevenge.java +++ b/Mage.Sets/src/mage/cards/s/SeaGodsRevenge.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -7,7 +6,7 @@ import mage.abilities.effects.keyword.ScryEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponentsCreaturePermanent; /** * @@ -16,12 +15,11 @@ import mage.target.common.TargetCreaturePermanent; public final class SeaGodsRevenge extends CardImpl { public SeaGodsRevenge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U}"); // Return up to three target creatures to their owners' hands. Scry 1. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0,3)); + this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent(0, 3)); this.getSpellAbility().addEffect(new ScryEffect(1)); } diff --git a/Mage.Sets/src/mage/cards/s/SelectiveSnare.java b/Mage.Sets/src/mage/cards/s/SelectiveSnare.java new file mode 100644 index 0000000000..61f62f5d60 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SelectiveSnare.java @@ -0,0 +1,70 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.choices.Choice; +import mage.choices.ChoiceCreatureType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetadjustment.TargetAdjuster; + +/** + * + * @author TheElk801 + */ +public final class SelectiveSnare extends CardImpl { + + public SelectiveSnare(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}"); + + // Return X target creatures of the creature type of your choice to their owner's hand. + this.getSpellAbility().addEffect( + new ReturnToHandTargetEffect(true) + .setText("Return X target creatures of " + + "the creature type of your choice " + + "to their owner's hand") + ); + this.getSpellAbility().setTargetAdjuster(SelectiveSnareAdjuster.instance); + } + + public SelectiveSnare(final SelectiveSnare card) { + super(card); + } + + @Override + public SelectiveSnare copy() { + return new SelectiveSnare(this); + } +} + +enum SelectiveSnareAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + Player player = game.getPlayer(ability.getControllerId()); + if (player == null) { + return; + } + Choice choice = new ChoiceCreatureType(); + if (!player.choose(Outcome.Benefit, choice, game)) { + return; + } + SubType subType = SubType.byDescription(choice.getChoice()); + int xValue = ability.getManaCostsToPay().getX(); + FilterPermanent filter = new FilterCreaturePermanent(subType.toString() + " creatures"); + filter.add(new SubtypePredicate(subType)); + ability.getTargets().clear(); + ability.addTarget(new TargetPermanent(xValue, filter)); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SelesnyaLocket.java b/Mage.Sets/src/mage/cards/s/SelesnyaLocket.java new file mode 100644 index 0000000000..5180d87ed1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SelesnyaLocket.java @@ -0,0 +1,47 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class SelesnyaLocket extends CardImpl { + + public SelesnyaLocket(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // {T}: Add {G} or {W}. + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + + // {G/W}{G/W}{G/W}{G/W}, {T}, Sacrifice Selesnya Locket: Draw two cards. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(2), + new ManaCostsImpl("{G/W}{G/W}{G/W}{G/W}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public SelesnyaLocket(final SelesnyaLocket card) { + super(card); + } + + @Override + public SelesnyaLocket copy() { + return new SelesnyaLocket(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SerrasLiturgy.java b/Mage.Sets/src/mage/cards/s/SerrasLiturgy.java index 5a97f18c1b..201092a0c1 100644 --- a/Mage.Sets/src/mage/cards/s/SerrasLiturgy.java +++ b/Mage.Sets/src/mage/cards/s/SerrasLiturgy.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -13,7 +12,6 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; @@ -21,6 +19,7 @@ import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.VerseCounterAdjuster; /** * @@ -50,7 +49,7 @@ public final class SerrasLiturgy extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(0, 0, filter, false)); - ability.setTargetAdjustment(TargetAdjustment.VERSE_COUNTER_TARGETS); + ability.setTargetAdjuster(VerseCounterAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SeveredStrands.java b/Mage.Sets/src/mage/cards/s/SeveredStrands.java new file mode 100644 index 0000000000..a0e7278361 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SeveredStrands.java @@ -0,0 +1,45 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesToughness; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class SeveredStrands extends CardImpl { + + public SeveredStrands(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); + + // As an additional cost to cast this spell, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + + // You gain life equal to the sacrificed creature's toughness. Destroy target creature an opponent controls. + this.getSpellAbility().addEffect(new GainLifeEffect( + new SacrificeCostCreaturesToughness(), + "You gain life equal to the " + + "sacrificed creature's toughness." + )); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent()); + } + + public SeveredStrands(final SeveredStrands card) { + super(card); + } + + @Override + public SeveredStrands copy() { + return new SeveredStrands(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SilentDart.java b/Mage.Sets/src/mage/cards/s/SilentDart.java new file mode 100644 index 0000000000..652d65c427 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SilentDart.java @@ -0,0 +1,45 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class SilentDart extends CardImpl { + + public SilentDart(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); + + // {4}, {T}, Sacrifice Silent Dart: It deals 3 damage to target creature. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new DamageTargetEffect(3, "it"), + new GenericManaCost(4) + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SilentDart(final SilentDart card) { + super(card); + } + + @Override + public SilentDart copy() { + return new SilentDart(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java index 4caebce8f9..82648348da 100644 --- a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java +++ b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java @@ -77,7 +77,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isControlledBy(this.controllerId) && (permanent.hasSubtype(SubType.WOLF, game) || permanent.hasSubtype(SubType.WEREWOLF, game))) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object instanceof Spell) { + if (object instanceof Spell) { Card c = (Spell) object; if (c.isInstant() || c.isSorcery()) { if (getTargets().isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/s/SimicManipulator.java b/Mage.Sets/src/mage/cards/s/SimicManipulator.java index f4c12960b6..5e74a62d85 100644 --- a/Mage.Sets/src/mage/cards/s/SimicManipulator.java +++ b/Mage.Sets/src/mage/cards/s/SimicManipulator.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -7,6 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.RemoveVariableCountersTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.abilities.keyword.EvolveAbility; @@ -21,7 +21,9 @@ import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetadjustment.TargetAdjuster; /** * Gatecrash FAQ (01.2013) @@ -37,7 +39,6 @@ import mage.target.common.TargetCreaturePermanent; */ public final class SimicManipulator extends CardImpl { - private final UUID originalId; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("with power less than or equal to the number of +1/+1 counters removed this way"); public SimicManipulator(UUID ownerId, CardSetInfo setInfo) { @@ -55,36 +56,38 @@ public final class SimicManipulator extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.Custom, true), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.P1P1.createInstance(), 1, "Remove one or more +1/+1 counters from {this}")); + ability.setTargetAdjuster(SimicManipulatorAdjuster.instance); this.addAbility(ability); - this.originalId = ability.getOriginalId(); - } public SimicManipulator(final SimicManipulator card) { super(card); - this.originalId = card.originalId; } @Override public SimicManipulator copy() { return new SimicManipulator(this); } +} + +enum SimicManipulatorAdjuster implements TargetAdjuster { + instance; @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getOriginalId().equals(originalId)) { - ability.getTargets().clear(); - int maxPower = 0; - FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power less than or equal to the number of +1/+1 counters removed this way"); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); + if (sourcePermanent != null) { + int xValue = 0; for (Cost cost : ability.getCosts()) { - if (cost instanceof RemoveVariableCountersSourceCost) { - maxPower = ((RemoveVariableCountersSourceCost) cost).getAmount(); + if (cost instanceof RemoveVariableCountersTargetCost) { + xValue = ((RemoveVariableCountersTargetCost) cost).getAmount(); break; } } - filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, maxPower + 1)); - TargetCreaturePermanent target = new TargetCreaturePermanent(1, 1, filter, false); - ability.addTarget(target); + ability.getTargets().clear(); + FilterCreaturePermanent newFilter = new FilterCreaturePermanent("creature with power " + xValue + " or less"); + newFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); + ability.addTarget(new TargetCreaturePermanent(newFilter)); } } } diff --git a/Mage.Sets/src/mage/cards/s/SinisterSabotage.java b/Mage.Sets/src/mage/cards/s/SinisterSabotage.java new file mode 100644 index 0000000000..836b845510 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SinisterSabotage.java @@ -0,0 +1,36 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.TargetSpell; + +/** + * + * @author TheElk801 + */ +public final class SinisterSabotage extends CardImpl { + + public SinisterSabotage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + + // Counter target spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + // Surveil 1. + this.getSpellAbility().addEffect(new SurveilEffect(1)); + } + + public SinisterSabotage(final SinisterSabotage card) { + super(card); + } + + @Override + public SinisterSabotage copy() { + return new SinisterSabotage(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SkylineScout.java b/Mage.Sets/src/mage/cards/s/SkylineScout.java new file mode 100644 index 0000000000..6cbb0a41ac --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkylineScout.java @@ -0,0 +1,47 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * + * @author TheElk801 + */ +public final class SkylineScout extends CardImpl { + + public SkylineScout(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Skyline Scout attacks, you may pay {1}{W}. If you do, it gains flying until end of turn. + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new GainAbilitySourceEffect( + FlyingAbility.getInstance(), + Duration.EndOfTurn + ), new ManaCostsImpl("{1}{W}") + ), false)); + } + + public SkylineScout(final SkylineScout card) { + super(card); + } + + @Override + public SkylineScout copy() { + return new SkylineScout(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SmeltWardMinotaur.java b/Mage.Sets/src/mage/cards/s/SmeltWardMinotaur.java new file mode 100644 index 0000000000..d3cf7c4ca5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SmeltWardMinotaur.java @@ -0,0 +1,47 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class SmeltWardMinotaur extends CardImpl { + + public SmeltWardMinotaur(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.MINOTAUR); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever you cast an instant or sorcery spell, target creature an opponent controls can't block this turn. + Ability ability = new SpellCastControllerTriggeredAbility( + new CantBlockTargetEffect(Duration.EndOfTurn), + StaticFilters.FILTER_SPELLS_INSTANT_OR_SORCERY, false + ); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + } + + public SmeltWardMinotaur(final SmeltWardMinotaur card) { + super(card); + } + + @Override + public SmeltWardMinotaur copy() { + return new SmeltWardMinotaur(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/Solemnity.java b/Mage.Sets/src/mage/cards/s/Solemnity.java index b930f65297..0ce74644da 100644 --- a/Mage.Sets/src/mage/cards/s/Solemnity.java +++ b/Mage.Sets/src/mage/cards/s/Solemnity.java @@ -123,7 +123,7 @@ class SolemnityEffect2 extends ReplacementEffectImpl { Permanent permanent2 = game.getPermanent(event.getTargetId()); Permanent permanent3 = game.getPermanentEntering(event.getTargetId()); - if (object != null && object instanceof Permanent) { + if (object instanceof Permanent) { if (filter.match((Permanent) object, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/s/SonicAssault.java b/Mage.Sets/src/mage/cards/s/SonicAssault.java new file mode 100644 index 0000000000..a7f408dcf3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SonicAssault.java @@ -0,0 +1,74 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class SonicAssault extends CardImpl { + + public SonicAssault(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{R}"); + + // Tap target creature. Sonic Assault deals 2 damage to that creature's controller. + this.getSpellAbility().addEffect(new SonicAssaultEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Jump-start + this.addAbility(new JumpStartAbility(this)); + } + + public SonicAssault(final SonicAssault card) { + super(card); + } + + @Override + public SonicAssault copy() { + return new SonicAssault(this); + } +} + +class SonicAssaultEffect extends OneShotEffect { + + public SonicAssaultEffect() { + super(Outcome.Benefit); + this.staticText = "Tap target creature. " + + "{this} deals 2 damage to that creature's controller."; + } + + public SonicAssaultEffect(final SonicAssaultEffect effect) { + super(effect); + } + + @Override + public SonicAssaultEffect copy() { + return new SonicAssaultEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature == null) { + return false; + } + creature.tap(game); + Player player = game.getPlayer(creature.getControllerId()); + if (player == null) { + return false; + } + player.damage(2, source.getSourceId(), game, false, true); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/s/SorinGrimNemesis.java b/Mage.Sets/src/mage/cards/s/SorinGrimNemesis.java index 4ffe833c37..a4d363f8bf 100644 --- a/Mage.Sets/src/mage/cards/s/SorinGrimNemesis.java +++ b/Mage.Sets/src/mage/cards/s/SorinGrimNemesis.java @@ -4,7 +4,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -40,7 +40,7 @@ public final class SorinGrimNemesis extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SORIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); // +1: Reveal the top card of your library and put that card into your hand. Each opponent loses life equal to its converted mana cost. this.addAbility(new LoyaltyAbility(new SorinGrimNemesisRevealEffect(), 1)); diff --git a/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java b/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java index 9a01521a28..211cb1e381 100644 --- a/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java +++ b/Mage.Sets/src/mage/cards/s/SorinLordOfInnistrad.java @@ -6,7 +6,7 @@ import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -47,7 +47,7 @@ public final class SorinLordOfInnistrad extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SORIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Create a 1/1 black Vampire creature token with lifelink. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SorinLordOfInnistradVampireToken()), 1)); diff --git a/Mage.Sets/src/mage/cards/s/SorinMarkov.java b/Mage.Sets/src/mage/cards/s/SorinMarkov.java index a2f3f39d29..1797ea59c4 100644 --- a/Mage.Sets/src/mage/cards/s/SorinMarkov.java +++ b/Mage.Sets/src/mage/cards/s/SorinMarkov.java @@ -4,7 +4,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; @@ -32,7 +32,7 @@ public final class SorinMarkov extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SORIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: Sorin Markov deals 2 damage to any target and you gain 2 life. LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(2), 2); diff --git a/Mage.Sets/src/mage/cards/s/SorinSolemnVisitor.java b/Mage.Sets/src/mage/cards/s/SorinSolemnVisitor.java index 73980a076f..c795a89197 100644 --- a/Mage.Sets/src/mage/cards/s/SorinSolemnVisitor.java +++ b/Mage.Sets/src/mage/cards/s/SorinSolemnVisitor.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -31,7 +31,7 @@ public final class SorinSolemnVisitor extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SORIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Until your next turn, creatures you control get +1/+0 and gain lifelink. Effect effect = new BoostControlledEffect(1, 0, Duration.UntilYourNextTurn, StaticFilters.FILTER_PERMANENT_CREATURES); diff --git a/Mage.Sets/src/mage/cards/s/SoulfireGrandMaster.java b/Mage.Sets/src/mage/cards/s/SoulfireGrandMaster.java index 015af98ca9..abd70447d8 100644 --- a/Mage.Sets/src/mage/cards/s/SoulfireGrandMaster.java +++ b/Mage.Sets/src/mage/cards/s/SoulfireGrandMaster.java @@ -111,7 +111,7 @@ class SoulfireGrandMasterCastFromHandReplacementEffect extends ReplacementEffect @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { MageObject mageObject = game.getObject(spellId); - if (mageObject == null || !(mageObject instanceof Spell) || ((Spell) mageObject).isCopiedSpell()) { + if (!(mageObject instanceof Spell) || ((Spell) mageObject).isCopiedSpell()) { return false; } else { Card sourceCard = game.getCard(spellId); diff --git a/Mage.Sets/src/mage/cards/s/SparkFiend.java b/Mage.Sets/src/mage/cards/s/SparkFiend.java index 0de02f16fd..3f55cc67b3 100644 --- a/Mage.Sets/src/mage/cards/s/SparkFiend.java +++ b/Mage.Sets/src/mage/cards/s/SparkFiend.java @@ -69,7 +69,7 @@ class SparkFiendEffect extends OneShotEffect { if (controller != null) { int roll = controller.rollDice(game, 6) + controller.rollDice(game, 6); MageObject mageObject = game.getObject(source.getSourceId()); - if (mageObject != null && mageObject instanceof Permanent) { + if (mageObject instanceof Permanent) { Permanent sourcePermanent = (Permanent) mageObject; if (roll == 2 || roll == 3 || roll == 12) { // sacrifice @@ -114,7 +114,7 @@ class SparkFiendUpkeepEffect extends OneShotEffect { && (Integer) game.getState().getValue("SparkFiend" + source.getSourceId().toString()) != 0) { int roll = controller.rollDice(game, 6) + controller.rollDice(game, 6); MageObject mageObject = game.getObject(source.getSourceId()); - if (mageObject != null && mageObject instanceof Permanent) { + if (mageObject instanceof Permanent) { Permanent sourcePermanent = (Permanent) mageObject; if (roll == 7) { // sacrifice diff --git a/Mage.Sets/src/mage/cards/s/SpectralPrison.java b/Mage.Sets/src/mage/cards/s/SpectralPrison.java index bac2d6a6b6..f502fd33e0 100644 --- a/Mage.Sets/src/mage/cards/s/SpectralPrison.java +++ b/Mage.Sets/src/mage/cards/s/SpectralPrison.java @@ -80,7 +80,7 @@ class SpectralPrisonAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && eventSourceObject instanceof Spell) { + if (eventSourceObject instanceof Spell) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { if (event.getTargetId().equals(enchantment.getAttachedTo())) { diff --git a/Mage.Sets/src/mage/cards/s/SpellShrivel.java b/Mage.Sets/src/mage/cards/s/SpellShrivel.java index 9da3aaafe4..6ab606a199 100644 --- a/Mage.Sets/src/mage/cards/s/SpellShrivel.java +++ b/Mage.Sets/src/mage/cards/s/SpellShrivel.java @@ -66,7 +66,7 @@ class SpellShrivelCounterUnlessPaysEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); MageObject sourceObject = source.getSourceObject(game); - if (spell != null && (spell instanceof Spell) && sourceObject != null) { + if ((spell instanceof Spell) && sourceObject != null) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int amount = 4; diff --git a/Mage.Sets/src/mage/cards/s/SphinxOfJwarIsle.java b/Mage.Sets/src/mage/cards/s/SphinxOfJwarIsle.java index fd8fa2f50f..49b8e776e4 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxOfJwarIsle.java +++ b/Mage.Sets/src/mage/cards/s/SphinxOfJwarIsle.java @@ -73,7 +73,7 @@ class SphinxOfJwarIsleEffect extends OneShotEffect { public SphinxOfJwarIsleEffect() { super(Outcome.Neutral); - this.staticText = "You may look at the top card of your library"; + this.staticText = "You may look at the top card of your library any time"; } public SphinxOfJwarIsleEffect(final SphinxOfJwarIsleEffect effect) { diff --git a/Mage.Sets/src/mage/cards/s/SpinalCentipede.java b/Mage.Sets/src/mage/cards/s/SpinalCentipede.java new file mode 100644 index 0000000000..9d5073b48b --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SpinalCentipede.java @@ -0,0 +1,44 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class SpinalCentipede extends CardImpl { + + public SpinalCentipede(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.INSECT); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Spinal Centipede dies, put a +1/+1 counter on target creature you control. + Ability ability = new DiesTriggeredAbility(new AddCountersTargetEffect( + CounterType.P1P1.createInstance() + ), false); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public SpinalCentipede(final SpinalCentipede card) { + super(card); + } + + @Override + public SpinalCentipede copy() { + return new SpinalCentipede(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SproutingRenewal.java b/Mage.Sets/src/mage/cards/s/SproutingRenewal.java new file mode 100644 index 0000000000..4a9e9c4285 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SproutingRenewal.java @@ -0,0 +1,47 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.ElfKnightToken; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class SproutingRenewal extends CardImpl { + + public SproutingRenewal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Choose one — + // • Create a 2/2 green and white Elf Knight creature token with vigilance. + this.getSpellAbility().addEffect(new CreateTokenEffect(new ElfKnightToken())); + + // • Destroy target artifact or enchantment. + Mode mode = new Mode(new DestroyTargetEffect()); + mode.addTarget(new TargetPermanent( + StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT + )); + this.getSpellAbility().addMode(mode); + } + + public SproutingRenewal(final SproutingRenewal card) { + super(card); + } + + @Override + public SproutingRenewal copy() { + return new SproutingRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/StatusStatue.java b/Mage.Sets/src/mage/cards/s/StatusStatue.java new file mode 100644 index 0000000000..fe14b42902 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StatusStatue.java @@ -0,0 +1,72 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class StatusStatue extends SplitCard { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT) + )); + } + + public StatusStatue(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B/G}", "{2}{B}{G}", SpellAbilityType.SPLIT); + + // Status + // Target creature gets +1/+1 and gains deathtouch until end of turn. + this.getLeftHalfCard().getSpellAbility().addEffect( + new BoostTargetEffect(1, 1, Duration.EndOfTurn) + .setText("Target creature gets +1/+1") + ); + this.getLeftHalfCard().getSpellAbility().addEffect( + new GainAbilityTargetEffect( + DeathtouchAbility.getInstance(), + Duration.EndOfTurn + ).setText("and gains deathtouch until end of turn") + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCreaturePermanent() + ); + + // Statue + // Destroy target artifact, creature, or enchantment. + this.getRightHalfCard().getSpellAbility().addEffect( + new DestroyTargetEffect() + ); + this.getRightHalfCard().getSpellAbility().addTarget( + new TargetPermanent(filter) + ); + } + + public StatusStatue(final StatusStatue card) { + super(card); + } + + @Override + public StatusStatue copy() { + return new StatusStatue(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SteelHellkite.java b/Mage.Sets/src/mage/cards/s/SteelHellkite.java index 504f6e7b6a..694efcbf18 100644 --- a/Mage.Sets/src/mage/cards/s/SteelHellkite.java +++ b/Mage.Sets/src/mage/cards/s/SteelHellkite.java @@ -1,7 +1,6 @@ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; @@ -9,19 +8,25 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; +import mage.filter.FilterPermanent; import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.watchers.common.PlayerDamagedBySourceWatcher; +import mage.watchers.Watcher; + +import java.util.*; /** * @author nantuko @@ -37,9 +42,17 @@ public final class SteelHellkite extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {2}: Steel Hellkite gets +1/+0 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new GenericManaCost(2))); + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(1, 0, Duration.EndOfTurn), + new GenericManaCost(2) + )); // {X}: Destroy each nonland permanent with converted mana cost X whose controller was dealt combat damage by Steel Hellkite this turn. Activate this ability only once each turn. - this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new SteelHellkiteDestroyEffect(), new ManaCostsImpl("{X}"))); + this.addAbility(new LimitedTimesPerTurnActivatedAbility( + Zone.BATTLEFIELD, + new SteelHellkiteDestroyEffect(), + new ManaCostsImpl("{X}") + ), new SteelHellkiteWatcher()); } @@ -71,15 +84,55 @@ class SteelHellkiteDestroyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int xValue = source.getManaCostsToPay().getX(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { - if (permanent.getConvertedManaCost() == xValue) { - PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get(PlayerDamagedBySourceWatcher.class.getSimpleName(), permanent.getControllerId()); - if (watcher != null && watcher.hasSourceDoneDamage(source.getSourceId(), game)) { - permanent.destroy(source.getSourceId(), game, false); - } - } + SteelHellkiteWatcher watcher = (SteelHellkiteWatcher) game.getState().getWatchers().get(SteelHellkiteWatcher.class.getSimpleName()); + if (watcher == null || watcher.getDamagedPlayers(source.getSourceId()).isEmpty()) { + return false; } - return true; + Set<Predicate<Permanent>> predicateSet = new HashSet<>(); + for (UUID playerId : watcher.getDamagedPlayers(source.getSourceId())) { + predicateSet.add(new ControllerIdPredicate(playerId)); + } + FilterPermanent filter = new FilterNonlandPermanent(); + filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, source.getManaCostsToPay().getX())); + filter.add(Predicates.or(predicateSet)); + return new DestroyAllEffect(filter).apply(game, source); } } + +class SteelHellkiteWatcher extends Watcher { + + private final Map<UUID, Set<UUID>> damageMap = new HashMap<>(); + + public SteelHellkiteWatcher() { + super(SteelHellkiteWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) { + super(watcher); + this.damageMap.putAll(watcher.damageMap); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER + && ((DamagedEvent) event).isCombatDamage()) { + damageMap.putIfAbsent(event.getSourceId(), new HashSet<>()); + damageMap.get(event.getSourceId()).add(event.getPlayerId()); + } + } + + @Override + public void reset() { + super.reset(); + this.damageMap.clear(); + } + + @Override + public Watcher copy() { + return new SteelHellkiteWatcher(this); + } + + public Set<UUID> getDamagedPlayers(UUID damagerId) { + return damageMap.getOrDefault(damagerId, new HashSet<>()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/SteelyResolve.java b/Mage.Sets/src/mage/cards/s/SteelyResolve.java index 8deff75df2..2c33f36dab 100644 --- a/Mage.Sets/src/mage/cards/s/SteelyResolve.java +++ b/Mage.Sets/src/mage/cards/s/SteelyResolve.java @@ -57,7 +57,7 @@ class FilterSteelyResolve extends FilterCreaturePermanent { @Override public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (super.match(permanent, sourceId, playerId, game)) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(sourceId, game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(sourceId, game); if (subType != null && permanent.hasSubtype(subType, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/s/StonehewerGiant.java b/Mage.Sets/src/mage/cards/s/StonehewerGiant.java index 2fec92da46..8fb3a3d39c 100644 --- a/Mage.Sets/src/mage/cards/s/StonehewerGiant.java +++ b/Mage.Sets/src/mage/cards/s/StonehewerGiant.java @@ -1,7 +1,6 @@ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -25,8 +24,9 @@ import mage.target.Target; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class StonehewerGiant extends CardImpl { @@ -42,7 +42,11 @@ public final class StonehewerGiant extends CardImpl { // Vigilance this.addAbility(VigilanceAbility.getInstance()); // {1}{W}, {tap}: Search your library for an Equipment card and put it onto the battlefield. Attach it to a creature you control. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new StonehewerGiantEffect(), new ManaCostsImpl("{1}{W}")); + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new StonehewerGiantEffect(), + new ManaCostsImpl("{1}{W}") + ); ability.addCost(new TapSourceCost()); this.addAbility(ability); @@ -90,6 +94,7 @@ class StonehewerGiantEffect extends OneShotEffect { controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent equipment = game.getPermanent(card.getId()); Target targetCreature = new TargetControlledCreaturePermanent(); + targetCreature.setNotTarget(true); if (equipment != null && controller.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) { Permanent permanent = game.getPermanent(targetCreature.getFirstTarget()); permanent.addAttachment(equipment.getId(), game); diff --git a/Mage.Sets/src/mage/cards/s/StreetRiot.java b/Mage.Sets/src/mage/cards/s/StreetRiot.java new file mode 100644 index 0000000000..47cfcea72a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StreetRiot.java @@ -0,0 +1,55 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class StreetRiot extends CardImpl { + + public StreetRiot(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}"); + + // As long as it's your turn, creatures you control get +1/+0 and have trample. + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect( + new BoostControlledEffect( + 1, 0, Duration.WhileOnBattlefield + ), MyTurnCondition.instance, + "As long as it's your turn, " + + "creatures you control get +1/+0" + )); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilityControlledEffect( + TrampleAbility.getInstance(), + Duration.WhileOnBattlefield, + StaticFilters.FILTER_CONTROLLED_CREATURES + ), MyTurnCondition.instance, "and have trample" + )); + this.addAbility(ability); + } + + public StreetRiot(final StreetRiot card) { + super(card); + } + + @Override + public StreetRiot copy() { + return new StreetRiot(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java b/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java new file mode 100644 index 0000000000..258cf03467 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java @@ -0,0 +1,55 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author TheElk801 + */ +public final class SumalaWoodshaper extends CardImpl { + + private static final FilterCard filter + = new FilterCard("a creature or enchantment card"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT) + )); + } + + public SumalaWoodshaper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Sumala Woodshaper enters the battlefield, look at the top four cards of your library. You may reveal a creature or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect( + new StaticValue(4), false, new StaticValue(1), filter, Zone.LIBRARY, false, true, false, Zone.HAND, false, false, false + ), false)); + } + + public SumalaWoodshaper(final SumalaWoodshaper card) { + super(card); + } + + @Override + public SumalaWoodshaper copy() { + return new SumalaWoodshaper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SummoningTrap.java b/Mage.Sets/src/mage/cards/s/SummoningTrap.java index 31be77a83f..8bc4391c42 100644 --- a/Mage.Sets/src/mage/cards/s/SummoningTrap.java +++ b/Mage.Sets/src/mage/cards/s/SummoningTrap.java @@ -90,8 +90,7 @@ class SummoningTrapWatcher extends Watcher { if (counteredSpell == null) { counteredSpell = (StackObject) game.getLastKnownInformation(event.getTargetId(), Zone.STACK); } - if (counteredSpell != null - && counteredSpell instanceof Spell + if (counteredSpell instanceof Spell && !players.contains(counteredSpell.getControllerId()) && counteredSpell.isCreature()) { StackObject counteringStackObject = game.getStack().getStackObject(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/s/SunhomeStalwart.java b/Mage.Sets/src/mage/cards/s/SunhomeStalwart.java new file mode 100644 index 0000000000..e62c0f6b94 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SunhomeStalwart.java @@ -0,0 +1,41 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class SunhomeStalwart extends CardImpl { + + public SunhomeStalwart(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + } + + public SunhomeStalwart(final SunhomeStalwart card) { + super(card); + } + + @Override + public SunhomeStalwart copy() { + return new SunhomeStalwart(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SupremeLeaderSnoke.java b/Mage.Sets/src/mage/cards/s/SupremeLeaderSnoke.java index b434075e19..c894340e3a 100644 --- a/Mage.Sets/src/mage/cards/s/SupremeLeaderSnoke.java +++ b/Mage.Sets/src/mage/cards/s/SupremeLeaderSnoke.java @@ -1,39 +1,32 @@ package mage.cards.s; -import java.util.Iterator; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.OpponentsLostLifeCount; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.*; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.constants.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.counters.Counter; import mage.counters.CounterType; -import mage.filter.FilterCard; import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.players.PlayerList; import mage.target.common.TargetCreaturePermanent; import mage.watchers.common.PlayerLostLifeNonCombatWatcher; -import mage.watchers.common.PlayerLostLifeWatcher; /** * @@ -48,7 +41,7 @@ public final class SupremeLeaderSnoke extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SNOKE); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Put a loyalty counter on Supreme Leader Snoke for each life lost by all opponents from noncombat sources this turn. Ability ability1 = new LoyaltyAbility(new SupremeLeaderSnokeCounterEffect(CounterType.LOYALTY.createInstance()), 1); diff --git a/Mage.Sets/src/mage/cards/s/SwarmGuildmage.java b/Mage.Sets/src/mage/cards/s/SwarmGuildmage.java new file mode 100644 index 0000000000..17e0ee5dca --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwarmGuildmage.java @@ -0,0 +1,64 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; + +/** + * + * @author TheElk801 + */ +public final class SwarmGuildmage extends CardImpl { + + public SwarmGuildmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {4}{B}, {T}: Creatures you control get +1/+0 and gain menace until end of turn. + Ability ability = new SimpleActivatedAbility( + new BoostControlledEffect(1, 0, Duration.EndOfTurn) + .setText("creatures you control get +1/+0"), + new ManaCostsImpl("{4}{B}") + ); + ability.addEffect(new GainAbilityControlledEffect( + new MenaceAbility(), Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + ).setText("and gain menace until end of turn")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {1}{G}, {T}: You gain 2 life. + ability = new SimpleActivatedAbility( + new GainLifeEffect(2), + new ManaCostsImpl("{1}{G}") + ); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public SwarmGuildmage(final SwarmGuildmage card) { + super(card); + } + + @Override + public SwarmGuildmage copy() { + return new SwarmGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java b/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java new file mode 100644 index 0000000000..3113d45bd0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java @@ -0,0 +1,75 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public final class SwathcutterGiant extends CardImpl { + + public SwathcutterGiant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{W}"); + + this.subtype.add(SubType.GIANT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Whenever Swathcutter Giant attacks, it deals 1 damage to each creature defending player controls. + this.addAbility(new AttacksTriggeredAbility(new SwathcutterGiantEffect(), false)); + } + + public SwathcutterGiant(final SwathcutterGiant card) { + super(card); + } + + @Override + public SwathcutterGiant copy() { + return new SwathcutterGiant(this); + } +} + +class SwathcutterGiantEffect extends OneShotEffect { + + public SwathcutterGiantEffect() { + super(Outcome.Benefit); + this.staticText = "it deals 1 damage to each creature " + + "defending player controls."; + } + + public SwathcutterGiantEffect(final SwathcutterGiantEffect effect) { + super(effect); + } + + @Override + public SwathcutterGiantEffect copy() { + return new SwathcutterGiantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate( + game.getCombat().getDefenderId(source.getSourceId()) + )); + return new DamageAllEffect(1, filter).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SwiftbladeVindicator.java b/Mage.Sets/src/mage/cards/s/SwiftbladeVindicator.java new file mode 100644 index 0000000000..d75c001f8d --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwiftbladeVindicator.java @@ -0,0 +1,45 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class SwiftbladeVindicator extends CardImpl { + + public SwiftbladeVindicator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public SwiftbladeVindicator(final SwiftbladeVindicator card) { + super(card); + } + + @Override + public SwiftbladeVindicator copy() { + return new SwiftbladeVindicator(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SwornCompanions.java b/Mage.Sets/src/mage/cards/s/SwornCompanions.java new file mode 100644 index 0000000000..52a743c21c --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwornCompanions.java @@ -0,0 +1,33 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.SoldierLifelinkToken; + +/** + * + * @author TheElk801 + */ +public final class SwornCompanions extends CardImpl { + + public SwornCompanions(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}"); + + // Creature two 1/1 white Soldier creature tokens with lifelink. + this.getSpellAbility().addEffect( + new CreateTokenEffect(new SoldierLifelinkToken(), 2) + ); + } + + public SwornCompanions(final SwornCompanions card) { + super(card); + } + + @Override + public SwornCompanions copy() { + return new SwornCompanions(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/Syncopate.java b/Mage.Sets/src/mage/cards/s/Syncopate.java index c2ff8016d8..01dd9e8825 100644 --- a/Mage.Sets/src/mage/cards/s/Syncopate.java +++ b/Mage.Sets/src/mage/cards/s/Syncopate.java @@ -61,7 +61,7 @@ class SyncopateCounterUnlessPaysEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); MageObject sourceObject = source.getSourceObject(game); - if (spell != null && (spell instanceof Spell) && sourceObject != null) { + if ((spell instanceof Spell) && sourceObject != null) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int amount = source.getManaCostsToPay().getX(); diff --git a/Mage.Sets/src/mage/cards/s/SynodArtificer.java b/Mage.Sets/src/mage/cards/s/SynodArtificer.java index 030b8805dd..efa906cbaa 100644 --- a/Mage.Sets/src/mage/cards/s/SynodArtificer.java +++ b/Mage.Sets/src/mage/cards/s/SynodArtificer.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -14,12 +13,12 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.XTargetsAdjuster; /** * @@ -46,7 +45,7 @@ public final class SynodArtificer extends CardImpl { tapEffect.setText("Tap X target noncreature artifacts."); Ability tapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, tapEffect, new ManaCostsImpl("{X}")); tapAbility.addCost(new TapSourceCost()); - tapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS); + tapAbility.setTargetAdjuster(XTargetsAdjuster.instance); tapAbility.addTarget(new TargetPermanent(filter)); this.addAbility(tapAbility); @@ -55,7 +54,7 @@ public final class SynodArtificer extends CardImpl { untapEffect.setText("Untap X target noncreature artifacts."); Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, untapEffect, new ManaCostsImpl("{X}")); untapAbility.addCost(new TapSourceCost()); - untapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS); + untapAbility.setTargetAdjuster(XTargetsAdjuster.instance); untapAbility.addTarget(new TargetPermanent(filter)); this.addAbility(untapAbility); } diff --git a/Mage.Sets/src/mage/cards/t/TajicLegionsEdge.java b/Mage.Sets/src/mage/cards/t/TajicLegionsEdge.java new file mode 100644 index 0000000000..faa291400c --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TajicLegionsEdge.java @@ -0,0 +1,77 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventAllNonCombatDamageToAllEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author TheElk801 + */ +public final class TajicLegionsEdge extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledCreaturePermanent("other creatures you control"); + + static { + filter.add(new AnotherPredicate()); + } + + public TajicLegionsEdge(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Mentor + this.addAbility(new MentorAbility()); + + // Prevent all noncombat damage that would be dealt to other creatures you control. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new PreventAllNonCombatDamageToAllEffect( + Duration.WhileOnBattlefield, filter + ) + )); + + // {R}{W}: Tajic, Legion's Edge gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new GainAbilitySourceEffect( + FirstStrikeAbility.getInstance(), + Duration.EndOfTurn + ), new ManaCostsImpl("{R}{W}") + )); + } + + public TajicLegionsEdge(final TajicLegionsEdge card) { + super(card); + } + + @Override + public TajicLegionsEdge copy() { + return new TajicLegionsEdge(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TakeHeart.java b/Mage.Sets/src/mage/cards/t/TakeHeart.java new file mode 100644 index 0000000000..b57596a363 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TakeHeart.java @@ -0,0 +1,50 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class TakeHeart extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent(); + + static { + filter.add(new AttackingPredicate()); + } + + public TakeHeart(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); + + // Target creature gets +2/+2 until end of turn. You gain 1 life for each attacking creature you control. + this.getSpellAbility().addEffect( + new BoostTargetEffect(2, 2, Duration.EndOfTurn) + ); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new GainLifeEffect( + new PermanentsOnBattlefieldCount(filter) + ).setText("You gain 1 life for each attacking creature you control.")); + } + + public TakeHeart(final TakeHeart card) { + super(card); + } + + @Override + public TakeHeart copy() { + return new TakeHeart(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java index c7d568a392..1df9e2de40 100644 --- a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java +++ b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java @@ -5,7 +5,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -52,7 +52,7 @@ public final class TamiyoFieldResearcher extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TAMIYO); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. Ability ability = new LoyaltyAbility(new TamiyoFieldResearcherEffect1(), 1); diff --git a/Mage.Sets/src/mage/cards/t/TamiyoTheMoonSage.java b/Mage.Sets/src/mage/cards/t/TamiyoTheMoonSage.java index ac407882ef..6239f76dff 100644 --- a/Mage.Sets/src/mage/cards/t/TamiyoTheMoonSage.java +++ b/Mage.Sets/src/mage/cards/t/TamiyoTheMoonSage.java @@ -4,7 +4,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; @@ -35,7 +35,7 @@ public final class TamiyoTheMoonSage extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TAMIYO); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Tap target permanent. It doesn't untap during its controller's next untap step. LoyaltyAbility ability = new LoyaltyAbility(new TapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/t/TawnossCoffin.java b/Mage.Sets/src/mage/cards/t/TawnossCoffin.java index 6bd80db5c5..af280935ff 100644 --- a/Mage.Sets/src/mage/cards/t/TawnossCoffin.java +++ b/Mage.Sets/src/mage/cards/t/TawnossCoffin.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.HashSet; @@ -171,7 +170,7 @@ class TawnossCoffinReturnEffect extends OneShotEffect { if (controller == null) { return false; } - UUID exileZoneId = CardUtil.getCardExileZoneId(game, source); + UUID exileZoneId = CardUtil.getCardExileZoneId(game, source.getSourceId(), source.getSourcePermanentIfItStillExists(game) == null); ExileZone exileZone = game.getExile().getExileZone(exileZoneId); if (exileZone == null) { return true; diff --git a/Mage.Sets/src/mage/cards/t/TeferiHeroOfDominaria.java b/Mage.Sets/src/mage/cards/t/TeferiHeroOfDominaria.java index a7206c9290..5c10121651 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiHeroOfDominaria.java +++ b/Mage.Sets/src/mage/cards/t/TeferiHeroOfDominaria.java @@ -1,11 +1,10 @@ package mage.cards.t; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -24,8 +23,9 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetNonlandPermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class TeferiHeroOfDominaria extends CardImpl { @@ -36,12 +36,13 @@ public final class TeferiHeroOfDominaria extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEFERI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); - // +1: Draw a card. At the beginning of the next end step, untap two lands. + // +1: Draw a card. At the beginning of the next end step, untap up to two lands. LoyaltyAbility ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility( - new UntapLandsEffect(2, false)); + new UntapLandsEffect(2) + ); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(delayedAbility)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java b/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java index 3fa04b528a..213dfc7d5a 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java +++ b/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java @@ -4,7 +4,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; @@ -31,7 +31,7 @@ public final class TeferiTemporalArchmage extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEFERI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library. this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect( diff --git a/Mage.Sets/src/mage/cards/t/TeferiTimebender.java b/Mage.Sets/src/mage/cards/t/TeferiTimebender.java index 66ad83cd17..89f3fb3f29 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiTimebender.java +++ b/Mage.Sets/src/mage/cards/t/TeferiTimebender.java @@ -3,7 +3,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -29,7 +29,7 @@ public final class TeferiTimebender extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEFERI); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Untap up to one target artifact or creature. FilterPermanent filter = new FilterPermanent("artifact or creature"); diff --git a/Mage.Sets/src/mage/cards/t/TenthDistrictGuard.java b/Mage.Sets/src/mage/cards/t/TenthDistrictGuard.java new file mode 100644 index 0000000000..805039d804 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TenthDistrictGuard.java @@ -0,0 +1,45 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class TenthDistrictGuard extends CardImpl { + + public TenthDistrictGuard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Tenth District Guard enters the battlefield, target creature gets +0/+1 until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility( + new BoostTargetEffect(0, 1, Duration.EndOfTurn) + ); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public TenthDistrictGuard(final TenthDistrictGuard card) { + super(card); + } + + @Override + public TenthDistrictGuard copy() { + return new TenthDistrictGuard(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java index 13d49cdd6f..f68b2a94ba 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java @@ -4,7 +4,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -43,7 +43,7 @@ public final class TezzeretAgentOfBolas extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(5, 1, filter, true), 1)); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretArtificeMaster.java b/Mage.Sets/src/mage/cards/t/TezzeretArtificeMaster.java index a1843d8453..472be04176 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretArtificeMaster.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretArtificeMaster.java @@ -2,7 +2,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -27,7 +27,7 @@ public final class TezzeretArtificeMaster extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Create a colorless Thopter artifact creature token with flying. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new ThopterColorlessToken()), 1)); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java index 352c1c8c59..0f1d8ca68a 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java @@ -3,7 +3,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -40,7 +40,7 @@ public final class TezzeretCruelMachinist extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Draw a card. this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1)); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java index ec7e60985a..962e8aa48b 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; @@ -43,7 +43,7 @@ public final class TezzeretMasterOfMetal extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Reveal cards from the top of your library until you reveal an artifact card. Put that card into your hand and the rest on the bottom of your library in a random order. this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterArtifactCard(), Zone.HAND, Zone.LIBRARY), 1)); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java b/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java index 980a219d49..89b2794b68 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java @@ -4,7 +4,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; @@ -33,7 +33,7 @@ public final class TezzeretTheSchemer extends CardImpl { this.subtype.add(SubType.TEZZERET); //Starting Loyalty - 5 - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Create a colorless artifact token named Etherium Cell which has "{T}, Sacrifice this artifact: Add one mana of any color." this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new EtheriumCellToken()), 1)); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java index 274b067721..c9f2ff0ed6 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.ContinuousEffectImpl; @@ -35,7 +35,7 @@ public final class TezzeretTheSeeker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Untap up to two target artifacts. LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java new file mode 100644 index 0000000000..f0db706fc4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java @@ -0,0 +1,260 @@ +package mage.cards.t; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.ExileZone; +import mage.game.Game; +import mage.players.ManaPoolItem; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public final class ThiefOfSanity extends CardImpl { + + protected static final String VALUE_PREFIX = "ExileZones"; + + public ThiefOfSanity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); + + this.subtype.add(SubType.SPECTER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Thief of Sanity deals combat damage to a player, look at the top three cards of that player's library, exile one of them face down, then put the rest into their graveyard. For as long as that card remains exiled, you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ThiefOfSanityEffect(), false, true)); + + Ability ability = new SimpleStaticAbility(Zone.ALL, new ThiefOfSanityLookEffect()); + ability.setRuleVisible(false); + this.addAbility(ability); + } + + public ThiefOfSanity(final ThiefOfSanity card) { + super(card); + } + + @Override + public ThiefOfSanity copy() { + return new ThiefOfSanity(this); + } +} + +class ThiefOfSanityEffect extends OneShotEffect { + + public ThiefOfSanityEffect() { + super(Outcome.Benefit); + this.staticText = "look at the top three cards of that player's library, exile one of them face down, then put the rest into their graveyard. For as long as that card remains exiled, you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it"; + } + + public ThiefOfSanityEffect(final ThiefOfSanityEffect effect) { + super(effect); + } + + @Override + public ThiefOfSanityEffect copy() { + return new ThiefOfSanityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player damagedPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && damagedPlayer != null && sourceObject != null) { + Cards topCards = new CardsImpl(); + topCards.addAll(damagedPlayer.getLibrary().getTopCards(game, 3)); + TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to exile face down")); + if (controller.choose(outcome, topCards, target, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + topCards.remove(card); + // move card to exile + UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + card.setFaceDown(true, game); + if (controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName())) { + card.setFaceDown(true, game); + Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(ThiefOfSanity.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones == null) { + exileZones = new HashSet<>(); + game.getState().setValue(ThiefOfSanity.VALUE_PREFIX + source.getSourceId().toString(), exileZones); + } + exileZones.add(exileZoneId); + // allow to cast the card + ContinuousEffect effect = new ThiefOfSanityCastFromExileEffect(); + effect.setTargetPointer(new FixedTarget(card.getId(), game)); + game.addEffect(effect, source); + // and you may spend mana as though it were mana of any color to cast it + effect = new ThiefOfSanitySpendAnyManaEffect(); + effect.setTargetPointer(new FixedTarget(card.getId(), game)); + game.addEffect(effect, source); + } + } + } + // put the rest into their graveyard + controller.moveCards(topCards, Zone.GRAVEYARD, source, game); + return true; + } + + return false; + } +} + +class ThiefOfSanityCastFromExileEffect extends AsThoughEffectImpl { + + public ThiefOfSanityCastFromExileEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); + staticText = "You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell"; + } + + public ThiefOfSanityCastFromExileEffect(final ThiefOfSanityCastFromExileEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ThiefOfSanityCastFromExileEffect copy() { + return new ThiefOfSanityCastFromExileEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + UUID targetId = getTargetPointer().getFirst(game, source); + if (targetId == null) { + this.discard(); + } else if (objectId.equals(targetId) + && affectedControllerId.equals(source.getControllerId())) { + Card card = game.getCard(objectId); + // TODO: Allow to cast Zoetic Cavern face down + return card != null && !card.isLand(); + } + return false; + } +} + +class ThiefOfSanitySpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { + + public ThiefOfSanitySpendAnyManaEffect() { + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.Custom, Outcome.Benefit); + staticText = "you may spend mana as though it were mana of any color to cast it"; + } + + public ThiefOfSanitySpendAnyManaEffect(final ThiefOfSanitySpendAnyManaEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ThiefOfSanitySpendAnyManaEffect copy() { + return new ThiefOfSanitySpendAnyManaEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget()) + && game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) { + + if (affectedControllerId.equals(source.getControllerId())) { + // if the card moved from exile to spell the zone change counter is increased by 1 + if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) { + return true; + } + } + + } else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) { + // object has moved zone so effect can be discarted + this.discard(); + } + return false; + } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + return mana.getFirstAvailable(); + } +} + +class ThiefOfSanityLookEffect extends AsThoughEffectImpl { + + public ThiefOfSanityLookEffect() { + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may look at the cards exiled with {this}"; + } + + public ThiefOfSanityLookEffect(final ThiefOfSanityLookEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ThiefOfSanityLookEffect copy() { + return new ThiefOfSanityLookEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Card card = game.getCard(objectId); + if (card != null && card.isFaceDown(game)) { + Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(ThiefOfSanity.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones != null) { + for (ExileZone exileZone : game.getExile().getExileZones()) { + if (exileZone.contains(objectId)) { + if (!exileZones.contains(exileZone.getId())) { + return false; + } + } + } + return true; + } + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/t/ThoughtErasure.java b/Mage.Sets/src/mage/cards/t/ThoughtErasure.java new file mode 100644 index 0000000000..4bbe88d5db --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThoughtErasure.java @@ -0,0 +1,43 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.common.FilterNonlandCard; +import mage.target.common.TargetOpponent; + +/** + * + * @author TheElk801 + */ +public final class ThoughtErasure extends CardImpl { + + private static final FilterCard filter = new FilterNonlandCard(); + + public ThoughtErasure(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{B}"); + + // Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. + this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect( + filter, TargetController.ANY + )); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Surveil 1. + this.getSpellAbility().addEffect(new SurveilEffect(1)); + } + + public ThoughtErasure(final ThoughtErasure card) { + super(card); + } + + @Override + public ThoughtErasure copy() { + return new ThoughtErasure(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/ThoughtPrison.java b/Mage.Sets/src/mage/cards/t/ThoughtPrison.java index 8a5e27bc06..7eef4e4083 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtPrison.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtPrison.java @@ -137,7 +137,7 @@ class ThoughtPrisonTriggeredAbility extends TriggeredAbilityImpl { Spell spell = (Spell) game.getObject(event.getTargetId()); Permanent sourcePermanent = game.getPermanent(this.getSourceId()); - if (spell != null && spell instanceof Spell) { + if (spell instanceof Spell) { if (sourcePermanent == null) { sourcePermanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); } diff --git a/Mage.Sets/src/mage/cards/t/ThoughtboundPhantasm.java b/Mage.Sets/src/mage/cards/t/ThoughtboundPhantasm.java new file mode 100644 index 0000000000..1c0041ff36 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThoughtboundPhantasm.java @@ -0,0 +1,96 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author TheElk801 + */ +public final class ThoughtboundPhantasm extends CardImpl { + + public ThoughtboundPhantasm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}"); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // Whenever you surveil, put a +1/+1 counter on Thoughtbound Phantasm. + this.addAbility(new ThoughtboundPhantasmTriggeredAbility()); + + // As long as Thoughtbound Phantasm has three or more +1/+1 counters on it, it can attack as though it didn't have defender. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect( + Duration.WhileOnBattlefield + ), new SourceHasCounterCondition(CounterType.P1P1, 3) + ).setText("As long as {this} has three " + + "or more +1/+1 counters on it, " + + "it can attack as though it " + + "didn't have defender.") + )); + } + + public ThoughtboundPhantasm(final ThoughtboundPhantasm card) { + super(card); + } + + @Override + public ThoughtboundPhantasm copy() { + return new ThoughtboundPhantasm(this); + } +} + +class ThoughtboundPhantasmTriggeredAbility extends TriggeredAbilityImpl { + + public ThoughtboundPhantasmTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect( + CounterType.P1P1.createInstance() + ), false); + } + + public ThoughtboundPhantasmTriggeredAbility(final ThoughtboundPhantasmTriggeredAbility ability) { + super(ability); + } + + @Override + public ThoughtboundPhantasmTriggeredAbility copy() { + return new ThoughtboundPhantasmTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEILED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()); + } + + @Override + public String getRule() { + return "Whenever you surveil, put a +1/+1 counter on {this}."; + } +} diff --git a/Mage.Sets/src/mage/cards/t/Thoughtseize.java b/Mage.Sets/src/mage/cards/t/Thoughtseize.java index c4d449f2fc..3d78bf76be 100644 --- a/Mage.Sets/src/mage/cards/t/Thoughtseize.java +++ b/Mage.Sets/src/mage/cards/t/Thoughtseize.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -8,9 +7,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; -import mage.filter.FilterCard; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.target.TargetPlayer; /** @@ -19,19 +16,12 @@ import mage.target.TargetPlayer; */ public final class Thoughtseize extends CardImpl { - private static final FilterCard filter = new FilterCard("nonland card"); - - static { - filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); - } - public Thoughtseize(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); // Target player reveals their hand. You choose a nonland card from it. That player discards that card. You lose 2 life. this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(filter, TargetController.ANY)); + this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(StaticFilters.FILTER_CARD_NON_LAND, TargetController.ANY)); this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2)); } @@ -44,4 +34,3 @@ public final class Thoughtseize extends CardImpl { return new Thoughtseize(this); } } - diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java new file mode 100644 index 0000000000..83c624009a --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java @@ -0,0 +1,124 @@ +package mage.cards.t; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.WatcherScope; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ +public final class ThousandYearStorm extends CardImpl { + + public ThousandYearStorm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}{R}"); + + // Whenever you cast an instant or sorcery spell, copy it for each other instant and sorcery spell you've cast before it this turn. You may choose new targets for the copies. + this.addAbility(new SpellCastControllerTriggeredAbility( + new ThousandYearStormEffect(), new FilterInstantOrSorcerySpell(), false, true + ), new ThousandYearWatcher()); + } + + public ThousandYearStorm(final ThousandYearStorm card) { + super(card); + } + + @Override + public ThousandYearStorm copy() { + return new ThousandYearStorm(this); + } +} + +class ThousandYearStormEffect extends OneShotEffect { + + public ThousandYearStormEffect() { + super(Outcome.Benefit); + this.staticText = "copy it for each other instant and sorcery spell you've cast before it this turn. You may choose new targets for the copies"; + } + + public ThousandYearStormEffect(final ThousandYearStormEffect effect) { + super(effect); + } + + @Override + public ThousandYearStormEffect copy() { + return new ThousandYearStormEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpellOrLKIStack(getTargetPointer().getFirst(game, source)); + if (spell != null) { + ThousandYearWatcher watcher = (ThousandYearWatcher) game.getState().getWatchers().get(ThousandYearWatcher.class.getSimpleName()); + if (watcher != null) { + int numberOfCopies = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) - 1; + if (numberOfCopies > 0) { + for (int i = 0; i < numberOfCopies; i++) { + spell.createCopyOnStack(game, source, source.getControllerId(), true); + } + } + return true; + } + } + return false; + } +} + +class ThousandYearWatcher extends Watcher { + + private final Map<UUID, Integer> amountOfInstantSorcerySpellsCastOnCurrentTurn = new HashMap<>(); + + public ThousandYearWatcher() { + super(ThousandYearWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public ThousandYearWatcher(final ThousandYearWatcher watcher) { + super(watcher); + for (Entry<UUID, Integer> entry : watcher.amountOfInstantSorcerySpellsCastOnCurrentTurn.entrySet()) { + amountOfInstantSorcerySpellsCastOnCurrentTurn.put(entry.getKey(), entry.getValue()); + } + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = game.getSpellOrLKIStack(event.getTargetId()); + if (spell != null && spell.isInstantOrSorcery()) { + UUID playerId = event.getPlayerId(); + if (playerId != null) { + amountOfInstantSorcerySpellsCastOnCurrentTurn.putIfAbsent(playerId, 0); + amountOfInstantSorcerySpellsCastOnCurrentTurn.compute(playerId, (k, a) -> a + 1); + } + } + } + } + + @Override + public void reset() { + amountOfInstantSorcerySpellsCastOnCurrentTurn.clear(); + } + + public int getAmountOfSpellsPlayerCastOnCurrentTurn(UUID playerId) { + return amountOfInstantSorcerySpellsCastOnCurrentTurn.getOrDefault(playerId, 0); + } + + @Override + public ThousandYearWatcher copy() { + return new ThousandYearWatcher(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java index 326cd9c887..a83deed0d4 100644 --- a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java +++ b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; @@ -44,7 +44,7 @@ public final class TibaltTheFiendBlooded extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TIBALT); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(2)); // +1: Draw a card, then discard a card at random. LoyaltyAbility ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); diff --git a/Mage.Sets/src/mage/cards/t/TitaniaProtectorOfArgoth.java b/Mage.Sets/src/mage/cards/t/TitaniaProtectorOfArgoth.java index c953ca9f25..2b732adc5e 100644 --- a/Mage.Sets/src/mage/cards/t/TitaniaProtectorOfArgoth.java +++ b/Mage.Sets/src/mage/cards/t/TitaniaProtectorOfArgoth.java @@ -41,7 +41,7 @@ public final class TitaniaProtectorOfArgoth extends CardImpl { this.toughness = new MageInt(3); // When Titania, Protector of Argoth enters the battlefield, return target land card from your graveyard to the battlefield. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), true); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false); ability.addTarget(new TargetCardInYourGraveyard(new FilterLandCard("land card from your graveyard"))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/TorchCourier.java b/Mage.Sets/src/mage/cards/t/TorchCourier.java new file mode 100644 index 0000000000..24566bcde9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TorchCourier.java @@ -0,0 +1,62 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.constants.SubType; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public final class TorchCourier extends CardImpl { + + private static final FilterPermanent filter + = new FilterCreaturePermanent("another target creature"); + + static { + filter.add(new AnotherPredicate()); + } + + public TorchCourier(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); + + this.subtype.add(SubType.GOBLIN); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Sacrifice Torch Courier: Another target creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility( + new GainAbilityTargetEffect( + HasteAbility.getInstance(), + Duration.EndOfTurn + ), new SacrificeSourceCost() + ); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public TorchCourier(final TorchCourier card) { + super(card); + } + + @Override + public TorchCourier copy() { + return new TorchCourier(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java b/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java index d99891cb1f..876e1d9be1 100644 --- a/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java +++ b/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java @@ -102,8 +102,7 @@ class TreacherousPitDwellerEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { MageObject permanent = source.getSourceObjectIfItStillExists(game); // it can also return Card object Player targetOpponent = game.getPlayer(source.getFirstTarget()); - if (permanent != null - && (permanent instanceof Permanent) + if ((permanent instanceof Permanent) && targetOpponent != null) { return ((Permanent) permanent).changeControllerId(targetOpponent.getId(), game); } else { diff --git a/Mage.Sets/src/mage/cards/t/TritonTactics.java b/Mage.Sets/src/mage/cards/t/TritonTactics.java index d400a0fd42..1823c39c19 100644 --- a/Mage.Sets/src/mage/cards/t/TritonTactics.java +++ b/Mage.Sets/src/mage/cards/t/TritonTactics.java @@ -89,7 +89,7 @@ class TritonTacticsUntapTargetEffect extends OneShotEffect { // save the targets for the watcher in a map with zone change counter (as the card is recast during combat it's neccessary to save with zone change counter) Map<Integer, Set<String>> targetMap; Object object = game.getState().getValue("targets" + source.getSourceId()); - if (object != null && object instanceof Map) { + if (object instanceof Map) { targetMap = (Map<Integer, Set<String>>) object; } else { targetMap = new HashMap<>(); @@ -155,7 +155,7 @@ class TritonTacticsEndOfCombatEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Map<Integer, Set<String>> attackerMap = null; Object object = game.getState().getValue("blockedAttackers" + source.getSourceId()); - if (object != null && object instanceof Map) { + if (object instanceof Map) { attackerMap = (Map<Integer, Set<String>>) object; for (Set<String> attackerSet : attackerMap.values()) { List<Permanent> doNotUntapNextUntapStep = new ArrayList<>(); @@ -197,7 +197,7 @@ class BlockedCreaturesWatcher extends Watcher { if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { Map<Integer, Set<String>> targetMap; Object object = game.getState().getValue("targets" + this.getSourceId().toString()); - if (object != null && object instanceof Map) { + if (object instanceof Map) { Permanent blocker = game.getPermanent(event.getSourceId()); if (blocker != null) { targetMap = (Map<Integer, Set<String>>) object; @@ -217,7 +217,7 @@ class BlockedCreaturesWatcher extends Watcher { Set<String> attackers; Map<Integer, Set<String>> attackerMap; Object object = game.getState().getValue("blockedAttackers" + getSourceId()); - if (object != null && object instanceof Map) { + if (object instanceof Map) { attackerMap = (Map<Integer, Set<String>>) object; } else { attackerMap = new HashMap<>(); diff --git a/Mage.Sets/src/mage/cards/t/TrostaniDiscordant.java b/Mage.Sets/src/mage/cards/t/TrostaniDiscordant.java new file mode 100644 index 0000000000..d7dfd63b47 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TrostaniDiscordant.java @@ -0,0 +1,125 @@ +package mage.cards.t; + +import java.util.Iterator; +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SoldierLifelinkToken; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class TrostaniDiscordant extends CardImpl { + + public TrostaniDiscordant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DRYAD); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Other creatures you control get +1/+1. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new BoostControlledEffect( + 1, 1, Duration.WhileOnBattlefield, true + ) + )); + + // When Trostani Discordant enters the battlefield, create two 1/1 white Soldier creature tokens with lifelink. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new CreateTokenEffect(new SoldierLifelinkToken(), 2) + )); + + // At the beginning of your end step, each player gains control of all creatures they own. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new TrostaniDiscordantEffect(), TargetController.YOU, false + )); + } + + public TrostaniDiscordant(final TrostaniDiscordant card) { + super(card); + } + + @Override + public TrostaniDiscordant copy() { + return new TrostaniDiscordant(this); + } +} + +class TrostaniDiscordantEffect extends ContinuousEffectImpl { + + public TrostaniDiscordantEffect() { + super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + this.staticText = "each player gains control of all creatures they own"; + } + + public TrostaniDiscordantEffect(final TrostaniDiscordantEffect effect) { + super(effect); + } + + @Override + public TrostaniDiscordantEffect copy() { + return new TrostaniDiscordantEffect(this); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + // add all creatures in range + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + FilterPermanent playerFilter = new FilterCreaturePermanent(); + playerFilter.add(new OwnerIdPredicate(playerId)); + for (Permanent permanent : game.getBattlefield().getActivePermanents(playerFilter, playerId, game)) { + affectedObjectList.add(new MageObjectReference(permanent, game)); + } + } + } + } + + @Override + public boolean apply(Game game, Ability source) { + for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { + Permanent creature = it.next().getPermanent(game); + if (creature != null) { + if (!creature.isControlledBy(creature.getOwnerId())) { + creature.changeControllerId(creature.getOwnerId(), game); + } + } else { + it.remove(); + } + } + if (affectedObjectList.isEmpty()) { + this.discard(); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/t/TruefireCaptain.java b/Mage.Sets/src/mage/cards/t/TruefireCaptain.java new file mode 100644 index 0000000000..657392ec9f --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TruefireCaptain.java @@ -0,0 +1,76 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealtDamageToSourceTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.target.TargetPlayer; + +/** + * + * @author TheElk801 + */ +public final class TruefireCaptain extends CardImpl { + + public TruefireCaptain(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{R}{W}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Mentor + this.addAbility(new MentorAbility()); + + // Whenever Truefire Captain is dealt damage, it deals that much damage to target player. + Ability ability = new DealtDamageToSourceTriggeredAbility( + Zone.BATTLEFIELD, new TruefireCaptainEffect(), + false, false, true + ); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public TruefireCaptain(final TruefireCaptain card) { + super(card); + } + + @Override + public TruefireCaptain copy() { + return new TruefireCaptain(this); + } +} + +class TruefireCaptainEffect extends OneShotEffect { + + public TruefireCaptainEffect() { + super(Outcome.Damage); + this.staticText = "it deals that much damage to target player"; + } + + public TruefireCaptainEffect(final TruefireCaptainEffect effect) { + super(effect); + } + + @Override + public TruefireCaptainEffect copy() { + return new TruefireCaptainEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = (Integer) getValue("damage"); + return new DamageTargetEffect(amount).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/u/UginTheSpiritDragon.java b/Mage.Sets/src/mage/cards/u/UginTheSpiritDragon.java index 483e29f07c..d508d489b3 100644 --- a/Mage.Sets/src/mage/cards/u/UginTheSpiritDragon.java +++ b/Mage.Sets/src/mage/cards/u/UginTheSpiritDragon.java @@ -6,7 +6,7 @@ import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.OneShotEffect; @@ -42,7 +42,7 @@ public final class UginTheSpiritDragon extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.UGIN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); // +2: Ugin, the Spirit Dragon deals 3 damage to any target. LoyaltyAbility ability = new LoyaltyAbility(new DamageTargetEffect(3), 2); diff --git a/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java b/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java index bc26083105..9b3cd9cc20 100644 --- a/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java +++ b/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java @@ -57,7 +57,7 @@ class UnclaimedTerritoryManaBuilder extends ConditionalManaBuilder { @Override public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { creatureType = subType; } diff --git a/Mage.Sets/src/mage/cards/u/UndercityNecrolisk.java b/Mage.Sets/src/mage/cards/u/UndercityNecrolisk.java new file mode 100644 index 0000000000..f1adb8461a --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UndercityNecrolisk.java @@ -0,0 +1,69 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author TheElk801 + */ +public final class UndercityNecrolisk extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledCreaturePermanent("another creature"); + + static { + filter.add(new AnotherPredicate()); + } + + public UndercityNecrolisk(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.LIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}, Sacrifice another creature: Put a +1/+1 counter on Undercity Necrolisk. It gains menace until end of turn. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility( + Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + new GenericManaCost(1) + ); + ability.addEffect(new GainAbilitySourceEffect( + new MenaceAbility(), + Duration.EndOfTurn + ).setText("It gains menace until end of turn.")); + ability.addCost(new SacrificeTargetCost( + new TargetControlledPermanent(filter) + )); + this.addAbility(ability); + } + + public UndercityNecrolisk(final UndercityNecrolisk card) { + super(card); + } + + @Override + public UndercityNecrolisk copy() { + return new UndercityNecrolisk(this); + } +} diff --git a/Mage.Sets/src/mage/cards/u/UndercityUprising.java b/Mage.Sets/src/mage/cards/u/UndercityUprising.java new file mode 100644 index 0000000000..da820f372b --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UndercityUprising.java @@ -0,0 +1,53 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.effects.common.FightTargetsEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.TargetController; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class UndercityUprising extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creature you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public UndercityUprising(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{G}"); + + // Creatures you control gain deathtouch until end of turn. Then target creature you control fights target creature you don't control. + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + DeathtouchAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + )); + this.getSpellAbility().addEffect(new FightTargetsEffect() + .setText("Then target creature you control fights target creature you don't control")); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public UndercityUprising(final UndercityUprising card) { + super(card); + } + + @Override + public UndercityUprising copy() { + return new UndercityUprising(this); + } +} diff --git a/Mage.Sets/src/mage/cards/u/UnderrealmLich.java b/Mage.Sets/src/mage/cards/u/UnderrealmLich.java new file mode 100644 index 0000000000..72d3b775ba --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnderrealmLich.java @@ -0,0 +1,109 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author TheElk801 + */ +public final class UnderrealmLich extends CardImpl { + + public UnderrealmLich(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // If you would draw a card, instead look at the top three cards of your library, then put one into your hand and the rest into your graveyard. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, new UnderrealmLichReplacementEffect() + )); + + // Pay 4 life: Underrealm Lich gains indestructible until end of turn. Tap it. + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), + Duration.EndOfTurn + ), new PayLifeCost(4) + ); + ability.addEffect(new TapSourceEffect().setText("Tap it")); + this.addAbility(ability); + } + + public UnderrealmLich(final UnderrealmLich card) { + super(card); + } + + @Override + public UnderrealmLich copy() { + return new UnderrealmLich(this); + } +} + +class UnderrealmLichReplacementEffect extends ReplacementEffectImpl { + + public UnderrealmLichReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If you would draw a card, instead look at the top " + + "three cards of your library, then put one into your hand " + + "and the rest into your graveyard."; + } + + public UnderrealmLichReplacementEffect(final UnderrealmLichReplacementEffect effect) { + super(effect); + } + + @Override + public UnderrealmLichReplacementEffect copy() { + return new UnderrealmLichReplacementEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return new LookLibraryAndPickControllerEffect( + new StaticValue(3), false, new StaticValue(1), + StaticFilters.FILTER_CARD, Zone.GRAVEYARD, + false, false, false, Zone.HAND, false + ).apply(game, source); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DRAW_CARD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(source.getControllerId()); + } +} diff --git a/Mage.Sets/src/mage/cards/u/UnexplainedDisappearance.java b/Mage.Sets/src/mage/cards/u/UnexplainedDisappearance.java new file mode 100644 index 0000000000..65b94b4c30 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnexplainedDisappearance.java @@ -0,0 +1,36 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class UnexplainedDisappearance extends CardImpl { + + public UnexplainedDisappearance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Return target creature to its owner's hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Surveil 1. + this.getSpellAbility().addEffect(new SurveilEffect(1)); + } + + public UnexplainedDisappearance(final UnexplainedDisappearance card) { + super(card); + } + + @Override + public UnexplainedDisappearance copy() { + return new UnexplainedDisappearance(this); + } +} diff --git a/Mage.Sets/src/mage/cards/u/UnmooredEgo.java b/Mage.Sets/src/mage/cards/u/UnmooredEgo.java new file mode 100644 index 0000000000..8b09521818 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnmooredEgo.java @@ -0,0 +1,124 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public final class UnmooredEgo extends CardImpl { + + public UnmooredEgo(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{B}"); + + // Choose a card name. Search target opponent's graveyard, hand, and library for up to four cards with that name and exile them. That player shuffles their library, then draws a card for each card exiled from their hand this way. + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL))); + this.getSpellAbility().addEffect(new UnmooredEgoEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public UnmooredEgo(final UnmooredEgo card) { + super(card); + } + + @Override + public UnmooredEgo copy() { + return new UnmooredEgo(this); + } +} + +class UnmooredEgoEffect extends OneShotEffect { + + public UnmooredEgoEffect() { + super(Outcome.Benefit); + this.staticText = "Search target opponent's graveyard, hand, and library for up to four cards with that name and exile them. That player shuffles their library, then draws a card for each card exiled from their hand this way"; + } + + public UnmooredEgoEffect(final UnmooredEgoEffect effect) { + super(effect); + } + + @Override + public UnmooredEgoEffect copy() { + return new UnmooredEgoEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); + Player controller = game.getPlayer(source.getControllerId()); + if (cardName != null && controller != null) { + int numberOfCardsStillToRemove = 4; + int numberOfCardsExiledFromHand = 0; + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + FilterCard filter = new FilterCard("card named " + cardName); + filter.add(new NamePredicate(cardName)); + + // cards in Graveyard + int cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getGraveyard().count(filter, game)); + if (cardsCount > 0) { + filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getName()); + TargetCard target = new TargetCard(Math.min(cardsCount, numberOfCardsStillToRemove), + Math.min(cardsCount, numberOfCardsStillToRemove), Zone.GRAVEYARD, filter); + if (controller.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) { + numberOfCardsStillToRemove -= target.getTargets().size(); + controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game); + } + } + + // cards in Hand + if (numberOfCardsStillToRemove > 0) { + cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getHand().count(filter, game)); + filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getName()); + TargetCard target = new TargetCard(0, Math.min(cardsCount, numberOfCardsStillToRemove), Zone.HAND, filter); + if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) { + numberOfCardsExiledFromHand = target.getTargets().size(); + numberOfCardsStillToRemove -= target.getTargets().size(); + controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game); + } + } + + // cards in Library + if (numberOfCardsStillToRemove > 0) { + Cards cardsInLibrary = new CardsImpl(); + cardsInLibrary.addAll(targetPlayer.getLibrary().getCards(game)); + cardsCount = (cardName.isEmpty() ? 0 : cardsInLibrary.count(filter, game)); + filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName()); + TargetCardInLibrary targetLib = new TargetCardInLibrary(0, Math.min(cardsCount, numberOfCardsStillToRemove), filter); + if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, game)) { + controller.moveCards(new CardsImpl(targetLib.getTargets()), Zone.EXILED, source, game); + } + } + targetPlayer.shuffleLibrary(source, game); + + if (numberOfCardsExiledFromHand > 0) { + game.getState().applyEffects(game); + targetPlayer.drawCards(numberOfCardsExiledFromHand, game); + } + } + + return true; + } + + return false; + } + +} diff --git a/Mage.Sets/src/mage/cards/u/UrbanUtopia.java b/Mage.Sets/src/mage/cards/u/UrbanUtopia.java new file mode 100644 index 0000000000..a6b67b50bb --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UrbanUtopia.java @@ -0,0 +1,63 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.constants.SubType; +import mage.target.common.TargetLandPermanent; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class UrbanUtopia extends CardImpl { + + public UrbanUtopia(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + + this.subtype.add(SubType.AURA); + + // Enchant Land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Urban Utopia enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(1) + )); + + // Enchanted land has "{T}: Add one mana of any color." + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new GainAbilityAttachedEffect( + new AnyColorManaAbility(), AttachmentType.AURA + ).setText("Enchanted land has " + + "\"{T}: Add one mana of any color.\"") + )); + } + + public UrbanUtopia(final UrbanUtopia card) { + super(card); + } + + @Override + public UrbanUtopia copy() { + return new UrbanUtopia(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java index 87a0cc004f..63a8cfd65d 100644 --- a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java +++ b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java @@ -81,7 +81,7 @@ class DrawCardIfCreatureTypeAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(getSourceId(), game); if (subType != null) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null diff --git a/Mage.Sets/src/mage/cards/v/VarchildBetrayerOfKjeldor.java b/Mage.Sets/src/mage/cards/v/VarchildBetrayerOfKjeldor.java index 4aafbd08c8..ae1f7cceec 100644 --- a/Mage.Sets/src/mage/cards/v/VarchildBetrayerOfKjeldor.java +++ b/Mage.Sets/src/mage/cards/v/VarchildBetrayerOfKjeldor.java @@ -6,18 +6,19 @@ import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect; import mage.abilities.effects.common.combat.CantBlockAllEffect; import mage.abilities.effects.common.continuous.GainControlAllEffect; -import mage.constants.SubType; -import mage.constants.SuperType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; @@ -108,9 +109,9 @@ class VarchildBetrayerOfKjeldorEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int damage = (int) this.getValue("damage"); if (damage > 0) { - return new CreateTokenEffect( - new SurvivorToken(), damage - ).apply(game, source); + Effect effect = new CreateTokenTargetEffect(new SurvivorToken(), damage); + effect.setTargetPointer(getTargetPointer()); + return effect.apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/cards/v/VedalkenMesmerist.java b/Mage.Sets/src/mage/cards/v/VedalkenMesmerist.java new file mode 100644 index 0000000000..ad7fe4d57e --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VedalkenMesmerist.java @@ -0,0 +1,45 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class VedalkenMesmerist extends CardImpl { + + public VedalkenMesmerist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); + + this.subtype.add(SubType.VEDALKEN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Vedalken Mesmerist attacks, target creature an opponent controls gets -2/-0 until end of turn. + Ability ability = new AttacksTriggeredAbility( + new BoostTargetEffect(-2, 0, Duration.EndOfTurn), false + ); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + } + + public VedalkenMesmerist(final VedalkenMesmerist card) { + super(card); + } + + @Override + public VedalkenMesmerist copy() { + return new VedalkenMesmerist(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VeiledShade.java b/Mage.Sets/src/mage/cards/v/VeiledShade.java new file mode 100644 index 0000000000..9a9e8df4a7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VeiledShade.java @@ -0,0 +1,44 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class VeiledShade extends CardImpl { + + public VeiledShade(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.SHADE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{B}: Veiled Shade gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new ManaCostsImpl("{1}{B}") + )); + } + + public VeiledShade(final VeiledShade card) { + super(card); + } + + @Override + public VeiledShade copy() { + return new VeiledShade(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java b/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java new file mode 100644 index 0000000000..34a41b9ab4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java @@ -0,0 +1,145 @@ +package mage.cards.v; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.WatcherScope; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ +public final class VeneratedLoxodon extends CardImpl { + + public VeneratedLoxodon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); + + this.subtype.add(SubType.ELEPHANT); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // When Venerated Loxodon enters the battlefield, put a +1/+1 counter on each creature that convoked it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new VeneratedLoxodonEffect(), false), new VeneratedLoxodonWatcher()); + } + + public VeneratedLoxodon(final VeneratedLoxodon card) { + super(card); + } + + @Override + public VeneratedLoxodon copy() { + return new VeneratedLoxodon(this); + } +} + +class VeneratedLoxodonEffect extends OneShotEffect { + + public VeneratedLoxodonEffect() { + super(Outcome.BoostCreature); + this.staticText = "put a +1/+1 counter on each creature that convoked it"; + } + + public VeneratedLoxodonEffect(final VeneratedLoxodonEffect effect) { + super(effect); + } + + @Override + public VeneratedLoxodonEffect copy() { + return new VeneratedLoxodonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + VeneratedLoxodonWatcher watcher = (VeneratedLoxodonWatcher) game.getState().getWatchers().get(VeneratedLoxodonWatcher.class.getSimpleName()); + if (watcher != null) { + MageObjectReference mor = new MageObjectReference(source.getSourceId(), source.getSourceObjectZoneChangeCounter() - 1, game); // -1 because of spell on the stack + Set<MageObjectReference> creatures = watcher.getConvokingCreatures(mor); + if (creatures != null) { + for (MageObjectReference creatureMOR : creatures) { + Permanent creature = creatureMOR.getPermanent(game); + if (creature != null) { + creature.addCounters(CounterType.P1P1.createInstance(), source, game); + } + } + } + return true; + } + return false; + } +} + +class VeneratedLoxodonWatcher extends Watcher { + + private final Map<MageObjectReference, Set<MageObjectReference>> convokingCreatures = new HashMap<>(); + + public VeneratedLoxodonWatcher() { + super(VeneratedLoxodonWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public VeneratedLoxodonWatcher(final VeneratedLoxodonWatcher watcher) { + super(watcher); + for (Entry<MageObjectReference, Set<MageObjectReference>> entry : watcher.convokingCreatures.entrySet()) { + Set<MageObjectReference> creatures = new HashSet<>(); + creatures.addAll(entry.getValue()); + convokingCreatures.put(entry.getKey(), creatures); + } + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.CONVOKED) { + Spell spell = game.getSpell(event.getSourceId()); + Permanent tappedCreature = game.getPermanentOrLKIBattlefield(event.getTargetId()); + if (spell != null && tappedCreature != null) { + MageObjectReference convokedSpell = new MageObjectReference(spell.getSourceId(), game); + Set<MageObjectReference> creatures; + if (convokingCreatures.containsKey(convokedSpell)) { + creatures = convokingCreatures.get(convokedSpell); + } else { + creatures = new HashSet<>(); + convokingCreatures.put(convokedSpell, creatures); + } + creatures.add(new MageObjectReference(tappedCreature, game)); + } + } + } + + public Set<MageObjectReference> getConvokingCreatures(MageObjectReference mor) { + return convokingCreatures.get(mor); + } + + @Override + public void reset() { + super.reset(); + convokingCreatures.clear(); + } + + @Override + public VeneratedLoxodonWatcher copy() { + return new VeneratedLoxodonWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VenserTheSojourner.java b/Mage.Sets/src/mage/cards/v/VenserTheSojourner.java index 291ea0a03f..87b3754f20 100644 --- a/Mage.Sets/src/mage/cards/v/VenserTheSojourner.java +++ b/Mage.Sets/src/mage/cards/v/VenserTheSojourner.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -42,7 +42,7 @@ public final class VenserTheSojourner extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VENSER); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +2: Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step. LoyaltyAbility ability1 = new LoyaltyAbility(new VenserTheSojournerEffect(), 2); diff --git a/Mage.Sets/src/mage/cards/v/VernadiShieldmate.java b/Mage.Sets/src/mage/cards/v/VernadiShieldmate.java new file mode 100644 index 0000000000..37f95d9a57 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VernadiShieldmate.java @@ -0,0 +1,37 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class VernadiShieldmate extends CardImpl { + + public VernadiShieldmate(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G/W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + } + + public VernadiShieldmate(final VernadiShieldmate card) { + super(card); + } + + @Override + public VernadiShieldmate copy() { + return new VernadiShieldmate(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/ViciousRumors.java b/Mage.Sets/src/mage/cards/v/ViciousRumors.java new file mode 100644 index 0000000000..447886bd3c --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/ViciousRumors.java @@ -0,0 +1,48 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveEachPlayerEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; + +/** + * + * @author TheElk801 + */ +public final class ViciousRumors extends CardImpl { + + public ViciousRumors(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); + + // Vicious Rumors deals 1 damage to each opponent. Each opponent discards a card, then puts the top card of their library into their graveyard. You gain 1 life. + this.getSpellAbility().addEffect( + new DamagePlayersEffect(1, TargetController.OPPONENT) + ); + this.getSpellAbility().addEffect(new DiscardEachPlayerEffect( + new StaticValue(1), false, + TargetController.OPPONENT + )); + this.getSpellAbility().addEffect( + new PutTopCardOfLibraryIntoGraveEachPlayerEffect( + 1, TargetController.OPPONENT + ).setText(", then puts the top card of their library " + + "into their graveyard") + ); + this.getSpellAbility().addEffect(new GainLifeEffect(1)); + } + + public ViciousRumors(final ViciousRumors card) { + super(card); + } + + @Override + public ViciousRumors copy() { + return new ViciousRumors(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VigorsporeWurm.java b/Mage.Sets/src/mage/cards/v/VigorsporeWurm.java new file mode 100644 index 0000000000..71214ca815 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VigorsporeWurm.java @@ -0,0 +1,69 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class VigorsporeWurm extends CardImpl { + + public VigorsporeWurm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}"); + + this.subtype.add(SubType.WURM); + this.power = new MageInt(6); + this.toughness = new MageInt(4); + + // Undergrowth — When Vigorspore Wurm enters the battlefield, target creature gains vigilance and gets +X/+X until end of turn, where X is the number of creature cards in your graveyard. + DynamicValue xValue = new CardsInControllerGraveyardCount( + StaticFilters.FILTER_CARD_CREATURE + ); + Ability ability = new EntersBattlefieldTriggeredAbility( + new GainAbilityTargetEffect( + VigilanceAbility.getInstance(), + Duration.EndOfTurn + ).setText("target creature gains vigilance"), + false, "<i>Undergrowth</i> — " + ); + ability.addEffect(new BoostTargetEffect( + xValue, xValue, Duration.EndOfTurn, true + ).setText("and gets +X/+X until end of turn, " + + "where X is the number of creature cards in your graveyard.")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // Vigorspore Wurm can't be blocked by more than one creature. + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new CantBeBlockedByMoreThanOneSourceEffect() + )); + } + + public VigorsporeWurm(final VigorsporeWurm card) { + super(card); + } + + @Override + public VigorsporeWurm copy() { + return new VigorsporeWurm(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VileRequiem.java b/Mage.Sets/src/mage/cards/v/VileRequiem.java index 7bc935cc24..e602b7b6b3 100644 --- a/Mage.Sets/src/mage/cards/v/VileRequiem.java +++ b/Mage.Sets/src/mage/cards/v/VileRequiem.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -14,7 +13,6 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetAdjustment; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; @@ -23,6 +21,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; +import mage.target.targetadjustment.VerseCounterAdjuster; /** * @@ -50,7 +49,7 @@ public final class VileRequiem extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(0, 0, filter, false)); - ability.setTargetAdjustment(TargetAdjustment.VERSE_COUNTER_TARGETS); + ability.setTargetAdjuster(VerseCounterAdjuster.instance); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/v/VividRevival.java b/Mage.Sets/src/mage/cards/v/VividRevival.java new file mode 100644 index 0000000000..267bf076bb --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VividRevival.java @@ -0,0 +1,42 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class VividRevival extends CardImpl { + + private static final FilterCard filter = new FilterCard("multicolored cards from your graveyard"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public VividRevival(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}"); + + // Return up to three target multicolor cards from your graveyard to your hand. Exile Vivid Revival. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 3, filter)); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + } + + public VividRevival(final VividRevival card) { + super(card); + } + + @Override + public VividRevival copy() { + return new VividRevival(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VivienOfTheArkbow.java b/Mage.Sets/src/mage/cards/v/VivienOfTheArkbow.java index f40809e0bb..b3068b7a35 100644 --- a/Mage.Sets/src/mage/cards/v/VivienOfTheArkbow.java +++ b/Mage.Sets/src/mage/cards/v/VivienOfTheArkbow.java @@ -3,7 +3,7 @@ package mage.cards.v; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.common.DamageWithPowerTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; @@ -40,7 +40,7 @@ public final class VivienOfTheArkbow extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VIVIEN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Put two +1/+1 counters on up to one target creature. Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), 2); diff --git a/Mage.Sets/src/mage/cards/v/VivienReid.java b/Mage.Sets/src/mage/cards/v/VivienReid.java index 219a8c5a3c..2ef81f8189 100644 --- a/Mage.Sets/src/mage/cards/v/VivienReid.java +++ b/Mage.Sets/src/mage/cards/v/VivienReid.java @@ -3,7 +3,7 @@ package mage.cards.v; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.GetEmblemEffect; @@ -52,7 +52,7 @@ public final class VivienReid extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VIVIEN); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java index cfca3c4884..4df002baa7 100644 --- a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java +++ b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java @@ -1,7 +1,6 @@ package mage.cards.v; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -12,21 +11,14 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.ManaType; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.players.ManaPoolItem; import mage.players.Player; +import java.util.UUID; + /** - * * @author jeffwadsworth */ public final class VizierOfTheMenagerie extends CardImpl { @@ -63,7 +55,7 @@ class VizierOfTheMenagerieTopCardRevealedEffect extends ContinuousEffectImpl { public VizierOfTheMenagerieTopCardRevealedEffect() { super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - staticText = "You may look at the top card of your library. (You may do this at any time.)"; + staticText = "You may look at the top card of your library any time"; } public VizierOfTheMenagerieTopCardRevealedEffect(final VizierOfTheMenagerieTopCardRevealedEffect effect) { diff --git a/Mage.Sets/src/mage/cards/v/VodalianArcanist.java b/Mage.Sets/src/mage/cards/v/VodalianArcanist.java index 4cecc4cc4d..8d1ebacba3 100644 --- a/Mage.Sets/src/mage/cards/v/VodalianArcanist.java +++ b/Mage.Sets/src/mage/cards/v/VodalianArcanist.java @@ -2,26 +2,13 @@ package mage.cards.v; import java.util.UUID; -import mage.ConditionalMana; import mage.MageInt; -import mage.MageObject; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; -import mage.abilities.condition.Condition; -import mage.abilities.costs.Cost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.mana.ConditionalColorlessManaAbility; -import mage.abilities.mana.builder.ConditionalManaBuilder; -import mage.abilities.mana.conditional.ManaCondition; import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterInstantOrSorceryCard; -import mage.game.Game; -import mage.players.Player; - /** * * @author TheElk801 @@ -36,8 +23,9 @@ public final class VodalianArcanist extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(3); - // {t}: Add {C}. Spend this mana only to cast an instant or sorcery spell. - this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 1, new InstantOrSorcerySpellManaBuilder())); + // {T}: Add {C}. Spend this mana only to cast an instant or sorcery spell. + this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 1, + new mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder())); } public VodalianArcanist(final VodalianArcanist card) { @@ -49,62 +37,3 @@ public final class VodalianArcanist extends CardImpl { return new VodalianArcanist(this); } } - -class InstantOrSorcerySpellManaBuilder extends ConditionalManaBuilder { - - @Override - public ConditionalMana build(Object... options) { - return new InstantOrSorceryCastConditionalMana(this.mana); - } - - @Override - public String getRule() { - return "Spend this mana only to cast an instant or sorcery spell"; - } -} - -class InstantOrSorceryCastConditionalMana extends ConditionalMana { - - public InstantOrSorceryCastConditionalMana(Mana mana) { - super(mana); - staticText = "Spend this mana only to cast an instant or sorcery spell"; - addCondition(new InstantOrSorceryCastManaCondition()); - } -} - -class InstantOrSorceryCastManaCondition extends ManaCondition implements Condition { - - @Override - public boolean apply(Game game, Ability source) { - if (source instanceof SpellAbility) { - MageObject object = game.getObject(source.getSourceId()); - if (object != null && (object.isInstant() || object.isSorcery())) { - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) { - return apply(game, source); - } -} - -class InstantOrSorceryCardsInControllerGraveCondition implements Condition { - - private int value; - - public InstantOrSorceryCardsInControllerGraveCondition(int value) { - this.value = value; - } - - @Override - public boolean apply(Game game, Ability source) { - Player p = game.getPlayer(source.getControllerId()); - if (p != null && p.getGraveyard().count(new FilterInstantOrSorceryCard(), game) >= value) { - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/cards/v/VolrathsLaboratory.java b/Mage.Sets/src/mage/cards/v/VolrathsLaboratory.java index faeaa328c4..3ddb23ac0c 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathsLaboratory.java +++ b/Mage.Sets/src/mage/cards/v/VolrathsLaboratory.java @@ -19,7 +19,6 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; import mage.game.permanent.token.VolrathsLaboratoryToken; @@ -74,7 +73,7 @@ class VolrathsLaboratoryEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); Token token = new VolrathsLaboratoryToken(color, subType); return token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java index 23b141bf43..f088c0551c 100644 --- a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java +++ b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java @@ -70,7 +70,7 @@ class TwiceDevouredGoblins implements DynamicValue { DevourEffect devourEffect = (DevourEffect) abilityEffect; int amountGoblins = 0; for (List<String> subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) { - if (subtypesItem.contains(SubType.GOBLIN)) { + if (subtypesItem.contains(SubType.GOBLIN.toString())) { ++amountGoblins; } } diff --git a/Mage.Sets/src/mage/cards/v/VraskaGolgariQueen.java b/Mage.Sets/src/mage/cards/v/VraskaGolgariQueen.java new file mode 100644 index 0000000000..bb15a7f722 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VraskaGolgariQueen.java @@ -0,0 +1,78 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.command.emblems.VraskaGolgariQueenEmblem; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author TheElk801 + */ +public final class VraskaGolgariQueen extends CardImpl { + + private static final FilterControlledPermanent filter1 + = new FilterControlledPermanent("another permanent"); + private static final FilterPermanent filter2 + = new FilterNonlandPermanent("nonland permanent with converted mana cost 3 or less"); + + static { + filter1.add(new AnotherPredicate()); + filter2.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4)); + } + + public VraskaGolgariQueen(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VRASKA); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); + + // +2: You may sacrifice another permanent. If you do, you gain 1 life and draw a card. + DoIfCostPaid effect = new DoIfCostPaid( + new GainLifeEffect(1), + new SacrificeTargetCost(new TargetControlledPermanent(filter1)) + ); + effect.addEffect(new DrawCardSourceControllerEffect(1).setText("and draw a card")); + this.addAbility(new LoyaltyAbility(effect, 2)); + + // -3: Destroy target nonland permanent with converted mana cost 3 or less. + Ability ability = new LoyaltyAbility(new DestroyTargetEffect(), -3); + ability.addTarget(new TargetPermanent(filter2)); + this.addAbility(ability); + + // -9: You get an emblem with "Whenever a creature you control deals combat damage to a player, that player loses the game." + this.addAbility(new LoyaltyAbility( + new GetEmblemEffect(new VraskaGolgariQueenEmblem()), -9 + )); + } + + public VraskaGolgariQueen(final VraskaGolgariQueen card) { + super(card); + } + + @Override + public VraskaGolgariQueen copy() { + return new VraskaGolgariQueen(this); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java b/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java new file mode 100644 index 0000000000..8e35dd757a --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java @@ -0,0 +1,99 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class VraskaRegalGorgon extends CardImpl { + + public VraskaRegalGorgon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{5}{B}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VRASKA); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); + + // +2: Put a +1/+1 counter on up to one target creature. That creature gains menace until end of turn. + Ability ability = new LoyaltyAbility(new AddCountersTargetEffect( + CounterType.P1P1.createInstance() + ).setText("Put a +1/+1 counter on up to one target creature."), 2); + ability.addEffect(new GainAbilityTargetEffect( + new MenaceAbility(), Duration.EndOfTurn + ).setText("That creature gains menace until end of turn.")); + ability.addTarget(new TargetCreaturePermanent(0, 1)); + this.addAbility(ability); + + // -3: Destroy target creature. + ability = new LoyaltyAbility(new DestroyTargetEffect(), -3); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // -10: For each creature card in your graveyard, put a +1/+1 counter on each creature you control. + this.addAbility(new LoyaltyAbility(new VraskaRegalGorgonEffect(), -10)); + } + + public VraskaRegalGorgon(final VraskaRegalGorgon card) { + super(card); + } + + @Override + public VraskaRegalGorgon copy() { + return new VraskaRegalGorgon(this); + } +} + +class VraskaRegalGorgonEffect extends OneShotEffect { + + public VraskaRegalGorgonEffect() { + super(Outcome.Benefit); + this.staticText = "For each creature card in your graveyard, " + + "put a +1/+1 counter on each creature you control."; + } + + public VraskaRegalGorgonEffect(final VraskaRegalGorgonEffect effect) { + super(effect); + } + + @Override + public VraskaRegalGorgonEffect copy() { + return new VraskaRegalGorgonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int count = player.getGraveyard().count( + StaticFilters.FILTER_CARD_CREATURE, game + ); + return new AddCountersAllEffect( + CounterType.P1P1.createInstance(count), + StaticFilters.FILTER_CONTROLLED_CREATURE + ).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/cards/v/VraskaRelicSeeker.java b/Mage.Sets/src/mage/cards/v/VraskaRelicSeeker.java index 4c178fb787..9a792d8e08 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaRelicSeeker.java +++ b/Mage.Sets/src/mage/cards/v/VraskaRelicSeeker.java @@ -4,7 +4,7 @@ package mage.cards.v; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.constants.SubType; @@ -34,7 +34,7 @@ public final class VraskaRelicSeeker extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VRASKA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6)); //+2: Create a 2/2 black Pirate creature token with menace. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new PirateToken()), 2)); diff --git a/Mage.Sets/src/mage/cards/v/VraskaSchemingGorgon.java b/Mage.Sets/src/mage/cards/v/VraskaSchemingGorgon.java index bc95698b89..dd25a8487d 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaSchemingGorgon.java +++ b/Mage.Sets/src/mage/cards/v/VraskaSchemingGorgon.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseGameTargetPlayerEffect; @@ -32,7 +32,7 @@ public final class VraskaSchemingGorgon extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VRASKA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +2: Creatures you control get +1/+0 until end of turn. Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE); diff --git a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java index 7699a25e1e..9ba830b1fa 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; @@ -47,7 +47,7 @@ public final class VraskaTheUnseen extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VRASKA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); // +1: Until your next turn, whenever a creature deals combat damage to Vraska the Unseen, destroy that creature. this.addAbility(new LoyaltyAbility(new VraskaTheUnseenGainAbilityEffect(new VraskaTheUnseenTriggeredAbility()), 1)); diff --git a/Mage.Sets/src/mage/cards/v/VraskasStoneglare.java b/Mage.Sets/src/mage/cards/v/VraskasStoneglare.java new file mode 100644 index 0000000000..853236eb45 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VraskasStoneglare.java @@ -0,0 +1,82 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class VraskasStoneglare extends CardImpl { + + private final static FilterCard filter = new FilterCard("Vraska, Regal Gorgon"); + + static { + filter.add(new NamePredicate("Vraska, Regal Gorgon")); + } + + public VraskasStoneglare(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{G}"); + + // Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard from a card named Vraska, Regal Gordon, reveal it, and put it in to your hand. If you search your library this way, shuffle it. + this.getSpellAbility().addEffect(new VraskasStoneglareEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect( + new SearchLibraryGraveyardPutInHandEffect(filter, false, true) + ); + } + + public VraskasStoneglare(final VraskasStoneglare card) { + super(card); + } + + @Override + public VraskasStoneglare copy() { + return new VraskasStoneglare(this); + } +} + +class VraskasStoneglareEffect extends OneShotEffect { + + public VraskasStoneglareEffect() { + super(Outcome.Benefit); + this.staticText = "Destroy target creature. " + + "You gain life equal to its toughness"; + } + + public VraskasStoneglareEffect(final VraskasStoneglareEffect effect) { + super(effect); + } + + @Override + public VraskasStoneglareEffect copy() { + return new VraskasStoneglareEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + Player player = game.getPlayer(source.getControllerId()); + int toughness = permanent.getToughness().getValue(); + permanent.destroy(source.getSourceId(), game, false); + if (player != null) { + player.gainLife(toughness, game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/w/WandOfVertebrae.java b/Mage.Sets/src/mage/cards/w/WandOfVertebrae.java new file mode 100644 index 0000000000..81915ca418 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WandOfVertebrae.java @@ -0,0 +1,92 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class WandOfVertebrae extends CardImpl { + + public WandOfVertebrae(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); + + // {T}: Put the top card of your library into your graveyard. + this.addAbility(new SimpleActivatedAbility( + new PutTopCardOfLibraryIntoGraveControllerEffect(1), + new TapSourceCost() + )); + + // {2}, {T}, Exile Wand of Vertebrae: Shuffle up to five target cards from your graveyard into your library. + Ability ability = new SimpleActivatedAbility( + new WandOfVertebraeEffect(), + new GenericManaCost(2) + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new ExileSourceCost()); + ability.addTarget(new TargetCardInYourGraveyard(0, 5)); + this.addAbility(ability); + } + + public WandOfVertebrae(final WandOfVertebrae card) { + super(card); + } + + @Override + public WandOfVertebrae copy() { + return new WandOfVertebrae(this); + } +} + +class WandOfVertebraeEffect extends OneShotEffect { + + public WandOfVertebraeEffect() { + super(Outcome.Benefit); + this.staticText = "Shuffle up to five target cards " + + "from your graveyard into your library."; + } + + public WandOfVertebraeEffect(final WandOfVertebraeEffect effect) { + super(effect); + } + + @Override + public WandOfVertebraeEffect copy() { + return new WandOfVertebraeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(); + for (UUID targetId : targetPointer.getTargets(game, source)) { + Card card = game.getCard(targetId); + if (card != null) { + cards.add(card); + } + } + player.getLibrary().addAll(cards.getCards(game), game); + player.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/w/WaryOkapi.java b/Mage.Sets/src/mage/cards/w/WaryOkapi.java new file mode 100644 index 0000000000..e4ffcbebd9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WaryOkapi.java @@ -0,0 +1,36 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WaryOkapi extends CardImpl { + + public WaryOkapi(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.ANTELOPE); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + } + + public WaryOkapi(final WaryOkapi card) { + super(card); + } + + @Override + public WaryOkapi copy() { + return new WaryOkapi(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WatcherInTheMist.java b/Mage.Sets/src/mage/cards/w/WatcherInTheMist.java new file mode 100644 index 0000000000..0214f13d87 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WatcherInTheMist.java @@ -0,0 +1,43 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WatcherInTheMist extends CardImpl { + + public WatcherInTheMist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Watcher in the Mist enters the battlefield, surveil 2. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SurveilEffect(2), false + )); + } + + public WatcherInTheMist(final WatcherInTheMist card) { + super(card); + } + + @Override + public WatcherInTheMist copy() { + return new WatcherInTheMist(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WhisperAgent.java b/Mage.Sets/src/mage/cards/w/WhisperAgent.java new file mode 100644 index 0000000000..63601ae27c --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WhisperAgent.java @@ -0,0 +1,42 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WhisperAgent extends CardImpl { + + public WhisperAgent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U/B}{U/B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Whisper Agent enters the battlefield, surveil 1. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SurveilEffect(1), false)); + } + + public WhisperAgent(final WhisperAgent card) { + super(card); + } + + @Override + public WhisperAgent copy() { + return new WhisperAgent(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java b/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java new file mode 100644 index 0000000000..c28daf0841 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java @@ -0,0 +1,117 @@ +package mage.cards.w; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.Watcher; + +/** + * + * @author TheElk801 + */ +public final class WhisperingSnitch extends CardImpl { + + public WhisperingSnitch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // When you surveil for the first time in a turn, Whispering Spy deals 1 damage to each opponent and you gain 1 life. + this.addAbility(new WhisperingSnitchTriggeredAbility()); + } + + public WhisperingSnitch(final WhisperingSnitch card) { + super(card); + } + + @Override + public WhisperingSnitch copy() { + return new WhisperingSnitch(this); + } +} + +class WhisperingSnitchTriggeredAbility extends TriggeredAbilityImpl { + + public WhisperingSnitchTriggeredAbility() { + super(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), false); + this.addEffect(new GainLifeEffect(1)); + this.addWatcher(new WhisperingSnitchWatcher()); + } + + public WhisperingSnitchTriggeredAbility(final WhisperingSnitchTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SURVEILED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + WhisperingSnitchWatcher watcher = (WhisperingSnitchWatcher) game.getState().getWatchers().get(WhisperingSnitchWatcher.class.getSimpleName()); + return watcher != null && watcher.getTimesSurveiled(getControllerId()) == 1; + } + + @Override + public WhisperingSnitchTriggeredAbility copy() { + return new WhisperingSnitchTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever you surveil for the first time each turn, " + + "{this} deals 1 damage to each opponent and you gain 1 life."; + } +} + +class WhisperingSnitchWatcher extends Watcher { + + private final Map<UUID, Integer> timesSurveiled = new HashMap<>(); + + public WhisperingSnitchWatcher() { + super(WhisperingSnitchWatcher.class.getSimpleName(), WatcherScope.GAME); + } + + public WhisperingSnitchWatcher(final WhisperingSnitchWatcher watcher) { + super(watcher); + } + + @Override + public WhisperingSnitchWatcher copy() { + return new WhisperingSnitchWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SURVEILED) { + timesSurveiled.put(event.getPlayerId(), getTimesSurveiled(event.getPlayerId()) + 1); + } + } + + @Override + public void reset() { + super.reset(); + timesSurveiled.clear(); + } + + public int getTimesSurveiled(UUID playerId) { + return timesSurveiled.getOrDefault(playerId, 0); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WildCeratok.java b/Mage.Sets/src/mage/cards/w/WildCeratok.java new file mode 100644 index 0000000000..9d65111665 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WildCeratok.java @@ -0,0 +1,32 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WildCeratok extends CardImpl { + + public WildCeratok(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.RHINO); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + } + + public WildCeratok(final WildCeratok card) { + super(card); + } + + @Override + public WildCeratok copy() { + return new WildCeratok(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WildDefiance.java b/Mage.Sets/src/mage/cards/w/WildDefiance.java index 6d2fd53615..25dcefa758 100644 --- a/Mage.Sets/src/mage/cards/w/WildDefiance.java +++ b/Mage.Sets/src/mage/cards/w/WildDefiance.java @@ -65,7 +65,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isControlledBy(this.controllerId) && permanent.isCreature()) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object instanceof Spell) { + if (object instanceof Spell) { Card c = (Spell) object; if (c.isInstant() || c.isSorcery()) { if (getTargets().isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/w/WillKenrith.java b/Mage.Sets/src/mage/cards/w/WillKenrith.java index 46759ba62e..e1d623e8fd 100644 --- a/Mage.Sets/src/mage/cards/w/WillKenrith.java +++ b/Mage.Sets/src/mage/cards/w/WillKenrith.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardTargetEffect; @@ -40,7 +40,7 @@ public final class WillKenrith extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.WILL); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +2: Until your next turn, up to two target creatures each have base power and toughness 0/3 and lose all abilities. Ability ability = new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/cards/w/WindgracesJudgment.java b/Mage.Sets/src/mage/cards/w/WindgracesJudgment.java index 00d95d3090..77067c6f63 100644 --- a/Mage.Sets/src/mage/cards/w/WindgracesJudgment.java +++ b/Mage.Sets/src/mage/cards/w/WindgracesJudgment.java @@ -24,7 +24,7 @@ public final class WindgracesJudgment extends CardImpl { // For any number of opponents, destroy target nonland permanent that player controls. this.getSpellAbility().addEffect( - new DestroyTargetEffect(). + new DestroyTargetEffect(false, true). setText("For any number of opponents, " + "destroy target nonland permanent " + "that player controls") diff --git a/Mage.Sets/src/mage/cards/w/WishcoinCrab.java b/Mage.Sets/src/mage/cards/w/WishcoinCrab.java new file mode 100644 index 0000000000..37c886fe7a --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WishcoinCrab.java @@ -0,0 +1,32 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WishcoinCrab extends CardImpl { + + public WishcoinCrab(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.CRAB); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + } + + public WishcoinCrab(final WishcoinCrab card) { + super(card); + } + + @Override + public WishcoinCrab copy() { + return new WishcoinCrab(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java index ca7fe9245a..e52cbe13d4 100644 --- a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java +++ b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java @@ -96,7 +96,7 @@ class WispweaverAngelEffect extends OneShotEffect { cardsToBattlefield.add(targetId); } else { Card card = game.getCard(targetId); - if (card != null && card instanceof MeldCard) { + if (card instanceof MeldCard) { MeldCard meldCard = (MeldCard) card; Card topCard = meldCard.getTopHalfCard(); Card bottomCard = meldCard.getBottomHalfCard(); diff --git a/Mage.Sets/src/mage/cards/w/WojekBodyguard.java b/Mage.Sets/src/mage/cards/w/WojekBodyguard.java new file mode 100644 index 0000000000..4b00e5a48b --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WojekBodyguard.java @@ -0,0 +1,43 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantAttackAloneAbility; +import mage.abilities.keyword.CantBlockAloneAbility; +import mage.constants.SubType; +import mage.abilities.keyword.MentorAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public final class WojekBodyguard extends CardImpl { + + public WojekBodyguard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Mentor + this.addAbility(new MentorAbility()); + + // Wojek Bodyguard can't attack or block alone. + this.addAbility(new CantAttackAloneAbility()); + this.addAbility(CantBlockAloneAbility.getInstance()); + } + + public WojekBodyguard(final WojekBodyguard card) { + super(card); + } + + @Override + public WojekBodyguard copy() { + return new WojekBodyguard(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WordOfCommand.java b/Mage.Sets/src/mage/cards/w/WordOfCommand.java index d03d033266..a73cc01035 100644 --- a/Mage.Sets/src/mage/cards/w/WordOfCommand.java +++ b/Mage.Sets/src/mage/cards/w/WordOfCommand.java @@ -98,7 +98,7 @@ class WordOfCommandEffect extends OneShotEffect { // You control that player until Word of Command finishes resolving controller.controlPlayersTurn(game, targetPlayer.getId()); - while (controller != null && controller.canRespond()) { + while (controller.canRespond()) { if (controller.chooseUse(Outcome.Benefit, "Resolve " + sourceObject.getLogName() + " now" + (card != null ? " and play " + card.getLogName() : "") + '?', source, game)) { // this is used to give the controller a little space to utilize his player controlling effect (look at face down creatures, hand, etc.) break; diff --git a/Mage.Sets/src/mage/cards/w/WorldAtWar.java b/Mage.Sets/src/mage/cards/w/WorldAtWar.java index 3bd876d6c1..0658ecda70 100644 --- a/Mage.Sets/src/mage/cards/w/WorldAtWar.java +++ b/Mage.Sets/src/mage/cards/w/WorldAtWar.java @@ -143,7 +143,7 @@ class UntapAttackingThisTurnEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Watcher watcher = game.getState().getWatchers().get(AttackedThisTurnWatcher.class.getSimpleName()); - if (watcher != null && watcher instanceof AttackedThisTurnWatcher) { + if (watcher instanceof AttackedThisTurnWatcher) { Set<MageObjectReference> attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures(); for (MageObjectReference mor : attackedThisTurn) { Permanent permanent = mor.getPermanent(game); diff --git a/Mage.Sets/src/mage/cards/w/WorldsoulColossus.java b/Mage.Sets/src/mage/cards/w/WorldsoulColossus.java new file mode 100644 index 0000000000..0f87ed598a --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WorldsoulColossus.java @@ -0,0 +1,46 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.constants.SubType; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public final class WorldsoulColossus extends CardImpl { + + public WorldsoulColossus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{W}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Worldsoul Colossus enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility( + new EntersBattlefieldWithXCountersEffect( + CounterType.P1P1.createInstance() + ) + )); + } + + public WorldsoulColossus(final WorldsoulColossus card) { + super(card); + } + + @Override + public WorldsoulColossus copy() { + return new WorldsoulColossus(this); + } +} diff --git a/Mage.Sets/src/mage/cards/x/XenagosTheReveler.java b/Mage.Sets/src/mage/cards/x/XenagosTheReveler.java index a4b279e83d..e09453a139 100644 --- a/Mage.Sets/src/mage/cards/x/XenagosTheReveler.java +++ b/Mage.Sets/src/mage/cards/x/XenagosTheReveler.java @@ -7,7 +7,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; @@ -41,7 +41,7 @@ public final class XenagosTheReveler extends CardImpl { this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.XENAGOS); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Add X mana in any combination of {R} and/or {G}, where X is the number of creatures you control. this.addAbility(new LoyaltyAbility(new XenagosManaEffect(), +1)); diff --git a/Mage.Sets/src/mage/cards/x/Xenograft.java b/Mage.Sets/src/mage/cards/x/Xenograft.java index c25914ae08..2e08278a7a 100644 --- a/Mage.Sets/src/mage/cards/x/Xenograft.java +++ b/Mage.Sets/src/mage/cards/x/Xenograft.java @@ -53,7 +53,7 @@ class XenograftAddSubtypeEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { diff --git a/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java b/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java index fbf46de1da..d36dfbe742 100644 --- a/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java +++ b/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java @@ -137,7 +137,7 @@ class YawgmothsAgendaReplacementEffect extends ReplacementEffectImpl { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent == null || !(permanent instanceof PermanentToken)) { + if (!(permanent instanceof PermanentToken)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/y/YawgmothsWill.java b/Mage.Sets/src/mage/cards/y/YawgmothsWill.java index 8690dbd141..cfdb0d77e1 100644 --- a/Mage.Sets/src/mage/cards/y/YawgmothsWill.java +++ b/Mage.Sets/src/mage/cards/y/YawgmothsWill.java @@ -127,7 +127,7 @@ class YawgmothsWillReplacementEffect extends ReplacementEffectImpl { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent == null || !(permanent instanceof PermanentToken)) { + if (!(permanent instanceof PermanentToken)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/y/YennetCryptSovereign.java b/Mage.Sets/src/mage/cards/y/YennettCrypticSovereign.java similarity index 73% rename from Mage.Sets/src/mage/cards/y/YennetCryptSovereign.java rename to Mage.Sets/src/mage/cards/y/YennettCrypticSovereign.java index 59b7e84f17..b8021cbbde 100644 --- a/Mage.Sets/src/mage/cards/y/YennetCryptSovereign.java +++ b/Mage.Sets/src/mage/cards/y/YennettCrypticSovereign.java @@ -24,9 +24,9 @@ import mage.players.Player; * * @author TheElk801 */ -public final class YennetCryptSovereign extends CardImpl { +public final class YennettCrypticSovereign extends CardImpl { - public YennetCryptSovereign(UUID ownerId, CardSetInfo setInfo) { + public YennettCrypticSovereign(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}{B}"); this.addSuperType(SuperType.LEGENDARY); @@ -43,25 +43,25 @@ public final class YennetCryptSovereign extends CardImpl { // Menace this.addAbility(new MenaceAbility()); - // Whenever Yennet, Crypt Sovereign attacks, reveal the top card of your library. If that card's converted mana cost is odd, you may cast it without paying its mana cost. Otherwise, draw a card. + // Whenever Yennett, Cryptic Sovereign attacks, reveal the top card of your library. If that card's converted mana cost is odd, you may cast it without paying its mana cost. Otherwise, draw a card. this.addAbility(new AttacksTriggeredAbility( - new YennetCryptSovereignEffect(), false + new YennettCrypticSovereignEffect(), false )); } - public YennetCryptSovereign(final YennetCryptSovereign card) { + public YennettCrypticSovereign(final YennettCrypticSovereign card) { super(card); } @Override - public YennetCryptSovereign copy() { - return new YennetCryptSovereign(this); + public YennettCrypticSovereign copy() { + return new YennettCrypticSovereign(this); } } -class YennetCryptSovereignEffect extends OneShotEffect { +class YennettCrypticSovereignEffect extends OneShotEffect { - public YennetCryptSovereignEffect() { + public YennettCrypticSovereignEffect() { super(Outcome.Benefit); this.staticText = "reveal the top card of your library. " + "If that card's converted mana cost is odd, " @@ -69,13 +69,13 @@ class YennetCryptSovereignEffect extends OneShotEffect { + "Otherwise, draw a card"; } - public YennetCryptSovereignEffect(final YennetCryptSovereignEffect effect) { + public YennettCrypticSovereignEffect(final YennettCrypticSovereignEffect effect) { super(effect); } @Override - public YennetCryptSovereignEffect copy() { - return new YennetCryptSovereignEffect(this); + public YennettCrypticSovereignEffect copy() { + return new YennettCrypticSovereignEffect(this); } @Override diff --git a/Mage.Sets/src/mage/cards/y/YodaJediMaster.java b/Mage.Sets/src/mage/cards/y/YodaJediMaster.java index 3b1dcb27d6..94bd681f28 100644 --- a/Mage.Sets/src/mage/cards/y/YodaJediMaster.java +++ b/Mage.Sets/src/mage/cards/y/YodaJediMaster.java @@ -4,7 +4,7 @@ package mage.cards.y; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; @@ -46,7 +46,7 @@ public final class YodaJediMaster extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{G}{U}"); this.subtype.add(SubType.YODA); - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Look at the top two cards of your library. Put one on the bottom of your library. Effect effect = new LookLibraryAndPickControllerEffect(new StaticValue(2), false, new StaticValue(1), diff --git a/Mage.Sets/src/mage/sets/Antiquities.java b/Mage.Sets/src/mage/sets/Antiquities.java index 45188cd211..d9ab4d74dd 100644 --- a/Mage.Sets/src/mage/sets/Antiquities.java +++ b/Mage.Sets/src/mage/sets/Antiquities.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -41,7 +40,7 @@ public final class Antiquities extends ExpansionSet { cards.add(new SetCardInfo("Atog", 23, Rarity.COMMON, mage.cards.a.Atog.class)); cards.add(new SetCardInfo("Battering Ram", 41, Rarity.COMMON, mage.cards.b.BatteringRam.class)); cards.add(new SetCardInfo("Candelabra of Tawnos", 43, Rarity.RARE, mage.cards.c.CandelabraOfTawnos.class)); - cards.add(new SetCardInfo("Circle of Protection: Artifacts", 4, Rarity.COMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); + cards.add(new SetCardInfo("Circle of Protection: Artifacts", 4, Rarity.UNCOMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); cards.add(new SetCardInfo("Citanul Druid", 31, Rarity.UNCOMMON, mage.cards.c.CitanulDruid.class)); cards.add(new SetCardInfo("Clay Statue", 44, Rarity.COMMON, mage.cards.c.ClayStatue.class)); cards.add(new SetCardInfo("Clockwork Avian", 45, Rarity.RARE, mage.cards.c.ClockworkAvian.class)); diff --git a/Mage.Sets/src/mage/sets/Chronicles.java b/Mage.Sets/src/mage/sets/Chronicles.java index 0ba0d34b1a..03cde6e56d 100644 --- a/Mage.Sets/src/mage/sets/Chronicles.java +++ b/Mage.Sets/src/mage/sets/Chronicles.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -30,7 +29,7 @@ public final class Chronicles extends ExpansionSet { cards.add(new SetCardInfo("Abu Ja'far", 57, Rarity.UNCOMMON, mage.cards.a.AbuJafar.class)); cards.add(new SetCardInfo("Active Volcano", 43, Rarity.COMMON, mage.cards.a.ActiveVolcano.class)); cards.add(new SetCardInfo("Akron Legionnaire", 58, Rarity.RARE, mage.cards.a.AkronLegionnaire.class)); - cards.add(new SetCardInfo("Aladdin", 44, Rarity.RARE, mage.cards.a.Aladdin.class)); + cards.add(new SetCardInfo("Aladdin", 44, Rarity.UNCOMMON, mage.cards.a.Aladdin.class)); cards.add(new SetCardInfo("Angelic Voices", 59, Rarity.RARE, mage.cards.a.AngelicVoices.class)); cards.add(new SetCardInfo("Arcades Sabboth", 106, Rarity.RARE, mage.cards.a.ArcadesSabboth.class)); cards.add(new SetCardInfo("Arena of the Ancients", 71, Rarity.RARE, mage.cards.a.ArenaOfTheAncients.class)); diff --git a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java index bd007d7caf..b7309d9c26 100644 --- a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java +++ b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java @@ -250,7 +250,7 @@ public final class ClassicSixthEdition extends ExpansionSet { cards.add(new SetCardInfo("Pearl Dragon", 34, Rarity.RARE, mage.cards.p.PearlDragon.class)); cards.add(new SetCardInfo("Pentagram of the Ages", 306, Rarity.RARE, mage.cards.p.PentagramOfTheAges.class)); cards.add(new SetCardInfo("Perish", 148, Rarity.UNCOMMON, mage.cards.p.Perish.class)); - cards.add(new SetCardInfo("Pestilence", 149, Rarity.COMMON, mage.cards.p.Pestilence.class)); + cards.add(new SetCardInfo("Pestilence", 149, Rarity.UNCOMMON, mage.cards.p.Pestilence.class)); cards.add(new SetCardInfo("Phantasmal Terrain", 84, Rarity.COMMON, mage.cards.p.PhantasmalTerrain.class)); cards.add(new SetCardInfo("Phantom Warrior", 85, Rarity.UNCOMMON, mage.cards.p.PhantomWarrior.class)); cards.add(new SetCardInfo("Phyrexian Vault", 307, Rarity.UNCOMMON, mage.cards.p.PhyrexianVault.class)); diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index ec1248e3ff..c9ee763771 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -291,7 +290,7 @@ public final class Commander2017 extends ExpansionSet { cards.add(new SetCardInfo("Sword of the Animist", 227, Rarity.RARE, mage.cards.s.SwordOfTheAnimist.class)); cards.add(new SetCardInfo("Swords to Plowshares", 76, Rarity.UNCOMMON, mage.cards.s.SwordsToPlowshares.class)); cards.add(new SetCardInfo("Syphon Mind", 127, Rarity.COMMON, mage.cards.s.SyphonMind.class)); - cards.add(new SetCardInfo("Taigam, Ojutai Master", 46, Rarity.MYTHIC, mage.cards.t.TaigamOjutaiMaster.class)); + cards.add(new SetCardInfo("Taigam, Ojutai Master", 46, Rarity.RARE, mage.cards.t.TaigamOjutaiMaster.class)); cards.add(new SetCardInfo("Taigam, Sidisi's Hand", 47, Rarity.RARE, mage.cards.t.TaigamSidisisHand.class)); cards.add(new SetCardInfo("Taj-Nar Swordsmith", 77, Rarity.UNCOMMON, mage.cards.t.TajNarSwordsmith.class)); cards.add(new SetCardInfo("Teferi's Protection", 8, Rarity.RARE, mage.cards.t.TeferisProtection.class)); @@ -320,7 +319,7 @@ public final class Commander2017 extends ExpansionSet { cards.add(new SetCardInfo("Vivid Grove", 291, Rarity.UNCOMMON, mage.cards.v.VividGrove.class)); cards.add(new SetCardInfo("Vivid Marsh", 292, Rarity.UNCOMMON, mage.cards.v.VividMarsh.class)); cards.add(new SetCardInfo("Vivid Meadow", 293, Rarity.UNCOMMON, mage.cards.v.VividMeadow.class)); - cards.add(new SetCardInfo("Wasitora, Nekoru Queen", 49, Rarity.MYTHIC, mage.cards.w.WasitoraNekoruQueen.class)); + cards.add(new SetCardInfo("Wasitora, Nekoru Queen", 49, Rarity.RARE, mage.cards.w.WasitoraNekoruQueen.class)); cards.add(new SetCardInfo("Wayfarer's Bauble", 230, Rarity.COMMON, mage.cards.w.WayfarersBauble.class)); cards.add(new SetCardInfo("Well of Lost Dreams", 231, Rarity.RARE, mage.cards.w.WellOfLostDreams.class)); cards.add(new SetCardInfo("White Sun's Zenith", 78, Rarity.RARE, mage.cards.w.WhiteSunsZenith.class)); diff --git a/Mage.Sets/src/mage/sets/Commander2018.java b/Mage.Sets/src/mage/sets/Commander2018.java index 0958b3ad4e..1ba0c10bd1 100644 --- a/Mage.Sets/src/mage/sets/Commander2018.java +++ b/Mage.Sets/src/mage/sets/Commander2018.java @@ -38,7 +38,7 @@ public final class Commander2018 extends ExpansionSet { cards.add(new SetCardInfo("Avenger of Zendikar", 129, Rarity.MYTHIC, mage.cards.a.AvengerOfZendikar.class)); cards.add(new SetCardInfo("Azorius Chancery", 233, Rarity.UNCOMMON, mage.cards.a.AzoriusChancery.class)); cards.add(new SetCardInfo("Azorius Guildgate", 234, Rarity.COMMON, mage.cards.a.AzoriusGuildgate.class)); - cards.add(new SetCardInfo("Azorius Signet", 196, Rarity.COMMON, mage.cards.a.AzoriusSignet.class)); + cards.add(new SetCardInfo("Azorius Signet", 196, Rarity.UNCOMMON, mage.cards.a.AzoriusSignet.class)); cards.add(new SetCardInfo("Baloth Woodcrasher", 130, Rarity.UNCOMMON, mage.cards.b.BalothWoodcrasher.class)); cards.add(new SetCardInfo("Banishing Stroke", 63, Rarity.UNCOMMON, mage.cards.b.BanishingStroke.class)); cards.add(new SetCardInfo("Bant Charm", 169, Rarity.UNCOMMON, mage.cards.b.BantCharm.class)); @@ -87,7 +87,7 @@ public final class Commander2018 extends ExpansionSet { cards.add(new SetCardInfo("Dictate of Kruphix", 86, Rarity.RARE, mage.cards.d.DictateOfKruphix.class)); cards.add(new SetCardInfo("Dimir Aqueduct", 242, Rarity.UNCOMMON, mage.cards.d.DimirAqueduct.class)); cards.add(new SetCardInfo("Dimir Guildgate", 243, Rarity.COMMON, mage.cards.d.DimirGuildgate.class)); - cards.add(new SetCardInfo("Dimir Signet", 203, Rarity.COMMON, mage.cards.d.DimirSignet.class)); + cards.add(new SetCardInfo("Dimir Signet", 203, Rarity.UNCOMMON, mage.cards.d.DimirSignet.class)); cards.add(new SetCardInfo("Dismal Backwater", 244, Rarity.COMMON, mage.cards.d.DismalBackwater.class)); cards.add(new SetCardInfo("Dismantling Blow", 66, Rarity.COMMON, mage.cards.d.DismantlingBlow.class)); cards.add(new SetCardInfo("Djinn of Wishes", 87, Rarity.RARE, mage.cards.d.DjinnOfWishes.class)); @@ -259,7 +259,7 @@ public final class Commander2018 extends ExpansionSet { cards.add(new SetCardInfo("Serra Avatar", 73, Rarity.MYTHIC, mage.cards.s.SerraAvatar.class)); cards.add(new SetCardInfo("Sharding Sphinx", 101, Rarity.RARE, mage.cards.s.ShardingSphinx.class)); cards.add(new SetCardInfo("Sigil of the Empty Throne", 74, Rarity.RARE, mage.cards.s.SigilOfTheEmptyThrone.class)); - cards.add(new SetCardInfo("Sigiled Starfish", 102, Rarity.COMMON, mage.cards.s.SigiledStarfish.class)); + cards.add(new SetCardInfo("Sigiled Starfish", 102, Rarity.UNCOMMON, mage.cards.s.SigiledStarfish.class)); cards.add(new SetCardInfo("Silent Sentinel", 75, Rarity.RARE, mage.cards.s.SilentSentinel.class)); cards.add(new SetCardInfo("Silent-Blade Oni", 191, Rarity.RARE, mage.cards.s.SilentBladeOni.class)); cards.add(new SetCardInfo("Simic Growth Chamber", 282, Rarity.UNCOMMON, mage.cards.s.SimicGrowthChamber.class)); @@ -324,7 +324,7 @@ public final class Commander2018 extends ExpansionSet { cards.add(new SetCardInfo("Xantcha, Sleeper Agent", 50, Rarity.RARE, mage.cards.x.XantchaSleeperAgent.class)); cards.add(new SetCardInfo("Yavimaya Elder", 166, Rarity.COMMON, mage.cards.y.YavimayaElder.class)); cards.add(new SetCardInfo("Yavimaya Enchantress", 167, Rarity.COMMON, mage.cards.y.YavimayaEnchantress.class)); - cards.add(new SetCardInfo("Yennett, Cryptic Sovereign", 51, Rarity.MYTHIC, mage.cards.y.YennetCryptSovereign.class)); + cards.add(new SetCardInfo("Yennett, Cryptic Sovereign", 51, Rarity.MYTHIC, mage.cards.y.YennettCrypticSovereign.class)); cards.add(new SetCardInfo("Yuriko, the Tiger's Shadow", 52, Rarity.RARE, mage.cards.y.YurikoTheTigersShadow.class)); cards.add(new SetCardInfo("Zendikar Incarnate", 195, Rarity.UNCOMMON, mage.cards.z.ZendikarIncarnate.class)); } diff --git a/Mage.Sets/src/mage/sets/CommanderAnthology.java b/Mage.Sets/src/mage/sets/CommanderAnthology.java index 8a48de8187..56158dae06 100644 --- a/Mage.Sets/src/mage/sets/CommanderAnthology.java +++ b/Mage.Sets/src/mage/sets/CommanderAnthology.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -151,7 +150,7 @@ public final class CommanderAnthology extends ExpansionSet { cards.add(new SetCardInfo("High Market", 257, Rarity.RARE, mage.cards.h.HighMarket.class)); cards.add(new SetCardInfo("Hunting Triad", 116, Rarity.UNCOMMON, mage.cards.h.HuntingTriad.class)); cards.add(new SetCardInfo("Immaculate Magistrate", 117, Rarity.RARE, mage.cards.i.ImmaculateMagistrate.class)); - cards.add(new SetCardInfo("Imperious Perfect", 118, Rarity.RARE, mage.cards.i.ImperiousPerfect.class)); + cards.add(new SetCardInfo("Imperious Perfect", 118, Rarity.UNCOMMON, mage.cards.i.ImperiousPerfect.class)); cards.add(new SetCardInfo("Indrik Stomphowler", 119, Rarity.UNCOMMON, mage.cards.i.IndrikStomphowler.class)); cards.add(new SetCardInfo("Island", 293, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 294, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); @@ -180,7 +179,7 @@ public final class CommanderAnthology extends ExpansionSet { cards.add(new SetCardInfo("Lys Alana Huntmaster", 126, Rarity.COMMON, mage.cards.l.LysAlanaHuntmaster.class)); cards.add(new SetCardInfo("Malfegor", 184, Rarity.MYTHIC, mage.cards.m.Malfegor.class)); cards.add(new SetCardInfo("Mana-Charged Dragon", 84, Rarity.RARE, mage.cards.m.ManaChargedDragon.class)); - cards.add(new SetCardInfo("Masked Admirers", 127, Rarity.UNCOMMON, mage.cards.m.MaskedAdmirers.class)); + cards.add(new SetCardInfo("Masked Admirers", 127, Rarity.RARE, mage.cards.m.MaskedAdmirers.class)); cards.add(new SetCardInfo("Master Warcraft", 202, Rarity.RARE, mage.cards.m.MasterWarcraft.class)); cards.add(new SetCardInfo("Mazirek, Kraul Death Priest", 185, Rarity.MYTHIC, mage.cards.m.MazirekKraulDeathPriest.class)); cards.add(new SetCardInfo("Meren of Clan Nel Toth", 186, Rarity.MYTHIC, mage.cards.m.MerenOfClanNelToth.class)); diff --git a/Mage.Sets/src/mage/sets/CommanderAnthologyVolumeII.java b/Mage.Sets/src/mage/sets/CommanderAnthologyVolumeII.java index eff5498d46..4290da2a3d 100644 --- a/Mage.Sets/src/mage/sets/CommanderAnthologyVolumeII.java +++ b/Mage.Sets/src/mage/sets/CommanderAnthologyVolumeII.java @@ -48,7 +48,7 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Bogardan Hellkite", 86, Rarity.MYTHIC, mage.cards.b.BogardanHellkite.class)); cards.add(new SetCardInfo("Borderland Behemoth", 87, Rarity.RARE, mage.cards.b.BorderlandBehemoth.class)); cards.add(new SetCardInfo("Boros Cluestone", 175, Rarity.COMMON, mage.cards.b.BorosCluestone.class)); - cards.add(new SetCardInfo("Boros Garrison", 239, Rarity.UNCOMMON, mage.cards.b.BorosGarrison.class)); + cards.add(new SetCardInfo("Boros Garrison", 239, Rarity.COMMON, mage.cards.b.BorosGarrison.class)); cards.add(new SetCardInfo("Boros Guildgate", 240, Rarity.COMMON, mage.cards.b.BorosGuildgate.class)); cards.add(new SetCardInfo("Boros Signet", 176, Rarity.COMMON, mage.cards.b.BorosSignet.class)); cards.add(new SetCardInfo("Bosh, Iron Golem", 5, Rarity.RARE, mage.cards.b.BoshIronGolem.class)); @@ -87,7 +87,7 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Deepglow Skate", 39, Rarity.RARE, mage.cards.d.DeepglowSkate.class)); cards.add(new SetCardInfo("Desecrator Hag", 153, Rarity.COMMON, mage.cards.d.DesecratorHag.class)); cards.add(new SetCardInfo("Desolation Giant", 91, Rarity.RARE, mage.cards.d.DesolationGiant.class)); - cards.add(new SetCardInfo("Dimir Aqueduct", 245, Rarity.UNCOMMON, mage.cards.d.DimirAqueduct.class)); + cards.add(new SetCardInfo("Dimir Aqueduct", 245, Rarity.COMMON, mage.cards.d.DimirAqueduct.class)); cards.add(new SetCardInfo("Dimir Signet", 185, Rarity.COMMON, mage.cards.d.DimirSignet.class)); cards.add(new SetCardInfo("Disaster Radius", 92, Rarity.RARE, mage.cards.d.DisasterRadius.class)); cards.add(new SetCardInfo("Disdainful Stroke", 40, Rarity.COMMON, mage.cards.d.DisdainfulStroke.class)); @@ -166,12 +166,12 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Island", 291, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 292, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Jalum Tome", 194, Rarity.RARE, mage.cards.j.JalumTome.class)); - cards.add(new SetCardInfo("Jareth, Leonine Titan", 30, Rarity.COMMON, mage.cards.j.JarethLeonineTitan.class)); + cards.add(new SetCardInfo("Jareth, Leonine Titan", 30, Rarity.RARE, mage.cards.j.JarethLeonineTitan.class)); cards.add(new SetCardInfo("Juniper Order Ranger", 158, Rarity.UNCOMMON, mage.cards.j.JuniperOrderRanger.class)); cards.add(new SetCardInfo("Junk Diver", 195, Rarity.RARE, mage.cards.j.JunkDiver.class)); cards.add(new SetCardInfo("Jwar Isle Refuge", 256, Rarity.UNCOMMON, mage.cards.j.JwarIsleRefuge.class)); - cards.add(new SetCardInfo("Kalemne, Disciple of Iroas", 7, Rarity.MYTHIC, mage.cards.k.KalemneDiscipleOfIroas.class)); cards.add(new SetCardInfo("Kalemne's Captain", 31, Rarity.RARE, mage.cards.k.KalemnesCaptain.class)); + cards.add(new SetCardInfo("Kalemne, Disciple of Iroas", 7, Rarity.MYTHIC, mage.cards.k.KalemneDiscipleOfIroas.class)); cards.add(new SetCardInfo("Kalonian Hydra", 140, Rarity.MYTHIC, mage.cards.k.KalonianHydra.class)); cards.add(new SetCardInfo("Languish", 67, Rarity.RARE, mage.cards.l.Languish.class)); cards.add(new SetCardInfo("Lhurgoyf", 141, Rarity.RARE, mage.cards.l.Lhurgoyf.class)); @@ -180,7 +180,7 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Living Death", 68, Rarity.RARE, mage.cards.l.LivingDeath.class)); cards.add(new SetCardInfo("Lonely Sandbar", 257, Rarity.COMMON, mage.cards.l.LonelySandbar.class)); cards.add(new SetCardInfo("Loreseeker's Stone", 198, Rarity.UNCOMMON, mage.cards.l.LoreseekersStone.class)); - cards.add(new SetCardInfo("Loxodon Warhammer", 199, Rarity.UNCOMMON, mage.cards.l.LoxodonWarhammer.class)); + cards.add(new SetCardInfo("Loxodon Warhammer", 199, Rarity.RARE, mage.cards.l.LoxodonWarhammer.class)); cards.add(new SetCardInfo("Magma Giant", 111, Rarity.RARE, mage.cards.m.MagmaGiant.class)); cards.add(new SetCardInfo("Magmaquake", 112, Rarity.RARE, mage.cards.m.Magmaquake.class)); cards.add(new SetCardInfo("Magus of the Wheel", 113, Rarity.RARE, mage.cards.m.MagusOfTheWheel.class)); @@ -201,7 +201,7 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 303, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 304, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 305, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mulldrifter", 47, Rarity.UNCOMMON, mage.cards.m.Mulldrifter.class)); + cards.add(new SetCardInfo("Mulldrifter", 47, Rarity.COMMON, mage.cards.m.Mulldrifter.class)); cards.add(new SetCardInfo("Murmuring Bosk", 258, Rarity.RARE, mage.cards.m.MurmuringBosk.class)); cards.add(new SetCardInfo("Mycosynth Wellspring", 201, Rarity.COMMON, mage.cards.m.MycosynthWellspring.class)); cards.add(new SetCardInfo("Myr Battlesphere", 202, Rarity.RARE, mage.cards.m.MyrBattlesphere.class)); @@ -251,7 +251,7 @@ public class CommanderAnthologyVolumeII extends ExpansionSet { cards.add(new SetCardInfo("Sewer Nemesis", 75, Rarity.RARE, mage.cards.s.SewerNemesis.class)); cards.add(new SetCardInfo("Shared Trauma", 76, Rarity.RARE, mage.cards.s.SharedTrauma.class)); cards.add(new SetCardInfo("Sign in Blood", 77, Rarity.COMMON, mage.cards.s.SignInBlood.class)); - cards.add(new SetCardInfo("Simic Growth Chamber", 267, Rarity.UNCOMMON, mage.cards.s.SimicGrowthChamber.class)); + cards.add(new SetCardInfo("Simic Growth Chamber", 267, Rarity.COMMON, mage.cards.s.SimicGrowthChamber.class)); cards.add(new SetCardInfo("Simic Signet", 215, Rarity.COMMON, mage.cards.s.SimicSignet.class)); cards.add(new SetCardInfo("Simic Signet", 216, Rarity.COMMON, mage.cards.s.SimicSignet.class)); cards.add(new SetCardInfo("Skullbriar, the Walking Grave", 165, Rarity.RARE, mage.cards.s.SkullbriarTheWalkingGrave.class)); diff --git a/Mage.Sets/src/mage/sets/CommandersArsenal.java b/Mage.Sets/src/mage/sets/CommandersArsenal.java index de11bb1263..f83095a8d3 100644 --- a/Mage.Sets/src/mage/sets/CommandersArsenal.java +++ b/Mage.Sets/src/mage/sets/CommandersArsenal.java @@ -20,24 +20,24 @@ public final class CommandersArsenal extends ExpansionSet { private CommandersArsenal() { super("Commander's Arsenal", "CM1", ExpansionSet.buildDate(2012, 11, 2), SetType.SUPPLEMENTAL); this.blockName = "Command Zone"; - cards.add(new SetCardInfo("Chaos Warp", 1, Rarity.SPECIAL, mage.cards.c.ChaosWarp.class)); + cards.add(new SetCardInfo("Chaos Warp", 1, Rarity.RARE, mage.cards.c.ChaosWarp.class)); cards.add(new SetCardInfo("Command Tower", 2, Rarity.COMMON, mage.cards.c.CommandTower.class)); - cards.add(new SetCardInfo("Decree of Pain", 3, Rarity.SPECIAL, mage.cards.d.DecreeOfPain.class)); - cards.add(new SetCardInfo("Desertion", 4, Rarity.SPECIAL, mage.cards.d.Desertion.class)); - cards.add(new SetCardInfo("Diaochan, Artful Beauty", 5, Rarity.SPECIAL, mage.cards.d.DiaochanArtfulBeauty.class)); - cards.add(new SetCardInfo("Dragonlair Spider", 6, Rarity.SPECIAL, mage.cards.d.DragonlairSpider.class)); - cards.add(new SetCardInfo("Duplicant", 7, Rarity.SPECIAL, mage.cards.d.Duplicant.class)); - cards.add(new SetCardInfo("Edric, Spymaster of Trest", 8, Rarity.SPECIAL, mage.cards.e.EdricSpymasterOfTrest.class)); - cards.add(new SetCardInfo("Kaalia of the Vast", 9, Rarity.SPECIAL, mage.cards.k.KaaliaOfTheVast.class)); - cards.add(new SetCardInfo("Loyal Retainers", 10, Rarity.SPECIAL, mage.cards.l.LoyalRetainers.class)); - cards.add(new SetCardInfo("Maelstrom Wanderer", 11, Rarity.SPECIAL, mage.cards.m.MaelstromWanderer.class)); - cards.add(new SetCardInfo("Mind's Eye", 13, Rarity.SPECIAL, mage.cards.m.MindsEye.class)); - cards.add(new SetCardInfo("Mirari's Wake", 14, Rarity.SPECIAL, mage.cards.m.MirarisWake.class)); + cards.add(new SetCardInfo("Decree of Pain", 3, Rarity.RARE, mage.cards.d.DecreeOfPain.class)); + cards.add(new SetCardInfo("Desertion", 4, Rarity.RARE, mage.cards.d.Desertion.class)); + cards.add(new SetCardInfo("Diaochan, Artful Beauty", 5, Rarity.RARE, mage.cards.d.DiaochanArtfulBeauty.class)); + cards.add(new SetCardInfo("Dragonlair Spider", 6, Rarity.RARE, mage.cards.d.DragonlairSpider.class)); + cards.add(new SetCardInfo("Duplicant", 7, Rarity.RARE, mage.cards.d.Duplicant.class)); + cards.add(new SetCardInfo("Edric, Spymaster of Trest", 8, Rarity.RARE, mage.cards.e.EdricSpymasterOfTrest.class)); + cards.add(new SetCardInfo("Kaalia of the Vast", 9, Rarity.MYTHIC, mage.cards.k.KaaliaOfTheVast.class)); + cards.add(new SetCardInfo("Loyal Retainers", 10, Rarity.UNCOMMON, mage.cards.l.LoyalRetainers.class)); + cards.add(new SetCardInfo("Maelstrom Wanderer", 11, Rarity.MYTHIC, mage.cards.m.MaelstromWanderer.class)); + cards.add(new SetCardInfo("Mind's Eye", 13, Rarity.RARE, mage.cards.m.MindsEye.class)); + cards.add(new SetCardInfo("Mirari's Wake", 14, Rarity.RARE, mage.cards.m.MirarisWake.class)); cards.add(new SetCardInfo("Rhystic Study", 15, Rarity.COMMON, mage.cards.r.RhysticStudy.class)); - cards.add(new SetCardInfo("Scroll Rack", 16, Rarity.SPECIAL, mage.cards.s.ScrollRack.class)); - cards.add(new SetCardInfo("Sylvan Library", 17, Rarity.SPECIAL, mage.cards.s.SylvanLibrary.class)); - cards.add(new SetCardInfo("The Mimeoplasm", 12, Rarity.SPECIAL, mage.cards.t.TheMimeoplasm.class)); - cards.add(new SetCardInfo("Vela the Night-Clad", 18, Rarity.SPECIAL, mage.cards.v.VelaTheNightClad.class)); + cards.add(new SetCardInfo("Scroll Rack", 16, Rarity.RARE, mage.cards.s.ScrollRack.class)); + cards.add(new SetCardInfo("Sylvan Library", 17, Rarity.RARE, mage.cards.s.SylvanLibrary.class)); + cards.add(new SetCardInfo("The Mimeoplasm", 12, Rarity.MYTHIC, mage.cards.t.TheMimeoplasm.class)); + cards.add(new SetCardInfo("Vela the Night-Clad", 18, Rarity.MYTHIC, mage.cards.v.VelaTheNightClad.class)); } } diff --git a/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java b/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java index 70ebcf6468..10c116f56a 100644 --- a/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java +++ b/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -150,7 +149,7 @@ public final class ConspiracyTakeTheCrown extends ExpansionSet { cards.add(new SetCardInfo("Mnemonic Wall", 116, Rarity.COMMON, mage.cards.m.MnemonicWall.class)); cards.add(new SetCardInfo("Murder", 143, Rarity.COMMON, mage.cards.m.Murder.class)); cards.add(new SetCardInfo("Negate", 117, Rarity.COMMON, mage.cards.n.Negate.class)); - cards.add(new SetCardInfo("Nessian Asp", 187, Rarity.COMMON, mage.cards.n.NessianAsp.class)); + cards.add(new SetCardInfo("Nessian Asp", 187, Rarity.UNCOMMON, mage.cards.n.NessianAsp.class)); cards.add(new SetCardInfo("Netcaster Spider", 188, Rarity.COMMON, mage.cards.n.NetcasterSpider.class)); cards.add(new SetCardInfo("Ogre Sentry", 168, Rarity.COMMON, mage.cards.o.OgreSentry.class)); cards.add(new SetCardInfo("Omenspeaker", 118, Rarity.COMMON, mage.cards.o.Omenspeaker.class)); @@ -184,7 +183,7 @@ public final class ConspiracyTakeTheCrown extends ExpansionSet { cards.add(new SetCardInfo("Selvala, Heart of the Wilds", 70, Rarity.MYTHIC, mage.cards.s.SelvalaHeartOfTheWilds.class)); cards.add(new SetCardInfo("Serum Visions", 120, Rarity.UNCOMMON, mage.cards.s.SerumVisions.class)); cards.add(new SetCardInfo("Shambling Goblin", 148, Rarity.COMMON, mage.cards.s.ShamblingGoblin.class)); - cards.add(new SetCardInfo("Shimmering Grotto", 221, Rarity.COMMON, mage.cards.s.ShimmeringGrotto.class)); + cards.add(new SetCardInfo("Shimmering Grotto", 221, Rarity.UNCOMMON, mage.cards.s.ShimmeringGrotto.class)); cards.add(new SetCardInfo("Shipwreck Singer", 206, Rarity.UNCOMMON, mage.cards.s.ShipwreckSinger.class)); cards.add(new SetCardInfo("Show and Tell", 121, Rarity.MYTHIC, mage.cards.s.ShowAndTell.class)); cards.add(new SetCardInfo("Sinuous Vermin", 46, Rarity.COMMON, mage.cards.s.SinuousVermin.class)); diff --git a/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java index 9ea33a1224..3851143763 100644 --- a/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java +++ b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java @@ -5,10 +5,6 @@ import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; -/** - * - * @author Shootbot - */ public final class DuelsOfThePlaneswalkers extends ExpansionSet { private static final DuelsOfThePlaneswalkers instance = new DuelsOfThePlaneswalkers(); @@ -19,6 +15,119 @@ public final class DuelsOfThePlaneswalkers extends ExpansionSet { private DuelsOfThePlaneswalkers() { super("Duels of the Planeswalkers", "DPA", ExpansionSet.buildDate(2010, 6, 4), SetType.SUPPLEMENTAL); + + cards.add(new SetCardInfo("Abyssal Specter", 18, Rarity.UNCOMMON, mage.cards.a.AbyssalSpecter.class)); + cards.add(new SetCardInfo("Act of Treason", 37, Rarity.UNCOMMON, mage.cards.a.ActOfTreason.class)); + cards.add(new SetCardInfo("Air Elemental", 1, Rarity.UNCOMMON, mage.cards.a.AirElemental.class)); + cards.add(new SetCardInfo("Ascendant Evincar", 19, Rarity.RARE, mage.cards.a.AscendantEvincar.class)); + cards.add(new SetCardInfo("Banefire", 38, Rarity.RARE, mage.cards.b.Banefire.class)); + cards.add(new SetCardInfo("Blanchwood Armor", 55, Rarity.UNCOMMON, mage.cards.b.BlanchwoodArmor.class)); + cards.add(new SetCardInfo("Blaze", 39, Rarity.UNCOMMON, mage.cards.b.Blaze.class)); + cards.add(new SetCardInfo("Bloodmark Mentor", 40, Rarity.UNCOMMON, mage.cards.b.BloodmarkMentor.class)); + cards.add(new SetCardInfo("Boomerang", 2, Rarity.COMMON, mage.cards.b.Boomerang.class)); + cards.add(new SetCardInfo("Cancel", 3, Rarity.COMMON, mage.cards.c.Cancel.class)); + cards.add(new SetCardInfo("Cinder Pyromancer", 41, Rarity.COMMON, mage.cards.c.CinderPyromancer.class)); + cards.add(new SetCardInfo("Civic Wayfinder", 56, Rarity.COMMON, mage.cards.c.CivicWayfinder.class)); + cards.add(new SetCardInfo("Cloud Sprite", 4, Rarity.COMMON, mage.cards.c.CloudSprite.class)); + cards.add(new SetCardInfo("Coat of Arms", 90, Rarity.RARE, mage.cards.c.CoatOfArms.class)); + cards.add(new SetCardInfo("Consume Spirit", 20, Rarity.UNCOMMON, mage.cards.c.ConsumeSpirit.class)); + cards.add(new SetCardInfo("Counterbore", 5, Rarity.RARE, mage.cards.c.Counterbore.class)); + cards.add(new SetCardInfo("Crowd of Cinders", 21, Rarity.UNCOMMON, mage.cards.c.CrowdOfCinders.class)); + cards.add(new SetCardInfo("Deluge", 6, Rarity.UNCOMMON, mage.cards.d.Deluge.class)); + cards.add(new SetCardInfo("Demon's Horn", 91, Rarity.UNCOMMON, mage.cards.d.DemonsHorn.class)); + cards.add(new SetCardInfo("Denizen of the Deep", 7, Rarity.RARE, mage.cards.d.DenizenOfTheDeep.class)); + cards.add(new SetCardInfo("Dragon's Claw", 92, Rarity.UNCOMMON, mage.cards.d.DragonsClaw.class)); + cards.add(new SetCardInfo("Drove of Elves", 57, Rarity.UNCOMMON, mage.cards.d.DroveOfElves.class)); + cards.add(new SetCardInfo("Drudge Skeletons", 22, Rarity.COMMON, mage.cards.d.DrudgeSkeletons.class)); + cards.add(new SetCardInfo("Dusk Imp", 23, Rarity.COMMON, mage.cards.d.DuskImp.class)); + cards.add(new SetCardInfo("Duskdale Wurm", 58, Rarity.UNCOMMON, mage.cards.d.DuskdaleWurm.class)); + cards.add(new SetCardInfo("Earth Elemental", 42, Rarity.UNCOMMON, mage.cards.e.EarthElemental.class)); + cards.add(new SetCardInfo("Elven Riders", 59, Rarity.UNCOMMON, mage.cards.e.ElvenRiders.class)); + cards.add(new SetCardInfo("Elvish Champion", 60, Rarity.RARE, mage.cards.e.ElvishChampion.class)); + cards.add(new SetCardInfo("Elvish Eulogist", 61, Rarity.COMMON, mage.cards.e.ElvishEulogist.class)); + cards.add(new SetCardInfo("Elvish Promenade", 62, Rarity.UNCOMMON, mage.cards.e.ElvishPromenade.class)); + cards.add(new SetCardInfo("Elvish Visionary", 63, Rarity.COMMON, mage.cards.e.ElvishVisionary.class)); + cards.add(new SetCardInfo("Elvish Warrior", 64, Rarity.COMMON, mage.cards.e.ElvishWarrior.class)); + cards.add(new SetCardInfo("Enrage", 43, Rarity.UNCOMMON, mage.cards.e.Enrage.class)); + cards.add(new SetCardInfo("Essence Drain", 24, Rarity.COMMON, mage.cards.e.EssenceDrain.class)); + cards.add(new SetCardInfo("Essence Scatter", 8, Rarity.COMMON, mage.cards.e.EssenceScatter.class)); + cards.add(new SetCardInfo("Evacuation", 9, Rarity.RARE, mage.cards.e.Evacuation.class)); + cards.add(new SetCardInfo("Eyeblight's Ending", 25, Rarity.COMMON, mage.cards.e.EyeblightsEnding.class)); + cards.add(new SetCardInfo("Forest", 110, Rarity.LAND, mage.cards.basiclands.Forest.class)); + cards.add(new SetCardInfo("Forest", 111, Rarity.LAND, mage.cards.basiclands.Forest.class)); + cards.add(new SetCardInfo("Forest", 112, Rarity.LAND, mage.cards.basiclands.Forest.class)); + cards.add(new SetCardInfo("Forest", 113, Rarity.LAND, mage.cards.basiclands.Forest.class)); + cards.add(new SetCardInfo("Furnace of Rath", 44, Rarity.RARE, mage.cards.f.FurnaceOfRath.class)); + cards.add(new SetCardInfo("Gaea's Herald", 65, Rarity.RARE, mage.cards.g.GaeasHerald.class)); + cards.add(new SetCardInfo("Giant Growth", 66, Rarity.COMMON, mage.cards.g.GiantGrowth.class)); + cards.add(new SetCardInfo("Giant Spider", 67, Rarity.COMMON, mage.cards.g.GiantSpider.class)); + cards.add(new SetCardInfo("Goblin Piker", 45, Rarity.COMMON, mage.cards.g.GoblinPiker.class)); + cards.add(new SetCardInfo("Goblin Sky Raider", 46, Rarity.COMMON, mage.cards.g.GoblinSkyRaider.class)); + cards.add(new SetCardInfo("Greenweaver Druid", 68, Rarity.UNCOMMON, mage.cards.g.GreenweaverDruid.class)); + cards.add(new SetCardInfo("Hill Giant", 47, Rarity.COMMON, mage.cards.h.HillGiant.class)); + cards.add(new SetCardInfo("Howl of the Night Pack", 69, Rarity.UNCOMMON, mage.cards.h.HowlOfTheNightPack.class)); + cards.add(new SetCardInfo("Immaculate Magistrate", 70, Rarity.RARE, mage.cards.i.ImmaculateMagistrate.class)); + cards.add(new SetCardInfo("Imperious Perfect", 71, Rarity.UNCOMMON, mage.cards.i.ImperiousPerfect.class)); + cards.add(new SetCardInfo("Incinerate", 48, Rarity.COMMON, mage.cards.i.Incinerate.class)); + cards.add(new SetCardInfo("Island", 100, Rarity.LAND, mage.cards.basiclands.Island.class)); + cards.add(new SetCardInfo("Island", 101, Rarity.LAND, mage.cards.basiclands.Island.class)); + cards.add(new SetCardInfo("Island", 98, Rarity.LAND, mage.cards.basiclands.Island.class)); + cards.add(new SetCardInfo("Island", 99, Rarity.LAND, mage.cards.basiclands.Island.class)); + cards.add(new SetCardInfo("Jagged-Scar Archers", 72, Rarity.UNCOMMON, mage.cards.j.JaggedScarArchers.class)); + cards.add(new SetCardInfo("Kamahl, Pit Fighter", 49, Rarity.RARE, mage.cards.k.KamahlPitFighter.class)); + cards.add(new SetCardInfo("Kraken's Eye", 93, Rarity.UNCOMMON, mage.cards.k.KrakensEye.class)); + cards.add(new SetCardInfo("Lightning Elemental", 50, Rarity.COMMON, mage.cards.l.LightningElemental.class)); + cards.add(new SetCardInfo("Loxodon Warhammer", 94, Rarity.RARE, mage.cards.l.LoxodonWarhammer.class)); + cards.add(new SetCardInfo("Lys Alana Huntmaster", 73, Rarity.COMMON, mage.cards.l.LysAlanaHuntmaster.class)); + cards.add(new SetCardInfo("Mahamoti Djinn", 10, Rarity.RARE, mage.cards.m.MahamotiDjinn.class)); + cards.add(new SetCardInfo("Megrim", 26, Rarity.UNCOMMON, mage.cards.m.Megrim.class)); + cards.add(new SetCardInfo("Mind Control", 11, Rarity.UNCOMMON, mage.cards.m.MindControl.class)); + cards.add(new SetCardInfo("Mind Rot", 27, Rarity.COMMON, mage.cards.m.MindRot.class)); + cards.add(new SetCardInfo("Mind Shatter", 28, Rarity.RARE, mage.cards.m.MindShatter.class)); + cards.add(new SetCardInfo("Mind Spring", 12, Rarity.RARE, mage.cards.m.MindSpring.class)); + cards.add(new SetCardInfo("Molimo, Maro-Sorcerer", 74, Rarity.RARE, mage.cards.m.MolimoMaroSorcerer.class)); + cards.add(new SetCardInfo("Moonglove Winnower", 29, Rarity.COMMON, mage.cards.m.MoongloveWinnower.class)); + cards.add(new SetCardInfo("Mortivore", 30, Rarity.RARE, mage.cards.m.Mortivore.class)); + cards.add(new SetCardInfo("Mountain", 106, Rarity.LAND, mage.cards.basiclands.Mountain.class)); + cards.add(new SetCardInfo("Mountain", 107, Rarity.LAND, mage.cards.basiclands.Mountain.class)); + cards.add(new SetCardInfo("Mountain", 108, Rarity.LAND, mage.cards.basiclands.Mountain.class)); + cards.add(new SetCardInfo("Mountain", 109, Rarity.LAND, mage.cards.basiclands.Mountain.class)); + cards.add(new SetCardInfo("Natural Spring", 75, Rarity.COMMON, mage.cards.n.NaturalSpring.class)); + cards.add(new SetCardInfo("Naturalize", 76, Rarity.COMMON, mage.cards.n.Naturalize.class)); + cards.add(new SetCardInfo("Nature's Spiral", 77, Rarity.UNCOMMON, mage.cards.n.NaturesSpiral.class)); + cards.add(new SetCardInfo("Negate", 13, Rarity.COMMON, mage.cards.n.Negate.class)); + cards.add(new SetCardInfo("Overrun", 78, Rarity.UNCOMMON, mage.cards.o.Overrun.class)); + cards.add(new SetCardInfo("Phantom Warrior", 14, Rarity.UNCOMMON, mage.cards.p.PhantomWarrior.class)); + cards.add(new SetCardInfo("Prodigal Pyromancer", 51, Rarity.UNCOMMON, mage.cards.p.ProdigalPyromancer.class)); + cards.add(new SetCardInfo("Rage Reflection", 52, Rarity.RARE, mage.cards.r.RageReflection.class)); + cards.add(new SetCardInfo("Rampant Growth", 79, Rarity.COMMON, mage.cards.r.RampantGrowth.class)); + cards.add(new SetCardInfo("Ravenous Rats", 31, Rarity.COMMON, mage.cards.r.RavenousRats.class)); + cards.add(new SetCardInfo("River Boa", 80, Rarity.UNCOMMON, mage.cards.r.RiverBoa.class)); + cards.add(new SetCardInfo("Roughshod Mentor", 81, Rarity.UNCOMMON, mage.cards.r.RoughshodMentor.class)); + cards.add(new SetCardInfo("Runeclaw Bear", 82, Rarity.COMMON, mage.cards.r.RuneclawBear.class)); + cards.add(new SetCardInfo("Sengir Vampire", 32, Rarity.RARE, mage.cards.s.SengirVampire.class)); + cards.add(new SetCardInfo("Severed Legion", 33, Rarity.COMMON, mage.cards.s.SeveredLegion.class)); + cards.add(new SetCardInfo("Shivan Dragon", 53, Rarity.RARE, mage.cards.s.ShivanDragon.class)); + cards.add(new SetCardInfo("Shock", 54, Rarity.COMMON, mage.cards.s.Shock.class)); + cards.add(new SetCardInfo("Snapping Drake", 15, Rarity.COMMON, mage.cards.s.SnappingDrake.class)); + cards.add(new SetCardInfo("Spined Wurm", 83, Rarity.COMMON, mage.cards.s.SpinedWurm.class)); + cards.add(new SetCardInfo("Swamp", 102, Rarity.LAND, mage.cards.basiclands.Swamp.class)); + cards.add(new SetCardInfo("Swamp", 103, Rarity.LAND, mage.cards.basiclands.Swamp.class)); + cards.add(new SetCardInfo("Swamp", 104, Rarity.LAND, mage.cards.basiclands.Swamp.class)); + cards.add(new SetCardInfo("Swamp", 105, Rarity.LAND, mage.cards.basiclands.Swamp.class)); + cards.add(new SetCardInfo("Talara's Battalion", 84, Rarity.RARE, mage.cards.t.TalarasBattalion.class)); + cards.add(new SetCardInfo("Terror", 34, Rarity.COMMON, mage.cards.t.Terror.class)); cards.add(new SetCardInfo("The Rack", 95, Rarity.UNCOMMON, mage.cards.t.TheRack.class)); + cards.add(new SetCardInfo("Thieving Magpie", 16, Rarity.UNCOMMON, mage.cards.t.ThievingMagpie.class)); + cards.add(new SetCardInfo("Trained Armodon", 85, Rarity.COMMON, mage.cards.t.TrainedArmodon.class)); + cards.add(new SetCardInfo("Troll Ascetic", 86, Rarity.RARE, mage.cards.t.TrollAscetic.class)); + cards.add(new SetCardInfo("Underworld Dreams", 35, Rarity.RARE, mage.cards.u.UnderworldDreams.class)); + cards.add(new SetCardInfo("Unholy Strength", 36, Rarity.COMMON, mage.cards.u.UnholyStrength.class)); + cards.add(new SetCardInfo("Unsummon", 17, Rarity.COMMON, mage.cards.u.Unsummon.class)); + cards.add(new SetCardInfo("Verdant Force", 87, Rarity.RARE, mage.cards.v.VerdantForce.class)); + cards.add(new SetCardInfo("Vigor", 88, Rarity.RARE, mage.cards.v.Vigor.class)); + cards.add(new SetCardInfo("Wall of Spears", 96, Rarity.COMMON, mage.cards.w.WallOfSpears.class)); + cards.add(new SetCardInfo("Wall of Wood", 89, Rarity.COMMON, mage.cards.w.WallOfWood.class)); + cards.add(new SetCardInfo("Wurm's Tooth", 97, Rarity.UNCOMMON, mage.cards.w.WurmsTooth.class)); } } diff --git a/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkersPromos.java b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkersPromos.java new file mode 100644 index 0000000000..228d227f16 --- /dev/null +++ b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkersPromos.java @@ -0,0 +1,55 @@ + +package mage.sets; + +import mage.cards.ExpansionSet; +import mage.constants.Rarity; +import mage.constants.SetType; + +/** + * + * @author JayDi85 + */ +public final class DuelsOfThePlaneswalkersPromos extends ExpansionSet { + + private static final DuelsOfThePlaneswalkersPromos instance = new DuelsOfThePlaneswalkersPromos(); + + public static DuelsOfThePlaneswalkersPromos getInstance() { + return instance; + } + + private DuelsOfThePlaneswalkersPromos() { + super("Duels of the Planeswalkers Promos", "DPAP", ExpansionSet.buildDate(2010, 6, 4), SetType.PROMOTIONAL); + this.hasBoosters = false; + this.hasBasicLands = false; + + // all promos in one inner set (2009 - 2014) + // cards numbers must be unqiue + // use replacement list for scryfall download + + // 2009 - https://scryfall.com/sets/pdtp + cards.add(new SetCardInfo("Garruk Wildspeaker", 1, Rarity.MYTHIC, mage.cards.g.GarrukWildspeaker.class)); + + // 2010 - https://scryfall.com/sets/pdp10 + cards.add(new SetCardInfo("Liliana Vess", 2, Rarity.MYTHIC, mage.cards.l.LilianaVess.class)); + cards.add(new SetCardInfo("Nissa Revane", 3, Rarity.MYTHIC, mage.cards.n.NissaRevane.class)); + + // 2011 - https://scryfall.com/sets/pdp11 + cards.add(new SetCardInfo("Frost Titan", 4, Rarity.MYTHIC, mage.cards.f.FrostTitan.class)); + cards.add(new SetCardInfo("Grave Titan", 5, Rarity.MYTHIC, mage.cards.g.GraveTitan.class)); + cards.add(new SetCardInfo("Inferno Titan", 6, Rarity.MYTHIC, mage.cards.i.InfernoTitan.class)); + + // 2012 - https://scryfall.com/sets/pdp12 + cards.add(new SetCardInfo("Primordial Hydra", 7, Rarity.MYTHIC, mage.cards.p.PrimordialHydra.class)); + cards.add(new SetCardInfo("Serra Avatar", 8, Rarity.MYTHIC, mage.cards.s.SerraAvatar.class)); + cards.add(new SetCardInfo("Vampire Nocturnus", 9, Rarity.MYTHIC, mage.cards.v.VampireNocturnus.class)); + + // 2013 - https://scryfall.com/sets/pdp13 + cards.add(new SetCardInfo("Bonescythe Sliver", 10, Rarity.RARE, mage.cards.b.BonescytheSliver.class)); + cards.add(new SetCardInfo("Ogre Battledriver", 11, Rarity.RARE, mage.cards.o.OgreBattledriver.class)); + cards.add(new SetCardInfo("Scavenging Ooze", 12, Rarity.RARE, mage.cards.s.ScavengingOoze.class)); + + // 2014 - https://scryfall.com/sets/pdp14 + cards.add(new SetCardInfo("Soul of Ravnica", 13, Rarity.MYTHIC, mage.cards.s.SoulOfRavnica.class)); + cards.add(new SetCardInfo("Soul of Zendikar", 14, Rarity.MYTHIC, mage.cards.s.SoulOfZendikar.class)); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/EighthEdition.java b/Mage.Sets/src/mage/sets/EighthEdition.java index 362fa2e004..79784eb062 100644 --- a/Mage.Sets/src/mage/sets/EighthEdition.java +++ b/Mage.Sets/src/mage/sets/EighthEdition.java @@ -1,8 +1,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.o.OrcishSpy; -import mage.cards.r.RukhEgg; import mage.constants.Rarity; import mage.constants.SetType; @@ -225,7 +223,7 @@ public final class EighthEdition extends ExpansionSet { cards.add(new SetCardInfo("Okk", 206, Rarity.RARE, mage.cards.o.Okk.class)); cards.add(new SetCardInfo("Oracle's Attendants", 32, Rarity.RARE, mage.cards.o.OraclesAttendants.class)); cards.add(new SetCardInfo("Orcish Artillery", 207, Rarity.UNCOMMON, mage.cards.o.OrcishArtillery.class)); - cards.add(new SetCardInfo("Orcish Spy", 208, Rarity.COMMON, OrcishSpy.class)); + cards.add(new SetCardInfo("Orcish Spy", 208, Rarity.COMMON, mage.cards.o.OrcishSpy.class)); cards.add(new SetCardInfo("Pacifism", 33, Rarity.COMMON, mage.cards.p.Pacifism.class)); cards.add(new SetCardInfo("Panic Attack", 209, Rarity.COMMON, mage.cards.p.PanicAttack.class)); cards.add(new SetCardInfo("Patagia Golem", 308, Rarity.UNCOMMON, mage.cards.p.PatagiaGolem.class)); @@ -267,7 +265,7 @@ public final class EighthEdition extends ExpansionSet { cards.add(new SetCardInfo("Rod of Ruin", 312, Rarity.UNCOMMON, mage.cards.r.RodOfRuin.class)); cards.add(new SetCardInfo("Rolling Stones", 38, Rarity.RARE, mage.cards.r.RollingStones.class)); cards.add(new SetCardInfo("Royal Assassin", 159, Rarity.RARE, mage.cards.r.RoyalAssassin.class)); - cards.add(new SetCardInfo("Rukh Egg", 216, Rarity.RARE, RukhEgg.class)); + cards.add(new SetCardInfo("Rukh Egg", 216, Rarity.RARE, mage.cards.r.RukhEgg.class)); cards.add(new SetCardInfo("Rushwood Dryad", 278, Rarity.COMMON, mage.cards.r.RushwoodDryad.class)); cards.add(new SetCardInfo("Sabretooth Tiger", 217, Rarity.COMMON, mage.cards.s.SabretoothTiger.class)); cards.add(new SetCardInfo("Sacred Ground", 39, Rarity.RARE, mage.cards.s.SacredGround.class)); @@ -343,9 +341,9 @@ public final class EighthEdition extends ExpansionSet { cards.add(new SetCardInfo("Unsummon", 112, Rarity.COMMON, mage.cards.u.Unsummon.class)); cards.add(new SetCardInfo("Urborg Volcano", 327, Rarity.UNCOMMON, mage.cards.u.UrborgVolcano.class)); cards.add(new SetCardInfo("Urza's Armor", 318, Rarity.RARE, mage.cards.u.UrzasArmor.class)); - cards.add(new SetCardInfo("Urza's Mine", 328, Rarity.COMMON, mage.cards.u.UrzasMine.class)); - cards.add(new SetCardInfo("Urza's Power Plant", 329, Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class)); - cards.add(new SetCardInfo("Urza's Tower", 330, Rarity.COMMON, mage.cards.u.UrzasTower.class)); + cards.add(new SetCardInfo("Urza's Mine", 328, Rarity.UNCOMMON, mage.cards.u.UrzasMine.class)); + cards.add(new SetCardInfo("Urza's Power Plant", 329, Rarity.UNCOMMON, mage.cards.u.UrzasPowerPlant.class)); + cards.add(new SetCardInfo("Urza's Tower", 330, Rarity.UNCOMMON, mage.cards.u.UrzasTower.class)); cards.add(new SetCardInfo("Vampiric Spirit", 170, Rarity.RARE, mage.cards.v.VampiricSpirit.class)); cards.add(new SetCardInfo("Venerable Monk", 55, Rarity.COMMON, mage.cards.v.VenerableMonk.class)); cards.add(new SetCardInfo("Verduran Enchantress", 285, Rarity.RARE, mage.cards.v.VerduranEnchantress.class)); diff --git a/Mage.Sets/src/mage/sets/ElvesVsGoblins.java b/Mage.Sets/src/mage/sets/ElvesVsGoblins.java index e41c7f5d3e..3d26f6113b 100644 --- a/Mage.Sets/src/mage/sets/ElvesVsGoblins.java +++ b/Mage.Sets/src/mage/sets/ElvesVsGoblins.java @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package mage.sets; import mage.cards.ExpansionSet; @@ -83,7 +78,7 @@ public final class ElvesVsGoblins extends ExpansionSet { cards.add(new SetCardInfo("Wellwisher", 15, Rarity.COMMON, mage.cards.w.Wellwisher.class)); cards.add(new SetCardInfo("Wildsize", 23, Rarity.COMMON, mage.cards.w.Wildsize.class)); cards.add(new SetCardInfo("Wirewood Herald", 16, Rarity.COMMON, mage.cards.w.WirewoodHerald.class)); - cards.add(new SetCardInfo("Wirewood Lodge", 26, Rarity.RARE, mage.cards.w.WirewoodLodge.class)); + cards.add(new SetCardInfo("Wirewood Lodge", 26, Rarity.UNCOMMON, mage.cards.w.WirewoodLodge.class)); cards.add(new SetCardInfo("Wirewood Symbiote", 17, Rarity.UNCOMMON, mage.cards.w.WirewoodSymbiote.class)); cards.add(new SetCardInfo("Wood Elves", 18, Rarity.COMMON, mage.cards.w.WoodElves.class)); cards.add(new SetCardInfo("Wren's Run Vanquisher", 19, Rarity.UNCOMMON, mage.cards.w.WrensRunVanquisher.class)); diff --git a/Mage.Sets/src/mage/sets/FTVTwenty.java b/Mage.Sets/src/mage/sets/FTVTwenty.java index 2b735c7e02..f41f6626a8 100644 --- a/Mage.Sets/src/mage/sets/FTVTwenty.java +++ b/Mage.Sets/src/mage/sets/FTVTwenty.java @@ -1,8 +1,6 @@ - package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.h.HymnToTourach; import mage.constants.Rarity; import mage.constants.SetType; @@ -31,7 +29,7 @@ public final class FTVTwenty extends ExpansionSet { cards.add(new SetCardInfo("Fyndhorn Elves", 4, Rarity.MYTHIC, mage.cards.f.FyndhornElves.class)); cards.add(new SetCardInfo("Gilded Lotus", 12, Rarity.MYTHIC, mage.cards.g.GildedLotus.class)); cards.add(new SetCardInfo("Green Sun's Zenith", 19, Rarity.MYTHIC, mage.cards.g.GreenSunsZenith.class)); - cards.add(new SetCardInfo("Hymn to Tourach", 3, Rarity.SPECIAL, HymnToTourach.class)); + cards.add(new SetCardInfo("Hymn to Tourach", 3, Rarity.MYTHIC, mage.cards.h.HymnToTourach.class)); cards.add(new SetCardInfo("Impulse", 5, Rarity.MYTHIC, mage.cards.i.Impulse.class)); cards.add(new SetCardInfo("Ink-Eyes, Servant of Oni", 13, Rarity.MYTHIC, mage.cards.i.InkEyesServantOfOni.class)); cards.add(new SetCardInfo("Jace, the Mind Sculptor", 18, Rarity.MYTHIC, mage.cards.j.JaceTheMindSculptor.class)); diff --git a/Mage.Sets/src/mage/sets/FifthEdition.java b/Mage.Sets/src/mage/sets/FifthEdition.java index ed2e2c43d9..fcef5f5123 100644 --- a/Mage.Sets/src/mage/sets/FifthEdition.java +++ b/Mage.Sets/src/mage/sets/FifthEdition.java @@ -1,18 +1,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.b.BrassclawOrcs; -import mage.cards.d.DwarvenSoldier; -import mage.cards.g.GoblinWarDrums; -import mage.cards.h.HomaridWarrior; -import mage.cards.i.IcatianScout; -import mage.cards.i.InitiatesOfTheEbonHand; -import mage.cards.m.MesaFalcon; -import mage.cards.m.MindstabThrull; -import mage.cards.n.Necrite; -import mage.cards.r.ReefPirates; -import mage.cards.t.Torture; -import mage.cards.v.VodalianSoldiers; import mage.constants.Rarity; import mage.constants.SetType; @@ -81,7 +69,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Bottomless Vault", 411, Rarity.RARE, mage.cards.b.BottomlessVault.class)); cards.add(new SetCardInfo("Brainstorm", 76, Rarity.COMMON, mage.cards.b.Brainstorm.class)); cards.add(new SetCardInfo("Brainwash", 13, Rarity.COMMON, mage.cards.b.Brainwash.class)); - cards.add(new SetCardInfo("Brassclaw Orcs", 213, Rarity.COMMON, BrassclawOrcs.class)); + cards.add(new SetCardInfo("Brassclaw Orcs", 213, Rarity.COMMON, mage.cards.b.BrassclawOrcs.class)); cards.add(new SetCardInfo("Breeding Pit", 148, Rarity.UNCOMMON, mage.cards.b.BreedingPit.class)); cards.add(new SetCardInfo("Broken Visage", 149, Rarity.RARE, mage.cards.b.BrokenVisage.class)); cards.add(new SetCardInfo("Brothers of Fire", 214, Rarity.COMMON, mage.cards.b.BrothersOfFire.class)); @@ -93,7 +81,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Cat Warriors", 282, Rarity.COMMON, mage.cards.c.CatWarriors.class)); cards.add(new SetCardInfo("Cave People", 215, Rarity.UNCOMMON, mage.cards.c.CavePeople.class)); cards.add(new SetCardInfo("Chub Toad", 283, Rarity.COMMON, mage.cards.c.ChubToad.class)); - cards.add(new SetCardInfo("Circle of Protection: Artifacts", 16, Rarity.COMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); + cards.add(new SetCardInfo("Circle of Protection: Artifacts", 16, Rarity.UNCOMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); cards.add(new SetCardInfo("Circle of Protection: Black", 17, Rarity.COMMON, mage.cards.c.CircleOfProtectionBlack.class)); cards.add(new SetCardInfo("Circle of Protection: Blue", 18, Rarity.COMMON, mage.cards.c.CircleOfProtectionBlue.class)); cards.add(new SetCardInfo("Circle of Protection: Green", 19, Rarity.COMMON, mage.cards.c.CircleOfProtectionGreen.class)); @@ -145,7 +133,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Dwarven Catapult", 220, Rarity.UNCOMMON, mage.cards.d.DwarvenCatapult.class)); cards.add(new SetCardInfo("Dwarven Hold", 414, Rarity.RARE, mage.cards.d.DwarvenHold.class)); cards.add(new SetCardInfo("Dwarven Ruins", 415, Rarity.UNCOMMON, mage.cards.d.DwarvenRuins.class)); - cards.add(new SetCardInfo("Dwarven Soldier", 221, Rarity.COMMON, DwarvenSoldier.class)); + cards.add(new SetCardInfo("Dwarven Soldier", 221, Rarity.COMMON, mage.cards.d.DwarvenSoldier.class)); cards.add(new SetCardInfo("Dwarven Warriors", 222, Rarity.COMMON, mage.cards.d.DwarvenWarriors.class)); cards.add(new SetCardInfo("Earthquake", 223, Rarity.RARE, mage.cards.e.Earthquake.class)); cards.add(new SetCardInfo("Ebon Stronghold", 416, Rarity.UNCOMMON, mage.cards.e.EbonStronghold.class)); @@ -177,8 +165,8 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Flood", 87, Rarity.COMMON, mage.cards.f.Flood.class)); cards.add(new SetCardInfo("Flying Carpet", 371, Rarity.RARE, mage.cards.f.FlyingCarpet.class)); cards.add(new SetCardInfo("Fog", 293, Rarity.COMMON, mage.cards.f.Fog.class)); - cards.add(new SetCardInfo("Force of Nature", 294, Rarity.RARE, mage.cards.f.ForceOfNature.class)); cards.add(new SetCardInfo("Force Spike", 88, Rarity.COMMON, mage.cards.f.ForceSpike.class)); + cards.add(new SetCardInfo("Force of Nature", 294, Rarity.RARE, mage.cards.f.ForceOfNature.class)); cards.add(new SetCardInfo("Forest", 446, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 447, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 448, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); @@ -203,7 +191,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Goblin Digging Team", 234, Rarity.COMMON, mage.cards.g.GoblinDiggingTeam.class)); cards.add(new SetCardInfo("Goblin Hero", 235, Rarity.COMMON, mage.cards.g.GoblinHero.class)); cards.add(new SetCardInfo("Goblin King", 236, Rarity.RARE, mage.cards.g.GoblinKing.class)); - cards.add(new SetCardInfo("Goblin War Drums", 237, Rarity.COMMON, GoblinWarDrums.class)); + cards.add(new SetCardInfo("Goblin War Drums", 237, Rarity.COMMON, mage.cards.g.GoblinWarDrums.class)); cards.add(new SetCardInfo("Goblin Warrens", 238, Rarity.RARE, mage.cards.g.GoblinWarrens.class)); cards.add(new SetCardInfo("Grapeshot Catapult", 375, Rarity.COMMON, mage.cards.g.GrapeshotCatapult.class)); cards.add(new SetCardInfo("Greater Realm of Preservation", 31, Rarity.UNCOMMON, mage.cards.g.GreaterRealmOfPreservation.class)); @@ -217,7 +205,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Hill Giant", 239, Rarity.COMMON, mage.cards.h.HillGiant.class)); cards.add(new SetCardInfo("Hollow Trees", 418, Rarity.RARE, mage.cards.h.HollowTrees.class)); cards.add(new SetCardInfo("Holy Strength", 35, Rarity.COMMON, mage.cards.h.HolyStrength.class)); - cards.add(new SetCardInfo("Homarid Warrior", 92, Rarity.COMMON, HomaridWarrior.class)); + cards.add(new SetCardInfo("Homarid Warrior", 92, Rarity.COMMON, mage.cards.h.HomaridWarrior.class)); cards.add(new SetCardInfo("Howl from Beyond", 168, Rarity.COMMON, mage.cards.h.HowlFromBeyond.class)); cards.add(new SetCardInfo("Howling Mine", 377, Rarity.RARE, mage.cards.h.HowlingMine.class)); cards.add(new SetCardInfo("Hungry Mist", 302, Rarity.COMMON, mage.cards.h.HungryMist.class)); @@ -226,7 +214,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Hurricane", 303, Rarity.UNCOMMON, mage.cards.h.Hurricane.class)); cards.add(new SetCardInfo("Hydroblast", 94, Rarity.UNCOMMON, mage.cards.h.Hydroblast.class)); cards.add(new SetCardInfo("Icatian Phalanx", 36, Rarity.UNCOMMON, mage.cards.i.IcatianPhalanx.class)); - cards.add(new SetCardInfo("Icatian Scout", 37, Rarity.COMMON, IcatianScout.class)); + cards.add(new SetCardInfo("Icatian Scout", 37, Rarity.COMMON, mage.cards.i.IcatianScout.class)); cards.add(new SetCardInfo("Icatian Store", 419, Rarity.RARE, mage.cards.i.IcatianStore.class)); cards.add(new SetCardInfo("Icatian Town", 38, Rarity.RARE, mage.cards.i.IcatianTown.class)); cards.add(new SetCardInfo("Ice Floe", 420, Rarity.UNCOMMON, mage.cards.i.IceFloe.class)); @@ -234,7 +222,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Incinerate", 242, Rarity.COMMON, mage.cards.i.Incinerate.class)); cards.add(new SetCardInfo("Inferno", 243, Rarity.RARE, mage.cards.i.Inferno.class)); cards.add(new SetCardInfo("Infinite Hourglass", 378, Rarity.RARE, mage.cards.i.InfiniteHourglass.class)); - cards.add(new SetCardInfo("Initiates of the Ebon Hand", 169, Rarity.COMMON, InitiatesOfTheEbonHand.class)); + cards.add(new SetCardInfo("Initiates of the Ebon Hand", 169, Rarity.COMMON, mage.cards.i.InitiatesOfTheEbonHand.class)); cards.add(new SetCardInfo("Instill Energy", 304, Rarity.UNCOMMON, mage.cards.i.InstillEnergy.class)); cards.add(new SetCardInfo("Iron Star", 379, Rarity.UNCOMMON, mage.cards.i.IronStar.class)); cards.add(new SetCardInfo("Ironclaw Curse", 244, Rarity.RARE, mage.cards.i.IronclawCurse.class)); @@ -292,13 +280,13 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Meekstone", 389, Rarity.RARE, mage.cards.m.Meekstone.class)); cards.add(new SetCardInfo("Memory Lapse", 103, Rarity.COMMON, mage.cards.m.MemoryLapse.class)); cards.add(new SetCardInfo("Merfolk of the Pearl Trident", 104, Rarity.COMMON, mage.cards.m.MerfolkOfThePearlTrident.class)); - cards.add(new SetCardInfo("Mesa Falcon", 46, Rarity.COMMON, MesaFalcon.class)); + cards.add(new SetCardInfo("Mesa Falcon", 46, Rarity.COMMON, mage.cards.m.MesaFalcon.class)); cards.add(new SetCardInfo("Mesa Pegasus", 47, Rarity.COMMON, mage.cards.m.MesaPegasus.class)); cards.add(new SetCardInfo("Millstone", 390, Rarity.RARE, mage.cards.m.Millstone.class)); cards.add(new SetCardInfo("Mind Bomb", 105, Rarity.UNCOMMON, mage.cards.m.MindBomb.class)); cards.add(new SetCardInfo("Mind Ravel", 176, Rarity.COMMON, mage.cards.m.MindRavel.class)); cards.add(new SetCardInfo("Mind Warp", 177, Rarity.UNCOMMON, mage.cards.m.MindWarp.class)); - cards.add(new SetCardInfo("Mindstab Thrull", 178, Rarity.COMMON, MindstabThrull.class)); + cards.add(new SetCardInfo("Mindstab Thrull", 178, Rarity.COMMON, mage.cards.m.MindstabThrull.class)); cards.add(new SetCardInfo("Mole Worms", 179, Rarity.UNCOMMON, mage.cards.m.MoleWorms.class)); cards.add(new SetCardInfo("Mons's Goblin Raiders", 251, Rarity.COMMON, mage.cards.m.MonssGoblinRaiders.class)); cards.add(new SetCardInfo("Mountain Goat", 252, Rarity.COMMON, mage.cards.m.MountainGoat.class)); @@ -308,7 +296,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 445, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Murk Dwellers", 180, Rarity.COMMON, mage.cards.m.MurkDwellers.class)); cards.add(new SetCardInfo("Nature's Lore", 316, Rarity.COMMON, mage.cards.n.NaturesLore.class)); - cards.add(new SetCardInfo("Necrite", 181, Rarity.COMMON, Necrite.class)); + cards.add(new SetCardInfo("Necrite", 181, Rarity.COMMON, mage.cards.n.Necrite.class)); cards.add(new SetCardInfo("Necropotence", 182, Rarity.RARE, mage.cards.n.Necropotence.class)); cards.add(new SetCardInfo("Nether Shadow", 183, Rarity.RARE, mage.cards.n.NetherShadow.class)); cards.add(new SetCardInfo("Nevinyrral's Disk", 391, Rarity.RARE, mage.cards.n.NevinyrralsDisk.class)); @@ -357,7 +345,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Raise Dead", 191, Rarity.COMMON, mage.cards.r.RaiseDead.class)); cards.add(new SetCardInfo("Ray of Command", 114, Rarity.COMMON, mage.cards.r.RayOfCommand.class)); cards.add(new SetCardInfo("Recall", 115, Rarity.RARE, mage.cards.r.Recall.class)); - cards.add(new SetCardInfo("Reef Pirates", 116, Rarity.COMMON, ReefPirates.class)); + cards.add(new SetCardInfo("Reef Pirates", 116, Rarity.COMMON, mage.cards.r.ReefPirates.class)); cards.add(new SetCardInfo("Regeneration", 321, Rarity.COMMON, mage.cards.r.Regeneration.class)); cards.add(new SetCardInfo("Remove Soul", 117, Rarity.COMMON, mage.cards.r.RemoveSoul.class)); cards.add(new SetCardInfo("Repentant Blacksmith", 54, Rarity.COMMON, mage.cards.r.RepentantBlacksmith.class)); @@ -424,7 +412,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Time Bomb", 404, Rarity.RARE, mage.cards.t.TimeBomb.class)); cards.add(new SetCardInfo("Time Elemental", 129, Rarity.RARE, mage.cards.t.TimeElemental.class)); cards.add(new SetCardInfo("Titania's Song", 332, Rarity.RARE, mage.cards.t.TitaniasSong.class)); - cards.add(new SetCardInfo("Torture", 199, Rarity.COMMON, Torture.class)); + cards.add(new SetCardInfo("Torture", 199, Rarity.COMMON, mage.cards.t.Torture.class)); cards.add(new SetCardInfo("Touch of Death", 200, Rarity.COMMON, mage.cards.t.TouchOfDeath.class)); cards.add(new SetCardInfo("Tranquility", 333, Rarity.COMMON, mage.cards.t.Tranquility.class)); cards.add(new SetCardInfo("Truce", 65, Rarity.RARE, mage.cards.t.Truce.class)); @@ -445,7 +433,7 @@ public final class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Vampire Bats", 202, Rarity.COMMON, mage.cards.v.VampireBats.class)); cards.add(new SetCardInfo("Venom", 336, Rarity.COMMON, mage.cards.v.Venom.class)); cards.add(new SetCardInfo("Verduran Enchantress", 337, Rarity.RARE, mage.cards.v.VerduranEnchantress.class)); - cards.add(new SetCardInfo("Vodalian Soldiers", 134, Rarity.COMMON, VodalianSoldiers.class)); + cards.add(new SetCardInfo("Vodalian Soldiers", 134, Rarity.COMMON, mage.cards.v.VodalianSoldiers.class)); cards.add(new SetCardInfo("Wall of Air", 135, Rarity.UNCOMMON, mage.cards.w.WallOfAir.class)); cards.add(new SetCardInfo("Wall of Bone", 203, Rarity.UNCOMMON, mage.cards.w.WallOfBone.class)); cards.add(new SetCardInfo("Wall of Brambles", 338, Rarity.UNCOMMON, mage.cards.w.WallOfBrambles.class)); diff --git a/Mage.Sets/src/mage/sets/FourthEdition.java b/Mage.Sets/src/mage/sets/FourthEdition.java index 45b1950075..4239ecae26 100644 --- a/Mage.Sets/src/mage/sets/FourthEdition.java +++ b/Mage.Sets/src/mage/sets/FourthEdition.java @@ -1,9 +1,6 @@ - package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.n.NafsAsp; -import mage.cards.p.Piety; import mage.constants.Rarity; import mage.constants.SetType; @@ -79,7 +76,7 @@ public final class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Celestial Prism", 304, Rarity.UNCOMMON, mage.cards.c.CelestialPrism.class)); cards.add(new SetCardInfo("Channel", 236, Rarity.UNCOMMON, mage.cards.c.Channel.class)); cards.add(new SetCardInfo("Chaoslace", 182, Rarity.RARE, mage.cards.c.Chaoslace.class)); - cards.add(new SetCardInfo("Circle of Protection: Artifacts", 13, Rarity.COMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); + cards.add(new SetCardInfo("Circle of Protection: Artifacts", 13, Rarity.UNCOMMON, mage.cards.c.CircleOfProtectionArtifacts.class)); cards.add(new SetCardInfo("Circle of Protection: Black", 14, Rarity.COMMON, mage.cards.c.CircleOfProtectionBlack.class)); cards.add(new SetCardInfo("Circle of Protection: Blue", 15, Rarity.COMMON, mage.cards.c.CircleOfProtectionBlue.class)); cards.add(new SetCardInfo("Circle of Protection: Green", 16, Rarity.COMMON, mage.cards.c.CircleOfProtectionGreen.class)); @@ -250,7 +247,7 @@ public final class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 374, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 375, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Murk Dwellers", 148, Rarity.COMMON, mage.cards.m.MurkDwellers.class)); - cards.add(new SetCardInfo("Nafs Asp", 264, Rarity.COMMON, NafsAsp.class)); + cards.add(new SetCardInfo("Nafs Asp", 264, Rarity.COMMON, mage.cards.n.NafsAsp.class)); cards.add(new SetCardInfo("Nether Shadow", 149, Rarity.RARE, mage.cards.n.NetherShadow.class)); cards.add(new SetCardInfo("Nevinyrral's Disk", 338, Rarity.RARE, mage.cards.n.NevinyrralsDisk.class)); cards.add(new SetCardInfo("Nightmare", 150, Rarity.RARE, mage.cards.n.Nightmare.class)); @@ -269,7 +266,7 @@ public final class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Phantasmal Forces", 88, Rarity.UNCOMMON, mage.cards.p.PhantasmalForces.class)); cards.add(new SetCardInfo("Phantasmal Terrain", 89, Rarity.COMMON, mage.cards.p.PhantasmalTerrain.class)); cards.add(new SetCardInfo("Phantom Monster", 90, Rarity.UNCOMMON, mage.cards.p.PhantomMonster.class)); - cards.add(new SetCardInfo("Piety", 41, Rarity.COMMON, Piety.class)); + cards.add(new SetCardInfo("Piety", 41, Rarity.COMMON, mage.cards.p.Piety.class)); cards.add(new SetCardInfo("Pikemen", 42, Rarity.COMMON, mage.cards.p.Pikemen.class)); cards.add(new SetCardInfo("Pirate Ship", 91, Rarity.RARE, mage.cards.p.PirateShip.class)); cards.add(new SetCardInfo("Pit Scorpion", 153, Rarity.COMMON, mage.cards.p.PitScorpion.class)); diff --git a/Mage.Sets/src/mage/sets/GrandPrix.java b/Mage.Sets/src/mage/sets/GrandPrix.java index 85c5b61dcf..f92b14e39e 100644 --- a/Mage.Sets/src/mage/sets/GrandPrix.java +++ b/Mage.Sets/src/mage/sets/GrandPrix.java @@ -18,22 +18,30 @@ public final class GrandPrix extends ExpansionSet { } private GrandPrix() { - super("Grand Prix", "GPX", ExpansionSet.buildDate(2011, 6, 17), SetType.PROMOTIONAL); + super("Grand Prix Promos", "GPX", ExpansionSet.buildDate(2011, 6, 17), SetType.PROMOTIONAL); this.hasBoosters = false; this.hasBasicLands = false; - cards.add(new SetCardInfo("All Is Dust", 9, Rarity.MYTHIC, mage.cards.a.AllIsDust.class)); - cards.add(new SetCardInfo("Batterskull", 10, Rarity.MYTHIC, mage.cards.b.Batterskull.class)); - cards.add(new SetCardInfo("Call of the Herd", 2, Rarity.RARE, mage.cards.c.CallOfTheHerd.class)); - cards.add(new SetCardInfo("Chrome Mox", 3, Rarity.RARE, mage.cards.c.ChromeMox.class)); - cards.add(new SetCardInfo("Progenitus", 13, Rarity.MYTHIC, mage.cards.p.Progenitus.class)); - cards.add(new SetCardInfo("Goblin Guide", 6, Rarity.RARE, mage.cards.g.GoblinGuide.class)); - cards.add(new SetCardInfo("Griselbrand", 11, Rarity.MYTHIC, mage.cards.g.Griselbrand.class)); - cards.add(new SetCardInfo("Lotus Cobra", 7, Rarity.MYTHIC, mage.cards.l.LotusCobra.class)); - cards.add(new SetCardInfo("Maelstrom Pulse", 5, Rarity.RARE, mage.cards.m.MaelstromPulse.class)); - cards.add(new SetCardInfo("Primeval Titan", 8, Rarity.MYTHIC, mage.cards.p.PrimevalTitan.class)); - cards.add(new SetCardInfo("Spiritmonger", 1, Rarity.RARE, mage.cards.s.Spiritmonger.class)); - cards.add(new SetCardInfo("Stoneforge Mystic", 12, Rarity.RARE, mage.cards.s.StoneforgeMystic.class)); - cards.add(new SetCardInfo("Umezawa's Jitte", 4, Rarity.RARE, mage.cards.u.UmezawasJitte.class)); + + cards.add(new SetCardInfo("All Is Dust", "2013b", Rarity.RARE, mage.cards.a.AllIsDust.class)); + cards.add(new SetCardInfo("Batterskull", 2014, Rarity.MYTHIC, mage.cards.b.Batterskull.class)); + cards.add(new SetCardInfo("Call of the Herd", 2008, Rarity.RARE, mage.cards.c.CallOfTheHerd.class)); + cards.add(new SetCardInfo("Chrome Mox", 2009, Rarity.RARE, mage.cards.c.ChromeMox.class)); + cards.add(new SetCardInfo("Forest", "2018f", Rarity.LAND, mage.cards.basiclands.Forest.class)); + cards.add(new SetCardInfo("Goblin Guide", "2012a", Rarity.RARE, mage.cards.g.GoblinGuide.class)); + cards.add(new SetCardInfo("Griselbrand", 2015, Rarity.MYTHIC, mage.cards.g.Griselbrand.class)); + cards.add(new SetCardInfo("Island", "2018b", Rarity.LAND, mage.cards.basiclands.Island.class)); + cards.add(new SetCardInfo("Lotus Cobra", "2012b", Rarity.RARE, mage.cards.l.LotusCobra.class)); + cards.add(new SetCardInfo("Maelstrom Pulse", 2011, Rarity.RARE, mage.cards.m.MaelstromPulse.class)); + cards.add(new SetCardInfo("Mountain", "2018d", Rarity.LAND, mage.cards.basiclands.Mountain.class)); + cards.add(new SetCardInfo("Mutavault", 2018, Rarity.RARE, mage.cards.m.Mutavault.class)); + cards.add(new SetCardInfo("Plains", "2018a", Rarity.LAND, mage.cards.basiclands.Plains.class)); + cards.add(new SetCardInfo("Primeval Titan", "2013a", Rarity.MYTHIC, mage.cards.p.PrimevalTitan.class)); + cards.add(new SetCardInfo("Progenitus", 2017, Rarity.MYTHIC, mage.cards.p.Progenitus.class)); + cards.add(new SetCardInfo("Spiritmonger", 2007, Rarity.RARE, mage.cards.s.Spiritmonger.class)); + cards.add(new SetCardInfo("Stoneforge Mystic", 2016, Rarity.RARE, mage.cards.s.StoneforgeMystic.class)); + cards.add(new SetCardInfo("Swamp", "2018c", Rarity.LAND, mage.cards.basiclands.Swamp.class)); + cards.add(new SetCardInfo("Sword of Feast and Famine", "2016b", Rarity.RARE, mage.cards.s.SwordOfFeastAndFamine.class)); + cards.add(new SetCardInfo("Umezawa's Jitte", 2010, Rarity.RARE, mage.cards.u.UmezawasJitte.class)); } } diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 1e3a161131..58b19900e2 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -50,7 +50,7 @@ public final class Guildpact extends ExpansionSet { cards.add(new SetCardInfo("Cremate", 45, Rarity.COMMON, mage.cards.c.Cremate.class)); cards.add(new SetCardInfo("Cry of Contrition", 46, Rarity.COMMON, mage.cards.c.CryOfContrition.class)); cards.add(new SetCardInfo("Cryptwailing", 47, Rarity.UNCOMMON, mage.cards.c.Cryptwailing.class)); - cards.add(new SetCardInfo("Crystal Seer", 23, Rarity.UNCOMMON, mage.cards.c.CrystalSeer.class)); + cards.add(new SetCardInfo("Crystal Seer", 23, Rarity.COMMON, mage.cards.c.CrystalSeer.class)); cards.add(new SetCardInfo("Culling Sun", 109, Rarity.RARE, mage.cards.c.CullingSun.class)); cards.add(new SetCardInfo("Daggerclaw Imp", 48, Rarity.UNCOMMON, mage.cards.d.DaggerclawImp.class)); cards.add(new SetCardInfo("Debtors' Knell", 141, Rarity.RARE, mage.cards.d.DebtorsKnell.class)); diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java new file mode 100644 index 0000000000..a17769262d --- /dev/null +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -0,0 +1,345 @@ +package mage.sets; + +import java.util.ArrayList; +import java.util.List; +import mage.cards.ExpansionSet; +import mage.cards.repository.CardCriteria; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetType; + +public final class GuildsOfRavnica extends ExpansionSet { + + private static final GuildsOfRavnica instance = new GuildsOfRavnica(); + + public static GuildsOfRavnica getInstance() { + return instance; + } + + private GuildsOfRavnica() { + super("Guilds of Ravnica", "GRN", ExpansionSet.buildDate(2018, 10, 5), SetType.EXPANSION); + this.blockName = "Guilds of Ravnica"; + this.hasBoosters = true; + this.numBoosterSpecial = 1; + this.numBoosterLands = 0; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + this.maxCardNumberInBooster = 259; + + cards.add(new SetCardInfo("Affectionate Indrik", 121, Rarity.UNCOMMON, mage.cards.a.AffectionateIndrik.class)); + cards.add(new SetCardInfo("Arboretum Elemental", 122, Rarity.UNCOMMON, mage.cards.a.ArboretumElemental.class)); + cards.add(new SetCardInfo("Arclight Phoenix", 91, Rarity.MYTHIC, mage.cards.a.ArclightPhoenix.class)); + cards.add(new SetCardInfo("Artful Takedown", 151, Rarity.COMMON, mage.cards.a.ArtfulTakedown.class)); + cards.add(new SetCardInfo("Assassin's Trophy", 152, Rarity.RARE, mage.cards.a.AssassinsTrophy.class)); + cards.add(new SetCardInfo("Assure // Assemble", 221, Rarity.RARE, mage.cards.a.AssureAssemble.class)); + cards.add(new SetCardInfo("Attendant of Vraska", 271, Rarity.UNCOMMON, mage.cards.a.AttendantOfVraska.class)); + cards.add(new SetCardInfo("Aurelia, Exemplar of Justice", 153, Rarity.MYTHIC, mage.cards.a.AureliaExemplarOfJustice.class)); + cards.add(new SetCardInfo("Barging Sergeant", 92, Rarity.COMMON, mage.cards.b.BargingSergeant.class)); + cards.add(new SetCardInfo("Barrier of Bones", 61, Rarity.COMMON, mage.cards.b.BarrierOfBones.class)); + cards.add(new SetCardInfo("Bartizan Bats", 62, Rarity.COMMON, mage.cards.b.BartizanBats.class)); + cards.add(new SetCardInfo("Beacon Bolt", 154, Rarity.UNCOMMON, mage.cards.b.BeaconBolt.class)); + cards.add(new SetCardInfo("Beamsplitter Mage", 155, Rarity.UNCOMMON, mage.cards.b.BeamsplitterMage.class)); + cards.add(new SetCardInfo("Beast Whisperer", 123, Rarity.RARE, mage.cards.b.BeastWhisperer.class)); + cards.add(new SetCardInfo("Blade Instructor", 1, Rarity.COMMON, mage.cards.b.BladeInstructor.class)); + cards.add(new SetCardInfo("Blood Operative", 63, Rarity.RARE, mage.cards.b.BloodOperative.class)); + cards.add(new SetCardInfo("Book Devourer", 93, Rarity.UNCOMMON, mage.cards.b.BookDevourer.class)); + cards.add(new SetCardInfo("Boros Challenger", 156, Rarity.UNCOMMON, mage.cards.b.BorosChallenger.class)); + cards.add(new SetCardInfo("Boros Guildgate", 243, Rarity.COMMON, mage.cards.b.BorosGuildgate.class)); + cards.add(new SetCardInfo("Boros Guildgate", 244, Rarity.COMMON, mage.cards.b.BorosGuildgate.class)); + cards.add(new SetCardInfo("Boros Locket", 231, Rarity.COMMON, mage.cards.b.BorosLocket.class)); + cards.add(new SetCardInfo("Bounty Agent", 2, Rarity.RARE, mage.cards.b.BountyAgent.class)); + cards.add(new SetCardInfo("Bounty of Might", 124, Rarity.RARE, mage.cards.b.BountyOfMight.class)); + cards.add(new SetCardInfo("Burglar Rat", 64, Rarity.COMMON, mage.cards.b.BurglarRat.class)); + cards.add(new SetCardInfo("Camaraderie", 157, Rarity.RARE, mage.cards.c.Camaraderie.class)); + cards.add(new SetCardInfo("Candlelight Vigil", 3, Rarity.COMMON, mage.cards.c.CandlelightVigil.class)); + cards.add(new SetCardInfo("Capture Sphere", 31, Rarity.COMMON, mage.cards.c.CaptureSphere.class)); + cards.add(new SetCardInfo("Centaur Peacemaker", 158, Rarity.COMMON, mage.cards.c.CentaurPeacemaker.class)); + cards.add(new SetCardInfo("Chamber Sentry", 232, Rarity.RARE, mage.cards.c.ChamberSentry.class)); + cards.add(new SetCardInfo("Chance for Glory", 159, Rarity.MYTHIC, mage.cards.c.ChanceForGlory.class)); + cards.add(new SetCardInfo("Charnel Troll", 160, Rarity.RARE, mage.cards.c.CharnelTroll.class)); + cards.add(new SetCardInfo("Chemister's Insight", 32, Rarity.UNCOMMON, mage.cards.c.ChemistersInsight.class)); + cards.add(new SetCardInfo("Child of Night", 65, Rarity.COMMON, mage.cards.c.ChildOfNight.class)); + cards.add(new SetCardInfo("Chromatic Lantern", 233, Rarity.RARE, mage.cards.c.ChromaticLantern.class)); + cards.add(new SetCardInfo("Circuitous Route", 125, Rarity.UNCOMMON, mage.cards.c.CircuitousRoute.class)); + cards.add(new SetCardInfo("Citywatch Sphinx", 33, Rarity.UNCOMMON, mage.cards.c.CitywatchSphinx.class)); + cards.add(new SetCardInfo("Citywide Bust", 4, Rarity.RARE, mage.cards.c.CitywideBust.class)); + cards.add(new SetCardInfo("Collar the Culprit", 5, Rarity.COMMON, mage.cards.c.CollarTheCulprit.class)); + cards.add(new SetCardInfo("Command the Storm", 94, Rarity.COMMON, mage.cards.c.CommandTheStorm.class)); + cards.add(new SetCardInfo("Conclave Cavalier", 161, Rarity.UNCOMMON, mage.cards.c.ConclaveCavalier.class)); + cards.add(new SetCardInfo("Conclave Guildmage", 162, Rarity.UNCOMMON, mage.cards.c.ConclaveGuildmage.class)); + cards.add(new SetCardInfo("Conclave Tribunal", 6, Rarity.UNCOMMON, mage.cards.c.ConclaveTribunal.class)); + cards.add(new SetCardInfo("Connive // Concoct", 222, Rarity.RARE, mage.cards.c.ConniveConcoct.class)); + cards.add(new SetCardInfo("Cosmotronic Wave", 95, Rarity.COMMON, mage.cards.c.CosmotronicWave.class)); + cards.add(new SetCardInfo("Crackling Drake", 163, Rarity.UNCOMMON, mage.cards.c.CracklingDrake.class)); + cards.add(new SetCardInfo("Creeping Chill", 66, Rarity.UNCOMMON, mage.cards.c.CreepingChill.class)); + cards.add(new SetCardInfo("Crush Contraband", 7, Rarity.UNCOMMON, mage.cards.c.CrushContraband.class)); + cards.add(new SetCardInfo("Crushing Canopy", 126, Rarity.COMMON, mage.cards.c.CrushingCanopy.class)); + cards.add(new SetCardInfo("Darkblade Agent", 164, Rarity.COMMON, mage.cards.d.DarkbladeAgent.class)); + cards.add(new SetCardInfo("Dawn of Hope", 8, Rarity.RARE, mage.cards.d.DawnOfHope.class)); + cards.add(new SetCardInfo("Dazzling Lights", 34, Rarity.COMMON, mage.cards.d.DazzlingLights.class)); + cards.add(new SetCardInfo("Dead Weight", 67, Rarity.COMMON, mage.cards.d.DeadWeight.class)); + cards.add(new SetCardInfo("Deadly Visit", 68, Rarity.COMMON, mage.cards.d.DeadlyVisit.class)); + cards.add(new SetCardInfo("Deafening Clarion", 165, Rarity.RARE, mage.cards.d.DeafeningClarion.class)); + cards.add(new SetCardInfo("Demotion", 9, Rarity.UNCOMMON, mage.cards.d.Demotion.class)); + cards.add(new SetCardInfo("Devious Cover-up", 35, Rarity.COMMON, mage.cards.d.DeviousCoverUp.class)); + cards.add(new SetCardInfo("Devkarin Dissident", 127, Rarity.COMMON, mage.cards.d.DevkarinDissident.class)); + cards.add(new SetCardInfo("Dimir Guildgate", 245, Rarity.COMMON, mage.cards.d.DimirGuildgate.class)); + cards.add(new SetCardInfo("Dimir Guildgate", 246, Rarity.COMMON, mage.cards.d.DimirGuildgate.class)); + cards.add(new SetCardInfo("Dimir Informant", 36, Rarity.COMMON, mage.cards.d.DimirInformant.class)); + cards.add(new SetCardInfo("Dimir Locket", 234, Rarity.COMMON, mage.cards.d.DimirLocket.class)); + cards.add(new SetCardInfo("Dimir Spybug", 166, Rarity.UNCOMMON, mage.cards.d.DimirSpybug.class)); + cards.add(new SetCardInfo("Direct Current", 96, Rarity.COMMON, mage.cards.d.DirectCurrent.class)); + cards.add(new SetCardInfo("Discovery // Dispersal", 223, Rarity.UNCOMMON, mage.cards.d.DiscoveryDispersal.class)); + cards.add(new SetCardInfo("Disdainful Stroke", 37, Rarity.COMMON, mage.cards.d.DisdainfulStroke.class)); + cards.add(new SetCardInfo("Disinformation Campaign", 167, Rarity.UNCOMMON, mage.cards.d.DisinformationCampaign.class)); + cards.add(new SetCardInfo("District Guide", 128, Rarity.UNCOMMON, mage.cards.d.DistrictGuide.class)); + cards.add(new SetCardInfo("Divine Visitation", 10, Rarity.MYTHIC, mage.cards.d.DivineVisitation.class)); + cards.add(new SetCardInfo("Doom Whisperer", 69, Rarity.MYTHIC, mage.cards.d.DoomWhisperer.class)); + cards.add(new SetCardInfo("Douser of Lights", 70, Rarity.COMMON, mage.cards.d.DouserOfLights.class)); + cards.add(new SetCardInfo("Dream Eater", 38, Rarity.MYTHIC, mage.cards.d.DreamEater.class)); + cards.add(new SetCardInfo("Drowned Secrets", 39, Rarity.RARE, mage.cards.d.DrownedSecrets.class)); + cards.add(new SetCardInfo("Electrostatic Field", 97, Rarity.UNCOMMON, mage.cards.e.ElectrostaticField.class)); + cards.add(new SetCardInfo("Emmara, Soul of the Accord", 168, Rarity.RARE, mage.cards.e.EmmaraSoulOfTheAccord.class)); + cards.add(new SetCardInfo("Enhanced Surveillance", 40, Rarity.UNCOMMON, mage.cards.e.EnhancedSurveillance.class)); + cards.add(new SetCardInfo("Erratic Cyclops", 98, Rarity.RARE, mage.cards.e.ErraticCyclops.class)); + cards.add(new SetCardInfo("Erstwhile Trooper", 169, Rarity.COMMON, mage.cards.e.ErstwhileTrooper.class)); + cards.add(new SetCardInfo("Etrata, the Silencer", 170, Rarity.RARE, mage.cards.e.EtrataTheSilencer.class)); + cards.add(new SetCardInfo("Expansion // Explosion", 224, Rarity.RARE, mage.cards.e.ExpansionExplosion.class)); + cards.add(new SetCardInfo("Experimental Frenzy", 99, Rarity.RARE, mage.cards.e.ExperimentalFrenzy.class)); + cards.add(new SetCardInfo("Fearless Halberdier", 100, Rarity.COMMON, mage.cards.f.FearlessHalberdier.class)); + cards.add(new SetCardInfo("Find // Finality", 225, Rarity.RARE, mage.cards.f.FindFinality.class)); + cards.add(new SetCardInfo("Fire Urchin", 101, Rarity.COMMON, mage.cards.f.FireUrchin.class)); + cards.add(new SetCardInfo("Firemind's Research", 171, Rarity.RARE, mage.cards.f.FiremindsResearch.class)); + cards.add(new SetCardInfo("Flight of Equenauts", 11, Rarity.UNCOMMON, mage.cards.f.FlightOfEquenauts.class)); + cards.add(new SetCardInfo("Flower // Flourish", 226, Rarity.UNCOMMON, mage.cards.f.FlowerFlourish.class)); + cards.add(new SetCardInfo("Forest", 264, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Fresh-Faced Recruit", 216, Rarity.COMMON, mage.cards.f.FreshFacedRecruit.class)); + cards.add(new SetCardInfo("Garrison Sergeant", 172, Rarity.COMMON, mage.cards.g.GarrisonSergeant.class)); + cards.add(new SetCardInfo("Gatekeeper Gargoyle", 235, Rarity.UNCOMMON, mage.cards.g.GatekeeperGargoyle.class)); + cards.add(new SetCardInfo("Gateway Plaza", 247, Rarity.COMMON, mage.cards.g.GatewayPlaza.class)); + cards.add(new SetCardInfo("Generous Stray", 129, Rarity.COMMON, mage.cards.g.GenerousStray.class)); + cards.add(new SetCardInfo("Gird for Battle", 12, Rarity.UNCOMMON, mage.cards.g.GirdForBattle.class)); + cards.add(new SetCardInfo("Glaive of the Guildpact", 236, Rarity.UNCOMMON, mage.cards.g.GlaiveOfTheGuildpact.class)); + cards.add(new SetCardInfo("Glowspore Shaman", 173, Rarity.UNCOMMON, mage.cards.g.GlowsporeShaman.class)); + cards.add(new SetCardInfo("Goblin Banneret", 102, Rarity.UNCOMMON, mage.cards.g.GoblinBanneret.class)); + cards.add(new SetCardInfo("Goblin Cratermaker", 103, Rarity.UNCOMMON, mage.cards.g.GoblinCratermaker.class)); + cards.add(new SetCardInfo("Goblin Electromancer", 174, Rarity.COMMON, mage.cards.g.GoblinElectromancer.class)); + cards.add(new SetCardInfo("Goblin Locksmith", 104, Rarity.COMMON, mage.cards.g.GoblinLocksmith.class)); + cards.add(new SetCardInfo("Golgari Findbroker", 175, Rarity.UNCOMMON, mage.cards.g.GolgariFindbroker.class)); + cards.add(new SetCardInfo("Golgari Guildgate", 248, Rarity.COMMON, mage.cards.g.GolgariGuildgate.class)); + cards.add(new SetCardInfo("Golgari Guildgate", 249, Rarity.COMMON, mage.cards.g.GolgariGuildgate.class)); + cards.add(new SetCardInfo("Golgari Locket", 237, Rarity.COMMON, mage.cards.g.GolgariLocket.class)); + cards.add(new SetCardInfo("Golgari Raiders", 130, Rarity.UNCOMMON, mage.cards.g.GolgariRaiders.class)); + cards.add(new SetCardInfo("Grappling Sundew", 131, Rarity.UNCOMMON, mage.cards.g.GrapplingSundew.class)); + cards.add(new SetCardInfo("Gravitic Punch", 105, Rarity.COMMON, mage.cards.g.GraviticPunch.class)); + cards.add(new SetCardInfo("Gruesome Menagerie", 71, Rarity.RARE, mage.cards.g.GruesomeMenagerie.class)); + cards.add(new SetCardInfo("Guild Summit", 41, Rarity.UNCOMMON, mage.cards.g.GuildSummit.class)); + cards.add(new SetCardInfo("Guildmages' Forum", 250, Rarity.RARE, mage.cards.g.GuildmagesForum.class)); + cards.add(new SetCardInfo("Haazda Marshal", 13, Rarity.UNCOMMON, mage.cards.h.HaazdaMarshal.class)); + cards.add(new SetCardInfo("Hammer Dropper", 176, Rarity.COMMON, mage.cards.h.HammerDropper.class)); + cards.add(new SetCardInfo("Hatchery Spider", 132, Rarity.RARE, mage.cards.h.HatcherySpider.class)); + cards.add(new SetCardInfo("Healer's Hawk", 14, Rarity.COMMON, mage.cards.h.HealersHawk.class)); + cards.add(new SetCardInfo("Hellkite Whelp", 106, Rarity.UNCOMMON, mage.cards.h.HellkiteWhelp.class)); + cards.add(new SetCardInfo("Hired Poisoner", 72, Rarity.COMMON, mage.cards.h.HiredPoisoner.class)); + cards.add(new SetCardInfo("Hitchclaw Recluse", 133, Rarity.COMMON, mage.cards.h.HitchclawRecluse.class)); + cards.add(new SetCardInfo("House Guildmage", 177, Rarity.UNCOMMON, mage.cards.h.HouseGuildmage.class)); + cards.add(new SetCardInfo("Hunted Witness", 15, Rarity.COMMON, mage.cards.h.HuntedWitness.class)); + cards.add(new SetCardInfo("Hypothesizzle", 178, Rarity.COMMON, mage.cards.h.Hypothesizzle.class)); + cards.add(new SetCardInfo("Impervious Greatwurm", 273, Rarity.MYTHIC, mage.cards.i.ImperviousGreatwurm.class)); + cards.add(new SetCardInfo("Inescapable Blaze", 107, Rarity.UNCOMMON, mage.cards.i.InescapableBlaze.class)); + cards.add(new SetCardInfo("Invert // Invent", 228, Rarity.UNCOMMON, mage.cards.i.InvertInvent.class)); + cards.add(new SetCardInfo("Inspiring Unicorn", 16, Rarity.UNCOMMON, mage.cards.i.InspiringUnicorn.class)); + cards.add(new SetCardInfo("Integrity // Intervention", 227, Rarity.UNCOMMON, mage.cards.i.IntegrityIntervention.class)); + cards.add(new SetCardInfo("Intrusive Packbeast", 17, Rarity.COMMON, mage.cards.i.IntrusivePackbeast.class)); + cards.add(new SetCardInfo("Ionize", 179, Rarity.RARE, mage.cards.i.Ionize.class)); + cards.add(new SetCardInfo("Ironshell Beetle", 134, Rarity.COMMON, mage.cards.i.IronshellBeetle.class)); + cards.add(new SetCardInfo("Island", 261, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Izoni, Thousand-Eyed", 180, Rarity.RARE, mage.cards.i.IzoniThousandEyed.class)); + cards.add(new SetCardInfo("Izzet Guildgate", 251, Rarity.COMMON, mage.cards.i.IzzetGuildgate.class)); + cards.add(new SetCardInfo("Izzet Guildgate", 252, Rarity.COMMON, mage.cards.i.IzzetGuildgate.class)); + cards.add(new SetCardInfo("Izzet Locket", 238, Rarity.COMMON, mage.cards.i.IzzetLocket.class)); + cards.add(new SetCardInfo("Join Shields", 181, Rarity.UNCOMMON, mage.cards.j.JoinShields.class)); + cards.add(new SetCardInfo("Justice Strike", 182, Rarity.UNCOMMON, mage.cards.j.JusticeStrike.class)); + cards.add(new SetCardInfo("Knight of Autumn", 183, Rarity.RARE, mage.cards.k.KnightOfAutumn.class)); + cards.add(new SetCardInfo("Kraul Foragers", 135, Rarity.COMMON, mage.cards.k.KraulForagers.class)); + cards.add(new SetCardInfo("Kraul Harpooner", 136, Rarity.UNCOMMON, mage.cards.k.KraulHarpooner.class)); + cards.add(new SetCardInfo("Kraul Raider", 270, Rarity.COMMON, mage.cards.k.KraulRaider.class)); + cards.add(new SetCardInfo("Kraul Swarm", 73, Rarity.UNCOMMON, mage.cards.k.KraulSwarm.class)); + cards.add(new SetCardInfo("Lava Coil", 108, Rarity.UNCOMMON, mage.cards.l.LavaCoil.class)); + cards.add(new SetCardInfo("Lazav, the Multifarious", 184, Rarity.MYTHIC, mage.cards.l.LazavTheMultifarious.class)); + cards.add(new SetCardInfo("League Guildmage", 185, Rarity.UNCOMMON, mage.cards.l.LeagueGuildmage.class)); + cards.add(new SetCardInfo("Leapfrog", 42, Rarity.COMMON, mage.cards.l.Leapfrog.class)); + cards.add(new SetCardInfo("Ledev Champion", 186, Rarity.UNCOMMON, mage.cards.l.LedevChampion.class)); + cards.add(new SetCardInfo("Ledev Guardian", 18, Rarity.COMMON, mage.cards.l.LedevGuardian.class)); + cards.add(new SetCardInfo("Legion Guildmage", 187, Rarity.UNCOMMON, mage.cards.l.LegionGuildmage.class)); + cards.add(new SetCardInfo("Legion Warboss", 109, Rarity.RARE, mage.cards.l.LegionWarboss.class)); + cards.add(new SetCardInfo("Light of the Legion", 19, Rarity.RARE, mage.cards.l.LightOfTheLegion.class)); + cards.add(new SetCardInfo("Lotleth Giant", 74, Rarity.UNCOMMON, mage.cards.l.LotlethGiant.class)); + cards.add(new SetCardInfo("Loxodon Restorer", 20, Rarity.COMMON, mage.cards.l.LoxodonRestorer.class)); + cards.add(new SetCardInfo("Luminous Bonds", 21, Rarity.COMMON, mage.cards.l.LuminousBonds.class)); + cards.add(new SetCardInfo("Maniacal Rage", 110, Rarity.COMMON, mage.cards.m.ManiacalRage.class)); + cards.add(new SetCardInfo("March of the Multitudes", 188, Rarity.MYTHIC, mage.cards.m.MarchOfTheMultitudes.class)); + cards.add(new SetCardInfo("Mausoleum Secrets", 75, Rarity.RARE, mage.cards.m.MausoleumSecrets.class)); + cards.add(new SetCardInfo("Maximize Altitude", 43, Rarity.COMMON, mage.cards.m.MaximizeAltitude.class)); + cards.add(new SetCardInfo("Maximize Velocity", 111, Rarity.COMMON, mage.cards.m.MaximizeVelocity.class)); + cards.add(new SetCardInfo("Mephitic Vapors", 76, Rarity.COMMON, mage.cards.m.MephiticVapors.class)); + cards.add(new SetCardInfo("Midnight Reaper", 77, Rarity.RARE, mage.cards.m.MidnightReaper.class)); + cards.add(new SetCardInfo("Might of the Masses", 137, Rarity.UNCOMMON, mage.cards.m.MightOfTheMasses.class)); + cards.add(new SetCardInfo("Mission Briefing", 44, Rarity.RARE, mage.cards.m.MissionBriefing.class)); + cards.add(new SetCardInfo("Mnemonic Betrayal", 189, Rarity.MYTHIC, mage.cards.m.MnemonicBetrayal.class)); + cards.add(new SetCardInfo("Molderhulk", 190, Rarity.UNCOMMON, mage.cards.m.Molderhulk.class)); + cards.add(new SetCardInfo("Moodmark Painter", 78, Rarity.COMMON, mage.cards.m.MoodmarkPainter.class)); + cards.add(new SetCardInfo("Mountain", 263, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Murmuring Mystic", 45, Rarity.UNCOMMON, mage.cards.m.MurmuringMystic.class)); + cards.add(new SetCardInfo("Muse Drake", 46, Rarity.COMMON, mage.cards.m.MuseDrake.class)); + cards.add(new SetCardInfo("Narcomoeba", 47, Rarity.RARE, mage.cards.n.Narcomoeba.class)); + cards.add(new SetCardInfo("Necrotic Wound", 79, Rarity.UNCOMMON, mage.cards.n.NecroticWound.class)); + cards.add(new SetCardInfo("Never Happened", 80, Rarity.COMMON, mage.cards.n.NeverHappened.class)); + cards.add(new SetCardInfo("Nightveil Predator", 191, Rarity.UNCOMMON, mage.cards.n.NightveilPredator.class)); + cards.add(new SetCardInfo("Nightveil Sprite", 48, Rarity.UNCOMMON, mage.cards.n.NightveilSprite.class)); + cards.add(new SetCardInfo("Niv-Mizzet, Parun", 192, Rarity.RARE, mage.cards.n.NivMizzetParun.class)); + cards.add(new SetCardInfo("Notion Rain", 193, Rarity.COMMON, mage.cards.n.NotionRain.class)); + cards.add(new SetCardInfo("Nullhide Ferox", 138, Rarity.MYTHIC, mage.cards.n.NullhideFerox.class)); + cards.add(new SetCardInfo("Ochran Assassin", 194, Rarity.UNCOMMON, mage.cards.o.OchranAssassin.class)); + cards.add(new SetCardInfo("Omnispell Adept", 49, Rarity.RARE, mage.cards.o.OmnispellAdept.class)); + cards.add(new SetCardInfo("Ornery Goblin", 112, Rarity.COMMON, mage.cards.o.OrneryGoblin.class)); + cards.add(new SetCardInfo("Overgrown Tomb", 253, Rarity.RARE, mage.cards.o.OvergrownTomb.class)); + cards.add(new SetCardInfo("Pack's Favor", 139, Rarity.COMMON, mage.cards.p.PacksFavor.class)); + cards.add(new SetCardInfo("Parhelion Patrol", 22, Rarity.COMMON, mage.cards.p.ParhelionPatrol.class)); + cards.add(new SetCardInfo("Passwall Adept", 50, Rarity.COMMON, mage.cards.p.PasswallAdept.class)); + cards.add(new SetCardInfo("Pause for Reflection", 140, Rarity.COMMON, mage.cards.p.PauseForReflection.class)); + cards.add(new SetCardInfo("Pelt Collector", 141, Rarity.RARE, mage.cards.p.PeltCollector.class)); + cards.add(new SetCardInfo("Pilfering Imp", 81, Rarity.UNCOMMON, mage.cards.p.PilferingImp.class)); + cards.add(new SetCardInfo("Piston-Fist Cyclops", 217, Rarity.COMMON, mage.cards.p.PistonFistCyclops.class)); + cards.add(new SetCardInfo("Pitiless Gorgon", 218, Rarity.COMMON, mage.cards.p.PitilessGorgon.class)); + cards.add(new SetCardInfo("Plaguecrafter", 82, Rarity.UNCOMMON, mage.cards.p.Plaguecrafter.class)); + cards.add(new SetCardInfo("Plains", 260, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Portcullis Vine", 142, Rarity.COMMON, mage.cards.p.PortcullisVine.class)); + cards.add(new SetCardInfo("Precision Bolt", 267, Rarity.COMMON, mage.cards.p.PrecisionBolt.class)); + cards.add(new SetCardInfo("Prey Upon", 143, Rarity.COMMON, mage.cards.p.PreyUpon.class)); + cards.add(new SetCardInfo("Price of Fame", 83, Rarity.UNCOMMON, mage.cards.p.PriceOfFame.class)); + cards.add(new SetCardInfo("Quasiduplicate", 51, Rarity.RARE, mage.cards.q.Quasiduplicate.class)); + cards.add(new SetCardInfo("Radical Idea", 52, Rarity.COMMON, mage.cards.r.RadicalIdea.class)); + cards.add(new SetCardInfo("Ral's Dispersal", 266, Rarity.RARE, mage.cards.r.RalsDispersal.class)); + cards.add(new SetCardInfo("Ral's Staticaster", 268, Rarity.UNCOMMON, mage.cards.r.RalsStaticaster.class)); + cards.add(new SetCardInfo("Ral, Caller of Storms", 265, Rarity.MYTHIC, mage.cards.r.RalCallerOfStorms.class)); + cards.add(new SetCardInfo("Ral, Izzet Viceroy", 195, Rarity.MYTHIC, mage.cards.r.RalIzzetViceroy.class)); + cards.add(new SetCardInfo("Rampaging Monument", 239, Rarity.UNCOMMON, mage.cards.r.RampagingMonument.class)); + cards.add(new SetCardInfo("Response // Resurgence", 229, Rarity.RARE, mage.cards.r.ResponseResurgence.class)); + cards.add(new SetCardInfo("Rhizome Lurcher", 196, Rarity.COMMON, mage.cards.r.RhizomeLurcher.class)); + cards.add(new SetCardInfo("Righteous Blow", 23, Rarity.COMMON, mage.cards.r.RighteousBlow.class)); + cards.add(new SetCardInfo("Risk Factor", 113, Rarity.RARE, mage.cards.r.RiskFactor.class)); + cards.add(new SetCardInfo("Ritual of Soot", 84, Rarity.RARE, mage.cards.r.RitualOfSoot.class)); + cards.add(new SetCardInfo("Roc Charger", 24, Rarity.UNCOMMON, mage.cards.r.RocCharger.class)); + cards.add(new SetCardInfo("Rosemane Centaur", 197, Rarity.COMMON, mage.cards.r.RosemaneCentaur.class)); + cards.add(new SetCardInfo("Rubblebelt Boar", 114, Rarity.COMMON, mage.cards.r.RubblebeltBoar.class)); + cards.add(new SetCardInfo("Runaway Steam-Kin", 115, Rarity.RARE, mage.cards.r.RunawaySteamKin.class)); + cards.add(new SetCardInfo("Sacred Foundry", 254, Rarity.RARE, mage.cards.s.SacredFoundry.class)); + cards.add(new SetCardInfo("Selective Snare", 53, Rarity.UNCOMMON, mage.cards.s.SelectiveSnare.class)); + cards.add(new SetCardInfo("Selesnya Guildgate", 255, Rarity.COMMON, mage.cards.s.SelesnyaGuildgate.class)); + cards.add(new SetCardInfo("Selesnya Guildgate", 256, Rarity.COMMON, mage.cards.s.SelesnyaGuildgate.class)); + cards.add(new SetCardInfo("Selesnya Locket", 240, Rarity.COMMON, mage.cards.s.SelesnyaLocket.class)); + cards.add(new SetCardInfo("Severed Strands", 85, Rarity.COMMON, mage.cards.s.SeveredStrands.class)); + cards.add(new SetCardInfo("Siege Wurm", 144, Rarity.COMMON, mage.cards.s.SiegeWurm.class)); + cards.add(new SetCardInfo("Silent Dart", 241, Rarity.UNCOMMON, mage.cards.s.SilentDart.class)); + cards.add(new SetCardInfo("Sinister Sabotage", 54, Rarity.UNCOMMON, mage.cards.s.SinisterSabotage.class)); + cards.add(new SetCardInfo("Skyknight Legionnaire", 198, Rarity.COMMON, mage.cards.s.SkyknightLegionnaire.class)); + cards.add(new SetCardInfo("Skyline Scout", 25, Rarity.COMMON, mage.cards.s.SkylineScout.class)); + cards.add(new SetCardInfo("Smelt-Ward Minotaur", 116, Rarity.UNCOMMON, mage.cards.s.SmeltWardMinotaur.class)); + cards.add(new SetCardInfo("Sonic Assault", 199, Rarity.COMMON, mage.cards.s.SonicAssault.class)); + cards.add(new SetCardInfo("Spinal Centipede", 86, Rarity.COMMON, mage.cards.s.SpinalCentipede.class)); + cards.add(new SetCardInfo("Sprouting Renewal", 145, Rarity.UNCOMMON, mage.cards.s.SproutingRenewal.class)); + cards.add(new SetCardInfo("Status // Statue", 230, Rarity.UNCOMMON, mage.cards.s.StatusStatue.class)); + cards.add(new SetCardInfo("Steam Vents", 257, Rarity.RARE, mage.cards.s.SteamVents.class)); + cards.add(new SetCardInfo("Street Riot", 117, Rarity.UNCOMMON, mage.cards.s.StreetRiot.class)); + cards.add(new SetCardInfo("Sumala Woodshaper", 200, Rarity.COMMON, mage.cards.s.SumalaWoodshaper.class)); + cards.add(new SetCardInfo("Sunhome Stalwart", 26, Rarity.UNCOMMON, mage.cards.s.SunhomeStalwart.class)); + cards.add(new SetCardInfo("Sure Strike", 118, Rarity.COMMON, mage.cards.s.SureStrike.class)); + cards.add(new SetCardInfo("Swamp", 262, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swarm Guildmage", 201, Rarity.UNCOMMON, mage.cards.s.SwarmGuildmage.class)); + cards.add(new SetCardInfo("Swathcutter Giant", 202, Rarity.UNCOMMON, mage.cards.s.SwathcutterGiant.class)); + cards.add(new SetCardInfo("Swiftblade Vindicator", 203, Rarity.RARE, mage.cards.s.SwiftbladeVindicator.class)); + cards.add(new SetCardInfo("Sworn Companions", 27, Rarity.COMMON, mage.cards.s.SwornCompanions.class)); + cards.add(new SetCardInfo("Tajic, Legion's Edge", 204, Rarity.RARE, mage.cards.t.TajicLegionsEdge.class)); + cards.add(new SetCardInfo("Take Heart", 28, Rarity.COMMON, mage.cards.t.TakeHeart.class)); + cards.add(new SetCardInfo("Temple Garden", 258, Rarity.RARE, mage.cards.t.TempleGarden.class)); + cards.add(new SetCardInfo("Tenth District Guard", 29, Rarity.COMMON, mage.cards.t.TenthDistrictGuard.class)); + cards.add(new SetCardInfo("Thief of Sanity", 205, Rarity.RARE, mage.cards.t.ThiefOfSanity.class)); + cards.add(new SetCardInfo("Thought Erasure", 206, Rarity.UNCOMMON, mage.cards.t.ThoughtErasure.class)); + cards.add(new SetCardInfo("Thoughtbound Phantasm", 55, Rarity.UNCOMMON, mage.cards.t.ThoughtboundPhantasm.class)); + cards.add(new SetCardInfo("Thousand-Year Storm", 207, Rarity.MYTHIC, mage.cards.t.ThousandYearStorm.class)); + cards.add(new SetCardInfo("Torch Courier", 119, Rarity.COMMON, mage.cards.t.TorchCourier.class)); + cards.add(new SetCardInfo("Trostani Discordant", 208, Rarity.MYTHIC, mage.cards.t.TrostaniDiscordant.class)); + cards.add(new SetCardInfo("Truefire Captain", 209, Rarity.UNCOMMON, mage.cards.t.TruefireCaptain.class)); + cards.add(new SetCardInfo("Undercity Necrolisk", 87, Rarity.UNCOMMON, mage.cards.u.UndercityNecrolisk.class)); + cards.add(new SetCardInfo("Undercity Uprising", 210, Rarity.COMMON, mage.cards.u.UndercityUprising.class)); + cards.add(new SetCardInfo("Underrealm Lich", 211, Rarity.MYTHIC, mage.cards.u.UnderrealmLich.class)); + cards.add(new SetCardInfo("Unexplained Disappearance", 56, Rarity.COMMON, mage.cards.u.UnexplainedDisappearance.class)); + cards.add(new SetCardInfo("Unmoored Ego", 212, Rarity.RARE, mage.cards.u.UnmooredEgo.class)); + cards.add(new SetCardInfo("Urban Utopia", 146, Rarity.COMMON, mage.cards.u.UrbanUtopia.class)); + cards.add(new SetCardInfo("Vedalken Mesmerist", 57, Rarity.COMMON, mage.cards.v.VedalkenMesmerist.class)); + cards.add(new SetCardInfo("Veiled Shade", 88, Rarity.COMMON, mage.cards.v.VeiledShade.class)); + cards.add(new SetCardInfo("Venerated Loxodon", 30, Rarity.RARE, mage.cards.v.VeneratedLoxodon.class)); + cards.add(new SetCardInfo("Vernadi Shieldmate", 219, Rarity.COMMON, mage.cards.v.VernadiShieldmate.class)); + cards.add(new SetCardInfo("Vicious Rumors", 89, Rarity.COMMON, mage.cards.v.ViciousRumors.class)); + cards.add(new SetCardInfo("Vigorspore Wurm", 147, Rarity.COMMON, mage.cards.v.VigorsporeWurm.class)); + cards.add(new SetCardInfo("Vivid Revival", 148, Rarity.RARE, mage.cards.v.VividRevival.class)); + cards.add(new SetCardInfo("Vraska's Stoneglare", 272, Rarity.RARE, mage.cards.v.VraskasStoneglare.class)); + cards.add(new SetCardInfo("Vraska, Golgari Queen", 213, Rarity.MYTHIC, mage.cards.v.VraskaGolgariQueen.class)); + cards.add(new SetCardInfo("Vraska, Regal Gorgon", 269, Rarity.MYTHIC, mage.cards.v.VraskaRegalGorgon.class)); + cards.add(new SetCardInfo("Wall of Mist", 58, Rarity.COMMON, mage.cards.w.WallOfMist.class)); + cards.add(new SetCardInfo("Wand of Vertebrae", 242, Rarity.UNCOMMON, mage.cards.w.WandOfVertebrae.class)); + cards.add(new SetCardInfo("Wary Okapi", 149, Rarity.COMMON, mage.cards.w.WaryOkapi.class)); + cards.add(new SetCardInfo("Watcher in the Mist", 59, Rarity.COMMON, mage.cards.w.WatcherInTheMist.class)); + cards.add(new SetCardInfo("Watery Grave", 259, Rarity.RARE, mage.cards.w.WateryGrave.class)); + cards.add(new SetCardInfo("Wee Dragonauts", 214, Rarity.UNCOMMON, mage.cards.w.WeeDragonauts.class)); + cards.add(new SetCardInfo("Whisper Agent", 220, Rarity.COMMON, mage.cards.w.WhisperAgent.class)); + cards.add(new SetCardInfo("Whispering Snitch", 90, Rarity.UNCOMMON, mage.cards.w.WhisperingSnitch.class)); + cards.add(new SetCardInfo("Wild Ceratok", 150, Rarity.COMMON, mage.cards.w.WildCeratok.class)); + cards.add(new SetCardInfo("Wishcoin Crab", 60, Rarity.COMMON, mage.cards.w.WishcoinCrab.class)); + cards.add(new SetCardInfo("Wojek Bodyguard", 120, Rarity.COMMON, mage.cards.w.WojekBodyguard.class)); + cards.add(new SetCardInfo("Worldsoul Colossus", 215, Rarity.UNCOMMON, mage.cards.w.WorldsoulColossus.class)); + } + + @Override + public List<CardInfo> getCardsByRarity(Rarity rarity) { + if (rarity == Rarity.COMMON) { + List<CardInfo> savedCardsInfos = savedCards.get(rarity); + if (savedCardsInfos == null) { + CardCriteria criteria = new CardCriteria(); + criteria.setCodes(this.code).notTypes(CardType.LAND); + criteria.rarities(rarity).doubleFaced(false); + savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster); + } + criteria = new CardCriteria(); + // Gateway Plaza is a normal common: https://twitter.com/EliShffrn/status/1043156989218414593s + criteria.setCodes(this.code).nameExact("Gateway Plaza"); + savedCardsInfos.addAll(CardRepository.instance.findCards(criteria)); + savedCards.put(rarity, savedCardsInfos); + } + // Return a copy of the saved cards information, as not to modify the original. + return new ArrayList<>(savedCardsInfos); + } else { + return super.getCardsByRarity(rarity); + } + } + + @Override + public List<CardInfo> getSpecialCommon() { + List<CardInfo> specialCards = getCardsByRarity(Rarity.SPECIAL); + if (specialCards.isEmpty()) { + CardCriteria criteria = new CardCriteria(); + criteria.rarities(Rarity.COMMON).setCodes(this.code).name("Guildgate"); + List<CardInfo> specialCardsSave = CardRepository.instance.findCards(criteria); + savedCards.put(Rarity.SPECIAL, specialCardsSave); + specialCards.addAll(specialCardsSave); + } + return specialCards; + } +} diff --git a/Mage.Sets/src/mage/sets/Homelands.java b/Mage.Sets/src/mage/sets/Homelands.java index 52e35f6772..3d9b71f53b 100644 --- a/Mage.Sets/src/mage/sets/Homelands.java +++ b/Mage.Sets/src/mage/sets/Homelands.java @@ -76,7 +76,7 @@ public final class Homelands extends ExpansionSet { cards.add(new SetCardInfo("Chain Stasis", 23, Rarity.RARE, mage.cards.c.ChainStasis.class)); cards.add(new SetCardInfo("Chandler", 69, Rarity.COMMON, mage.cards.c.Chandler.class)); cards.add(new SetCardInfo("Clockwork Gnomes", 102, Rarity.COMMON, mage.cards.c.ClockworkGnomes.class)); - cards.add(new SetCardInfo("Clockwork Steed", 103, Rarity.UNCOMMON, mage.cards.c.ClockworkSteed.class)); + cards.add(new SetCardInfo("Clockwork Steed", 103, Rarity.COMMON, mage.cards.c.ClockworkSteed.class)); cards.add(new SetCardInfo("Clockwork Swarm", 104, Rarity.COMMON, mage.cards.c.ClockworkSwarm.class)); cards.add(new SetCardInfo("Coral Reef", 24, Rarity.COMMON, mage.cards.c.CoralReef.class)); cards.add(new SetCardInfo("Dark Maze", "25a", Rarity.COMMON, mage.cards.d.DarkMaze.class, NON_FULL_USE_VARIOUS)); @@ -101,13 +101,13 @@ public final class Homelands extends ExpansionSet { cards.add(new SetCardInfo("Folk of An-Havva", "87a", Rarity.COMMON, FolkOfAnHavva.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Folk of An-Havva", "87b", Rarity.COMMON, FolkOfAnHavva.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forget", 26, Rarity.RARE, mage.cards.f.Forget.class)); - cards.add(new SetCardInfo("Funeral March", 48, Rarity.UNCOMMON, mage.cards.f.FuneralMarch.class)); + cards.add(new SetCardInfo("Funeral March", 48, Rarity.COMMON, mage.cards.f.FuneralMarch.class)); cards.add(new SetCardInfo("Ghost Hounds", 49, Rarity.UNCOMMON, mage.cards.g.GhostHounds.class)); cards.add(new SetCardInfo("Giant Oyster", 28, Rarity.UNCOMMON, mage.cards.g.GiantOyster.class)); cards.add(new SetCardInfo("Giant Albatross", "27a", Rarity.COMMON, mage.cards.g.GiantAlbatross.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Giant Albatross", "27b", Rarity.COMMON, mage.cards.g.GiantAlbatross.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Grandmother Sengir", 50, Rarity.RARE, mage.cards.g.GrandmotherSengir.class)); - cards.add(new SetCardInfo("Greater Werewolf", 51, Rarity.UNCOMMON, mage.cards.g.GreaterWerewolf.class)); + cards.add(new SetCardInfo("Greater Werewolf", 51, Rarity.COMMON, mage.cards.g.GreaterWerewolf.class)); cards.add(new SetCardInfo("Hazduhr the Abbot", 8, Rarity.RARE, mage.cards.h.HazduhrTheAbbot.class)); cards.add(new SetCardInfo("Headstone", 52, Rarity.COMMON, mage.cards.h.Headstone.class)); cards.add(new SetCardInfo("Heart Wolf", 75, Rarity.RARE, mage.cards.h.HeartWolf.class)); @@ -137,7 +137,7 @@ public final class Homelands extends ExpansionSet { cards.add(new SetCardInfo("Orcish Mine", 78, Rarity.UNCOMMON, mage.cards.o.OrcishMine.class)); cards.add(new SetCardInfo("Primal Order", 92, Rarity.RARE, mage.cards.p.PrimalOrder.class)); cards.add(new SetCardInfo("Prophecy", 11, Rarity.COMMON, mage.cards.p.Prophecy.class)); - cards.add(new SetCardInfo("Rashka the Slayer", 12, Rarity.RARE, mage.cards.r.RashkaTheSlayer.class)); + cards.add(new SetCardInfo("Rashka the Slayer", 12, Rarity.UNCOMMON, mage.cards.r.RashkaTheSlayer.class)); cards.add(new SetCardInfo("Reef Pirates", "36a", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Reef Pirates", "36b", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Renewal", 93, Rarity.COMMON, mage.cards.r.Renewal.class)); @@ -154,7 +154,7 @@ public final class Homelands extends ExpansionSet { cards.add(new SetCardInfo("Sengir Bats", "57a", Rarity.COMMON, SengirBats.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sengir Bats", "57b", Rarity.COMMON, SengirBats.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Serra Aviary", 14, Rarity.RARE, mage.cards.s.SerraAviary.class)); - cards.add(new SetCardInfo("Serra Bestiary", 15, Rarity.UNCOMMON, mage.cards.s.SerraBestiary.class)); + cards.add(new SetCardInfo("Serra Bestiary", 15, Rarity.COMMON, mage.cards.s.SerraBestiary.class)); cards.add(new SetCardInfo("Serra Inquisitors", 16, Rarity.UNCOMMON, mage.cards.s.SerraInquisitors.class)); cards.add(new SetCardInfo("Serra Paladin", 17, Rarity.COMMON, mage.cards.s.SerraPaladin.class)); cards.add(new SetCardInfo("Serrated Arrows", 110, Rarity.COMMON, mage.cards.s.SerratedArrows.class)); diff --git a/Mage.Sets/src/mage/sets/Magic2011.java b/Mage.Sets/src/mage/sets/Magic2011.java index e393fded7e..7ac019836b 100644 --- a/Mage.Sets/src/mage/sets/Magic2011.java +++ b/Mage.Sets/src/mage/sets/Magic2011.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -70,7 +69,7 @@ public final class Magic2011 extends ExpansionSet { cards.add(new SetCardInfo("Clone", 49, Rarity.RARE, mage.cards.c.Clone.class)); cards.add(new SetCardInfo("Cloud Crusader", 10, Rarity.COMMON, mage.cards.c.CloudCrusader.class)); cards.add(new SetCardInfo("Cloud Elemental", 50, Rarity.COMMON, mage.cards.c.CloudElemental.class)); - cards.add(new SetCardInfo("Combust", 130, Rarity.COMMON, mage.cards.c.Combust.class)); + cards.add(new SetCardInfo("Combust", 130, Rarity.UNCOMMON, mage.cards.c.Combust.class)); cards.add(new SetCardInfo("Condemn", 11, Rarity.UNCOMMON, mage.cards.c.Condemn.class)); cards.add(new SetCardInfo("Conundrum Sphinx", 51, Rarity.RARE, mage.cards.c.ConundrumSphinx.class)); cards.add(new SetCardInfo("Corrupt", 89, Rarity.UNCOMMON, mage.cards.c.Corrupt.class)); @@ -95,7 +94,7 @@ public final class Magic2011 extends ExpansionSet { cards.add(new SetCardInfo("Dryad's Favor", 169, Rarity.COMMON, mage.cards.d.DryadsFavor.class)); cards.add(new SetCardInfo("Duress", 96, Rarity.COMMON, mage.cards.d.Duress.class)); cards.add(new SetCardInfo("Duskdale Wurm", 170, Rarity.UNCOMMON, mage.cards.d.DuskdaleWurm.class)); - cards.add(new SetCardInfo("Earth Servant", 134, Rarity.COMMON, mage.cards.e.EarthServant.class)); + cards.add(new SetCardInfo("Earth Servant", 134, Rarity.UNCOMMON, mage.cards.e.EarthServant.class)); cards.add(new SetCardInfo("Elite Vanguard", 13, Rarity.UNCOMMON, mage.cards.e.EliteVanguard.class)); cards.add(new SetCardInfo("Elixir of Immortality", 206, Rarity.UNCOMMON, mage.cards.e.ElixirOfImmortality.class)); cards.add(new SetCardInfo("Elvish Archdruid", 171, Rarity.RARE, mage.cards.e.ElvishArchdruid.class)); diff --git a/Mage.Sets/src/mage/sets/Magic2012.java b/Mage.Sets/src/mage/sets/Magic2012.java index 3d2d8fcdd5..5e4480d5d0 100644 --- a/Mage.Sets/src/mage/sets/Magic2012.java +++ b/Mage.Sets/src/mage/sets/Magic2012.java @@ -1,8 +1,6 @@ - package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.g.GoblinGrenade; import mage.constants.Rarity; import mage.constants.SetType; @@ -70,7 +68,7 @@ public final class Magic2012 extends ExpansionSet { cards.add(new SetCardInfo("Chasm Drake", 48, Rarity.COMMON, mage.cards.c.ChasmDrake.class)); cards.add(new SetCardInfo("Child of Night", 87, Rarity.COMMON, mage.cards.c.ChildOfNight.class)); cards.add(new SetCardInfo("Circle of Flame", 127, Rarity.UNCOMMON, mage.cards.c.CircleOfFlame.class)); - cards.add(new SetCardInfo("Combust", 128, Rarity.COMMON, mage.cards.c.Combust.class)); + cards.add(new SetCardInfo("Combust", 128, Rarity.UNCOMMON, mage.cards.c.Combust.class)); cards.add(new SetCardInfo("Consume Spirit", 88, Rarity.UNCOMMON, mage.cards.c.ConsumeSpirit.class)); cards.add(new SetCardInfo("Coral Merfolk", 49, Rarity.COMMON, mage.cards.c.CoralMerfolk.class)); cards.add(new SetCardInfo("Crimson Mage", 129, Rarity.UNCOMMON, mage.cards.c.CrimsonMage.class)); @@ -129,7 +127,7 @@ public final class Magic2012 extends ExpansionSet { cards.add(new SetCardInfo("Goblin Bangchuckers", 137, Rarity.UNCOMMON, mage.cards.g.GoblinBangchuckers.class)); cards.add(new SetCardInfo("Goblin Chieftain", 138, Rarity.RARE, mage.cards.g.GoblinChieftain.class)); cards.add(new SetCardInfo("Goblin Fireslinger", 139, Rarity.COMMON, mage.cards.g.GoblinFireslinger.class)); - cards.add(new SetCardInfo("Goblin Grenade", 140, Rarity.UNCOMMON, GoblinGrenade.class)); + cards.add(new SetCardInfo("Goblin Grenade", 140, Rarity.UNCOMMON, mage.cards.g.GoblinGrenade.class)); cards.add(new SetCardInfo("Goblin Piker", 141, Rarity.COMMON, mage.cards.g.GoblinPiker.class)); cards.add(new SetCardInfo("Goblin Tunneler", 142, Rarity.COMMON, mage.cards.g.GoblinTunneler.class)); cards.add(new SetCardInfo("Goblin War Paint", 143, Rarity.COMMON, mage.cards.g.GoblinWarPaint.class)); diff --git a/Mage.Sets/src/mage/sets/Magic2014.java b/Mage.Sets/src/mage/sets/Magic2014.java index 1aaa2ae4f1..be6793a89b 100644 --- a/Mage.Sets/src/mage/sets/Magic2014.java +++ b/Mage.Sets/src/mage/sets/Magic2014.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -77,7 +76,7 @@ public final class Magic2014 extends ExpansionSet { cards.add(new SetCardInfo("Dark Favor", 92, Rarity.COMMON, mage.cards.d.DarkFavor.class)); cards.add(new SetCardInfo("Dark Prophecy", 93, Rarity.RARE, mage.cards.d.DarkProphecy.class)); cards.add(new SetCardInfo("Darksteel Forge", 206, Rarity.MYTHIC, mage.cards.d.DarksteelForge.class)); - cards.add(new SetCardInfo("Darksteel Ingot", 207, Rarity.COMMON, mage.cards.d.DarksteelIngot.class)); + cards.add(new SetCardInfo("Darksteel Ingot", 207, Rarity.UNCOMMON, mage.cards.d.DarksteelIngot.class)); cards.add(new SetCardInfo("Dawnstrike Paladin", 15, Rarity.COMMON, mage.cards.d.DawnstrikePaladin.class)); cards.add(new SetCardInfo("Deadly Recluse", 168, Rarity.COMMON, mage.cards.d.DeadlyRecluse.class)); cards.add(new SetCardInfo("Deathgaze Cockatrice", 94, Rarity.COMMON, mage.cards.d.DeathgazeCockatrice.class)); @@ -213,7 +212,7 @@ public final class Magic2014 extends ExpansionSet { cards.add(new SetCardInfo("Serra Angel", 32, Rarity.UNCOMMON, mage.cards.s.SerraAngel.class)); cards.add(new SetCardInfo("Shadowborn Apostle", 114, Rarity.COMMON, mage.cards.s.ShadowbornApostle.class)); cards.add(new SetCardInfo("Shadowborn Demon", 115, Rarity.MYTHIC, mage.cards.s.ShadowbornDemon.class)); - cards.add(new SetCardInfo("Shimmering Grotto", 229, Rarity.COMMON, mage.cards.s.ShimmeringGrotto.class)); + cards.add(new SetCardInfo("Shimmering Grotto", 229, Rarity.UNCOMMON, mage.cards.s.ShimmeringGrotto.class)); cards.add(new SetCardInfo("Shivan Dragon", 154, Rarity.RARE, mage.cards.s.ShivanDragon.class)); cards.add(new SetCardInfo("Shiv's Embrace", 153, Rarity.UNCOMMON, mage.cards.s.ShivsEmbrace.class)); cards.add(new SetCardInfo("Shock", 155, Rarity.COMMON, mage.cards.s.Shock.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEditionIV.java b/Mage.Sets/src/mage/sets/MastersEditionIV.java index 8658d66d9b..505fa1bd67 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIV.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIV.java @@ -318,4 +318,4 @@ public final class MastersEditionIV extends ExpansionSet { return new ArrayList<>(savedSpecialLand); } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 73f52e9903..a1110e968c 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -309,7 +308,7 @@ public final class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Stinging Barrier", 107, Rarity.COMMON, mage.cards.s.StingingBarrier.class)); cards.add(new SetCardInfo("Stone Rain", 215, Rarity.COMMON, mage.cards.s.StoneRain.class)); cards.add(new SetCardInfo("Story Circle", 51, Rarity.UNCOMMON, mage.cards.s.StoryCircle.class)); - cards.add(new SetCardInfo("Strongarm Thug", 165, Rarity.COMMON, mage.cards.s.StrongarmThug.class)); + cards.add(new SetCardInfo("Strongarm Thug", 165, Rarity.UNCOMMON, mage.cards.s.StrongarmThug.class)); cards.add(new SetCardInfo("Subterranean Hangar", 329, Rarity.UNCOMMON, mage.cards.s.SubterraneanHangar.class)); cards.add(new SetCardInfo("Sustenance", 278, Rarity.UNCOMMON, mage.cards.s.Sustenance.class)); cards.add(new SetCardInfo("Swamp", 339, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/MindVsMight.java b/Mage.Sets/src/mage/sets/MindVsMight.java index 48d26f8b5e..0030640825 100644 --- a/Mage.Sets/src/mage/sets/MindVsMight.java +++ b/Mage.Sets/src/mage/sets/MindVsMight.java @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package mage.sets; import mage.cards.ExpansionSet; @@ -36,7 +31,7 @@ public final class MindVsMight extends ExpansionSet { cards.add(new SetCardInfo("Coat of Arms", 58, Rarity.RARE, mage.cards.c.CoatOfArms.class)); cards.add(new SetCardInfo("Deep-Sea Kraken", 3, Rarity.RARE, mage.cards.d.DeepSeaKraken.class)); cards.add(new SetCardInfo("Desperate Ritual", 14, Rarity.UNCOMMON, mage.cards.d.DesperateRitual.class)); - cards.add(new SetCardInfo("Empty the Warrens", 15, Rarity.RARE, mage.cards.e.EmptyTheWarrens.class)); + cards.add(new SetCardInfo("Empty the Warrens", 15, Rarity.COMMON, mage.cards.e.EmptyTheWarrens.class)); cards.add(new SetCardInfo("Firebolt", 37, Rarity.COMMON, mage.cards.f.Firebolt.class)); cards.add(new SetCardInfo("Firemind's Foresight", 21, Rarity.RARE, mage.cards.f.FiremindsForesight.class)); cards.add(new SetCardInfo("Forest", 63, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 845414da3a..bfe9319576 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -100,6 +100,7 @@ public final class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Ebony Charm", 120, Rarity.COMMON, mage.cards.e.EbonyCharm.class)); cards.add(new SetCardInfo("Ekundu Griffin", 13, Rarity.COMMON, mage.cards.e.EkunduGriffin.class)); cards.add(new SetCardInfo("Elixir of Vitality", 300, Rarity.UNCOMMON, mage.cards.e.ElixirOfVitality.class)); + cards.add(new SetCardInfo("Emberwilde Caliph", 322, Rarity.RARE, mage.cards.e.EmberwildeCaliph.class)); cards.add(new SetCardInfo("Emberwilde Djinn", 172, Rarity.RARE, mage.cards.e.EmberwildeDjinn.class)); cards.add(new SetCardInfo("Energy Bolt", 263, Rarity.RARE, mage.cards.e.EnergyBolt.class)); cards.add(new SetCardInfo("Enfeeblement", 121, Rarity.COMMON, mage.cards.e.Enfeeblement.class)); @@ -244,6 +245,7 @@ public final class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Ritual of Steel", 36, Rarity.COMMON, mage.cards.r.RitualOfSteel.class)); cards.add(new SetCardInfo("Rock Basilisk", 279, Rarity.RARE, mage.cards.r.RockBasilisk.class)); cards.add(new SetCardInfo("Rocky Tar Pit", 329, Rarity.UNCOMMON, mage.cards.r.RockyTarPit.class)); + cards.add(new SetCardInfo("Roots of Life", 237, Rarity.UNCOMMON, mage.cards.r.RootsOfLife.class)); cards.add(new SetCardInfo("Sabertooth Cobra", 238, Rarity.COMMON, mage.cards.s.SabertoothCobra.class)); cards.add(new SetCardInfo("Sacred Mesa", 37, Rarity.RARE, mage.cards.s.SacredMesa.class)); cards.add(new SetCardInfo("Sandbar Crocodile", 88, Rarity.COMMON, mage.cards.s.SandbarCrocodile.class)); diff --git a/Mage.Sets/src/mage/sets/ModernMasters2015.java b/Mage.Sets/src/mage/sets/ModernMasters2015.java index 0e8f97315e..3230298231 100644 --- a/Mage.Sets/src/mage/sets/ModernMasters2015.java +++ b/Mage.Sets/src/mage/sets/ModernMasters2015.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -243,7 +242,7 @@ public final class ModernMasters2015 extends ExpansionSet { cards.add(new SetCardInfo("Sylvan Bounty", 164, Rarity.COMMON, mage.cards.s.SylvanBounty.class)); cards.add(new SetCardInfo("Taj-Nar Swordsmith", 36, Rarity.UNCOMMON, mage.cards.t.TajNarSwordsmith.class)); cards.add(new SetCardInfo("Tarmogoyf", 165, Rarity.MYTHIC, mage.cards.t.Tarmogoyf.class)); - cards.add(new SetCardInfo("Telling Time", 61, Rarity.UNCOMMON, mage.cards.t.TellingTime.class)); + cards.add(new SetCardInfo("Telling Time", 61, Rarity.COMMON, mage.cards.t.TellingTime.class)); cards.add(new SetCardInfo("Terashi's Grasp", 37, Rarity.COMMON, mage.cards.t.TerashisGrasp.class)); cards.add(new SetCardInfo("Tezzeret's Gambit", 63, Rarity.UNCOMMON, mage.cards.t.TezzeretsGambit.class)); cards.add(new SetCardInfo("Tezzeret the Seeker", 62, Rarity.MYTHIC, mage.cards.t.TezzeretTheSeeker.class)); diff --git a/Mage.Sets/src/mage/sets/NinthEdition.java b/Mage.Sets/src/mage/sets/NinthEdition.java index 2996fb9c07..02a6e2dbc2 100644 --- a/Mage.Sets/src/mage/sets/NinthEdition.java +++ b/Mage.Sets/src/mage/sets/NinthEdition.java @@ -338,9 +338,9 @@ public final class NinthEdition extends ExpansionSet { cards.add(new SetCardInfo("Underworld Dreams", 167, Rarity.RARE, mage.cards.u.UnderworldDreams.class)); cards.add(new SetCardInfo("Unholy Strength", 168, Rarity.COMMON, mage.cards.u.UnholyStrength.class)); cards.add(new SetCardInfo("Ur-Golem's Eye", 314, Rarity.UNCOMMON, mage.cards.u.UrGolemsEye.class)); - cards.add(new SetCardInfo("Urza's Mine", 327, Rarity.COMMON, mage.cards.u.UrzasMine.class)); - cards.add(new SetCardInfo("Urza's Power Plant", 328, Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class)); - cards.add(new SetCardInfo("Urza's Tower", 329, Rarity.COMMON, mage.cards.u.UrzasTower.class)); + cards.add(new SetCardInfo("Urza's Mine", 327, Rarity.UNCOMMON, mage.cards.u.UrzasMine.class)); + cards.add(new SetCardInfo("Urza's Power Plant", 328, Rarity.UNCOMMON, mage.cards.u.UrzasPowerPlant.class)); + cards.add(new SetCardInfo("Urza's Tower", 329, Rarity.UNCOMMON, mage.cards.u.UrzasTower.class)); cards.add(new SetCardInfo("Utopia Tree", 277, Rarity.RARE, mage.cards.u.UtopiaTree.class)); cards.add(new SetCardInfo("Venerable Monk", 51, Rarity.COMMON, mage.cards.v.VenerableMonk.class)); cards.add(new SetCardInfo("Verdant Force", 278, Rarity.RARE, mage.cards.v.VerdantForce.class)); diff --git a/Mage.Sets/src/mage/sets/NissaVsObNixilis.java b/Mage.Sets/src/mage/sets/NissaVsObNixilis.java index 9a814fd36d..30216d2d59 100644 --- a/Mage.Sets/src/mage/sets/NissaVsObNixilis.java +++ b/Mage.Sets/src/mage/sets/NissaVsObNixilis.java @@ -37,7 +37,7 @@ public final class NissaVsObNixilis extends ExpansionSet { cards.add(new SetCardInfo("Desecration Demon", 44, Rarity.RARE, mage.cards.d.DesecrationDemon.class)); cards.add(new SetCardInfo("Despoiler of Souls", 45, Rarity.RARE, mage.cards.d.DespoilerOfSouls.class)); cards.add(new SetCardInfo("Disfigure", 46, Rarity.COMMON, mage.cards.d.Disfigure.class)); - cards.add(new SetCardInfo("Doom Blade", 47, Rarity.COMMON, mage.cards.d.DoomBlade.class)); + cards.add(new SetCardInfo("Doom Blade", 47, Rarity.UNCOMMON, mage.cards.d.DoomBlade.class)); cards.add(new SetCardInfo("Elvish Visionary", 8, Rarity.COMMON, mage.cards.e.ElvishVisionary.class)); cards.add(new SetCardInfo("Fertile Thicket", 27, Rarity.COMMON, mage.cards.f.FertileThicket.class)); cards.add(new SetCardInfo("Fertilid", 9, Rarity.COMMON, mage.cards.f.Fertilid.class)); @@ -88,7 +88,7 @@ public final class NissaVsObNixilis extends ExpansionSet { cards.add(new SetCardInfo("Treetop Village", 30, Rarity.UNCOMMON, mage.cards.t.TreetopVillage.class)); cards.add(new SetCardInfo("Unhallowed Pact", 64, Rarity.COMMON, mage.cards.u.UnhallowedPact.class)); cards.add(new SetCardInfo("Vines of the Recluse", 23, Rarity.COMMON, mage.cards.v.VinesOfTheRecluse.class)); - cards.add(new SetCardInfo("Walker of the Grove", 24, Rarity.COMMON, mage.cards.w.WalkerOfTheGrove.class)); + cards.add(new SetCardInfo("Walker of the Grove", 24, Rarity.UNCOMMON, mage.cards.w.WalkerOfTheGrove.class)); cards.add(new SetCardInfo("Woodborn Behemoth", 26, Rarity.UNCOMMON, mage.cards.w.WoodbornBehemoth.class)); cards.add(new SetCardInfo("Wood Elves", 25, Rarity.COMMON, mage.cards.w.WoodElves.class)); } diff --git a/Mage.Sets/src/mage/sets/Odyssey.java b/Mage.Sets/src/mage/sets/Odyssey.java index b730110daa..ac86aa2ac8 100644 --- a/Mage.Sets/src/mage/sets/Odyssey.java +++ b/Mage.Sets/src/mage/sets/Odyssey.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -297,7 +296,7 @@ public final class Odyssey extends ExpansionSet { cards.add(new SetCardInfo("Second Thoughts", 45, Rarity.COMMON, mage.cards.s.SecondThoughts.class)); cards.add(new SetCardInfo("Seize the Day", 220, Rarity.RARE, mage.cards.s.SeizeTheDay.class)); cards.add(new SetCardInfo("Seton, Krosan Protector", 267, Rarity.RARE, mage.cards.s.SetonKrosanProtector.class)); - cards.add(new SetCardInfo("Seton's Desire", 268, Rarity.UNCOMMON, mage.cards.s.SetonsDesire.class)); + cards.add(new SetCardInfo("Seton's Desire", 268, Rarity.COMMON, mage.cards.s.SetonsDesire.class)); cards.add(new SetCardInfo("Shadowblood Egg", 308, Rarity.UNCOMMON, mage.cards.s.ShadowbloodEgg.class)); cards.add(new SetCardInfo("Shadowblood Ridge", 326, Rarity.RARE, mage.cards.s.ShadowbloodRidge.class)); cards.add(new SetCardInfo("Shadowmage Infiltrator", 294, Rarity.RARE, mage.cards.s.ShadowmageInfiltrator.class)); diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 4f6bfaebab..59bdc6e657 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -350,7 +350,7 @@ public final class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Windswept Heath", 328, Rarity.RARE, mage.cards.w.WindsweptHeath.class, new CardGraphicInfo(new ObjectColor("GW"), null, false))); cards.add(new SetCardInfo("Wirewood Elf", 301, Rarity.COMMON, mage.cards.w.WirewoodElf.class)); cards.add(new SetCardInfo("Wirewood Herald", 302, Rarity.COMMON, mage.cards.w.WirewoodHerald.class)); - cards.add(new SetCardInfo("Wirewood Lodge", 329, Rarity.RARE, mage.cards.w.WirewoodLodge.class)); + cards.add(new SetCardInfo("Wirewood Lodge", 329, Rarity.UNCOMMON, mage.cards.w.WirewoodLodge.class)); cards.add(new SetCardInfo("Wirewood Pride", 303, Rarity.COMMON, mage.cards.w.WirewoodPride.class)); cards.add(new SetCardInfo("Wirewood Savage", 304, Rarity.COMMON, mage.cards.w.WirewoodSavage.class)); cards.add(new SetCardInfo("Withering Hex", 181, Rarity.UNCOMMON, mage.cards.w.WitheringHex.class)); diff --git a/Mage.Sets/src/mage/sets/Planechase2012.java b/Mage.Sets/src/mage/sets/Planechase2012.java index e13d480a03..70ea2b24fa 100644 --- a/Mage.Sets/src/mage/sets/Planechase2012.java +++ b/Mage.Sets/src/mage/sets/Planechase2012.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -50,7 +49,7 @@ public final class Planechase2012 extends ExpansionSet { cards.add(new SetCardInfo("Dimir Infiltrator", 86, Rarity.COMMON, mage.cards.d.DimirInfiltrator.class)); cards.add(new SetCardInfo("Dowsing Shaman", 63, Rarity.UNCOMMON, mage.cards.d.DowsingShaman.class)); cards.add(new SetCardInfo("Dragonlair Spider", 87, Rarity.RARE, mage.cards.d.DragonlairSpider.class)); - cards.add(new SetCardInfo("Dreampod Druid", 64, Rarity.RARE, mage.cards.d.DreampodDruid.class)); + cards.add(new SetCardInfo("Dreampod Druid", 64, Rarity.UNCOMMON, mage.cards.d.DreampodDruid.class)); cards.add(new SetCardInfo("Elderwood Scion", 88, Rarity.RARE, mage.cards.e.ElderwoodScion.class)); cards.add(new SetCardInfo("Enigma Sphinx", 89, Rarity.RARE, mage.cards.e.EnigmaSphinx.class)); cards.add(new SetCardInfo("Enlisted Wurm", 90, Rarity.UNCOMMON, mage.cards.e.EnlistedWurm.class)); diff --git a/Mage.Sets/src/mage/sets/Shadowmoor.java b/Mage.Sets/src/mage/sets/Shadowmoor.java index 27144ed832..769955a781 100644 --- a/Mage.Sets/src/mage/sets/Shadowmoor.java +++ b/Mage.Sets/src/mage/sets/Shadowmoor.java @@ -2,12 +2,10 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.t.Torture; import mage.constants.Rarity; import mage.constants.SetType; /** - * * @author North */ public final class Shadowmoor extends ExpansionSet { @@ -63,17 +61,17 @@ public final class Shadowmoor extends ExpansionSet { cards.add(new SetCardInfo("Consign to Dream", 32, Rarity.COMMON, mage.cards.c.ConsignToDream.class)); cards.add(new SetCardInfo("Corrosive Mentor", 61, Rarity.UNCOMMON, mage.cards.c.CorrosiveMentor.class)); cards.add(new SetCardInfo("Corrupt", 62, Rarity.UNCOMMON, mage.cards.c.Corrupt.class)); - cards.add(new SetCardInfo("Counterbore", 33, Rarity.UNCOMMON, mage.cards.c.Counterbore.class)); + cards.add(new SetCardInfo("Counterbore", 33, Rarity.RARE, mage.cards.c.Counterbore.class)); cards.add(new SetCardInfo("Crabapple Cohort", 109, Rarity.COMMON, mage.cards.c.CrabappleCohort.class)); cards.add(new SetCardInfo("Cragganwick Cremator", 87, Rarity.RARE, mage.cards.c.CragganwickCremator.class)); - cards.add(new SetCardInfo("Crimson Wisps", 88, Rarity.UNCOMMON, mage.cards.c.CrimsonWisps.class)); + cards.add(new SetCardInfo("Crimson Wisps", 88, Rarity.COMMON, mage.cards.c.CrimsonWisps.class)); cards.add(new SetCardInfo("Crowd of Cinders", 63, Rarity.UNCOMMON, mage.cards.c.CrowdOfCinders.class)); cards.add(new SetCardInfo("Cultbrand Cinder", 182, Rarity.COMMON, mage.cards.c.CultbrandCinder.class)); - cards.add(new SetCardInfo("Cursecatcher", 34, Rarity.UNCOMMON, mage.cards.c.Cursecatcher.class)); cards.add(new SetCardInfo("Curse of Chains", 139, Rarity.COMMON, mage.cards.c.CurseOfChains.class)); + cards.add(new SetCardInfo("Cursecatcher", 34, Rarity.UNCOMMON, mage.cards.c.Cursecatcher.class)); cards.add(new SetCardInfo("Dawnglow Infusion", 225, Rarity.UNCOMMON, mage.cards.d.DawnglowInfusion.class)); - cards.add(new SetCardInfo("Deepchannel Mentor", 35, Rarity.UNCOMMON, mage.cards.d.DeepchannelMentor.class)); cards.add(new SetCardInfo("Deep-Slumber Titan", 89, Rarity.RARE, mage.cards.d.DeepSlumberTitan.class)); + cards.add(new SetCardInfo("Deepchannel Mentor", 35, Rarity.UNCOMMON, mage.cards.d.DeepchannelMentor.class)); cards.add(new SetCardInfo("Demigod of Revenge", 183, Rarity.RARE, mage.cards.d.DemigodOfRevenge.class)); cards.add(new SetCardInfo("Deus of Calamity", 204, Rarity.RARE, mage.cards.d.DeusOfCalamity.class)); cards.add(new SetCardInfo("Devoted Druid", 110, Rarity.COMMON, mage.cards.d.DevotedDruid.class)); @@ -169,9 +167,9 @@ public final class Shadowmoor extends ExpansionSet { cards.add(new SetCardInfo("Lockjaw Snapper", 255, Rarity.UNCOMMON, mage.cards.l.LockjawSnapper.class)); cards.add(new SetCardInfo("Lurebound Scarecrow", 256, Rarity.UNCOMMON, mage.cards.l.LureboundScarecrow.class)); cards.add(new SetCardInfo("Madblind Mountain", 274, Rarity.UNCOMMON, mage.cards.m.MadblindMountain.class)); + cards.add(new SetCardInfo("Mana Reflection", 122, Rarity.RARE, mage.cards.m.ManaReflection.class)); cards.add(new SetCardInfo("Manaforge Cinder", 191, Rarity.COMMON, mage.cards.m.ManaforgeCinder.class)); cards.add(new SetCardInfo("Manamorphose", 211, Rarity.COMMON, mage.cards.m.Manamorphose.class)); - cards.add(new SetCardInfo("Mana Reflection", 122, Rarity.RARE, mage.cards.m.ManaReflection.class)); cards.add(new SetCardInfo("Mass Calcify", 12, Rarity.RARE, mage.cards.m.MassCalcify.class)); cards.add(new SetCardInfo("Medicine Runner", 230, Rarity.COMMON, mage.cards.m.MedicineRunner.class)); cards.add(new SetCardInfo("Memory Plunder", 169, Rarity.RARE, mage.cards.m.MemoryPlunder.class)); @@ -199,8 +197,8 @@ public final class Shadowmoor extends ExpansionSet { cards.add(new SetCardInfo("Niveous Wisps", 15, Rarity.COMMON, mage.cards.n.NiveousWisps.class)); cards.add(new SetCardInfo("Nurturer Initiate", 124, Rarity.COMMON, mage.cards.n.NurturerInitiate.class)); cards.add(new SetCardInfo("Old Ghastbark", 232, Rarity.COMMON, mage.cards.o.OldGhastbark.class)); - cards.add(new SetCardInfo("Oona, Queen of the Fae", 172, Rarity.RARE, mage.cards.o.OonaQueenOfTheFae.class)); cards.add(new SetCardInfo("Oona's Gatewarden", 173, Rarity.COMMON, mage.cards.o.OonasGatewarden.class)); + cards.add(new SetCardInfo("Oona, Queen of the Fae", 172, Rarity.RARE, mage.cards.o.OonaQueenOfTheFae.class)); cards.add(new SetCardInfo("Oracle of Nectars", 233, Rarity.RARE, mage.cards.o.OracleOfNectars.class)); cards.add(new SetCardInfo("Order of Whiteclay", 16, Rarity.RARE, mage.cards.o.OrderOfWhiteclay.class)); cards.add(new SetCardInfo("Oversoul of Dusk", 234, Rarity.RARE, mage.cards.o.OversoulOfDusk.class)); @@ -297,7 +295,7 @@ public final class Shadowmoor extends ExpansionSet { cards.add(new SetCardInfo("Toil to Renown", 130, Rarity.COMMON, mage.cards.t.ToilToRenown.class)); cards.add(new SetCardInfo("Torpor Dust", 177, Rarity.COMMON, mage.cards.t.TorporDust.class)); cards.add(new SetCardInfo("Torrent of Souls", 199, Rarity.UNCOMMON, mage.cards.t.TorrentOfSouls.class)); - cards.add(new SetCardInfo("Torture", 80, Rarity.COMMON, Torture.class)); + cards.add(new SetCardInfo("Torture", 80, Rarity.COMMON, mage.cards.t.Torture.class)); cards.add(new SetCardInfo("Tower Above", 131, Rarity.UNCOMMON, mage.cards.t.TowerAbove.class)); cards.add(new SetCardInfo("Traitor's Roar", 200, Rarity.COMMON, mage.cards.t.TraitorsRoar.class)); cards.add(new SetCardInfo("Trip Noose", 266, Rarity.UNCOMMON, mage.cards.t.TripNoose.class)); @@ -314,8 +312,8 @@ public final class Shadowmoor extends ExpansionSet { cards.add(new SetCardInfo("Wheel of Sun and Moon", 243, Rarity.RARE, mage.cards.w.WheelOfSunAndMoon.class)); cards.add(new SetCardInfo("Whimwader", 54, Rarity.COMMON, mage.cards.w.Whimwader.class)); cards.add(new SetCardInfo("Wicker Warcrawler", 269, Rarity.UNCOMMON, mage.cards.w.WickerWarcrawler.class)); - cards.add(new SetCardInfo("Wildslayer Elves", 133, Rarity.COMMON, mage.cards.w.WildslayerElves.class)); cards.add(new SetCardInfo("Wild Swing", 108, Rarity.UNCOMMON, mage.cards.w.WildSwing.class)); + cards.add(new SetCardInfo("Wildslayer Elves", 133, Rarity.COMMON, mage.cards.w.WildslayerElves.class)); cards.add(new SetCardInfo("Wilt-Leaf Cavaliers", 244, Rarity.UNCOMMON, mage.cards.w.WiltLeafCavaliers.class)); cards.add(new SetCardInfo("Wilt-Leaf Liege", 245, Rarity.RARE, mage.cards.w.WiltLeafLiege.class)); cards.add(new SetCardInfo("Windbrisk Raptor", 26, Rarity.RARE, mage.cards.w.WindbriskRaptor.class)); diff --git a/Mage.Sets/src/mage/sets/Starter1999.java b/Mage.Sets/src/mage/sets/Starter1999.java index a2dfcb0487..e7e5d8050c 100644 --- a/Mage.Sets/src/mage/sets/Starter1999.java +++ b/Mage.Sets/src/mage/sets/Starter1999.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -86,7 +85,7 @@ public final class Starter1999 extends ExpansionSet { cards.add(new SetCardInfo("Goblin Commando", 100, Rarity.UNCOMMON, mage.cards.g.GoblinCommando.class)); cards.add(new SetCardInfo("Goblin General", 101, Rarity.UNCOMMON, mage.cards.g.GoblinGeneral.class)); cards.add(new SetCardInfo("Goblin Glider", 102, Rarity.UNCOMMON, mage.cards.g.GoblinGlider.class)); - cards.add(new SetCardInfo("Goblin Hero", 103, Rarity.RARE, mage.cards.g.GoblinHero.class)); + cards.add(new SetCardInfo("Goblin Hero", 103, Rarity.COMMON, mage.cards.g.GoblinHero.class)); cards.add(new SetCardInfo("Goblin Lore", 104, Rarity.UNCOMMON, mage.cards.g.GoblinLore.class)); cards.add(new SetCardInfo("Goblin Mountaineer", 105, Rarity.COMMON, mage.cards.g.GoblinMountaineer.class)); cards.add(new SetCardInfo("Goblin Settler", 106, Rarity.UNCOMMON, mage.cards.g.GoblinSettler.class)); @@ -114,7 +113,7 @@ public final class Starter1999 extends ExpansionSet { cards.add(new SetCardInfo("Man-o'-War", 41, Rarity.UNCOMMON, mage.cards.m.ManOWar.class)); cards.add(new SetCardInfo("Merfolk of the Pearl Trident", 42, Rarity.COMMON, mage.cards.m.MerfolkOfThePearlTrident.class)); cards.add(new SetCardInfo("Mind Rot", 83, Rarity.COMMON, mage.cards.m.MindRot.class)); - cards.add(new SetCardInfo("Mons's Goblin Raiders", 112, Rarity.RARE, mage.cards.m.MonssGoblinRaiders.class)); + cards.add(new SetCardInfo("Mons's Goblin Raiders", 112, Rarity.COMMON, mage.cards.m.MonssGoblinRaiders.class)); cards.add(new SetCardInfo("Monstrous Growth", 132, Rarity.COMMON, mage.cards.m.MonstrousGrowth.class)); cards.add(new SetCardInfo("Moon Sprite", 133, Rarity.UNCOMMON, mage.cards.m.MoonSprite.class)); cards.add(new SetCardInfo("Mountain", 166, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/Tempest.java b/Mage.Sets/src/mage/sets/Tempest.java index a5fce2ce5a..5269f4c17c 100644 --- a/Mage.Sets/src/mage/sets/Tempest.java +++ b/Mage.Sets/src/mage/sets/Tempest.java @@ -104,7 +104,7 @@ public final class Tempest extends ExpansionSet { cards.add(new SetCardInfo("Eladamri, Lord of Leaves", 224, Rarity.RARE, mage.cards.e.EladamriLordOfLeaves.class)); cards.add(new SetCardInfo("Elite Javelineer", 17, Rarity.COMMON, mage.cards.e.EliteJavelineer.class)); cards.add(new SetCardInfo("Elven Warhounds", 225, Rarity.RARE, mage.cards.e.ElvenWarhounds.class)); - cards.add(new SetCardInfo("Elvish Fury", 226, Rarity.UNCOMMON, mage.cards.e.ElvishFury.class)); + cards.add(new SetCardInfo("Elvish Fury", 226, Rarity.COMMON, mage.cards.e.ElvishFury.class)); cards.add(new SetCardInfo("Emerald Medallion", 283, Rarity.RARE, mage.cards.e.EmeraldMedallion.class)); cards.add(new SetCardInfo("Emmessi Tome", 284, Rarity.RARE, mage.cards.e.EmmessiTome.class)); cards.add(new SetCardInfo("Endless Scream", 132, Rarity.COMMON, mage.cards.e.EndlessScream.class)); @@ -205,7 +205,7 @@ public final class Tempest extends ExpansionSet { cards.add(new SetCardInfo("Mogg Fanatic", 190, Rarity.COMMON, mage.cards.m.MoggFanatic.class)); cards.add(new SetCardInfo("Mogg Hollows", 320, Rarity.UNCOMMON, mage.cards.m.MoggHollows.class)); cards.add(new SetCardInfo("Mogg Raider", 191, Rarity.COMMON, mage.cards.m.MoggRaider.class)); - cards.add(new SetCardInfo("Mogg Squad", 192, Rarity.COMMON, mage.cards.m.MoggSquad.class)); + cards.add(new SetCardInfo("Mogg Squad", 192, Rarity.UNCOMMON, mage.cards.m.MoggSquad.class)); cards.add(new SetCardInfo("Mongrel Pack", 237, Rarity.RARE, mage.cards.m.MongrelPack.class)); cards.add(new SetCardInfo("Mountain", 343, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 344, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/TempestRemastered.java b/Mage.Sets/src/mage/sets/TempestRemastered.java index fa98de3e01..cfccc6aed7 100644 --- a/Mage.Sets/src/mage/sets/TempestRemastered.java +++ b/Mage.Sets/src/mage/sets/TempestRemastered.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -85,7 +84,7 @@ public final class TempestRemastered extends ExpansionSet { cards.add(new SetCardInfo("Dream Prowler", 47, Rarity.UNCOMMON, mage.cards.d.DreamProwler.class)); cards.add(new SetCardInfo("Dungeon Shade", 103, Rarity.COMMON, mage.cards.d.DungeonShade.class)); cards.add(new SetCardInfo("Elven Rite", 169, Rarity.COMMON, mage.cards.e.ElvenRite.class)); - cards.add(new SetCardInfo("Elvish Fury", 170, Rarity.UNCOMMON, mage.cards.e.ElvishFury.class)); + cards.add(new SetCardInfo("Elvish Fury", 170, Rarity.COMMON, mage.cards.e.ElvishFury.class)); cards.add(new SetCardInfo("Emmessi Tome", 221, Rarity.UNCOMMON, mage.cards.e.EmmessiTome.class)); cards.add(new SetCardInfo("Endangered Armodon", 171, Rarity.COMMON, mage.cards.e.EndangeredArmodon.class)); cards.add(new SetCardInfo("Ephemeron", 48, Rarity.RARE, mage.cards.e.Ephemeron.class)); diff --git a/Mage.Sets/src/mage/sets/TheDark.java b/Mage.Sets/src/mage/sets/TheDark.java index 869fa6d422..fed5a520d8 100644 --- a/Mage.Sets/src/mage/sets/TheDark.java +++ b/Mage.Sets/src/mage/sets/TheDark.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -31,10 +30,10 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Apprentice Wizard", 21, Rarity.RARE, mage.cards.a.ApprenticeWizard.class)); cards.add(new SetCardInfo("Ashes to Ashes", 39, Rarity.COMMON, mage.cards.a.AshesToAshes.class)); cards.add(new SetCardInfo("Ball Lightning", 57, Rarity.RARE, mage.cards.b.BallLightning.class)); - cards.add(new SetCardInfo("Banshee", 40, Rarity.RARE, mage.cards.b.Banshee.class)); + cards.add(new SetCardInfo("Banshee", 40, Rarity.UNCOMMON, mage.cards.b.Banshee.class)); cards.add(new SetCardInfo("Barl's Cage", 96, Rarity.RARE, mage.cards.b.BarlsCage.class)); cards.add(new SetCardInfo("Blood Moon", 58, Rarity.RARE, mage.cards.b.BloodMoon.class)); - cards.add(new SetCardInfo("Blood of the Martyr", 2, Rarity.RARE, mage.cards.b.BloodOfTheMartyr.class)); + cards.add(new SetCardInfo("Blood of the Martyr", 2, Rarity.UNCOMMON, mage.cards.b.BloodOfTheMartyr.class)); cards.add(new SetCardInfo("Bog Imp", 41, Rarity.COMMON, mage.cards.b.BogImp.class)); cards.add(new SetCardInfo("Bog Rats", 42, Rarity.COMMON, mage.cards.b.BogRats.class)); cards.add(new SetCardInfo("Bone Flute", 97, Rarity.UNCOMMON, mage.cards.b.BoneFlute.class)); @@ -46,10 +45,10 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("City of Shadows", 116, Rarity.RARE, mage.cards.c.CityOfShadows.class)); cards.add(new SetCardInfo("Cleansing", 4, Rarity.RARE, mage.cards.c.Cleansing.class)); cards.add(new SetCardInfo("Coal Golem", 99, Rarity.UNCOMMON, mage.cards.c.CoalGolem.class)); - cards.add(new SetCardInfo("Curse Artifact", 43, Rarity.RARE, mage.cards.c.CurseArtifact.class)); + cards.add(new SetCardInfo("Curse Artifact", 43, Rarity.UNCOMMON, mage.cards.c.CurseArtifact.class)); cards.add(new SetCardInfo("Dance of Many", 22, Rarity.RARE, mage.cards.d.DanceOfMany.class)); cards.add(new SetCardInfo("Dark Heart of the Wood", 95, Rarity.COMMON, mage.cards.d.DarkHeartOfTheWood.class)); - cards.add(new SetCardInfo("Dark Sphere", 100, Rarity.RARE, mage.cards.d.DarkSphere.class)); + cards.add(new SetCardInfo("Dark Sphere", 100, Rarity.UNCOMMON, mage.cards.d.DarkSphere.class)); cards.add(new SetCardInfo("Deep Water", 23, Rarity.COMMON, mage.cards.d.DeepWater.class)); cards.add(new SetCardInfo("Diabolic Machine", 101, Rarity.UNCOMMON, mage.cards.d.DiabolicMachine.class)); cards.add(new SetCardInfo("Drowned", 24, Rarity.COMMON, mage.cards.d.Drowned.class)); @@ -60,11 +59,11 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Erosion", 26, Rarity.COMMON, mage.cards.e.Erosion.class)); cards.add(new SetCardInfo("Eternal Flame", 61, Rarity.RARE, mage.cards.e.EternalFlame.class)); cards.add(new SetCardInfo("Exorcist", 6, Rarity.RARE, mage.cards.e.Exorcist.class)); - cards.add(new SetCardInfo("Fasting", 7, Rarity.RARE, mage.cards.f.Fasting.class)); + cards.add(new SetCardInfo("Fasting", 7, Rarity.UNCOMMON, mage.cards.f.Fasting.class)); cards.add(new SetCardInfo("Fellwar Stone", 102, Rarity.UNCOMMON, mage.cards.f.FellwarStone.class)); cards.add(new SetCardInfo("Festival", 8, Rarity.COMMON, mage.cards.f.Festival.class)); - cards.add(new SetCardInfo("Fire and Brimstone", 9, Rarity.RARE, mage.cards.f.FireAndBrimstone.class)); cards.add(new SetCardInfo("Fire Drake", 62, Rarity.UNCOMMON, mage.cards.f.FireDrake.class)); + cards.add(new SetCardInfo("Fire and Brimstone", 9, Rarity.UNCOMMON, mage.cards.f.FireAndBrimstone.class)); cards.add(new SetCardInfo("Fissure", 63, Rarity.COMMON, mage.cards.f.Fissure.class)); cards.add(new SetCardInfo("Flood", 27, Rarity.UNCOMMON, mage.cards.f.Flood.class)); cards.add(new SetCardInfo("Fountain of Youth", 103, Rarity.UNCOMMON, mage.cards.f.FountainOfYouth.class)); @@ -101,7 +100,7 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Morale", 14, Rarity.COMMON, mage.cards.m.Morale.class)); cards.add(new SetCardInfo("Murk Dwellers", 49, Rarity.COMMON, mage.cards.m.MurkDwellers.class)); cards.add(new SetCardInfo("Nameless Race", 50, Rarity.RARE, mage.cards.n.NamelessRace.class)); - cards.add(new SetCardInfo("Necropolis", 105, Rarity.RARE, mage.cards.n.Necropolis.class)); + cards.add(new SetCardInfo("Necropolis", 105, Rarity.UNCOMMON, mage.cards.n.Necropolis.class)); cards.add(new SetCardInfo("Niall Silvain", 82, Rarity.RARE, mage.cards.n.NiallSilvain.class)); cards.add(new SetCardInfo("Orc General", 73, Rarity.UNCOMMON, mage.cards.o.OrcGeneral.class)); cards.add(new SetCardInfo("People of the Woods", 83, Rarity.UNCOMMON, mage.cards.p.PeopleOfTheWoods.class)); @@ -110,10 +109,10 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Psychic Allergy", 34, Rarity.RARE, mage.cards.p.PsychicAllergy.class)); cards.add(new SetCardInfo("Rag Man", 51, Rarity.RARE, mage.cards.r.RagMan.class)); cards.add(new SetCardInfo("Riptide", 35, Rarity.COMMON, mage.cards.r.Riptide.class)); - cards.add(new SetCardInfo("Runesword", 107, Rarity.RARE, mage.cards.r.Runesword.class)); + cards.add(new SetCardInfo("Runesword", 107, Rarity.UNCOMMON, mage.cards.r.Runesword.class)); cards.add(new SetCardInfo("Safe Haven", 118, Rarity.RARE, mage.cards.s.SafeHaven.class)); cards.add(new SetCardInfo("Savaen Elves", 84, Rarity.COMMON, mage.cards.s.SavaenElves.class)); - cards.add(new SetCardInfo("Scarecrow", 108, Rarity.RARE, mage.cards.s.Scarecrow.class)); + cards.add(new SetCardInfo("Scarecrow", 108, Rarity.UNCOMMON, mage.cards.s.Scarecrow.class)); cards.add(new SetCardInfo("Scarwood Bandits", 85, Rarity.RARE, mage.cards.s.ScarwoodBandits.class)); cards.add(new SetCardInfo("Scarwood Goblins", 94, Rarity.COMMON, mage.cards.s.ScarwoodGoblins.class)); cards.add(new SetCardInfo("Scarwood Hag", 86, Rarity.UNCOMMON, mage.cards.s.ScarwoodHag.class)); @@ -122,21 +121,21 @@ public final class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Sisters of the Flame", 74, Rarity.UNCOMMON, mage.cards.s.SistersOfTheFlame.class)); cards.add(new SetCardInfo("Skull of Orm", 109, Rarity.UNCOMMON, mage.cards.s.SkullOfOrm.class)); cards.add(new SetCardInfo("Sorrow's Path", 119, Rarity.RARE, mage.cards.s.SorrowsPath.class)); - cards.add(new SetCardInfo("Spitting Slug", 88, Rarity.RARE, mage.cards.s.SpittingSlug.class)); + cards.add(new SetCardInfo("Spitting Slug", 88, Rarity.UNCOMMON, mage.cards.s.SpittingSlug.class)); cards.add(new SetCardInfo("Squire", 17, Rarity.COMMON, mage.cards.s.Squire.class)); cards.add(new SetCardInfo("Standing Stones", 110, Rarity.UNCOMMON, mage.cards.s.StandingStones.class)); cards.add(new SetCardInfo("Stone Calendar", 111, Rarity.RARE, mage.cards.s.StoneCalendar.class)); cards.add(new SetCardInfo("Sunken City", 36, Rarity.COMMON, mage.cards.s.SunkenCity.class)); - cards.add(new SetCardInfo("Tangle Kelp", 37, Rarity.RARE, mage.cards.t.TangleKelp.class)); - cards.add(new SetCardInfo("The Fallen", 53, Rarity.RARE, mage.cards.t.TheFallen.class)); + cards.add(new SetCardInfo("Tangle Kelp", 37, Rarity.UNCOMMON, mage.cards.t.TangleKelp.class)); + cards.add(new SetCardInfo("The Fallen", 53, Rarity.UNCOMMON, mage.cards.t.TheFallen.class)); cards.add(new SetCardInfo("Tivadar's Crusade", 18, Rarity.UNCOMMON, mage.cards.t.TivadarsCrusade.class)); cards.add(new SetCardInfo("Tormod's Crypt", 112, Rarity.UNCOMMON, mage.cards.t.TormodsCrypt.class)); - cards.add(new SetCardInfo("Tower of Coireall", 113, Rarity.RARE, mage.cards.t.TowerOfCoireall.class)); + cards.add(new SetCardInfo("Tower of Coireall", 113, Rarity.UNCOMMON, mage.cards.t.TowerOfCoireall.class)); cards.add(new SetCardInfo("Tracker", 89, Rarity.RARE, mage.cards.t.Tracker.class)); cards.add(new SetCardInfo("Uncle Istvan", 54, Rarity.UNCOMMON, mage.cards.u.UncleIstvan.class)); cards.add(new SetCardInfo("Venom", 90, Rarity.COMMON, mage.cards.v.Venom.class)); - cards.add(new SetCardInfo("Wand of Ith", 114, Rarity.RARE, mage.cards.w.WandOfIth.class)); - cards.add(new SetCardInfo("War Barge", 115, Rarity.RARE, mage.cards.w.WarBarge.class)); + cards.add(new SetCardInfo("Wand of Ith", 114, Rarity.UNCOMMON, mage.cards.w.WandOfIth.class)); + cards.add(new SetCardInfo("War Barge", 115, Rarity.UNCOMMON, mage.cards.w.WarBarge.class)); cards.add(new SetCardInfo("Water Wurm", 38, Rarity.COMMON, mage.cards.w.WaterWurm.class)); cards.add(new SetCardInfo("Witch Hunter", 19, Rarity.RARE, mage.cards.w.WitchHunter.class)); cards.add(new SetCardInfo("Word of Binding", 55, Rarity.COMMON, mage.cards.w.WordOfBinding.class)); diff --git a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java index da2fe23c4b..350e324ddc 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java +++ b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java @@ -1,9 +1,6 @@ - package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.i.IcatianJavelineers; -import mage.cards.s.SwampMosquito; import mage.constants.Rarity; import mage.constants.SetType; @@ -24,7 +21,7 @@ public final class TimeSpiralTimeshifted extends ExpansionSet { this.blockName = "Time Spiral"; this.parentSet = TimeSpiral.getInstance(); this.hasBasicLands = false; - cards.add(new SetCardInfo("Akroma, Angel of Wrath", 1, Rarity.COMMON, mage.cards.a.AkromaAngelOfWrath.class)); + cards.add(new SetCardInfo("Akroma, Angel of Wrath", 1, Rarity.SPECIAL, mage.cards.a.AkromaAngelOfWrath.class)); cards.add(new SetCardInfo("Arena", 117, Rarity.SPECIAL, mage.cards.a.Arena.class)); cards.add(new SetCardInfo("Assault // Battery", 106, Rarity.SPECIAL, mage.cards.a.AssaultBattery.class)); cards.add(new SetCardInfo("Auratog", 2, Rarity.COMMON, mage.cards.a.Auratog.class)); @@ -73,7 +70,7 @@ public final class TimeSpiralTimeshifted extends ExpansionSet { cards.add(new SetCardInfo("Hail Storm", 79, Rarity.SPECIAL, mage.cards.h.HailStorm.class)); cards.add(new SetCardInfo("Honorable Passage", 9, Rarity.SPECIAL, mage.cards.h.HonorablePassage.class)); cards.add(new SetCardInfo("Hunting Moa", 80, Rarity.COMMON, mage.cards.h.HuntingMoa.class)); - cards.add(new SetCardInfo("Icatian Javelineers", 10, Rarity.SPECIAL, IcatianJavelineers.class)); + cards.add(new SetCardInfo("Icatian Javelineers", 10, Rarity.SPECIAL, mage.cards.i.IcatianJavelineers.class)); cards.add(new SetCardInfo("Jasmine Boreal", 93, Rarity.COMMON, mage.cards.j.JasmineBoreal.class)); cards.add(new SetCardInfo("Jolrael, Empress of Beasts", 81, Rarity.SPECIAL, mage.cards.j.JolraelEmpressOfBeasts.class)); cards.add(new SetCardInfo("Kobold Taskmaster", 65, Rarity.SPECIAL, mage.cards.k.KoboldTaskmaster.class)); @@ -118,7 +115,7 @@ public final class TimeSpiralTimeshifted extends ExpansionSet { cards.add(new SetCardInfo("Stormscape Familiar", 32, Rarity.COMMON, mage.cards.s.StormscapeFamiliar.class)); cards.add(new SetCardInfo("Stupor", 48, Rarity.COMMON, mage.cards.s.Stupor.class)); cards.add(new SetCardInfo("Suq'Ata Lancer", 69, Rarity.COMMON, mage.cards.s.SuqAtaLancer.class)); - cards.add(new SetCardInfo("Swamp Mosquito", 49, Rarity.SPECIAL, SwampMosquito.class)); + cards.add(new SetCardInfo("Swamp Mosquito", 49, Rarity.SPECIAL, mage.cards.s.SwampMosquito.class)); cards.add(new SetCardInfo("Teferi's Moat", 103, Rarity.SPECIAL, mage.cards.t.TeferisMoat.class)); cards.add(new SetCardInfo("Thallid", 86, Rarity.COMMON, mage.cards.t.Thallid.class)); cards.add(new SetCardInfo("The Rack", 113, Rarity.SPECIAL, mage.cards.t.TheRack.class)); diff --git a/Mage.Sets/src/mage/sets/Torment.java b/Mage.Sets/src/mage/sets/Torment.java index 5f56b5d7d2..847347f882 100644 --- a/Mage.Sets/src/mage/sets/Torment.java +++ b/Mage.Sets/src/mage/sets/Torment.java @@ -32,7 +32,7 @@ public final class Torment extends ExpansionSet { cards.add(new SetCardInfo("Acorn Harvest", 118, Rarity.COMMON, mage.cards.a.AcornHarvest.class)); cards.add(new SetCardInfo("Ambassador Laquatus", 23, Rarity.RARE, mage.cards.a.AmbassadorLaquatus.class)); cards.add(new SetCardInfo("Angel of Retribution", 1, Rarity.RARE, mage.cards.a.AngelOfRetribution.class)); - cards.add(new SetCardInfo("Anurid Scavenger", 119, Rarity.COMMON, mage.cards.a.AnuridScavenger.class)); + cards.add(new SetCardInfo("Anurid Scavenger", 119, Rarity.UNCOMMON, mage.cards.a.AnuridScavenger.class)); cards.add(new SetCardInfo("Aquamoeba", 24, Rarity.COMMON, mage.cards.a.Aquamoeba.class)); cards.add(new SetCardInfo("Arrogant Wurm", 120, Rarity.UNCOMMON, mage.cards.a.ArrogantWurm.class)); cards.add(new SetCardInfo("Aven Trooper", 2, Rarity.COMMON, mage.cards.a.AvenTrooper.class)); diff --git a/Mage.Sets/src/mage/sets/Unglued.java b/Mage.Sets/src/mage/sets/Unglued.java index 1a9c250908..690e1a2520 100644 --- a/Mage.Sets/src/mage/sets/Unglued.java +++ b/Mage.Sets/src/mage/sets/Unglued.java @@ -21,7 +21,9 @@ public final class Unglued extends ExpansionSet { private Unglued() { super("Unglued", "UGL", ExpansionSet.buildDate(1998, 8, 11), SetType.JOKESET); + cards.add(new SetCardInfo("Burning Cinder Fury of Crimson Chaos Fire", 40, Rarity.RARE, mage.cards.b.BurningCinderFuryOfCrimsonChaosFire.class)); cards.add(new SetCardInfo("Checks and Balances", 16, Rarity.UNCOMMON, mage.cards.c.ChecksAndBalances.class)); + cards.add(new SetCardInfo("Chicken Egg", 41, Rarity.COMMON, mage.cards.c.ChickenEgg.class)); cards.add(new SetCardInfo("Chicken a la King", 17, Rarity.RARE, mage.cards.c.ChickenALaKing.class)); cards.add(new SetCardInfo("Chicken Egg", 41, Rarity.COMMON, mage.cards.c.ChickenEgg.class)); cards.add(new SetCardInfo("Clambassadors", 18, Rarity.COMMON, mage.cards.c.Clambassadors.class)); @@ -41,6 +43,7 @@ public final class Unglued extends ExpansionSet { cards.add(new SetCardInfo("Incoming!", 64, Rarity.RARE, mage.cards.i.Incoming.class)); cards.add(new SetCardInfo("Island", 85, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Jack-in-the-Mox", 75, Rarity.RARE, mage.cards.j.JackInTheMox.class)); + cards.add(new SetCardInfo("Jalum Grifter", 47, Rarity.RARE, mage.cards.j.JalumGrifter.class)); cards.add(new SetCardInfo("Jumbo Imp", 34, Rarity.UNCOMMON, mage.cards.j.JumboImp.class)); cards.add(new SetCardInfo("Krazy Kow", 48, Rarity.COMMON, mage.cards.k.KrazyKow.class)); cards.add(new SetCardInfo("Mine, Mine, Mine!", 65, Rarity.RARE, mage.cards.m.MineMineMine.class)); diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index 0d1da153d2..17e0fd38ed 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -120,6 +120,7 @@ public final class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Repercussion", 95, Rarity.RARE, mage.cards.r.Repercussion.class)); cards.add(new SetCardInfo("Replenish", 15, Rarity.RARE, mage.cards.r.Replenish.class)); cards.add(new SetCardInfo("Rescue", 44, Rarity.COMMON, mage.cards.r.Rescue.class)); + cards.add(new SetCardInfo("Rofellos's Gift", 119, Rarity.COMMON, mage.cards.r.RofellossGift.class)); cards.add(new SetCardInfo("Rofellos, Llanowar Emissary", 118, Rarity.RARE, mage.cards.r.RofellosLlanowarEmissary.class)); cards.add(new SetCardInfo("Sanctimony", 16, Rarity.UNCOMMON, mage.cards.s.Sanctimony.class)); cards.add(new SetCardInfo("Scent of Brine", 45, Rarity.COMMON, mage.cards.s.ScentOfBrine.class)); diff --git a/Mage.Sets/src/mage/sets/UrzasSaga.java b/Mage.Sets/src/mage/sets/UrzasSaga.java index d231b8227d..161a5e42ca 100644 --- a/Mage.Sets/src/mage/sets/UrzasSaga.java +++ b/Mage.Sets/src/mage/sets/UrzasSaga.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -230,7 +229,7 @@ public final class UrzasSaga extends ExpansionSet { cards.add(new SetCardInfo("Plains", 333, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Plains", 334, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Planar Birth", 31, Rarity.RARE, mage.cards.p.PlanarBirth.class)); - cards.add(new SetCardInfo("Planar Void", 149, Rarity.RARE, mage.cards.p.PlanarVoid.class)); + cards.add(new SetCardInfo("Planar Void", 149, Rarity.UNCOMMON, mage.cards.p.PlanarVoid.class)); cards.add(new SetCardInfo("Polluted Mire", 323, Rarity.COMMON, mage.cards.p.PollutedMire.class)); cards.add(new SetCardInfo("Pouncing Jaguar", 269, Rarity.COMMON, mage.cards.p.PouncingJaguar.class)); cards.add(new SetCardInfo("Power Sink", 89, Rarity.COMMON, mage.cards.p.PowerSink.class)); diff --git a/Mage.Sets/src/mage/sets/VenserVsKoth.java b/Mage.Sets/src/mage/sets/VenserVsKoth.java index 66ddf824c4..14424bff5d 100644 --- a/Mage.Sets/src/mage/sets/VenserVsKoth.java +++ b/Mage.Sets/src/mage/sets/VenserVsKoth.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -36,7 +35,7 @@ public final class VenserVsKoth extends ExpansionSet { cards.add(new SetCardInfo("Cosi's Ravager", 52, Rarity.COMMON, mage.cards.c.CosisRavager.class)); cards.add(new SetCardInfo("Cryptic Annelid", 15, Rarity.UNCOMMON, mage.cards.c.CrypticAnnelid.class)); cards.add(new SetCardInfo("Downhill Charge", 69, Rarity.COMMON, mage.cards.d.DownhillCharge.class)); - cards.add(new SetCardInfo("Earth Servant", 60, Rarity.COMMON, mage.cards.e.EarthServant.class)); + cards.add(new SetCardInfo("Earth Servant", 60, Rarity.UNCOMMON, mage.cards.e.EarthServant.class)); cards.add(new SetCardInfo("Fiery Hellhound", 49, Rarity.COMMON, mage.cards.f.FieryHellhound.class)); cards.add(new SetCardInfo("Flood Plain", 34, Rarity.UNCOMMON, mage.cards.f.FloodPlain.class)); cards.add(new SetCardInfo("Galepowder Mage", 12, Rarity.RARE, mage.cards.g.GalepowderMage.class)); diff --git a/Mage.Sets/src/mage/sets/VintageMasters.java b/Mage.Sets/src/mage/sets/VintageMasters.java index 92ca744361..bc5a382261 100644 --- a/Mage.Sets/src/mage/sets/VintageMasters.java +++ b/Mage.Sets/src/mage/sets/VintageMasters.java @@ -1,10 +1,7 @@ - package mage.sets; import java.util.List; import mage.cards.ExpansionSet; -import mage.cards.h.HighTide; -import mage.cards.h.HymnToTourach; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; @@ -115,7 +112,7 @@ public final class VintageMasters extends ExpansionSet { cards.add(new SetCardInfo("Desert Twister", 203, Rarity.UNCOMMON, mage.cards.d.DesertTwister.class)); cards.add(new SetCardInfo("Devout Witness", 24, Rarity.UNCOMMON, mage.cards.d.DevoutWitness.class)); cards.add(new SetCardInfo("Drakestown Forgotten", 117, Rarity.RARE, mage.cards.d.DrakestownForgotten.class)); - cards.add(new SetCardInfo("Dreampod Druid", 204, Rarity.RARE, mage.cards.d.DreampodDruid.class)); + cards.add(new SetCardInfo("Dreampod Druid", 204, Rarity.UNCOMMON, mage.cards.d.DreampodDruid.class)); cards.add(new SetCardInfo("Edric, Spymaster of Trest", 251, Rarity.RARE, mage.cards.e.EdricSpymasterOfTrest.class)); cards.add(new SetCardInfo("Elephant Guide", 205, Rarity.COMMON, mage.cards.e.ElephantGuide.class)); cards.add(new SetCardInfo("Elvish Aberration", 206, Rarity.COMMON, mage.cards.e.ElvishAberration.class)); @@ -169,9 +166,9 @@ public final class VintageMasters extends ExpansionSet { cards.add(new SetCardInfo("Gush", 72, Rarity.UNCOMMON, mage.cards.g.Gush.class)); cards.add(new SetCardInfo("Gustcloak Harrier", 30, Rarity.COMMON, mage.cards.g.GustcloakHarrier.class)); cards.add(new SetCardInfo("Hermit Druid", 216, Rarity.RARE, mage.cards.h.HermitDruid.class)); - cards.add(new SetCardInfo("High Tide", 73, Rarity.UNCOMMON, HighTide.class)); + cards.add(new SetCardInfo("High Tide", 73, Rarity.UNCOMMON, mage.cards.h.HighTide.class)); cards.add(new SetCardInfo("Hulking Goblin", 174, Rarity.COMMON, mage.cards.h.HulkingGoblin.class)); - cards.add(new SetCardInfo("Hymn to Tourach", 122, Rarity.UNCOMMON, HymnToTourach.class)); + cards.add(new SetCardInfo("Hymn to Tourach", 122, Rarity.UNCOMMON, mage.cards.h.HymnToTourach.class)); cards.add(new SetCardInfo("Ichorid", 123, Rarity.RARE, mage.cards.i.Ichorid.class)); cards.add(new SetCardInfo("Ivory Tower", 269, Rarity.UNCOMMON, mage.cards.i.IvoryTower.class)); cards.add(new SetCardInfo("Jace, the Mind Sculptor", 74, Rarity.MYTHIC, mage.cards.j.JaceTheMindSculptor.class)); diff --git a/Mage.Sets/src/mage/sets/WelcomeDeck2016.java b/Mage.Sets/src/mage/sets/WelcomeDeck2016.java index c4b6e6442b..fd8b916d4d 100644 --- a/Mage.Sets/src/mage/sets/WelcomeDeck2016.java +++ b/Mage.Sets/src/mage/sets/WelcomeDeck2016.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -32,7 +31,7 @@ public final class WelcomeDeck2016 extends ExpansionSet { cards.add(new SetCardInfo("Nightmare", 8, Rarity.RARE, mage.cards.n.Nightmare.class)); cards.add(new SetCardInfo("Oakenform", 15, Rarity.COMMON, mage.cards.o.Oakenform.class)); cards.add(new SetCardInfo("Sengir Vampire", 9, Rarity.UNCOMMON, mage.cards.s.SengirVampire.class)); - cards.add(new SetCardInfo("Serra Angel", 3, Rarity.RARE, mage.cards.s.SerraAngel.class)); + cards.add(new SetCardInfo("Serra Angel", 3, Rarity.UNCOMMON, mage.cards.s.SerraAngel.class)); cards.add(new SetCardInfo("Shivan Dragon", 13, Rarity.RARE, mage.cards.s.ShivanDragon.class)); cards.add(new SetCardInfo("Soul of the Harvest", 16, Rarity.RARE, mage.cards.s.SoulOfTheHarvest.class)); cards.add(new SetCardInfo("Sphinx of Magosi", 6, Rarity.RARE, mage.cards.s.SphinxOfMagosi.class)); diff --git a/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java index 372ba21583..63256e1560 100644 --- a/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java +++ b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java @@ -1,4 +1,3 @@ - package mage.sets; import mage.cards.ExpansionSet; @@ -38,7 +37,7 @@ public final class ZendikarVsEldrazi extends ExpansionSet { cards.add(new SetCardInfo("Eldrazi Temple", 68, Rarity.UNCOMMON, mage.cards.e.EldraziTemple.class)); cards.add(new SetCardInfo("Emrakul's Hatcher", 59, Rarity.COMMON, mage.cards.e.EmrakulsHatcher.class)); cards.add(new SetCardInfo("Evolving Wilds", 31, Rarity.COMMON, mage.cards.e.EvolvingWilds.class)); - cards.add(new SetCardInfo("Explorer's Scope", 28, Rarity.UNCOMMON, mage.cards.e.ExplorersScope.class)); + cards.add(new SetCardInfo("Explorer's Scope", 28, Rarity.COMMON, mage.cards.e.ExplorersScope.class)); cards.add(new SetCardInfo("Forerunner of Slaughter", 64, Rarity.UNCOMMON, mage.cards.f.ForerunnerOfSlaughter.class)); cards.add(new SetCardInfo("Forest", 38, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 39, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java index 3950fa971b..5427cb8460 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java @@ -7,7 +7,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.permanent.Permanent; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -162,7 +161,6 @@ public class BestowTest extends CardTestPlayerBase { * Bestowed creature can be used to sacrifice a creature for the Away part. * http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/513828-bestow-far-away */ - @Ignore // TODO: make fused targeting support @Test public void bestowWithFusedSpell() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java new file mode 100644 index 0000000000..ca0be11736 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java @@ -0,0 +1,110 @@ +package org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * Jump-start is found on instants and sorceries. You can cast a card with + * jump-start from your graveyard by paying all its regular costs and one + * additional cost: discarding a card from your hand. + * + * @author LevelX2 + */ +public class JumpStartTest extends CardTestPlayerBase { + + @Test + public void testNormalUse() { + // Direct Current deals 2 damage to any target. + // Jump-start + addCard(Zone.HAND, playerA, "Direct Current", 1); // Sorcery {1}{R}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); + addCard(Zone.HAND, playerA, "Disenchant", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertHandCount(playerA, 0); // 1 from sacrificed Clue and 1 from draw of turn 3 + assertExileCount(playerA, "Direct Current", 1); + + assertLife(playerA, 20); + assertLife(playerB, 18); + + } + + @Test + public void testCastFromGraveyardCountered() { + // Direct Current deals 2 damage to any target. + // Jump-start + addCard(Zone.HAND, playerA, "Direct Current", 1); // Sorcery {1}{R}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); + addCard(Zone.HAND, playerA, "Disenchant", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2 + addCard(Zone.HAND, playerB, "Counterspell", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Counterspell", "Direct Current"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Counterspell", 1); + assertHandCount(playerA, 0); + assertGraveyardCount(playerA, "Direct Current", 0); + assertExileCount(playerA, "Direct Current", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + } + + @Test + public void testWithExperimentalFrenzy() { + // Direct Current deals 2 damage to any target. + // Jump-start + addCard(Zone.HAND, playerA, "Direct Current", 1); // Sorcery {1}{R}{R} + // You may look at the top card of your library any time. + // You may play the top card of your library. + // You can't play cards from your hand. + // {3}{R}: Destroy Experimental Frenzy. + addCard(Zone.HAND, playerA, "Experimental Frenzy", 1); // Enchantment {3}{R} + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 12); + addCard(Zone.HAND, playerA, "Lightning Bolt", 2); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Experimental Frenzy"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Experimental Frenzy", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerA, "Direct Current", 0); + assertExileCount(playerA, "Direct Current", 1); + + assertHandCount(playerA, "Lightning Bolt", 1); // prevented to cast from hand by Experimental Frenzy + assertGraveyardCount(playerA, "Lightning Bolt", 1); // Discarded by using jump-start + + assertLife(playerA, 20); + assertLife(playerB, 18); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java index ff27aed08c..7a802e59d0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java @@ -1,4 +1,3 @@ - package org.mage.test.cards.abilities.oneshot.exile; import mage.abilities.keyword.ReachAbility; @@ -116,4 +115,36 @@ public class ExileAndReturnTest extends CardTestPlayerBase { assertHandCount(playerB, 3); // 1 from Turn 2 and 2 from Frog Tongue } + + @Test + public void testExileAndReturnIfTawnosLeftBattlefield() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 7); + // You may choose not to untap Tawnos's Coffin during your untap step. + // {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature. + // When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under + // its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura + // cards to the battlefield under their owner's control attached to that permanent. + addCard(Zone.HAND, playerA, "Tawnos's Coffin"); // Artifact {4} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Zone.HAND, playerB, "Disenchant"); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}", "Silvercoat Lion"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Disenchant", "Tawnos's Coffin"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Disenchant", 1); + + assertPermanentCount(playerA, "Tawnos's Coffin", 0); + assertGraveyardCount(playerA, "Tawnos's Coffin", 1); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/dynamicvalue/CryptRatsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/dynamicvalue/CryptRatsTest.java index fd6064f78a..b00ae84ebf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/dynamicvalue/CryptRatsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/dynamicvalue/CryptRatsTest.java @@ -10,7 +10,7 @@ public class CryptRatsTest extends CardTestPlayerBase { String cRats = "Crypt Rats"; @Test - public void damageOnlyCreatureAndPlayers(){ + public void damageOnlyCreatureAndPlayers() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); addCard(Zone.BATTLEFIELD, playerA, cRats, 1); addCard(Zone.BATTLEFIELD, playerB, "Shivan Dragon", 1); @@ -20,6 +20,7 @@ public class CryptRatsTest extends CardTestPlayerBase { setChoice(playerA, "X=4"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertLife(playerA, 16); assertLife(playerB, 16); assertGraveyardCount(playerA, cRats, 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java index 62fc6ce811..281f0644b2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java @@ -19,8 +19,8 @@ public class LilianaTest extends CardTestPlayerBase { /* Binding Mummy {1}{W} Creature - Zombie 2/2 - Whenever another Zombie enters the battlefield under your control, you may tap target artifact or creature. - */ + Whenever another Zombie enters the battlefield under your control, you may tap target artifact or creature. + */ String bMummy = "Binding Mummy"; /* @@ -29,7 +29,7 @@ public class LilianaTest extends CardTestPlayerBase { [+1] : Create a 2/2 black Zombie creature token. Put the top two cards of your library into your graveyard. [-3] : Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types. [-7] : Destroy all non-Zombie creatures. - */ + */ String liliannaDM = "Liliana, Death's Majesty"; /* @@ -37,7 +37,7 @@ public class LilianaTest extends CardTestPlayerBase { Creature - Angel 3/3 Flying, vigilance Cycling {W} - */ + */ String wShepherd = "Winged Shepherd"; String yOx = "Yoked Ox"; // {W} 0/4 @@ -56,7 +56,7 @@ public class LilianaTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - + assertPermanentCount(playerA, bMummy, 1); assertPermanentCount(playerA, liliannaDM, 1); assertPermanentCount(playerA, wShepherd, 1); @@ -66,4 +66,44 @@ public class LilianaTest extends CardTestPlayerBase { assertType(wShepherd, CardType.CREATURE, SubType.ANGEL); assertTapped(yOx, true); } + + @Test + public void testCastingCreaturesFromGraveTriggerDesecratedTomb() { + + /* + Liliana, Untouched by Death {2}{B}{B} + Legendary Planeswalker — Liliana + +1: Put the top three cards of your library into your graveyard. If at least one of them is a Zombie card, each opponent loses 2 life and you gain 2 life. + −2: Target creature gets -X/-X until end of turn, where X is the number of Zombies you control. + −3: You may cast Zombie cards from your graveyard this turn. + */ + String liliannaUbD = "Liliana, Untouched by Death"; + + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); + addCard(Zone.HAND, playerA, liliannaUbD); + /* + * Carrion Feeder {B} + * Creature — Zombie + * Carrion Feeder can’t block. + * Sacrifice a creature: Put a +1/+1 counter on Carrion Feeder. + */ + addCard(Zone.GRAVEYARD, playerA, "Carrion Feeder"); + + // Whenever one or more creature cards leave your graveyard, create a 1/1 black Bat creature token with flying. + addCard(Zone.BATTLEFIELD, playerA, "Desecrated Tomb", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaUbD); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3:"); // Liliana -3 + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Carrion Feeder"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, liliannaUbD, 1); + assertCounterCount(playerA, liliannaUbD, CounterType.LOYALTY, 1); + assertPermanentCount(playerA, "Carrion Feeder", 1); + + assertPermanentCount(playerA, "Bat", 1); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/RealityScrambleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/RealityScrambleTest.java new file mode 100644 index 0000000000..a72bea1811 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/RealityScrambleTest.java @@ -0,0 +1,32 @@ +package org.mage.test.cards.single.c18; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author Quercitron + */ +public class RealityScrambleTest extends CardTestPlayerBase { + + @Test + public void testFirstCardIsCast() { + // Put target permanent you own on the bottom of your library. Reveal cards from the top of your library until + // you reveal a card that shares a card type with that permanent. Put that card onto the battlefield and + // the rest on the bottom of your library in a random order. + addCard(Zone.HAND, playerA, "Reality Scramble"); + addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + addCard(Zone.LIBRARY, playerA, "Storm Crow"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reality Scramble", "Grizzly Bears"); + + execute(); + + assertPermanentCount(playerA, "Grizzly Bears", 0); + assertPermanentCount(playerA, "Storm Crow", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m19/OneWithTheMachineTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m19/OneWithTheMachineTest.java new file mode 100644 index 0000000000..f0f0cf17ac --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m19/OneWithTheMachineTest.java @@ -0,0 +1,31 @@ +package org.mage.test.cards.single.m19; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author Quercitron + */ +public class OneWithTheMachineTest extends CardTestPlayerBase { + + @Test + public void testOnlyArtifactsAreConsidered() { + // Draw cards equal to the highest converted mana cost among artifacts you control + addCard(Zone.HAND, playerA, "One with the Machine"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + // CMC = 2, artifact + addCard(Zone.BATTLEFIELD, playerA, "Millstone"); + // CMC = 6, not artifact + addCard(Zone.BATTLEFIELD, playerA, "Colossal Dreadmaw"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "One with the Machine"); + + execute(); + + assertHandCount(playerA, 2); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index eed329f958..0fa4a84a09 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -1,9 +1,5 @@ package org.mage.test.player; -import java.io.Serializable; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import mage.MageObject; import mage.MageObjectReference; import mage.ObjectColor; @@ -52,6 +48,12 @@ import mage.target.*; import mage.target.common.*; import org.junit.Assert; import org.junit.Ignore; + +import java.io.Serializable; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import static org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl.*; /** @@ -126,7 +128,7 @@ public class TestPlayer implements Player { /** * @param maxCallsWithoutAction max number of priority passes a player may - * have for this test (default = 100) + * have for this test (default = 100) */ public void setMaxCallsWithoutAction(int maxCallsWithoutAction) { this.maxCallsWithoutAction = maxCallsWithoutAction; @@ -771,7 +773,7 @@ public class TestPlayer implements Player { // Loop through players and validate can attack/block this turn UUID defenderId = null; //List<PlayerAction> - for (Iterator<org.mage.test.player.PlayerAction> it = actions.iterator(); it.hasNext();) { + for (Iterator<org.mage.test.player.PlayerAction> it = actions.iterator(); it.hasNext(); ) { PlayerAction action = it.next(); if (action.getTurnNum() == game.getTurnNum() && action.getAction().startsWith("attack:")) { String command = action.getAction(); @@ -1590,6 +1592,11 @@ public class TestPlayer implements Player { return computerPlayer.removeFromGraveyard(card, game); } + @Override + public boolean putCardsOnBottomOfLibrary(Card card, Game game, Ability source, boolean anyOrder) { + return computerPlayer.putCardsOnBottomOfLibrary(card, game, source, anyOrder); + } + @Override public boolean putCardsOnBottomOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder) { return computerPlayer.putCardsOnBottomOfLibrary(cards, game, source, anyOrder); @@ -2454,7 +2461,7 @@ public class TestPlayer implements Player { @Override public boolean choose(Outcome outcome, Target target, - UUID sourceId, Game game + UUID sourceId, Game game ) { // needed to call here the TestPlayer because it's overwitten return choose(outcome, target, sourceId, game, null); @@ -2462,7 +2469,7 @@ public class TestPlayer implements Player { @Override public boolean choose(Outcome outcome, Cards cards, - TargetCard target, Game game + TargetCard target, Game game ) { if (!choices.isEmpty()) { for (String choose2 : choices) { @@ -2494,7 +2501,7 @@ public class TestPlayer implements Player { @Override public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, - Ability source, Game game + Ability source, Game game ) { return computerPlayer.chooseTargetAmount(outcome, target, source, game); } @@ -2507,15 +2514,15 @@ public class TestPlayer implements Player { @Override public boolean choosePile(Outcome outcome, String message, - List<? extends Card> pile1, List<? extends Card> pile2, - Game game + List<? extends Card> pile1, List<? extends Card> pile2, + Game game ) { return computerPlayer.choosePile(outcome, message, pile1, pile2, game); } @Override public boolean playMana(Ability ability, ManaCost unpaid, - String promptText, Game game + String promptText, Game game ) { groupsForTargetHandling = null; return computerPlayer.playMana(ability, unpaid, promptText, game); @@ -2529,15 +2536,15 @@ public class TestPlayer implements Player { @Override public UUID chooseBlockerOrder(List<Permanent> blockers, CombatGroup combatGroup, - List<UUID> blockerOrder, Game game + List<UUID> blockerOrder, Game game ) { return computerPlayer.chooseBlockerOrder(blockers, combatGroup, blockerOrder, game); } @Override public void assignDamage(int damage, List<UUID> targets, - String singleTargetName, UUID sourceId, - Game game + String singleTargetName, UUID sourceId, + Game game ) { computerPlayer.assignDamage(damage, targets, singleTargetName, sourceId, game); } @@ -2556,14 +2563,14 @@ public class TestPlayer implements Player { @Override public void pickCard(List<Card> cards, Deck deck, - Draft draft + Draft draft ) { computerPlayer.pickCard(cards, deck, draft); } @Override public boolean scry(int value, Ability source, - Game game + Game game ) { // Don't scry at the start of the game. if (game.getTurnNum() == 1 && game.getStep() == null) { @@ -2572,39 +2579,46 @@ public class TestPlayer implements Player { return computerPlayer.scry(value, source, game); } + @Override + public boolean surveil(int value, Ability source, + Game game + ) { + return computerPlayer.surveil(value, source, game); + } + @Override public boolean moveCards(Card card, Zone toZone, - Ability source, Game game + Ability source, Game game ) { return computerPlayer.moveCards(card, toZone, source, game); } @Override public boolean moveCards(Card card, Zone toZone, - Ability source, Game game, - boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects + Ability source, Game game, + boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects ) { return computerPlayer.moveCards(card, toZone, source, game, tapped, faceDown, byOwner, appliedEffects); } @Override public boolean moveCards(Cards cards, Zone toZone, - Ability source, Game game + Ability source, Game game ) { return computerPlayer.moveCards(cards, toZone, source, game); } @Override public boolean moveCards(Set<Card> cards, Zone toZone, - Ability source, Game game + Ability source, Game game ) { return computerPlayer.moveCards(cards, toZone, source, game); } @Override public boolean moveCards(Set<Card> cards, Zone toZone, - Ability source, Game game, - boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects + Ability source, Game game, + boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects ) { return computerPlayer.moveCards(cards, toZone, source, game, tapped, faceDown, byOwner, appliedEffects); } diff --git a/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java index bc84033378..810c068ccf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java +++ b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java @@ -1,7 +1,5 @@ package org.mage.test.stub; -import java.io.Serializable; -import java.util.*; import mage.MageObject; import mage.MageObjectReference; import mage.abilities.*; @@ -40,8 +38,10 @@ import mage.target.TargetAmount; import mage.target.TargetCard; import mage.target.common.TargetCardInLibrary; +import java.io.Serializable; +import java.util.*; + /** - * * @author Quercitron */ public class PlayerStub implements Player { @@ -882,6 +882,11 @@ public class PlayerStub implements Player { return false; } + @Override + public boolean putCardsOnBottomOfLibrary(Card card, Game game, Ability source, boolean anyOrder) { + return false; + } + @Override public boolean putCardsOnBottomOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder) { return false; @@ -1257,6 +1262,11 @@ public class PlayerStub implements Player { return false; } + @Override + public boolean surveil(int value, Ability source, Game game) { + return false; + } + @Override public boolean addTargets(Ability ability, Game game) { return false; diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index 27d780138f..3882476d58 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -72,16 +72,12 @@ public class VerifyCardDataTest { // subtype skipListCreate("SUBTYPE"); - skipListAddName("SUBTYPE", "Dragon Egg"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Rukh Egg"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Roc Egg"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Summoner's Egg"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Ludevic's Test Subject"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Prowling Pangolin"); // remove when MTGJSON is updated with M19 - skipListAddName("SUBTYPE", "Electryte"); // remove when MTGJSON is updated with M19 // number skipListCreate("NUMBER"); + + // missing abilities + skipListCreate("MISSING_ABILITIES"); } public static List<Card> allCards() { @@ -440,6 +436,7 @@ public class VerifyCardDataTest { checkColors(card, ref); //checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers) checkBasicLands(card, ref); + checkMissingAbilities(card, ref); } private void checkColors(Card card, JsonCard ref) { @@ -510,6 +507,32 @@ public class VerifyCardDataTest { } } + private void checkMissingAbilities(Card card, JsonCard ref) { + if (skipListHaveName("MISSING_ABILITIES", card.getName())) { + return; + } + + // search missing abilities from card source + if (ref.text == null || ref.text.isEmpty()) { + return; + } + + // spells have only 1 abilities + if (card.isSorcery() || card.isInstant()) { + return; + } + + // additional cost go to 1 ability + if (ref.text.startsWith("As an additional cost to cast")) { + return; + } + + // always 1 ability (to cast) + if (card.getAbilities().toArray().length == 1) { // all cards have 1 inner ability to cast + fail(card, "abilities", "card's abilities is empty, but ref have text"); + } + } + private static <T> boolean eqSet(Collection<T> a, Collection<T> b) { if (a == null || a.isEmpty()) { return b == null || b.isEmpty(); diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 1ce4f4b56d..b65f172173 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -86,10 +86,10 @@ public interface MageObject extends MageItem, Serializable { void setZoneChangeCounter(int value, Game game); - default boolean isHistoric(){ + default boolean isHistoric() { return getCardType().contains(CardType.ARTIFACT) || getSuperType().contains(SuperType.LEGENDARY) - || hasSubtype(SubType.SAGA, null ); + || hasSubtype(SubType.SAGA, null); } default boolean isCreature() { @@ -116,6 +116,10 @@ public interface MageObject extends MageItem, Serializable { return getCardType().contains(CardType.SORCERY); } + default boolean isInstantOrSorcery() { + return this.isInstant() || this.isSorcery(); + } + default boolean isPlaneswalker() { return getCardType().contains(CardType.PLANESWALKER); } diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index be99ef4b1d..051b958457 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -9,7 +9,7 @@ import java.util.UUID; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; @@ -158,8 +158,8 @@ public abstract class MageObjectImpl implements MageObject { @Override public int getStartingLoyalty() { for (Ability ab : getAbilities()) { - if (ab instanceof PlanswalkerEntersWithLoyalityCountersAbility) { - return ((PlanswalkerEntersWithLoyalityCountersAbility) ab).getStartingLoyalty(); + if (ab instanceof PlaneswalkerEntersWithLoyaltyCountersAbility) { + return ((PlaneswalkerEntersWithLoyaltyCountersAbility) ab).getStartingLoyalty(); } } return 0; diff --git a/Mage/src/main/java/mage/abilities/Ability.java b/Mage/src/main/java/mage/abilities/Ability.java index 2f5324f120..9701e1a140 100644 --- a/Mage/src/main/java/mage/abilities/Ability.java +++ b/Mage/src/main/java/mage/abilities/Ability.java @@ -1,4 +1,3 @@ - package mage.abilities; import java.io.Serializable; @@ -14,7 +13,6 @@ import mage.abilities.effects.Effects; import mage.constants.AbilityType; import mage.constants.AbilityWord; import mage.constants.EffectType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.game.Controllable; import mage.game.Game; @@ -23,6 +21,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.Targets; +import mage.target.targetadjustment.TargetAdjuster; import mage.watchers.Watcher; /** @@ -527,7 +526,9 @@ public interface Ability extends Controllable, Serializable { boolean canFizzle(); - void setTargetAdjustment(TargetAdjustment targetAdjustment); + void setTargetAdjuster(TargetAdjuster targetAdjuster); - TargetAdjustment getTargetAdjustment(); + TargetAdjuster getTargetAdjuster(); + + void adjustTargets(Game game); } diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 800b1242a3..6047e07969 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -1,4 +1,3 @@ - package mage.abilities; import java.util.ArrayList; @@ -33,6 +32,7 @@ import mage.game.stack.StackAbility; import mage.players.Player; import mage.target.Target; import mage.target.Targets; +import mage.target.targetadjustment.TargetAdjuster; import mage.util.GameLog; import mage.util.ThreadLocalStringBuilder; import mage.watchers.Watcher; @@ -72,7 +72,7 @@ public abstract class AbilityImpl implements Ability { protected List<Watcher> watchers = new ArrayList<>(); protected List<Ability> subAbilities = null; protected boolean canFizzle = true; - protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE; + protected TargetAdjuster targetAdjuster = null; public AbilityImpl(AbilityType abilityType, Zone zone) { this.id = UUID.randomUUID(); @@ -119,7 +119,7 @@ public abstract class AbilityImpl implements Ability { this.sourceObject = ability.sourceObject; this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter; this.canFizzle = ability.canFizzle; - this.targetAdjustment = ability.targetAdjustment; + this.targetAdjuster = ability.targetAdjuster; } @Override @@ -1225,12 +1225,19 @@ public abstract class AbilityImpl implements Ability { } @Override - public void setTargetAdjustment(TargetAdjustment targetAdjustment) { - this.targetAdjustment = targetAdjustment; + public void setTargetAdjuster(TargetAdjuster targetAdjuster) { + this.targetAdjuster = targetAdjuster; } @Override - public TargetAdjustment getTargetAdjustment() { - return targetAdjustment; + public TargetAdjuster getTargetAdjuster() { + return targetAdjuster; + } + + @Override + public void adjustTargets(Game game) { + if (targetAdjuster != null) { + targetAdjuster.adjustTargets(this, game); + } } } diff --git a/Mage/src/main/java/mage/abilities/DelayedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/DelayedTriggeredAbility.java index 8748e25d3f..739915cc4c 100644 --- a/Mage/src/main/java/mage/abilities/DelayedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/DelayedTriggeredAbility.java @@ -13,7 +13,7 @@ import mage.game.Game; public abstract class DelayedTriggeredAbility extends TriggeredAbilityImpl { private Duration duration; - private boolean triggerOnlyOnce; + protected boolean triggerOnlyOnce; public DelayedTriggeredAbility(Effect effect) { this(effect, Duration.EndOfGame); diff --git a/Mage/src/main/java/mage/abilities/Mode.java b/Mage/src/main/java/mage/abilities/Mode.java index 0c336d121a..02e9d9144e 100644 --- a/Mage/src/main/java/mage/abilities/Mode.java +++ b/Mage/src/main/java/mage/abilities/Mode.java @@ -1,9 +1,10 @@ - package mage.abilities; import java.io.Serializable; import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; +import mage.target.Target; import mage.target.Targets; /** @@ -13,16 +14,23 @@ import mage.target.Targets; public class Mode implements Serializable { protected UUID id; - protected Targets targets; - protected Effects effects; + protected final Targets targets; + protected final Effects effects; public Mode() { + this((Effect) null); + } + + public Mode(Effect effect) { this.id = UUID.randomUUID(); this.targets = new Targets(); this.effects = new Effects(); + if (effect != null) { + this.effects.add(effect); + } } - public Mode(Mode mode) { + public Mode(final Mode mode) { this.id = mode.id; this.targets = mode.targets.copy(); this.effects = mode.effects.copy(); @@ -44,7 +52,15 @@ public class Mode implements Serializable { return targets; } + public void addTarget(Target target) { + targets.add(target); + } + public Effects getEffects() { return effects; } + + public void addEffect(Effect effect) { + effects.add(effect); + } } diff --git a/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java b/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java index e7d12c05c7..2d6fe3a254 100644 --- a/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java @@ -10,7 +10,6 @@ import mage.constants.Zone; import mage.game.Game; /** - * * @author LevelX2 */ public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl { @@ -37,15 +36,12 @@ public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl { } else { sb.append(" Activate this ability only "); } - if (condition.toString() != null) { - if (!condition.toString().startsWith("during") - && !condition.toString().startsWith("before")) { - sb.append("if "); - } - sb.append(condition.toString()).append('.'); - } else { - sb.append(" [Condition toString() == null] "); + if (!condition.toString().startsWith("during") + && !condition.toString().startsWith("before")) { + sb.append("if "); } + sb.append(condition.toString()).append('.'); + return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java index abbebcf05e..3ece2bd954 100644 --- a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.common; import java.util.Locale; @@ -68,6 +67,7 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { } break; case ANY: + case EACH_PLAYER: case NEXT: if (getTargets().isEmpty()) { for (Effect effect : this.getEffects()) { @@ -123,6 +123,8 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of each opponent's end step, ").toString(); case ANY: return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of each end step, ").toString(); + case EACH_PLAYER: + return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of each player's end step, ").toString(); case CONTROLLER_ATTACHED_TO: return sb.insert(0, generateConditionString()).insert(0, abilityWordRule + "At the beginning of the end step of enchanted permanent's controller, ").toString(); } diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java index 19fb7eacfd..7d4a85629c 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java @@ -31,7 +31,7 @@ public class DealsDamageToOneOrMoreCreaturesTriggeredAbility extends DealsDamage || game.getTurn().getStepType() == PhaseStep.FIRST_COMBAT_DAMAGE) { String stepHash = (String) game.getState().getValue("damageStep" + getOriginalId()); String newStepHash = game.getStep().getType().toString() + game.getTurnNum(); - if (stepHash == null || !newStepHash.equals(stepHash)) { + if (!newStepHash.equals(stepHash)) { // this ability did not trigger during this damage step game.getState().setValue("damageStep" + getOriginalId(), game.getStep().getType().toString() + game.getTurnNum()); return true; diff --git a/Mage/src/main/java/mage/abilities/common/DiesAttachedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DiesAttachedTriggeredAbility.java index 3eb151ac1e..351ba9821e 100644 --- a/Mage/src/main/java/mage/abilities/common/DiesAttachedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DiesAttachedTriggeredAbility.java @@ -62,41 +62,40 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).isDiesEvent()) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; boolean triggered = false; - if (zEvent != null) { - if (zEvent.getTarget() != null && zEvent.getTarget().getAttachments() != null && zEvent.getTarget().getAttachments().contains(this.getSourceId())) { - triggered = true; - } else { - // If both (attachment and attached went to graveyard at the same time, the attachemnets can be already removed from the attached object.) - // So check here with the LKI of the enchantment - Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); - if (attachment != null - && zEvent.getTargetId() != null && attachment.getAttachedTo() != null - && zEvent.getTargetId().equals(attachment.getAttachedTo())) { - Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo()); - if (attachedTo != null - && attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)) { // zoneChangeCounter is stored in Permanent - triggered = true; + if (zEvent.getTarget() != null && zEvent.getTarget().getAttachments() != null && zEvent.getTarget().getAttachments().contains(this.getSourceId())) { + triggered = true; + } else { + // If both (attachment and attached went to graveyard at the same time, the attachemnets can be already removed from the attached object.) + // So check here with the LKI of the enchantment + Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); + if (attachment != null + && zEvent.getTargetId() != null && attachment.getAttachedTo() != null + && zEvent.getTargetId().equals(attachment.getAttachedTo())) { + Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo()); + if (attachedTo != null + && attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)) { // zoneChangeCounter is stored in Permanent + triggered = true; + } + } + } + if (triggered) { + for (Effect effect : getEffects()) { + if (zEvent.getTarget() != null) { + effect.setValue("attachedTo", zEvent.getTarget()); + if (setTargetPointer == SetTargetPointer.ATTACHED_TO_CONTROLLER) { + Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); + if (attachment != null && attachment.getAttachedTo() != null) { + Permanent attachedTo = (Permanent) game.getLastKnownInformation(attachment.getAttachedTo(), Zone.BATTLEFIELD, attachment.getAttachedToZoneChangeCounter()); + if (attachedTo != null) { + effect.setTargetPointer(new FixedTarget(attachedTo.getControllerId())); + } + } } } } - if (triggered) { - for (Effect effect : getEffects()) { - if (zEvent.getTarget() != null) { - effect.setValue("attachedTo", zEvent.getTarget()); - if (setTargetPointer == SetTargetPointer.ATTACHED_TO_CONTROLLER) { - Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); - if (attachment != null && attachment.getAttachedTo() != null) { - Permanent attachedTo = (Permanent) game.getLastKnownInformation(attachment.getAttachedTo(), Zone.BATTLEFIELD, attachment.getAttachedToZoneChangeCounter()); - if (attachedTo != null) { - effect.setTargetPointer(new FixedTarget(attachedTo.getControllerId())); - } - } - } - } - } - return true; - } + return true; } + } return false; } diff --git a/Mage/src/main/java/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java b/Mage/src/main/java/mage/abilities/common/PlaneswalkerEntersWithLoyaltyCountersAbility.java similarity index 67% rename from Mage/src/main/java/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java rename to Mage/src/main/java/mage/abilities/common/PlaneswalkerEntersWithLoyaltyCountersAbility.java index d47119c7f8..58cecdbb69 100644 --- a/Mage/src/main/java/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java +++ b/Mage/src/main/java/mage/abilities/common/PlaneswalkerEntersWithLoyaltyCountersAbility.java @@ -12,17 +12,17 @@ import mage.counters.CounterType; * * @author LevelX2 */ -public class PlanswalkerEntersWithLoyalityCountersAbility extends EntersBattlefieldAbility { +public class PlaneswalkerEntersWithLoyaltyCountersAbility extends EntersBattlefieldAbility { private final int startingLoyalty; - public PlanswalkerEntersWithLoyalityCountersAbility(int loyalty) { + public PlaneswalkerEntersWithLoyaltyCountersAbility(int loyalty) { super(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(loyalty))); startingLoyalty = loyalty; setRuleVisible(false); } - public PlanswalkerEntersWithLoyalityCountersAbility(final PlanswalkerEntersWithLoyalityCountersAbility ability) { + public PlaneswalkerEntersWithLoyaltyCountersAbility(final PlaneswalkerEntersWithLoyaltyCountersAbility ability) { super(ability); startingLoyalty = ability.startingLoyalty; } @@ -32,7 +32,7 @@ public class PlanswalkerEntersWithLoyalityCountersAbility extends EntersBattlefi } @Override - public PlanswalkerEntersWithLoyalityCountersAbility copy() { - return new PlanswalkerEntersWithLoyalityCountersAbility(this); + public PlaneswalkerEntersWithLoyaltyCountersAbility copy() { + return new PlaneswalkerEntersWithLoyaltyCountersAbility(this); } } diff --git a/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java index a0d3c0f0e8..b41e1001bb 100644 --- a/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java @@ -1,62 +1,62 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package mage.abilities.common; - -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; - -/** - * - * @author fireshoes - */ -public class SpellCounteredControllerTriggeredAbility extends TriggeredAbilityImpl { - - public SpellCounteredControllerTriggeredAbility(Effect effect) { - this(effect, false); - } - - public SpellCounteredControllerTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } - - public SpellCounteredControllerTriggeredAbility(final SpellCounteredControllerTriggeredAbility ability) { - super(ability); - } - - @Override - public SpellCounteredControllerTriggeredAbility copy() { - return new SpellCounteredControllerTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.COUNTERED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - StackObject stackObjectThatCountered = game.getStack().getStackObject(event.getSourceId()); - if (stackObjectThatCountered == null) { - stackObjectThatCountered = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK); - } - if (stackObjectThatCountered != null && stackObjectThatCountered.isControlledBy(getControllerId())) { - StackObject counteredStackObject = (StackObject) game.getLastKnownInformation(event.getTargetId(), Zone.STACK); - return counteredStackObject != null && (counteredStackObject instanceof Spell); - } - return false; - } - - @Override - public String getRule() { - return "Whenever a spell or ability you control counters a spell, " + super.getRule(); - } -} +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; + +/** + * + * @author fireshoes + */ +public class SpellCounteredControllerTriggeredAbility extends TriggeredAbilityImpl { + + public SpellCounteredControllerTriggeredAbility(Effect effect) { + this(effect, false); + } + + public SpellCounteredControllerTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public SpellCounteredControllerTriggeredAbility(final SpellCounteredControllerTriggeredAbility ability) { + super(ability); + } + + @Override + public SpellCounteredControllerTriggeredAbility copy() { + return new SpellCounteredControllerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTERED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + StackObject stackObjectThatCountered = game.getStack().getStackObject(event.getSourceId()); + if (stackObjectThatCountered == null) { + stackObjectThatCountered = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK); + } + if (stackObjectThatCountered != null && stackObjectThatCountered.isControlledBy(getControllerId())) { + StackObject counteredStackObject = (StackObject) game.getLastKnownInformation(event.getTargetId(), Zone.STACK); + return (counteredStackObject instanceof Spell); + } + return false; + } + + @Override + public String getRule() { + return "Whenever a spell or ability you control counters a spell, " + super.getRule(); + } +} diff --git a/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java index 4b95507e5a..603d43cc69 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java @@ -1,40 +1,40 @@ - -package mage.abilities.condition.common; - -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.condition.Condition; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.NamePredicate; -import mage.filter.predicate.other.OwnerIdPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; - -/** - * - * @author emerald000 - */ -public class MeldCondition implements Condition { - - private final String meldWithName; - - public MeldCondition(String meldWithName) { - this.meldWithName = meldWithName; - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject sourceMageObject = source.getSourceObjectIfItStillExists(game); - if (sourceMageObject != null && sourceMageObject instanceof Permanent) { - Permanent sourcePermanent = (Permanent) sourceMageObject; - if (sourcePermanent.isControlledBy(source.getControllerId()) - && sourcePermanent.isOwnedBy(source.getControllerId())) { - FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - filter.add(new NamePredicate(this.meldWithName)); - filter.add(new OwnerIdPredicate(source.getControllerId())); - return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0; - } - } - return false; - } -} + +package mage.abilities.condition.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author emerald000 + */ +public class MeldCondition implements Condition { + + private final String meldWithName; + + public MeldCondition(String meldWithName) { + this.meldWithName = meldWithName; + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceMageObject = source.getSourceObjectIfItStillExists(game); + if (sourceMageObject instanceof Permanent) { + Permanent sourcePermanent = (Permanent) sourceMageObject; + if (sourcePermanent.isControlledBy(source.getControllerId()) + && sourcePermanent.isOwnedBy(source.getControllerId())) { + FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + filter.add(new NamePredicate(this.meldWithName)); + filter.add(new OwnerIdPredicate(source.getControllerId())); + return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0; + } + } + return false; + } +} diff --git a/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java index 9e808722ef..d4a8223399 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java @@ -19,9 +19,9 @@ import mage.game.Game; */ public class MostCommonColorCondition implements Condition { - protected ObjectColor compareColor; - protected boolean isMono; - protected Predicate predicate; + protected final ObjectColor compareColor; + protected final boolean isMono; + protected final Predicate predicate; public MostCommonColorCondition(ObjectColor color) { this(color, false, null); @@ -31,6 +31,7 @@ public class MostCommonColorCondition implements Condition { public MostCommonColorCondition(ObjectColor color, boolean isMono, Predicate predicate) { this.compareColor = color; this.isMono = isMono; + this.predicate = predicate; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java index 9d603e0bcf..6e99dfaf8f 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java @@ -25,6 +25,11 @@ public class HighestConvertedManaCostValue implements DynamicValue { this.filter = filter; } + public HighestConvertedManaCostValue(final HighestConvertedManaCostValue dynamicValue){ + super(); + this.filter = dynamicValue.filter.copy(); + } + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Player controller = game.getPlayer(sourceAbility.getControllerId()); @@ -41,7 +46,7 @@ public class HighestConvertedManaCostValue implements DynamicValue { @Override public DynamicValue copy() { - return new HighestConvertedManaCostValue(); + return new HighestConvertedManaCostValue(this); } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java new file mode 100644 index 0000000000..accaf56ad6 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java @@ -0,0 +1,43 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.cards.Card; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +/** + * @author TheElk801 + */ +public enum InstantSorceryExileGraveyardCount implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player != null) { + int exileCount = 0; + for (Card exiledCard : game.getExile().getAllCards(game)) { + if (exiledCard.getOwnerId().equals(player.getId()) && exiledCard.isInstantOrSorcery()) { + exileCount++; + } + } + return player.getGraveyard().count( + StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game + ) + exileCount; + } + return 0; + } + + @Override + public InstantSorceryExileGraveyardCount copy() { + return instance; + } + + @Override + public String getMessage() { + return ""; + } +} diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java index 9948b486a3..d42cc3f528 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SunburstCount.java @@ -24,7 +24,7 @@ public class SunburstCount implements DynamicValue { int count = 0; if (!game.getStack().isEmpty()) { StackObject spell = game.getStack().getFirst(); - if (spell != null && spell instanceof Spell && ((Spell) spell).getSourceId().equals(source.getSourceId())) { + if (spell instanceof Spell && ((Spell) spell).getSourceId().equals(source.getSourceId())) { Mana mana = ((Spell) spell).getSpellAbility().getManaCostsToPay().getPayment(); if (mana.getBlack() > 0) { count++; diff --git a/Mage/src/main/java/mage/abilities/effects/AsThoughEffect.java b/Mage/src/main/java/mage/abilities/effects/AsThoughEffect.java index 44c7c14824..1c58869db3 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsThoughEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/AsThoughEffect.java @@ -12,7 +12,7 @@ import mage.game.Game; */ public interface AsThoughEffect extends ContinuousEffect { - boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game); + boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game, UUID playerId); boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game); diff --git a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java index 020d995cce..03ed5c0b3d 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java @@ -1,4 +1,3 @@ - package mage.abilities.effects; import java.util.UUID; @@ -29,8 +28,12 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements } @Override - public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game) { - return applies(objectId, source, affectedAbility.getControllerId(), game); + public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) { + if (getAsThoughEffectType().equals(AsThoughEffectType.LOOK_AT_FACE_DOWN)) { + return applies(objectId, source, playerId, game); + } else { + return applies(objectId, source, affectedAbility.getControllerId(), game); + } } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java index 0fd1aee39b..2e9b42d980 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java @@ -1,4 +1,3 @@ - package mage.abilities.effects; import java.io.Serializable; @@ -496,7 +495,7 @@ public class ContinuousEffects implements Serializable { if (effect.applies(objectId, ability, controllerId, game)) { return new MageObjectReference(ability.getSourceObject(game), game); } - } else if (effect.applies(objectId, affectedAbility, ability, game)) { + } else if (effect.applies(objectId, affectedAbility, ability, game, controllerId)) { return new MageObjectReference(ability.getSourceObject(game), game); } } @@ -512,7 +511,7 @@ public class ContinuousEffects implements Serializable { Set<Ability> abilities = asThoughEffectsMap.get(AsThoughEffectType.SPEND_ONLY_MANA).getAbility(effect.getId()); for (Ability ability : abilities) { if ((affectedAbility == null && effect.applies(objectId, ability, controllerId, game)) - || effect.applies(objectId, affectedAbility, ability, game)) { + || effect.applies(objectId, affectedAbility, ability, game, controllerId)) { if (((AsThoughManaEffect) effect).getAsThoughManaType(manaType, mana, controllerId, ability, game) == null) { return null; } @@ -525,7 +524,7 @@ public class ContinuousEffects implements Serializable { Set<Ability> abilities = asThoughEffectsMap.get(AsThoughEffectType.SPEND_OTHER_MANA).getAbility(effect.getId()); for (Ability ability : abilities) { if ((affectedAbility == null && effect.applies(objectId, ability, controllerId, game)) - || effect.applies(objectId, affectedAbility, ability, game)) { + || effect.applies(objectId, affectedAbility, ability, game, controllerId)) { ManaType usableManaType = ((AsThoughManaEffect) effect).getAsThoughManaType(manaType, mana, controllerId, ability, game); if (usableManaType != null) { return usableManaType; diff --git a/Mage/src/main/java/mage/abilities/effects/common/CastSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/effects/common/CastSourceTriggeredAbility.java index 60b9b9468d..b9b552d762 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CastSourceTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CastSourceTriggeredAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.effects.common; import mage.MageObject; @@ -16,18 +15,25 @@ import mage.game.stack.Spell; public class CastSourceTriggeredAbility extends TriggeredAbilityImpl { public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility"; + private final String rulePrefix; public CastSourceTriggeredAbility(Effect effect) { this(effect, false); } public CastSourceTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, ""); + } + + public CastSourceTriggeredAbility(Effect effect, boolean optional, String rulePrefix) { super(Zone.STACK, effect, optional); this.ruleAtTheTop = true; + this.rulePrefix = rulePrefix; } public CastSourceTriggeredAbility(final CastSourceTriggeredAbility ability) { super(ability); + this.rulePrefix = ability.rulePrefix; } @Override @@ -44,7 +50,7 @@ public class CastSourceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getSourceId().equals(this.getSourceId())) { MageObject spellObject = game.getObject(sourceId); - if (spellObject != null && (spellObject instanceof Spell)) { + if ((spellObject instanceof Spell)) { Spell spell = (Spell) spellObject; if (spell.getSpellAbility() != null) { for (Effect effect : getEffects()) { @@ -59,6 +65,6 @@ public class CastSourceTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When you cast {source}, " + super.getRule(); + return rulePrefix + "When you cast this spell, " + super.getRule(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java index e8fc6ab108..86edae8d1f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java @@ -18,7 +18,7 @@ import mage.util.CardUtil; */ public class ChooseACardNameEffect extends OneShotEffect { - public static String INFO_KEY = "NAMED_CARD"; + public static final String INFO_KEY = "NAMED_CARD"; public enum TypeOfName { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java index ee84454831..739aaaeca4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java @@ -22,7 +22,7 @@ import mage.util.CardUtil; */ public class ChooseBasicLandTypeEffect extends OneShotEffect { - public static String VALUE_KEY = "BasicLandType"; + public static final String VALUE_KEY = "BasicLandType"; public ChooseBasicLandTypeEffect(Outcome outcome) { super(outcome); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java index a41257ec93..c1bdd3f9f4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java @@ -62,7 +62,7 @@ public class ChooseCreatureTypeEffect extends OneShotEffect { * @param game * @return */ - public static SubType getChoosenCreatureType(UUID objectId, Game game) { + public static SubType getChosenCreatureType(UUID objectId, Game game) { SubType creatureType = null; Object savedCreatureType = game.getState().getValue(objectId + "_type"); if (savedCreatureType != null) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseOpponentEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseOpponentEffect.java index 8b7662df2b..8c841e907f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseOpponentEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseOpponentEffect.java @@ -21,7 +21,7 @@ import mage.util.CardUtil; */ public class ChooseOpponentEffect extends OneShotEffect { - public static String VALUE_KEY = "_opponent"; + public static final String VALUE_KEY = "_opponent"; public ChooseOpponentEffect(Outcome outcome) { super(outcome); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyTargetSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyTargetSpellEffect.java index 9278af4374..040be4c85d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyTargetSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyTargetSpellEffect.java @@ -54,7 +54,7 @@ public class CopyTargetSpellEffect extends OneShotEffect { if (spell != null) { StackObject newStackObject = spell.createCopyOnStack(game, source, useController ? spell.getControllerId() : source.getControllerId(), true); Player player = game.getPlayer(source.getControllerId()); - if (player != null && newStackObject != null && newStackObject instanceof Spell) { + if (player != null && newStackObject instanceof Spell) { String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java index 5e15a0c802..df18d2d691 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DamageMultiEffect.java @@ -1,4 +1,3 @@ - package mage.abilities.effects.common; import java.util.UUID; @@ -71,6 +70,9 @@ public class DamageMultiEffect extends OneShotEffect { if (staticText != null && !staticText.isEmpty()) { return staticText; } + if (amount.toString().equals("3")) { + return this.sourceName + " deals 3 damage divided as you choose among one, two, or three targets"; + } return this.sourceName + " deals " + amount.toString() + " damage divided as you choose among any number of " + mode.getTargets().get(0).getTargetName(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java index a68dc8e27f..845fe9e5a4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java @@ -27,7 +27,10 @@ public class DoIfCostPaid extends OneShotEffect { } public DoIfCostPaid(Effect effect, Effect effect2, Cost cost) { - this(effect, cost, null, true); + this(effect,effect2,cost,true); + } + public DoIfCostPaid(Effect effect, Effect effect2, Cost cost,boolean optional) { + this(effect, cost, null, optional); this.otherwiseEffects.add(effect2); } @@ -54,8 +57,9 @@ public class DoIfCostPaid extends OneShotEffect { this.optional = effect.optional; } - public void addEffect(Effect effect) { + public DoIfCostPaid addEffect(Effect effect) { executingEffects.add(effect); + return this; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java index 306a8e4650..486bbe1296 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java @@ -39,7 +39,7 @@ public class EntersBattlefieldWithXCountersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null) { - if (permanent == null && source.getAbilityType() == AbilityType.STATIC) { + if (source.getAbilityType() == AbilityType.STATIC) { permanent = game.getPermanentEntering(source.getSourceId()); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index 285dd2b9fa..608124199c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -81,7 +81,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop, boolean reveal) { this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, - targetZoneLookedCards, putOnTop, reveal, false); + targetZoneLookedCards, putOnTop, reveal, reveal); } public LookLibraryAndPickControllerEffect(int numberOfCards, diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java index 601f0423c8..5c857c93c2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java @@ -6,6 +6,7 @@ import mage.constants.Duration; import mage.abilities.Ability; import mage.abilities.effects.PreventionEffectImpl; import mage.filter.FilterInPlay; +import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.events.DamageEvent; import mage.game.events.GameEvent; @@ -18,9 +19,9 @@ import mage.players.Player; */ public class PreventAllNonCombatDamageToAllEffect extends PreventionEffectImpl { - protected FilterInPlay filter; + protected final FilterPermanent filter; - public PreventAllNonCombatDamageToAllEffect(Duration duration, FilterInPlay filter) { + public PreventAllNonCombatDamageToAllEffect(Duration duration, FilterPermanent filter) { super(duration, Integer.MAX_VALUE, false); this.filter = filter; staticText = "Prevent all non combat damage that would be dealt to " + filter.getMessage() + ' ' + duration.toString(); @@ -42,15 +43,7 @@ public class PreventAllNonCombatDamageToAllEffect extends PreventionEffectImpl { && !((DamageEvent) event).isCombatDamage()) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { - return true; - } - } - else { - Player player = game.getPlayer(event.getTargetId()); - if (player != null && filter.match(player, source.getSourceId(), source.getControllerId(), game)) { - return true; - } + return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); } } return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java index 7584851375..ff587be44f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java @@ -37,7 +37,7 @@ public class ReturnToBattlefieldUnderOwnerControlAttachedEffect extends OneShotE return false; } Object object = getValue("attachedTo"); - if (object != null && object instanceof Permanent) { + if (object instanceof Permanent) { Card card = game.getCard(((Permanent) object).getId()); if (card != null) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java index b23a11e1d0..657a347d2b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java @@ -66,7 +66,7 @@ public class ReturnToBattlefieldUnderOwnerControlTargetEffect extends OneShotEff } else { Card card = game.getCard(targetId); - if (card != null && card instanceof MeldCard) { + if (card instanceof MeldCard) { MeldCard meldCard = (MeldCard) card; Card topCard = meldCard.getTopHalfCard(); Card bottomCard = meldCard.getBottomHalfCard(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java index 55130c8f3b..c3156147b8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java @@ -43,7 +43,7 @@ public class ReturnToBattlefieldUnderYourControlAttachedEffect extends OneShotEf public boolean apply(Game game, Ability source) { Object object = getValue("attachedTo"); Player controller = game.getPlayer(source.getControllerId()); - if (controller != null && object != null && object instanceof Permanent) { + if (controller != null && object instanceof Permanent) { Card card = game.getCard(((Permanent) object).getId()); // Move the card only, if it is still in the next zone after the battlefield if (card != null && card.getZoneChangeCounter(game) == ((Permanent) object).getZoneChangeCounter(game) + 1) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java index 05787cfd2f..e8bd4ab47a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java @@ -64,7 +64,7 @@ public class ReturnToBattlefieldUnderYourControlTargetEffect extends OneShotEffe } else { Card card = game.getCard(targetId); - if (card != null && card instanceof MeldCard) { + if (card instanceof MeldCard) { MeldCard meldCard = (MeldCard) card; Card topCard = meldCard.getTopHalfCard(); Card bottomCard = meldCard.getBottomHalfCard(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandAttachedEffect.java index ff3dce414b..368788d3f2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandAttachedEffect.java @@ -33,7 +33,7 @@ public class ReturnToHandAttachedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Object object = getValue("attachedTo"); - if (object != null && object instanceof Permanent) { + if (object instanceof Permanent) { Card card = game.getCard(((Permanent)object).getId()); if (card != null) { if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/RollPlanarDieEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RollPlanarDieEffect.java index 8d9d108fad..8defc46d6b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/RollPlanarDieEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/RollPlanarDieEffect.java @@ -76,7 +76,7 @@ public class RollPlanarDieEffect extends OneShotEffect { for (int i = 0; i < chaosEffects.size(); i++) { Effect effect = chaosEffects.get(i); Target target = null; - if (chaosTargets != null && chaosTargets.size() > i) { + if (chaosTargets.size() > i) { target = chaosTargets.get(i); } boolean done = false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java index 5e70a7f70f..e3636ad588 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java @@ -47,7 +47,7 @@ public class TransformSourceEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObjectIfItStillExists(game); // Transform only if it's the same object as the effect was put on the stack - if (sourceObject != null && sourceObject instanceof Permanent) { + if (sourceObject instanceof Permanent) { Permanent sourcePermanent = (Permanent) sourceObject; if (sourcePermanent.canTransform(source, game)) { // check not to transform twice the same side diff --git a/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java index 4b95b39ace..78834f82ae 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java @@ -37,7 +37,7 @@ public class UntapAllThatAttackedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Watcher watcher = game.getState().getWatchers().get(AttackedThisTurnWatcher.class.getSimpleName()); - if (watcher != null && watcher instanceof AttackedThisTurnWatcher) { + if (watcher instanceof AttackedThisTurnWatcher) { Set<MageObjectReference> attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures(); for (MageObjectReference mor : attackedThisTurn) { Permanent permanent = mor.getPermanent(game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java index 66f45a13dd..44b4356b8e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java @@ -25,7 +25,7 @@ public class AttacksIfAbleSourceEffect extends RequirementEffect { super(duration); this.eachCombat = eachCombat; if (this.duration == Duration.EndOfTurn) { - staticText = "{this} attacks " + (eachCombat ? "each combat" : "this turn") + " if able"; + staticText = "{this} attacks " + (eachCombat ? "each combat" : "this combat") + " if able"; } else { staticText = "{this} attacks each " + (eachCombat ? "combat" : "turn") + " if able"; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java index 4f76c81b72..d15adb8048 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java @@ -43,7 +43,7 @@ public class ActivateAbilitiesAnyTimeYouCouldCastInstantEffect extends AsThoughE } @Override - public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game) { + public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) { return affectedAbility.isControlledBy(source.getControllerId()) && activatedAbility.isInstance(affectedAbility); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java index b0123bb40f..66bfc9bf0a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java @@ -15,8 +15,8 @@ import mage.game.permanent.Permanent; public class AddCardSubtypeAllEffect extends ContinuousEffectImpl { - private static FilterPermanent filter; - private static SubType addedSubtype; + private FilterPermanent filter; + private SubType addedSubtype; public AddCardSubtypeAllEffect(FilterPermanent _filter, SubType _addedSubtype, DependencyType _dependency) { super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); @@ -28,6 +28,8 @@ public class AddCardSubtypeAllEffect extends ContinuousEffectImpl { public AddCardSubtypeAllEffect(final AddCardSubtypeAllEffect effect) { super(effect); + filter = effect.filter.copy(); + addedSubtype = effect.addedSubtype; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddChosenSubtypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddChosenSubtypeEffect.java index bb86dce4a5..cf8c158d7b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddChosenSubtypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddChosenSubtypeEffect.java @@ -22,7 +22,7 @@ public class AddChosenSubtypeEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(permanent.getId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(permanent.getId(), game); if (subType != null && !permanent.hasSubtype(subType, game)) { permanent.getSubtype(game).add(subType); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllOfChosenSubtypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllOfChosenSubtypeEffect.java index 7ee579c1fb..cfc1f2a7b5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllOfChosenSubtypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllOfChosenSubtypeEffect.java @@ -49,7 +49,7 @@ public class BoostAllOfChosenSubtypeEffect extends BoostAllEffect { @Override protected void setRuntimeData(Ability source, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { subtype = subType; } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java index bdf7ecbee9..3eb33e61e4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java @@ -32,7 +32,7 @@ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(source.getFirstTarget()); + Permanent target = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (target != null) { int power = target.getPower().getValue(); target.getPower().setValue(target.getToughness().getValue()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenSubtypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenSubtypeEffect.java index 4a8fdf40d0..7655362906 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenSubtypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenSubtypeEffect.java @@ -37,7 +37,7 @@ public class SpellsCostReductionAllOfChosenSubtypeEffect extends SpellsCostReduc @Override protected boolean selectedByRuntimeData(Card card, Ability source, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType != null) { return card.hasSubtype(subType, game); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java index 8468f9ead0..7f1d990bb2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java @@ -1,4 +1,3 @@ - package mage.abilities.effects.common.search; import mage.MageObject; @@ -28,10 +27,14 @@ public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect { } public SearchLibraryGraveyardPutInHandEffect(FilterCard filter, boolean forceToSearchBoth) { + this(filter, forceToSearchBoth, false); + } + + public SearchLibraryGraveyardPutInHandEffect(FilterCard filter, boolean forceToSearchBoth, boolean youMay) { super(Outcome.Benefit); this.filter = filter; this.forceToSearchBoth = forceToSearchBoth; - staticText = "search your library and" + (forceToSearchBoth ? "" : "/or") + " graveyard for a card named " + filter.getMessage() + staticText = (youMay ? "You may" : "") + "search your library and" + (forceToSearchBoth ? "" : "/or") + " graveyard for a card named " + filter.getMessage() + ", reveal it, and put it into your hand. " + (forceToSearchBoth ? "Then shuffle your library" : "If you search your library this way, shuffle it"); } diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/FatesealEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/FatesealEffect.java index cf36084701..264c11484e 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/FatesealEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/FatesealEffect.java @@ -24,7 +24,7 @@ import mage.util.CardUtil; public class FatesealEffect extends OneShotEffect { - protected static FilterCard filter1 = new FilterCard("card to put on the bottom of opponent's library"); + protected static final FilterCard filter1 = new FilterCard("card to put on the bottom of opponent's library"); protected int fatesealNumber; diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ScryEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ScryEffect.java index b714b72f2d..99fd8e360a 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ScryEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ScryEffect.java @@ -1,10 +1,8 @@ - package mage.abilities.effects.keyword; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; -import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; @@ -15,8 +13,6 @@ import mage.util.CardUtil; */ public class ScryEffect extends OneShotEffect { - protected static FilterCard filter1 = new FilterCard("card to put on the bottom of your library"); - protected int scryNumber; public ScryEffect(int scryNumber) { diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/SurveilEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/SurveilEffect.java new file mode 100644 index 0000000000..6ac26220de --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/keyword/SurveilEffect.java @@ -0,0 +1,54 @@ +package mage.abilities.effects.keyword; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author TheElk801 + */ +public class SurveilEffect extends OneShotEffect { + + protected int surveilNumber; + + public SurveilEffect(int scryNumber) { + super(Outcome.Benefit); + this.surveilNumber = scryNumber; + this.setText(); + } + + public SurveilEffect(final SurveilEffect effect) { + super(effect); + this.surveilNumber = effect.surveilNumber; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + return player.surveil(surveilNumber, source, game); + } + return false; + } + + @Override + public SurveilEffect copy() { + return new SurveilEffect(this); + } + + private void setText() { + StringBuilder sb = new StringBuilder("surveil ").append(surveilNumber); + if (surveilNumber == 1) { + sb.append(". <i>(Look at the top card of your library. You may put that card into your graveyard.)</i>"); + } else { + sb.append(". <i>(Look at the top "); + sb.append(CardUtil.numberToText(surveilNumber)); + sb.append(" cards of your library, then put any number of them into your graveyard and the rest on top in any order.)</i>"); + } + staticText = sb.toString(); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfAnyColorEffect.java b/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfAnyColorEffect.java index ae56882269..dc03549ea0 100644 --- a/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfAnyColorEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfAnyColorEffect.java @@ -16,12 +16,17 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect { protected final int amount; protected final ArrayList<Mana> netMana = new ArrayList<>(); + protected final boolean setFlag; public AddManaOfAnyColorEffect() { this(1); } public AddManaOfAnyColorEffect(int amount) { + this(amount, false); + } + + public AddManaOfAnyColorEffect(int amount, boolean setFlag) { super(new Mana(0, 0, 0, 0, 0, 0, amount, 0)); this.amount = amount; netMana.add(Mana.GreenMana(amount)); @@ -30,12 +35,14 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect { netMana.add(Mana.WhiteMana(amount)); netMana.add(Mana.RedMana(amount)); this.staticText = "add " + CardUtil.numberToText(amount) + " mana of any " + (amount > 1 ? "one " : "") + "color"; + this.setFlag = setFlag; } public AddManaOfAnyColorEffect(final AddManaOfAnyColorEffect effect) { super(effect); this.amount = effect.amount; this.netMana.addAll(effect.netMana); + this.setFlag = effect.setFlag; } @Override @@ -66,7 +73,9 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect { ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId())); if (controller.choose(outcome, choice, game)) { if (choice.getColor() != null) { - return choice.getMana(amount); + Mana mana = choice.getMana(amount); + mana.setFlag(setFlag); + return mana; } } } diff --git a/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java b/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java index 419b78a155..d661dea215 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java @@ -149,7 +149,7 @@ class AftermathExileAsResolvesFromGraveyard extends ReplacementEffectImpl { // wants to do that in the future. UUID sourceId = source.getSourceId(); Card sourceCard = game.getCard(source.getSourceId()); - if (sourceCard != null && sourceCard instanceof SplitCardHalf) { + if (sourceCard instanceof SplitCardHalf) { sourceCard = ((SplitCardHalf) sourceCard).getParentCard(); sourceId = sourceCard.getId(); } @@ -170,7 +170,7 @@ class AftermathExileAsResolvesFromGraveyard extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { UUID sourceId = source.getSourceId(); Card sourceCard = game.getCard(source.getSourceId()); - if (sourceCard != null && sourceCard instanceof SplitCardHalf) { + if (sourceCard instanceof SplitCardHalf) { sourceCard = ((SplitCardHalf) sourceCard).getParentCard(); sourceId = sourceCard.getId(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/AscendAbility.java b/Mage/src/main/java/mage/abilities/keyword/AscendAbility.java index 3a0334470f..2292030e09 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AscendAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AscendAbility.java @@ -22,7 +22,7 @@ import mage.players.Player; */ public class AscendAbility extends SimpleStaticAbility { - public static String ASCEND_RULE = "Ascend <i>(If you control ten or more permanents, you get the city's blessing for the rest of the game.)</i>"; + public static final String ASCEND_RULE = "Ascend <i>(If you control ten or more permanents, you get the city's blessing for the rest of the game.)</i>"; public AscendAbility() { super(Zone.BATTLEFIELD, new AscendContinuousEffect()); diff --git a/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java b/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java index 212d940a9f..30778d34e2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java @@ -272,7 +272,7 @@ class ConspireEffect extends OneShotEffect { Card card = game.getCard(conspiredSpell.getSourceId()); if (card != null) { StackObject newStackObject = conspiredSpell.createCopyOnStack(game, source, source.getControllerId(), true); - if (newStackObject != null && newStackObject instanceof Spell && !game.isSimulation()) { + if (newStackObject instanceof Spell && !game.isSimulation()) { game.informPlayers(controller.getLogName() + ((Spell) newStackObject).getActivatedMessage(game)); } return true; diff --git a/Mage/src/main/java/mage/abilities/keyword/ConvokeAbility.java b/Mage/src/main/java/mage/abilities/keyword/ConvokeAbility.java index a863da01c2..afba2dcd99 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ConvokeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ConvokeAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.keyword; import java.util.ArrayList; @@ -25,6 +24,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; +import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.ManaPool; import mage.players.Player; @@ -223,6 +223,7 @@ class ConvokeEffect extends OneShotEffect { manaPool.unlockManaType(ManaType.COLORLESS); manaName = "colorless"; } + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CONVOKED, perm.getId(), source.getSourceId(), source.getControllerId())); game.informPlayers("Convoke: " + controller.getLogName() + " taps " + perm.getLogName() + " to pay one " + manaName + " mana"); } diff --git a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java index 3d48995f48..b07f6dbd32 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.keyword; import java.util.UUID; @@ -158,7 +157,7 @@ public class FlashbackAbility extends SpellAbility { } /** - * Used for split card sin PlayerImpl method: + * Used for split card in PlayerImpl method: * getOtherUseableActivatedAbilities * * @param abilityName diff --git a/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java b/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java index 3320589b45..9e08681fb9 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java @@ -83,7 +83,7 @@ public class HauntAbility extends TriggeredAbilityImpl { if (card != null) { String key = new StringBuilder("Haunting_").append(getSourceId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString(); Object object = game.getState().getValue(key); - if (object != null && object instanceof FixedTarget) { + if (object instanceof FixedTarget) { FixedTarget target = (FixedTarget) object; if (target.getTarget() != null && target.getTarget().equals(event.getTargetId())) { usedFromExile = true; diff --git a/Mage/src/main/java/mage/abilities/keyword/JumpStartAbility.java b/Mage/src/main/java/mage/abilities/keyword/JumpStartAbility.java new file mode 100644 index 0000000000..815f625c75 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/JumpStartAbility.java @@ -0,0 +1,142 @@ +package mage.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.target.targetpointer.FixedTarget; + +/** + * Jump-start is found on instants and sorceries. You can cast a card with + * jump-start from your graveyard by paying all its regular costs and one + * additional cost: discarding a card from your hand. Casting a spell with + * jump-start follows all the normal timing rules, so sorceries with jump-start + * are still limited to your main phases. A spell with jump-start that was cast + * from your graveyard can still be countered, and if it has targets, it won't + * do anything if all its targets disappear or otherwise become illegal. After a + * spell with jump-start cast from your graveyard resolves, is countered, or + * leaves the stack in any way, it's exiled. + * + * @author TheElk801 + */ +public class JumpStartAbility extends SpellAbility { + + private boolean replacementEffectAdded = false; + + public JumpStartAbility(Card card) { + super(card.getManaCost(), card.getName() + " with jump-start", Zone.GRAVEYARD, SpellAbilityType.BASE_ALTERNATE); + this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); + Cost cost = new DiscardTargetCost(new TargetCardInHand()); + cost.setText(""); + this.addCost(cost); + this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); + this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); + this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; + this.timing = card.getSpellAbility().getTiming(); + + } + + public JumpStartAbility(final JumpStartAbility ability) { + super(ability); + this.replacementEffectAdded = ability.replacementEffectAdded; + } + + @Override + public SpellAbility getSpellAbilityToResolve(Game game) { + Card card = game.getCard(getSourceId()); + if (card != null) { + if (!replacementEffectAdded) { + replacementEffectAdded = true; + ContinuousEffect effect = new JumpStartReplacementEffect(); + effect.setTargetPointer(new FixedTarget(getSourceId(), game.getState().getZoneChangeCounter(getSourceId()))); + game.addEffect(effect, this); + } + } + return this; + } + + @Override + public JumpStartAbility copy() { + return new JumpStartAbility(this); + } + + @Override + public String getRule(boolean all) { + return getRule(); + } + + @Override + public String getRule() { + return "Jump-start <i>(You may cast this card from your graveyard " + + "by discarding a card in addition to paying its other costs. " + + "Then exile this card.)</i>"; + } +} + +class JumpStartReplacementEffect extends ReplacementEffectImpl { + + public JumpStartReplacementEffect() { + super(Duration.OneUse, Outcome.Exile); + staticText = "(If this spell was cast with jump-start, " + + "exile it instead of putting it anywhere else " + + "any time it would leave the stack)"; + } + + public JumpStartReplacementEffect(final JumpStartReplacementEffect effect) { + super(effect); + } + + @Override + public JumpStartReplacementEffect copy() { + return new JumpStartReplacementEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(event.getTargetId()); + if (card != null) { + discard(); + return controller.moveCards( + card, Zone.EXILED, source, game, false, false, false, event.getAppliedEffects()); + } + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getTargetId().equals(source.getSourceId()) + && ((ZoneChangeEvent) event).getFromZone() == Zone.STACK + && ((ZoneChangeEvent) event).getToZone() != Zone.EXILED) { + if (game.getState().getZoneChangeCounter(source.getSourceId()) == source.getSourceObjectZoneChangeCounter() + 1) { + return true; + } + + } + return false; + } +} diff --git a/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java b/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java index b07de0e0b0..9918789ed2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java @@ -71,7 +71,7 @@ public class MadnessAbility extends StaticAbility { return new MadnessAbility(this); } - public static Condition GetCondition() { + public static Condition getCondition() { return MadnessCondition.instance; } diff --git a/Mage/src/main/java/mage/abilities/keyword/MentorAbility.java b/Mage/src/main/java/mage/abilities/keyword/MentorAbility.java new file mode 100644 index 0000000000..bd579657da --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/MentorAbility.java @@ -0,0 +1,56 @@ +package mage.abilities.keyword; + +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.Card; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class MentorAbility extends AttacksTriggeredAbility { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("attacking creature with lesser power"); + + static { + filter.add(new AttackingPredicate()); + filter.add(new MentorAbilityPredicate()); + } + + public MentorAbility() { + super(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false); + this.addTarget(new TargetCreaturePermanent(filter)); + } + + public MentorAbility(final MentorAbility ability) { + super(ability); + } + + @Override + public String getRule() { + return "mentor <i>(Whenever this creature attacks, put a +1/+1 counter on target attacking creature with lesser power.)</i>"; + } + + @Override + public MentorAbility copy() { + return new MentorAbility(this); + } + +} + +class MentorAbilityPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Card>> { + + @Override + public boolean apply(ObjectSourcePlayer<Card> input, Game game) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId()); + return sourcePermanent != null && input.getObject().getPower().getValue() < sourcePermanent.getPower().getValue(); + } +} diff --git a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java index e3943352f9..6a1b3c449e 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java @@ -283,7 +283,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost mageObject.getManaCost().clear(); if (mageObject instanceof Permanent) { ((Permanent) mageObject).setExpansionSetCode(""); - ((Permanent) mageObject).setRarity(Rarity.NA); + ((Permanent) mageObject).setRarity(Rarity.SPECIAL); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java index 9a1de9fd98..6ce501563f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java @@ -104,7 +104,7 @@ class OfferingAsThoughEffect extends AsThoughEffectImpl { } @Override - public boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game) { + public boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game, UUID playerId) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(sourceId); if (!card.isOwnedBy(source.getControllerId())) { diff --git a/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java b/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java index bd29bffab2..3f0c3037dd 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java @@ -222,7 +222,7 @@ class ReplicateCopyEffect extends OneShotEffect { // create the copies for (int i = 0; i < replicateCount; i++) { StackObject newStackObject = spell.createCopyOnStack(game, source, source.getControllerId(), true); - if (newStackObject != null && newStackObject instanceof Spell && !game.isSimulation()) { + if (newStackObject instanceof Spell && !game.isSimulation()) { game.informPlayers(controller.getLogName() + ((Spell) newStackObject).getActivatedMessage(game)); } } diff --git a/Mage/src/main/java/mage/abilities/mana/AnyColorManaAbility.java b/Mage/src/main/java/mage/abilities/mana/AnyColorManaAbility.java index 8e0720750a..e22d6b79a4 100644 --- a/Mage/src/main/java/mage/abilities/mana/AnyColorManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/AnyColorManaAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.mana; import mage.Mana; @@ -8,13 +7,18 @@ import mage.abilities.effects.mana.AddManaOfAnyColorEffect; import mage.constants.Zone; public class AnyColorManaAbility extends ActivatedManaAbilityImpl { + public AnyColorManaAbility() { this(new TapSourceCost()); } public AnyColorManaAbility(Cost cost) { - super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), cost); - this.netMana.add(new Mana(0,0,0,0,0,0,1, 0)); + this(cost, false); + } + + public AnyColorManaAbility(Cost cost, boolean setFlag) { + super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(1, setFlag), cost); + this.netMana.add(new Mana(0, 0, 0, 0, 0, 0, 1, 0)); } public AnyColorManaAbility(final AnyColorManaAbility ability) { diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 4130242ad7..8b19cf5d3f 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -1,4 +1,3 @@ - package mage.cards; import mage.MageObject; @@ -6,25 +5,12 @@ import mage.MageObjectImpl; import mage.Mana; import mage.ObjectColor; import mage.abilities.*; -import mage.abilities.costs.Cost; -import mage.abilities.costs.VariableCost; -import mage.abilities.costs.common.RemoveVariableCountersTargetCost; -import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.repository.PluginClassloaderRegistery; import mage.constants.*; import mage.counters.Counter; -import mage.counters.CounterType; import mage.counters.Counters; -import mage.filter.FilterCard; import mage.filter.FilterMana; -import mage.filter.FilterPermanent; -import mage.filter.FilterSpell; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; -import mage.filter.predicate.mageobject.NamePredicate; -import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.*; import mage.game.command.CommandObject; import mage.game.events.GameEvent; @@ -32,11 +18,6 @@ import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.game.stack.StackObject; -import mage.target.TargetCard; -import mage.target.TargetPermanent; -import mage.target.TargetSpell; -import mage.target.common.TargetCardInOpponentsGraveyard; -import mage.target.common.TargetCreaturePermanent; import mage.util.GameLog; import mage.util.SubTypeList; import mage.watchers.Watcher; @@ -351,110 +332,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { // } @Override public void adjustTargets(Ability ability, Game game) { - int xValue; - TargetPermanent oldTargetPermanent; - FilterPermanent permanentFilter; - int minTargets; - int maxTargets; - switch (ability.getTargetAdjustment()) { - case NONE: - break; - case X_CMC_EQUAL_PERM: - xValue = ability.getManaCostsToPay().getX(); - oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0); - minTargets = oldTargetPermanent.getMinNumberOfTargets(); - maxTargets = oldTargetPermanent.getMaxNumberOfTargets(); - permanentFilter = oldTargetPermanent.getFilter().copy(); - permanentFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); - ability.getTargets().clear(); - ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false)); - break; - case X_TARGETS: - xValue = ability.getManaCostsToPay().getX(); - permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter(); - ability.getTargets().clear(); - ability.addTarget(new TargetPermanent(xValue, permanentFilter)); - break; - case X_POWER_LEQ:// Minamo Sightbender only - xValue = ability.getManaCostsToPay().getX(); - oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0); - minTargets = oldTargetPermanent.getMinNumberOfTargets(); - maxTargets = oldTargetPermanent.getMaxNumberOfTargets(); - permanentFilter = oldTargetPermanent.getFilter().copy(); - permanentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); - ability.getTargets().clear(); - ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false)); - break; - case VERSE_COUNTER_TARGETS: - Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); - if (sourcePermanent != null) { - xValue = sourcePermanent.getCounters(game).getCount(CounterType.VERSE); - permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter(); - ability.getTargets().clear(); - ability.addTarget(new TargetPermanent(0, xValue, permanentFilter, false)); - } - break; - case X_CMC_EQUAL_GY_CARD: //Geth, Lord of the Vault only - xValue = ability.getManaCostsToPay().getX(); - TargetCard oldTarget = (TargetCard) ability.getTargets().get(0); - FilterCard filterCard = oldTarget.getFilter().copy(); - filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); - ability.getTargets().clear(); - ability.getTargets().add(new TargetCardInOpponentsGraveyard(filterCard)); - break; - case CHOSEN_NAME: //Declaration of Naught only - ability.getTargets().clear(); - FilterSpell filterSpell = new FilterSpell("spell with the chosen name"); - filterSpell.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))); - TargetSpell target = new TargetSpell(1, filterSpell); - ability.addTarget(target); - break; - case CHOSEN_COLOR: //Pentarch Paladin only - ObjectColor chosenColor = (ObjectColor) game.getState().getValue(ability.getSourceId() + "_color"); - ability.getTargets().clear(); - FilterPermanent filter = new FilterPermanent("permanent of the chosen color."); - if (chosenColor != null) { - filter.add(new ColorPredicate(chosenColor)); - } else { - filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, -5));// Pretty sure this is always false - } - oldTargetPermanent = new TargetPermanent(filter); - ability.addTarget(oldTargetPermanent); - break; - case TREASURE_COUNTER_POWER: //Legacy's Allure only - sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); - if (sourcePermanent != null) { - xValue = sourcePermanent.getCounters(game).getCount(CounterType.TREASURE); - FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on {this}"); - filter2.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); - ability.getTargets().clear(); - ability.getTargets().add(new TargetCreaturePermanent(filter2)); - } - break; - case SIMIC_MANIPULATOR: //Simic Manipulator only - xValue = 0; - for (Cost cost : ability.getCosts()) { - if (cost instanceof RemoveVariableCountersTargetCost) { - xValue = ((RemoveVariableCountersTargetCost) cost).getAmount(); - break; - } - } - ability.getTargets().clear(); - FilterCreaturePermanent newFilter = new FilterCreaturePermanent("creature with power less than or equal to " + xValue); - newFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); - ability.addTarget(new TargetCreaturePermanent(newFilter)); - break; - case CREATURE_POWER_X_OR_LESS: // Aryel, Knight of Windgrace - int value = 0; - for (VariableCost cost : ability.getCosts().getVariableCosts()) { - value = cost.getAmount(); - } - FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent("creature with power " + value + " or less"); - filterCreaturePermanent.add(new PowerPredicate(ComparisonType.FEWER_THAN, value + 1)); - ability.getTargets().clear(); - ability.addTarget(new TargetCreaturePermanent(filterCreaturePermanent)); - break; - } + ability.adjustTargets(game); } @Override diff --git a/Mage/src/main/java/mage/cards/ExpansionSet.java b/Mage/src/main/java/mage/cards/ExpansionSet.java index 15e4b052d3..df4b5ae8bd 100644 --- a/Mage/src/main/java/mage/cards/ExpansionSet.java +++ b/Mage/src/main/java/mage/cards/ExpansionSet.java @@ -185,7 +185,7 @@ public abstract class ExpansionSet implements Serializable { return theBooster; } - protected int AddMissingPartner(List<Card> booster, boolean partnerAllowed, int max, int i) { + protected int addMissingPartner(List<Card> booster, boolean partnerAllowed, int max, int i) { for (Ability ability : booster.get(booster.size() - 1).getAbilities()) { //Check if fetched card has the PartnerWithAbility @@ -328,7 +328,7 @@ public abstract class ExpansionSet implements Serializable { for (int i = 0; i < numBoosterUncommon; i++) { while (true) { addToBooster(booster, uncommons); - int check = AddMissingPartner(booster, partnerAllowed, numBoosterUncommon - 1, i); + int check = addMissingPartner(booster, partnerAllowed, numBoosterUncommon - 1, i); if (check == 1) { break; } @@ -358,7 +358,7 @@ public abstract class ExpansionSet implements Serializable { if (ratioBoosterMythic > 0 && RandomUtil.nextInt(ratioBoosterMythic) == 0) { while (true) { addToBooster(booster, mythics); - int check = AddMissingPartner(booster, partnerAllowed, -1, 1); + int check = addMissingPartner(booster, partnerAllowed, -1, 1); if (check == 1) { break; } @@ -370,7 +370,7 @@ public abstract class ExpansionSet implements Serializable { } else { while (true) { addToBooster(booster, rares); - int check = AddMissingPartner(booster, partnerAllowed, -1, 1); + int check = addMissingPartner(booster, partnerAllowed, -1, 1); if (check == 1) { break; } diff --git a/Mage/src/main/java/mage/cards/Sets.java b/Mage/src/main/java/mage/cards/Sets.java index 3f11abff3b..f68db60abe 100644 --- a/Mage/src/main/java/mage/cards/Sets.java +++ b/Mage/src/main/java/mage/cards/Sets.java @@ -135,7 +135,7 @@ public class Sets extends HashMap<String, ExpansionSet> { if (onlyBasicLands) { // lands is colorless // discard not needed color by mana produce - Assert.assertEquals("only basic lands allow", 1, card.getMana().size()); + Assert.assertEquals("only basic lands allow, but found " + card.getName(), 1, card.getMana().size()); for (Mana manaLand : card.getMana()) { if (manaLand.getWhite() > 0 && !manaNeed.isWhite()) { cardManaOK = false; } if (manaLand.getBlue() > 0 && !manaNeed.isBlue()) { cardManaOK = false; } diff --git a/Mage/src/main/java/mage/cards/decks/Constructed.java b/Mage/src/main/java/mage/cards/decks/Constructed.java index ba74447185..23410c32b5 100644 --- a/Mage/src/main/java/mage/cards/decks/Constructed.java +++ b/Mage/src/main/java/mage/cards/decks/Constructed.java @@ -17,8 +17,8 @@ public class Constructed extends DeckValidator { private static final Logger logger = Logger.getLogger(DeckValidator.class); - protected static List<String> anyNumberCardsAllowed = new ArrayList<>(Arrays.asList("Relentless Rats", "Shadowborn Apostle", "Rat Colony")); - protected static List<String> basicLandNames = new ArrayList<>( + protected static final List<String> anyNumberCardsAllowed = new ArrayList<>(Arrays.asList("Relentless Rats", "Shadowborn Apostle", "Rat Colony")); + protected static final List<String> basicLandNames = new ArrayList<>( Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains", "Wastes", "Snow-Covered Forest", "Snow-Covered Island", "Snow-Covered Mountain", "Snow-Covered Swamp", "Snow-Covered Plains")); protected List<String> banned = new ArrayList<>(); diff --git a/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java b/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java index 2912dafd7e..a0e90dc526 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java +++ b/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java @@ -12,7 +12,7 @@ import mage.cards.decks.DeckCardLists; */ public final class DeckImporterUtil { - public static final String[] SIDEBOARD_MARKS = new String[]{"//sideboard", "sb: "}; + private static final String[] SIDEBOARD_MARKS = new String[]{"//sideboard", "sb: "}; public static boolean haveSideboardSection(String file) { // search for sideboard section: diff --git a/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java index 14d2b31f57..4d593610ff 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java @@ -16,9 +16,9 @@ import mage.cards.repository.CardRepository; */ public class TxtDeckImporter extends DeckImporter { - public static final String[] SET_VALUES = new String[]{"lands", "creatures", "planeswalkers", "other spells", "sideboard cards", + private static final String[] SET_VALUES = new String[]{"lands", "creatures", "planeswalkers", "other spells", "sideboard cards", "Instant", "Land", "Enchantment", "Artifact", "Sorcery", "Planeswalker", "Creature"}; - public static final Set<String> IGNORE_NAMES = new HashSet<>(Arrays.asList(SET_VALUES)); + private static final Set<String> IGNORE_NAMES = new HashSet<>(Arrays.asList(SET_VALUES)); private boolean sideboard = false; private boolean switchSideboardByEmptyLine = true; // all cards after first empty line will be sideboard (like mtgo format) diff --git a/Mage/src/main/java/mage/cards/repository/CardInfo.java b/Mage/src/main/java/mage/cards/repository/CardInfo.java index cc5caa7c98..2563d4e307 100644 --- a/Mage/src/main/java/mage/cards/repository/CardInfo.java +++ b/Mage/src/main/java/mage/cards/repository/CardInfo.java @@ -9,7 +9,7 @@ import java.util.stream.Collectors; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.SpellAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.cards.*; import mage.cards.mock.MockCard; import mage.cards.mock.MockSplitCard; @@ -181,8 +181,8 @@ public class CardInfo { // Starting loyalty if (card.isPlaneswalker()) { for (Ability ab : card.getAbilities()) { - if (ab instanceof PlanswalkerEntersWithLoyalityCountersAbility) { - this.startingLoyalty = "" + ((PlanswalkerEntersWithLoyalityCountersAbility) ab).getStartingLoyalty(); + if (ab instanceof PlaneswalkerEntersWithLoyaltyCountersAbility) { + this.startingLoyalty = "" + ((PlaneswalkerEntersWithLoyaltyCountersAbility) ab).getStartingLoyalty(); } } if (this.startingLoyalty == null) { diff --git a/Mage/src/main/java/mage/cards/repository/CardRepository.java b/Mage/src/main/java/mage/cards/repository/CardRepository.java index adbd4d05c5..6fbb195bfc 100644 --- a/Mage/src/main/java/mage/cards/repository/CardRepository.java +++ b/Mage/src/main/java/mage/cards/repository/CardRepository.java @@ -32,7 +32,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 51; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 118; + private static final long CARD_CONTENT_VERSION = 120; private Dao<CardInfo, Object> cardDao; private Set<String> classNames; diff --git a/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java b/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java index 7bdb97e5ce..4ed44d2966 100644 --- a/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java +++ b/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java @@ -29,7 +29,7 @@ public enum ExpansionRepository { private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "expansion"; private static final long EXPANSION_DB_VERSION = 5; - private static final long EXPANSION_CONTENT_VERSION = 16; + private static final long EXPANSION_CONTENT_VERSION = 17; private Dao<ExpansionInfo, Object> expansionDao; diff --git a/Mage/src/main/java/mage/constants/AbilityWord.java b/Mage/src/main/java/mage/constants/AbilityWord.java index 0d52e07560..408e590c66 100644 --- a/Mage/src/main/java/mage/constants/AbilityWord.java +++ b/Mage/src/main/java/mage/constants/AbilityWord.java @@ -43,6 +43,7 @@ public enum AbilityWord { SWEEP("Sweep"), TEMPTING_OFFER("Tempting offer"), THRESHOLD("Threshold"), + UNDERGROWTH("Undergrowth"), WILL_OF_THE_COUNCIL("Will of the council"); private final String text; diff --git a/Mage/src/main/java/mage/constants/Rarity.java b/Mage/src/main/java/mage/constants/Rarity.java index d57ff3636c..b8fbf3259e 100644 --- a/Mage/src/main/java/mage/constants/Rarity.java +++ b/Mage/src/main/java/mage/constants/Rarity.java @@ -6,7 +6,6 @@ package mage.constants; */ public enum Rarity { - NA ("na", "na", "N", 0), LAND ("Land", "common", "C", 1), COMMON ("Common", "common", "C", 1), UNCOMMON ("Uncommon", "uncommon", "U", 2), diff --git a/Mage/src/main/java/mage/constants/TargetAdjustment.java b/Mage/src/main/java/mage/constants/TargetAdjustment.java deleted file mode 100644 index 04543a991d..0000000000 --- a/Mage/src/main/java/mage/constants/TargetAdjustment.java +++ /dev/null @@ -1,18 +0,0 @@ -package mage.constants; - -/** - * - * @author TheElk801 - */ -public enum TargetAdjustment { - NONE, - X_TARGETS, - X_CMC_EQUAL_PERM, - X_CMC_EQUAL_GY_CARD, - X_POWER_LEQ, CHOSEN_NAME, - CHOSEN_COLOR, - VERSE_COUNTER_TARGETS, - TREASURE_COUNTER_POWER, - SIMIC_MANIPULATOR, - CREATURE_POWER_X_OR_LESS -} diff --git a/Mage/src/main/java/mage/constants/TargetController.java b/Mage/src/main/java/mage/constants/TargetController.java index 2236ebe464..f1dd2e1b60 100644 --- a/Mage/src/main/java/mage/constants/TargetController.java +++ b/Mage/src/main/java/mage/constants/TargetController.java @@ -6,5 +6,5 @@ package mage.constants; */ public enum TargetController { - ACTIVE, ANY, YOU, NOT_YOU, OPPONENT, TEAM, OWNER, CONTROLLER_ATTACHED_TO, NEXT + ACTIVE, ANY, YOU, NOT_YOU, OPPONENT, TEAM, OWNER, CONTROLLER_ATTACHED_TO, NEXT, EACH_PLAYER } diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index 2d4eea8e4b..7f8d10f8ae 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -1,4 +1,3 @@ - package mage.counters; /** @@ -55,6 +54,7 @@ public enum CounterType { GROWTH("growth"), HATCHLING("hatchling"), HEALING("healing"), + HIT("hit"), HOOFPRINT("hoofprint"), HOUR("hour"), HOURGLASS("hourglass"), diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java index 21a8c11bf8..576783bdc7 100644 --- a/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/ChosenSubtypePredicate.java @@ -19,7 +19,7 @@ public class ChosenSubtypePredicate implements ObjectPlayerPredicate<ObjectSourc @Override public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) { - SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(input.getSourceId(), game); + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(input.getSourceId(), game); return input.getObject().hasSubtype(subType, game); } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/CounterPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/CounterPredicate.java index ed505b2cd2..75469d4dc1 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/CounterPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/CounterPredicate.java @@ -1,16 +1,15 @@ - package mage.filter.predicate.permanent; +import mage.cards.Card; import mage.counters.CounterType; import mage.filter.predicate.Predicate; import mage.game.Game; -import mage.game.permanent.Permanent; /** * * @author jeffwadsworth */ -public class CounterPredicate implements Predicate<Permanent> { +public class CounterPredicate implements Predicate<Card> { private final CounterType counter; @@ -23,7 +22,7 @@ public class CounterPredicate implements Predicate<Permanent> { } @Override - public boolean apply(Permanent input, Game game) { + public boolean apply(Card input, Game game) { if (counter == null) { return !input.getCounters(game).keySet().isEmpty(); } else { diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 20f6284b9b..e745c75e12 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -1191,7 +1191,7 @@ public abstract class GameImpl implements Game, Serializable { player.shuffleLibrary(null, this); int deduction = 1; if (freeMulligans > 0) { - if (usedFreeMulligans != null && usedFreeMulligans.containsKey(player.getId())) { + if (usedFreeMulligans.containsKey(player.getId())) { int used = usedFreeMulligans.get(player.getId()); if (used < freeMulligans) { deduction = 0; @@ -1424,7 +1424,7 @@ public abstract class GameImpl implements Game, Serializable { } else { spellControllerId = spell.getControllerId(); // i.e. resolved spell is the target opponent's spell } - if (commandedBy != null && spellControllerId != null) { + if (spellControllerId != null) { Player turnController = getPlayer(commandedBy); if (turnController != null) { Player targetPlayer = getPlayer(spellControllerId); @@ -1987,7 +1987,8 @@ public abstract class GameImpl implements Game, Serializable { if (card != null && card.isCreature()) { UUID wasAttachedTo = perm.getAttachedTo(); perm.attachTo(null, this); - BestowAbility.becomeCreature(perm, this); + //moved to mage.game.permanent.PermanentImpl::detachAllAttachments + //BestowAbility.becomeCreature(perm, this); fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId())); } else if (movePermanentToGraveyardWithInfo(perm)) { somethingHappened = true; diff --git a/Mage/src/main/java/mage/game/ZonesHandler.java b/Mage/src/main/java/mage/game/ZonesHandler.java index c14b2da884..c6eeff3142 100644 --- a/Mage/src/main/java/mage/game/ZonesHandler.java +++ b/Mage/src/main/java/mage/game/ZonesHandler.java @@ -10,6 +10,7 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.command.Commander; import mage.game.events.ZoneChangeEvent; +import mage.game.events.ZoneChangeGroupEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; import mage.game.permanent.PermanentMeld; @@ -25,6 +26,12 @@ public final class ZonesHandler { public static boolean cast(ZoneChangeInfo info, Game game) { if (maybeRemoveFromSourceZone(info, game)) { placeInDestinationZone(info, game); + // create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx)) + Set<Card> cards = new HashSet<>(); + Card targetCard = getTargetCard(game, info.event.getTargetId()); + cards.add(targetCard); + game.fireEvent(new ZoneChangeGroupEvent(cards, info.event.getSourceId(), info.event.getPlayerId(), info.event.getFromZone(), info.event.getToZone())); + // normal movement game.fireEvent(info.event); return true; } diff --git a/Mage/src/main/java/mage/game/command/Plane.java b/Mage/src/main/java/mage/game/command/Plane.java index a21f0a27dd..b6a3768c29 100644 --- a/Mage/src/main/java/mage/game/command/Plane.java +++ b/Mage/src/main/java/mage/game/command/Plane.java @@ -286,7 +286,7 @@ public class Plane implements CommandObject { Class<?> c = Class.forName(planeName); Constructor<?> cons = c.getConstructor(); Object plane = cons.newInstance(); - if (plane != null && plane instanceof mage.game.command.Plane) { + if (plane instanceof Plane) { return (Plane) plane; } } catch (Exception ex) { diff --git a/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java index 3a74eac9dd..cdb80518c7 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java @@ -11,7 +11,7 @@ import mage.game.permanent.token.CatToken2; * * @author TheElk801 */ -public class AjaniAdversaryOfTyrantsEmblem extends Emblem { +public final class AjaniAdversaryOfTyrantsEmblem extends Emblem { // −7: You get an emblem with "At the beginning of your end step, create three 1/1 white Cat creature tokens with lifelink." public AjaniAdversaryOfTyrantsEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java index 755291e039..ce2123de09 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java @@ -15,7 +15,7 @@ import mage.game.permanent.Permanent; * * @author spjspj */ -public class AjaniSteadfastEmblem extends Emblem { +public final class AjaniSteadfastEmblem extends Emblem { public AjaniSteadfastEmblem() { setName("Emblem Ajani"); diff --git a/Mage/src/main/java/mage/game/command/emblems/ArlinnEmbracedByTheMoonEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ArlinnEmbracedByTheMoonEmblem.java index fb9926cc7b..008e205f36 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ArlinnEmbracedByTheMoonEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ArlinnEmbracedByTheMoonEmblem.java @@ -21,7 +21,7 @@ import mage.target.common.TargetAnyTarget; * * @author spjspj */ -public class ArlinnEmbracedByTheMoonEmblem extends Emblem { +public final class ArlinnEmbracedByTheMoonEmblem extends Emblem { // "Creatures you control have haste and '{T}: This creature deals damage equal to its power to any target.'" public ArlinnEmbracedByTheMoonEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/AurraSingBaneOfJediEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AurraSingBaneOfJediEmblem.java index f227d4429d..8917e9a01f 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AurraSingBaneOfJediEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AurraSingBaneOfJediEmblem.java @@ -13,7 +13,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class AurraSingBaneOfJediEmblem extends Emblem { +public final class AurraSingBaneOfJediEmblem extends Emblem { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a nontoken creature you control"); diff --git a/Mage/src/main/java/mage/game/command/emblems/ChandraRoaringFlameEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ChandraRoaringFlameEmblem.java index 463695800e..3d263f9fbc 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ChandraRoaringFlameEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ChandraRoaringFlameEmblem.java @@ -12,7 +12,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class ChandraRoaringFlameEmblem extends Emblem { +public final class ChandraRoaringFlameEmblem extends Emblem { /** * Emblem with "At the beginning of your upkeep, this emblem deals 3 damage diff --git a/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java index a47118ccd6..33a9673b99 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ChandraTorchOfDefianceEmblem.java @@ -14,7 +14,7 @@ import mage.target.common.TargetAnyTarget; * * @author spjspj */ -public class ChandraTorchOfDefianceEmblem extends Emblem { +public final class ChandraTorchOfDefianceEmblem extends Emblem { // You get an emblem with "Whenever you cast a spell, this emblem deals 5 damage to any target." public ChandraTorchOfDefianceEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/DackFaydenEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DackFaydenEmblem.java index 9771492ba2..25f7674a4e 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DackFaydenEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DackFaydenEmblem.java @@ -29,7 +29,7 @@ import mage.target.targetpointer.FixedTargets; * * @author spjspj */ -public class DackFaydenEmblem extends Emblem { +public final class DackFaydenEmblem extends Emblem { public DackFaydenEmblem() { this.setName("Emblem Dack"); diff --git a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java index 246f783855..85a51c0e9a 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java @@ -22,7 +22,7 @@ import mage.target.targetpointer.FixedTarget; * * @author spjspj */ -public class DarettiScrapSavantEmblem extends Emblem { +public final class DarettiScrapSavantEmblem extends Emblem { // You get an emblem with "Whenever an artifact is put into your graveyard from the battlefield, return that card to the battlefield at the beginning of the next end step." public DarettiScrapSavantEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/DomriRadeEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DomriRadeEmblem.java index 11231f2d23..d71bb577c1 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DomriRadeEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DomriRadeEmblem.java @@ -18,7 +18,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class DomriRadeEmblem extends Emblem { +public final class DomriRadeEmblem extends Emblem { // "Creatures you control have double strike, trample, hexproof and haste." public DomriRadeEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/DovinBaanEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DovinBaanEmblem.java index 4deb79b50b..3935f32b8d 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DovinBaanEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DovinBaanEmblem.java @@ -15,7 +15,7 @@ import mage.players.Player; * * @author spjspj */ -public class DovinBaanEmblem extends Emblem { +public final class DovinBaanEmblem extends Emblem { public DovinBaanEmblem() { this.setName("Emblem Dovin"); diff --git a/Mage/src/main/java/mage/game/command/emblems/ElspethKnightErrantEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ElspethKnightErrantEmblem.java index 6067faaeed..1789969181 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ElspethKnightErrantEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ElspethKnightErrantEmblem.java @@ -17,7 +17,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class ElspethKnightErrantEmblem extends Emblem { +public final class ElspethKnightErrantEmblem extends Emblem { public ElspethKnightErrantEmblem() { this.setName("Emblem Elspeth"); diff --git a/Mage/src/main/java/mage/game/command/emblems/ElspethSunsChampionEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ElspethSunsChampionEmblem.java index 72e045663e..9a2f602146 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ElspethSunsChampionEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ElspethSunsChampionEmblem.java @@ -14,7 +14,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class ElspethSunsChampionEmblem extends Emblem { +public final class ElspethSunsChampionEmblem extends Emblem { // -7: You get an emblem with "Creatures you control get +2/+2 and have flying." public ElspethSunsChampionEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/GarrukApexPredatorEmblem.java b/Mage/src/main/java/mage/game/command/emblems/GarrukApexPredatorEmblem.java index 6450b060ea..63bae300ec 100644 --- a/Mage/src/main/java/mage/game/command/emblems/GarrukApexPredatorEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/GarrukApexPredatorEmblem.java @@ -16,7 +16,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class GarrukApexPredatorEmblem extends Emblem { +public final class GarrukApexPredatorEmblem extends Emblem { /** * Emblem with "Whenever a creature attacks you, it gets +5/+5 and gains diff --git a/Mage/src/main/java/mage/game/command/emblems/GarrukCallerOfBeastsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/GarrukCallerOfBeastsEmblem.java index cf77fef925..f0a8f56760 100644 --- a/Mage/src/main/java/mage/game/command/emblems/GarrukCallerOfBeastsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/GarrukCallerOfBeastsEmblem.java @@ -16,7 +16,7 @@ import mage.target.common.TargetCardInLibrary; * * @author spjspj */ -public class GarrukCallerOfBeastsEmblem extends Emblem { +public final class GarrukCallerOfBeastsEmblem extends Emblem { /** * Emblem: "Whenever you cast a creature spell, you may search your library diff --git a/Mage/src/main/java/mage/game/command/emblems/GideonAllyOfZendikarEmblem.java b/Mage/src/main/java/mage/game/command/emblems/GideonAllyOfZendikarEmblem.java index 05af49a7e4..cb0390ca08 100644 --- a/Mage/src/main/java/mage/game/command/emblems/GideonAllyOfZendikarEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/GideonAllyOfZendikarEmblem.java @@ -12,7 +12,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class GideonAllyOfZendikarEmblem extends Emblem { +public final class GideonAllyOfZendikarEmblem extends Emblem { public GideonAllyOfZendikarEmblem() { this.setName("Emblem Gideon"); diff --git a/Mage/src/main/java/mage/game/command/emblems/GideonOfTheTrialsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/GideonOfTheTrialsEmblem.java index 83173169fa..60a9820f35 100644 --- a/Mage/src/main/java/mage/game/command/emblems/GideonOfTheTrialsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/GideonOfTheTrialsEmblem.java @@ -18,7 +18,7 @@ import mage.game.events.GameEvent; * * @author spjspj */ -public class GideonOfTheTrialsEmblem extends Emblem { +public final class GideonOfTheTrialsEmblem extends Emblem { public GideonOfTheTrialsEmblem() { this.setName("Emblem - Gideon"); diff --git a/Mage/src/main/java/mage/game/command/emblems/HuatliRadiantChampionEmblem.java b/Mage/src/main/java/mage/game/command/emblems/HuatliRadiantChampionEmblem.java index 6b68b18a1e..cc9dc6967c 100644 --- a/Mage/src/main/java/mage/game/command/emblems/HuatliRadiantChampionEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/HuatliRadiantChampionEmblem.java @@ -12,7 +12,7 @@ import mage.game.command.Emblem; * * @author LevelX2 */ -public class HuatliRadiantChampionEmblem extends Emblem { +public final class HuatliRadiantChampionEmblem extends Emblem { public HuatliRadiantChampionEmblem() { this.setName("Emblem Huatli"); diff --git a/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java b/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java index 064ce91bc7..6891d99b3e 100644 --- a/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/JaceTelepathUnboundEmblem.java @@ -14,7 +14,7 @@ import mage.target.common.TargetOpponent; * * @author spjspj */ -public class JaceTelepathUnboundEmblem extends Emblem { +public final class JaceTelepathUnboundEmblem extends Emblem { // You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of their library into their graveyard". public JaceTelepathUnboundEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/JaceUnravelerOfSecretsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/JaceUnravelerOfSecretsEmblem.java index 19b3c6d091..0ae65c4043 100644 --- a/Mage/src/main/java/mage/game/command/emblems/JaceUnravelerOfSecretsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/JaceUnravelerOfSecretsEmblem.java @@ -18,7 +18,7 @@ import mage.watchers.common.SpellsCastWatcher; * * @author spjspj */ -public class JaceUnravelerOfSecretsEmblem extends Emblem { +public final class JaceUnravelerOfSecretsEmblem extends Emblem { /** * Emblem: "Whenever an opponent casts their first spell each turn, diff --git a/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java b/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java index f7b4621238..45f0b291d7 100644 --- a/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java @@ -28,7 +28,7 @@ import mage.watchers.common.CastFromGraveyardWatcher; * * @author LevelX2 */ -public class JayaBallardEmblem extends Emblem { +public final class JayaBallardEmblem extends Emblem { // You get an emblem with "You may cast instant and sorcery cards from your graveyard. If a card cast this way would be put into your graveyard, exile it instead." public JayaBallardEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/KioraEmblem.java b/Mage/src/main/java/mage/game/command/emblems/KioraEmblem.java index 844c1116ca..9b730e2c9c 100644 --- a/Mage/src/main/java/mage/game/command/emblems/KioraEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/KioraEmblem.java @@ -13,7 +13,7 @@ import mage.game.permanent.token.KioraKrakenToken; * * @author spjspj */ -public class KioraEmblem extends Emblem { +public final class KioraEmblem extends Emblem { /** * Emblem: "At the beginning of your end step, create a 9/9 blue Kraken diff --git a/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java index 9c662b5540..41bf5b2db7 100644 --- a/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java @@ -17,7 +17,7 @@ import mage.target.common.TargetCreaturePermanent; * * @author spjspj */ -public class KioraMasterOfTheDepthsEmblem extends Emblem { +public final class KioraMasterOfTheDepthsEmblem extends Emblem { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures"); diff --git a/Mage/src/main/java/mage/game/command/emblems/KothOfTheHammerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/KothOfTheHammerEmblem.java index de13fbeaed..e11abefd72 100644 --- a/Mage/src/main/java/mage/game/command/emblems/KothOfTheHammerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/KothOfTheHammerEmblem.java @@ -23,7 +23,7 @@ import mage.target.common.TargetAnyTarget; * * @author spjspj */ -public class KothOfTheHammerEmblem extends Emblem { +public final class KothOfTheHammerEmblem extends Emblem { // "Mountains you control have '{T}: This land deals 1 damage to any target.'" public KothOfTheHammerEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/LilianaDefiantNecromancerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LilianaDefiantNecromancerEmblem.java index 7a4711e823..de57aa1f3c 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LilianaDefiantNecromancerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LilianaDefiantNecromancerEmblem.java @@ -20,7 +20,7 @@ import mage.target.targetpointer.FixedTarget; * * @author spjspj */ -public class LilianaDefiantNecromancerEmblem extends Emblem { +public final class LilianaDefiantNecromancerEmblem extends Emblem { // You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step." private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); diff --git a/Mage/src/main/java/mage/game/command/emblems/LilianaOfTheDarkRealmsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LilianaOfTheDarkRealmsEmblem.java index c6687fa973..5acaa3281e 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LilianaOfTheDarkRealmsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LilianaOfTheDarkRealmsEmblem.java @@ -18,7 +18,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class LilianaOfTheDarkRealmsEmblem extends Emblem { +public final class LilianaOfTheDarkRealmsEmblem extends Emblem { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamps"); diff --git a/Mage/src/main/java/mage/game/command/emblems/LilianaTheLastHopeEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LilianaTheLastHopeEmblem.java index 6c111af430..4c867957ff 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LilianaTheLastHopeEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LilianaTheLastHopeEmblem.java @@ -19,7 +19,7 @@ import mage.game.permanent.token.ZombieToken; * * @author spjspj */ -public class LilianaTheLastHopeEmblem extends Emblem { +public final class LilianaTheLastHopeEmblem extends Emblem { // "At the beginning of your end step, create X 2/2 black Zombie creature tokens, where X is two plus the number of Zombies you control." public LilianaTheLastHopeEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java index 037d7c0cdf..32a2fb8daf 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java @@ -20,7 +20,7 @@ import mage.players.Player; * * @author NinthWorld */ -public class LukeSkywalkerEmblem extends Emblem { +public final class LukeSkywalkerEmblem extends Emblem { // -6: You get an emblem with "Prevent all damage that would be dealt to you during combat." Exile Luke Skywalker, the Last Jedi. public LukeSkywalkerEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java b/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java index 67eb74bfab..272a96ba41 100644 --- a/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/MomirEmblem.java @@ -28,7 +28,7 @@ import mage.util.RandomUtil; * * @author spjspj */ -public class MomirEmblem extends Emblem { +public final class MomirEmblem extends Emblem { // Faking Vanguard as an Emblem; need to come back to this and add a new type of CommandObject public MomirEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java b/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java index cd063a3125..e21d2d8141 100644 --- a/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java @@ -18,7 +18,7 @@ import mage.players.Player; * * @author spjspj */ -public class NarsetTranscendentEmblem extends Emblem { +public final class NarsetTranscendentEmblem extends Emblem { // "Your opponents can't cast noncreature spells. public NarsetTranscendentEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/NissaVitalForceEmblem.java b/Mage/src/main/java/mage/game/command/emblems/NissaVitalForceEmblem.java index 9df9cc2d4a..7aadb4e560 100644 --- a/Mage/src/main/java/mage/game/command/emblems/NissaVitalForceEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/NissaVitalForceEmblem.java @@ -12,7 +12,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class NissaVitalForceEmblem extends Emblem { +public final class NissaVitalForceEmblem extends Emblem { // You get an emblem with "Whenever a land enters the battlefield under your control, you may draw a card." public NissaVitalForceEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java index 2d73617feb..c324972d06 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java @@ -19,7 +19,7 @@ import mage.target.common.TargetControlledCreaturePermanent; * * @author spjspj */ -public class ObNixilisOfTheBlackOathEmblem extends Emblem { +public final class ObNixilisOfTheBlackOathEmblem extends Emblem { // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." public ObNixilisOfTheBlackOathEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/ObNixilisReignitedEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObNixilisReignitedEmblem.java index 2211886250..6535e7f3bb 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObNixilisReignitedEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObNixilisReignitedEmblem.java @@ -14,7 +14,7 @@ import mage.game.events.GameEvent.EventType; * * @author spjspj */ -public class ObNixilisReignitedEmblem extends Emblem { +public final class ObNixilisReignitedEmblem extends Emblem { public ObNixilisReignitedEmblem() { setName("Emblem Nixilis"); diff --git a/Mage/src/main/java/mage/game/command/emblems/ObiWanKenobiEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObiWanKenobiEmblem.java index 5903138733..19cb118202 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObiWanKenobiEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObiWanKenobiEmblem.java @@ -17,7 +17,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class ObiWanKenobiEmblem extends Emblem { +public final class ObiWanKenobiEmblem extends Emblem { // Creatures you control get +1/+1 and have vigilance, first strike, and lifelink public ObiWanKenobiEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/RalIzzetViceroyEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RalIzzetViceroyEmblem.java new file mode 100644 index 0000000000..18328ce633 --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/RalIzzetViceroyEmblem.java @@ -0,0 +1,32 @@ +package mage.game.command.emblems; + +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.command.Emblem; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class RalIzzetViceroyEmblem extends Emblem { + + // You get an emblem with "Whenever you cast an instant or sorcery spell, this emblem deals 4 damage to any target and you draw two cards." + public RalIzzetViceroyEmblem() { + this.setName("Emblem Ral"); + Ability ability = new SpellCastControllerTriggeredAbility( + Zone.COMMAND, new DamageTargetEffect(4, "this emblem"), + StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false, false + ); + ability.addEffect( + new DrawCardSourceControllerEffect(2) + .setText("and you draw two cards") + ); + ability.addTarget(new TargetAnyTarget()); + getAbilities().add(ability); + } +} diff --git a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java index 46ecdbb4e6..c3f33d114b 100644 --- a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java @@ -18,7 +18,7 @@ import mage.players.Player; * * @author TheElk801 */ -public class RowanKenrithEmblem extends Emblem { +public final class RowanKenrithEmblem extends Emblem { // Target player gets an emblem with "Whenever you activate an ability that isn't a mana ability, copy it. You may choose new targets for the copy." public RowanKenrithEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/SarkhanTheDragonspeakerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/SarkhanTheDragonspeakerEmblem.java index 9ec91355f4..814514d2c2 100644 --- a/Mage/src/main/java/mage/game/command/emblems/SarkhanTheDragonspeakerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/SarkhanTheDragonspeakerEmblem.java @@ -13,7 +13,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class SarkhanTheDragonspeakerEmblem extends Emblem { +public final class SarkhanTheDragonspeakerEmblem extends Emblem { public SarkhanTheDragonspeakerEmblem() { setName("Emblem Sarkhan"); diff --git a/Mage/src/main/java/mage/game/command/emblems/SorinLordOfInnistradEmblem.java b/Mage/src/main/java/mage/game/command/emblems/SorinLordOfInnistradEmblem.java index 5034a0583c..5c340dface 100644 --- a/Mage/src/main/java/mage/game/command/emblems/SorinLordOfInnistradEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/SorinLordOfInnistradEmblem.java @@ -12,7 +12,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class SorinLordOfInnistradEmblem extends Emblem { +public final class SorinLordOfInnistradEmblem extends Emblem { public SorinLordOfInnistradEmblem() { this.setName("Emblem Sorin"); diff --git a/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java b/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java index cd0f7eb0d4..eedc5bf4a7 100644 --- a/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java @@ -13,7 +13,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class SorinSolemnVisitorEmblem extends Emblem { +public final class SorinSolemnVisitorEmblem extends Emblem { /** * Emblem: "At the beginning of each opponent's upkeep, that player diff --git a/Mage/src/main/java/mage/game/command/emblems/TamiyoFieldResearcherEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TamiyoFieldResearcherEmblem.java index d6febe73ff..14b91f6c47 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TamiyoFieldResearcherEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TamiyoFieldResearcherEmblem.java @@ -10,7 +10,7 @@ import mage.game.command.Emblem; * * Author: spjspj */ -public class TamiyoFieldResearcherEmblem extends Emblem { +public final class TamiyoFieldResearcherEmblem extends Emblem { // You may cast nonland cards from your hand without paying their mana costs. public TamiyoFieldResearcherEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/TamiyoTheMoonSageEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TamiyoTheMoonSageEmblem.java index 0ea5a61575..6034f77158 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TamiyoTheMoonSageEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TamiyoTheMoonSageEmblem.java @@ -19,7 +19,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class TamiyoTheMoonSageEmblem extends Emblem { +public final class TamiyoTheMoonSageEmblem extends Emblem { /** * Emblem with "You have no maximum hand size" and "Whenever a card is put diff --git a/Mage/src/main/java/mage/game/command/emblems/TeferiHeroOfDominariaEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TeferiHeroOfDominariaEmblem.java index 7c9447c049..baee186e0a 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TeferiHeroOfDominariaEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TeferiHeroOfDominariaEmblem.java @@ -19,7 +19,7 @@ import mage.target.TargetPermanent; * * @author LevelX2 */ -public class TeferiHeroOfDominariaEmblem extends Emblem { +public final class TeferiHeroOfDominariaEmblem extends Emblem { // Whenever you draw a card, exile target permanent an opponent controls. public TeferiHeroOfDominariaEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/TeferiTemporalArchmageEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TeferiTemporalArchmageEmblem.java index 5a90eca994..0ea3da5859 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TeferiTemporalArchmageEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TeferiTemporalArchmageEmblem.java @@ -11,7 +11,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class TeferiTemporalArchmageEmblem extends Emblem { +public final class TeferiTemporalArchmageEmblem extends Emblem { // "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant." public TeferiTemporalArchmageEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java index 397aac8c66..7b4dd91633 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java @@ -12,7 +12,7 @@ import mage.target.common.TargetCardInLibrary; * * @author TheElk801 */ -public class TezzeretArtificeMasterEmblem extends Emblem { +public final class TezzeretArtificeMasterEmblem extends Emblem { // −9: You get an emblem with "At the beginning of your end step, search your library for a permanent card, put it into the battlefield, then shuffle your library." public TezzeretArtificeMasterEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java index 8ccc7d4632..f730fc2d4b 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java @@ -18,7 +18,7 @@ import mage.target.TargetPermanent; * * @author spjspj */ -public class TezzeretTheSchemerEmblem extends Emblem { +public final class TezzeretTheSchemerEmblem extends Emblem { public TezzeretTheSchemerEmblem() { this.setName("Emblem Tezzeret"); diff --git a/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java index ada5b37e9d..127efd8d93 100644 --- a/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/VenserTheSojournerEmblem.java @@ -20,7 +20,7 @@ import mage.target.targetpointer.FixedTarget; * * @author spjspj */ -public class VenserTheSojournerEmblem extends Emblem { +public final class VenserTheSojournerEmblem extends Emblem { /** * Emblem: "Whenever you cast a spell, exile target permanent." diff --git a/Mage/src/main/java/mage/game/command/emblems/VivienReidEmblem.java b/Mage/src/main/java/mage/game/command/emblems/VivienReidEmblem.java index c411e581df..f63da5fa04 100644 --- a/Mage/src/main/java/mage/game/command/emblems/VivienReidEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/VivienReidEmblem.java @@ -16,7 +16,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class VivienReidEmblem extends Emblem { +public final class VivienReidEmblem extends Emblem { // -8: You get an emblem with "Creatures you control get +2/+2 and have vigilance, trample, and indestructible. public VivienReidEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/VraskaGolgariQueenEmblem.java b/Mage/src/main/java/mage/game/command/emblems/VraskaGolgariQueenEmblem.java new file mode 100644 index 0000000000..f7c2fac333 --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/VraskaGolgariQueenEmblem.java @@ -0,0 +1,25 @@ +package mage.game.command.emblems; + +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; +import mage.abilities.effects.common.LoseGameTargetPlayerEffect; +import mage.constants.SetTargetPointer; +import mage.filter.StaticFilters; +import mage.game.command.Emblem; + +/** + * + * @author TheElk801 + */ +public final class VraskaGolgariQueenEmblem extends Emblem { + + // -9: You get an emblem with "Whenever a creature you control deals combat damage to a player, that player loses the game." + public VraskaGolgariQueenEmblem() { + this.setName("Emblem Vraska"); + this.setExpansionSetCodeForImage("GRN"); + this.getAbilities().add(new DealsDamageToAPlayerAllTriggeredAbility( + new LoseGameTargetPlayerEffect(), + StaticFilters.FILTER_CONTROLLED_A_CREATURE, + false, SetTargetPointer.PLAYER, true + )); + } +} diff --git a/Mage/src/main/java/mage/game/command/emblems/WillKenrithEmblem.java b/Mage/src/main/java/mage/game/command/emblems/WillKenrithEmblem.java index 0574973f5c..9a0f1bbbe6 100644 --- a/Mage/src/main/java/mage/game/command/emblems/WillKenrithEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/WillKenrithEmblem.java @@ -11,7 +11,7 @@ import mage.game.command.Emblem; * * @author TheElk801 */ -public class WillKenrithEmblem extends Emblem { +public final class WillKenrithEmblem extends Emblem { // Target player gets an emblem with "Whenever you cast an instant or sorcery spell, copy it. You may choose new targets for the copy." public WillKenrithEmblem() { diff --git a/Mage/src/main/java/mage/game/command/emblems/YodaEmblem.java b/Mage/src/main/java/mage/game/command/emblems/YodaEmblem.java index 39145754e6..9c7d02276b 100644 --- a/Mage/src/main/java/mage/game/command/emblems/YodaEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/YodaEmblem.java @@ -16,7 +16,7 @@ import mage.game.command.Emblem; * * @author spjspj */ -public class YodaEmblem extends Emblem { +public final class YodaEmblem extends Emblem { // You get an emblem with "Hexproof, you and your creatures have." public YodaEmblem() { diff --git a/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java b/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java index 4f52246b02..58b485755b 100644 --- a/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java @@ -88,10 +88,8 @@ class DrawCardsActivePlayerEffect extends OneShotEffect { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Academy at Tolaria West")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Academy at Tolaria West")) { + return false; } Player player = game.getPlayer(game.getActivePlayerId()); if (player != null) { diff --git a/Mage/src/main/java/mage/game/command/planes/AstralArenaPlane.java b/Mage/src/main/java/mage/game/command/planes/AstralArenaPlane.java index 0034e82a92..7c7bf12635 100644 --- a/Mage/src/main/java/mage/game/command/planes/AstralArenaPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/AstralArenaPlane.java @@ -81,10 +81,8 @@ class AstralArenaAttackRestrictionEffect extends RestrictionEffect { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) { + return false; } return true; @@ -118,10 +116,8 @@ class AstralArenaBlockRestrictionEffect extends RestrictionEffect { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) { + return false; } return true; } diff --git a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java index 553994511f..4a29f9fd16 100644 --- a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java @@ -101,10 +101,8 @@ class EdgeOfMalacolEffect extends ContinuousRuleModifyingEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Edge of Malacol")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Edge of Malacol")) { + return false; } Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && filter.match(permanent, game) && Objects.equals(permanent.getControllerId(), game.getActivePlayerId())) { diff --git a/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java b/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java index c23922c773..bf125dadf4 100644 --- a/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/FeedingGroundsPlane.java @@ -79,7 +79,7 @@ class FeedingGroundsEffect extends CostModificationEffectImpl { new ColorPredicate(ObjectColor.GREEN))); } - private static final String rule = "Red spells cost {1} less to cast. Green spells cost {1} less to cast."; + private static final String rule = "Red spells cost {1} less to cast. Green spells cost {1} less to cast."; private int amount = 1; public FeedingGroundsEffect() { @@ -133,19 +133,17 @@ class FeedingGroundsEffect extends CostModificationEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Feeding Grounds")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Feeding Grounds")) { + return false; } Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { - return this.filter.match(spell, game) && selectedByRuntimeData(spell, source, game); + return filter.match(spell, game) && selectedByRuntimeData(spell, source, game); } else { // used at least for flashback ability because Flashback ability doesn't use stack Card sourceCard = game.getCard(abilityToModify.getSourceId()); - return sourceCard != null && this.filter.match(sourceCard, game) && selectedByRuntimeData(sourceCard, source, game); + return sourceCard != null && filter.match(sourceCard, game) && selectedByRuntimeData(sourceCard, source, game); } } return false; diff --git a/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java b/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java index 5b5ab8bbb7..abb010d4dc 100644 --- a/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java @@ -95,10 +95,8 @@ class HedronFieldsOfAgadeemRestrictionEffect extends RestrictionEffect { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Hedron Fields of Agadeem")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Hedron Fields of Agadeem")) { + return false; } return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); } diff --git a/Mage/src/main/java/mage/game/command/planes/TazeemPlane.java b/Mage/src/main/java/mage/game/command/planes/TazeemPlane.java index 65d66d0a5b..a1bdad2eec 100644 --- a/Mage/src/main/java/mage/game/command/planes/TazeemPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TazeemPlane.java @@ -65,7 +65,6 @@ class TazeemCantBlockAllEffect extends RestrictionEffect { public TazeemCantBlockAllEffect() { super(Duration.Custom); - this.filter = filter; } public TazeemCantBlockAllEffect(final TazeemCantBlockAllEffect effect) { diff --git a/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java b/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java index f0a458626f..75592637a0 100644 --- a/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java @@ -87,10 +87,8 @@ class TheEonFogSkipUntapStepEffect extends ContinuousRuleModifyingEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - The Eon Fog")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - The Eon Fog")) { + return false; } return event.getType() == GameEvent.EventType.UNTAP_STEP; } diff --git a/Mage/src/main/java/mage/game/command/planes/TheGreatForestPlane.java b/Mage/src/main/java/mage/game/command/planes/TheGreatForestPlane.java index 56e7f1e2c6..329a91b5e8 100644 --- a/Mage/src/main/java/mage/game/command/planes/TheGreatForestPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TheGreatForestPlane.java @@ -86,10 +86,8 @@ class TheGreatForestCombatDamageRuleEffect extends ContinuousEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - The Great Forest")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - The Great Forest")) { + return false; } // Change the rule diff --git a/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java b/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java index 1af6669798..7b13f11c20 100644 --- a/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java @@ -101,10 +101,8 @@ class TrailOfTheMageRingsReboundEffect extends ContinuousEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Trail of the Mage-Rings")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Trail of the Mage-Rings")) { + return false; } for (UUID playerId : game.getPlayers().keySet()) { diff --git a/Mage/src/main/java/mage/game/command/planes/TurriIslandPlane.java b/Mage/src/main/java/mage/game/command/planes/TurriIslandPlane.java index c18e2dc83a..29dc7e71f8 100644 --- a/Mage/src/main/java/mage/game/command/planes/TurriIslandPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TurriIslandPlane.java @@ -114,19 +114,17 @@ class TurriIslandEffect extends CostModificationEffectImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Turri Island")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Turri Island")) { + return false; } - + Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { - return this.filter.match(spell, game) && selectedByRuntimeData(spell, source, game); + return filter.match(spell, game) && selectedByRuntimeData(spell, source, game); } else { // used at least for flashback ability because Flashback ability doesn't use stack Card sourceCard = game.getCard(abilityToModify.getSourceId()); - return sourceCard != null && this.filter.match(sourceCard, game) && selectedByRuntimeData(sourceCard, source, game); + return sourceCard != null && filter.match(sourceCard, game) && selectedByRuntimeData(sourceCard, source, game); } } return false; diff --git a/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java b/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java index 75196fbfda..9677f18085 100644 --- a/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java @@ -96,10 +96,8 @@ class UndercityReachesTriggeredAbility extends TriggeredAbilityImpl { if (cPlane == null) { return false; } - if (cPlane != null) { - if (!cPlane.getName().equalsIgnoreCase("Plane - Undercity Reaches")) { - return false; - } + if (!cPlane.getName().equalsIgnoreCase("Plane - Undercity Reaches")) { + return false; } if (((DamagedPlayerEvent) event).isCombatDamage()) { diff --git a/Mage/src/main/java/mage/game/events/GameEvent.java b/Mage/src/main/java/mage/game/events/GameEvent.java index 958d4e736e..eeb746ce95 100644 --- a/Mage/src/main/java/mage/game/events/GameEvent.java +++ b/Mage/src/main/java/mage/game/events/GameEvent.java @@ -72,6 +72,12 @@ public class GameEvent implements Serializable { MADNESS_CARD_EXILED, INVESTIGATED, KICKED, + /* CONVOKED + targetId id of the creature that was taped to convoke the sourceId + sourceId sourceId of the convoked spell + playerId controller of the convoked spell + */ + CONVOKED, DISCARD_CARD, DISCARDED_CARD, CYCLE_CARD, CYCLED_CARD, @@ -209,7 +215,7 @@ public class GameEvent implements Serializable { SHUFFLE_LIBRARY, LIBRARY_SHUFFLED, ENCHANT_PLAYER, ENCHANTED_PLAYER, CAN_TAKE_MULLIGAN, - FLIP_COIN, COIN_FLIPPED, SCRY, FATESEAL, + FLIP_COIN, COIN_FLIPPED, SCRY, SURVEIL, SURVEILED, FATESEAL, ROLL_DICE, DICE_ROLLED, ROLL_PLANAR_DIE, PLANAR_DIE_ROLLED, PLANESWALK, PLANESWALKED, diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 74739b25a3..776f0b775d 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -1437,6 +1437,24 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { return color; } + //20180810 - 701.3d + //If an object leaves the zone it's in, all attached permanents become unattached + //note that this code doesn't actually detach anything, and is a bit of a bandaid + public void detachAllAttachments(Game game) { + for(UUID attachmentId : getAttachments()) { + Permanent attachment = game.getPermanent(attachmentId); + Card attachmentCard = game.getCard(attachmentId); + if(attachment != null && attachmentCard != null) { + //make bestow cards and licids into creatures + //aura test to stop bludgeon brawl shenanigans from using this code + //consider adding code to handle that case? + if(attachment.hasSubtype(SubType.AURA, game) && attachmentCard.isCreature()) { + BestowAbility.becomeCreature(attachment, game); + } + } + } + } + @Override public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag, List<UUID> appliedEffects) { Zone fromZone = game.getState().getZone(objectId); @@ -1449,7 +1467,10 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } else { zoneChangeInfo = new ZoneChangeInfo(event); } - return ZonesHandler.moveCard(zoneChangeInfo, game); + boolean successfullyMoved = ZonesHandler.moveCard(zoneChangeInfo, game); + //20180810 - 701.3d + detachAllAttachments(game); + return successfullyMoved; } return false; } @@ -1459,7 +1480,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { Zone fromZone = game.getState().getZone(objectId); ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, ownerId, fromZone, Zone.EXILED, appliedEffects); ZoneChangeInfo.Exile info = new ZoneChangeInfo.Exile(event, exileId, name); - return ZonesHandler.moveCard(info, game); + + boolean successfullyMoved = ZonesHandler.moveCard(info, game); + //20180810 - 701.3d + detachAllAttachments(game); + return successfullyMoved; } } diff --git a/Mage/src/main/java/mage/game/permanent/token/AngelToken2.java b/Mage/src/main/java/mage/game/permanent/token/AngelVigilanceToken.java similarity index 71% rename from Mage/src/main/java/mage/game/permanent/token/AngelToken2.java rename to Mage/src/main/java/mage/game/permanent/token/AngelVigilanceToken.java index 9369b05c36..0167c1a2bb 100644 --- a/Mage/src/main/java/mage/game/permanent/token/AngelToken2.java +++ b/Mage/src/main/java/mage/game/permanent/token/AngelVigilanceToken.java @@ -6,9 +6,9 @@ import mage.abilities.keyword.VigilanceAbility; import mage.constants.CardType; import mage.constants.SubType; -public final class AngelToken2 extends TokenImpl { +public final class AngelVigilanceToken extends TokenImpl { - public AngelToken2() { + public AngelVigilanceToken() { super("Angel", "4/4 white Angel creature token with flying and vigilance"); cardType.add(CardType.CREATURE); color.setWhite(true); @@ -19,11 +19,11 @@ public final class AngelToken2 extends TokenImpl { addAbility(VigilanceAbility.getInstance()); } - public AngelToken2(final AngelToken2 token) { + public AngelVigilanceToken(final AngelVigilanceToken token) { super(token); } - public AngelToken2 copy() { - return new AngelToken2(this); + public AngelVigilanceToken copy() { + return new AngelVigilanceToken(this); } } diff --git a/Mage/src/main/java/mage/game/permanent/token/BirdIllusionToken.java b/Mage/src/main/java/mage/game/permanent/token/BirdIllusionToken.java new file mode 100644 index 0000000000..6bb98201c1 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/BirdIllusionToken.java @@ -0,0 +1,33 @@ + + +package mage.game.permanent.token; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author TheElk801 + */ +public final class BirdIllusionToken extends TokenImpl { + + public BirdIllusionToken() { + super("Bird Illusion", "1/1 blue Bird Illusion creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add(SubType.BIRD); + subtype.add(SubType.ILLUSION); + power = new MageInt(1); + toughness = new MageInt(1); + this.addAbility(FlyingAbility.getInstance()); + } + + public BirdIllusionToken(final BirdIllusionToken token) { + super(token); + } + + public BirdIllusionToken copy() { + return new BirdIllusionToken(this); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/ElfKnightToken.java b/Mage/src/main/java/mage/game/permanent/token/ElfKnightToken.java new file mode 100644 index 0000000000..ecb2764cda --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/ElfKnightToken.java @@ -0,0 +1,35 @@ +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.constants.SubType; +import mage.MageInt; +import mage.abilities.keyword.VigilanceAbility; + +/** + * + * @author TheElk801 + */ +public final class ElfKnightToken extends TokenImpl { + + public ElfKnightToken() { + super("Knight Ally", "2/2 green and white Elf Knight creature token with vigilance"); + this.setExpansionSetCodeForImage("GRN"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + color.setWhite(true); + subtype.add(SubType.ELF); + subtype.add(SubType.KNIGHT); + power = new MageInt(2); + toughness = new MageInt(2); + this.addAbility(VigilanceAbility.getInstance()); + } + + public ElfKnightToken(final ElfKnightToken token) { + super(token); + } + + public ElfKnightToken copy() { + return new ElfKnightToken(this); + } + +} diff --git a/Mage/src/main/java/mage/game/permanent/token/IzoniInsectToken.java b/Mage/src/main/java/mage/game/permanent/token/IzoniInsectToken.java new file mode 100644 index 0000000000..6b7f5a3e1b --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/IzoniInsectToken.java @@ -0,0 +1,32 @@ + + +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.constants.SubType; +import mage.MageInt; + +/** + * + * @author TheElk801 + */ +public final class IzoniInsectToken extends TokenImpl { + + public IzoniInsectToken() { + super("Insect", "1/1 black and green Insect creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + color.setGreen(true); + subtype.add(SubType.INSECT); + power = new MageInt(1); + toughness = new MageInt(1); + } + + public IzoniInsectToken(final IzoniInsectToken token) { + super(token); + } + + public IzoniInsectToken copy() { + return new IzoniInsectToken(this); + } +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/game/permanent/token/JaceCunningCastawayIllusionToken.java b/Mage/src/main/java/mage/game/permanent/token/JaceCunningCastawayIllusionToken.java index 26f809f941..d4dd3a6c8a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/JaceCunningCastawayIllusionToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/JaceCunningCastawayIllusionToken.java @@ -63,7 +63,7 @@ class IllusionTokenTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && event.getTargetId().equals(this.getSourceId()) && eventSourceObject instanceof Spell) { + if (event.getTargetId().equals(this.getSourceId()) && eventSourceObject instanceof Spell) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage/src/main/java/mage/game/permanent/token/SoldierLifelinkToken.java b/Mage/src/main/java/mage/game/permanent/token/SoldierLifelinkToken.java new file mode 100644 index 0000000000..4b8ca53fb2 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/SoldierLifelinkToken.java @@ -0,0 +1,32 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.LifelinkAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * + * @author TheElk801 + */ +public final class SoldierLifelinkToken extends TokenImpl { + + public SoldierLifelinkToken() { + super("Soldier", "1/1 white Soldier creature token with lifelink"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add(SubType.SOLDIER); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(LifelinkAbility.getInstance()); + } + + public SoldierLifelinkToken(final SoldierLifelinkToken token) { + super(token); + } + + public SoldierLifelinkToken copy() { + return new SoldierLifelinkToken(this); + } + +} diff --git a/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java b/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java index a1bea63750..86ba65c2c7 100644 --- a/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java +++ b/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java @@ -1,4 +1,3 @@ - package mage.game.permanent.token; import java.util.ArrayList; @@ -191,7 +190,7 @@ public abstract class TokenImpl extends MageObjectImpl implements Token { this.lastAddedTokenIds.add(permanent.getId()); this.lastAddedTokenId = permanent.getId(); game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), Zone.OUTSIDE, Zone.BATTLEFIELD)); - if (attacking && game.getCombat() != null) { + if (attacking && game.getCombat() != null && game.getActivePlayerId().equals(permanent.getControllerId())) { game.getCombat().addAttackingCreature(permanent.getId(), game, attackedPlayer); } if (!game.isSimulation()) { diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index a9d8707f09..4c7259ed7d 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -1,4 +1,3 @@ - package mage.game.stack; import java.util.ArrayList; @@ -28,6 +27,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.Targets; +import mage.target.targetadjustment.TargetAdjuster; import mage.util.GameLog; import mage.util.SubTypeList; import mage.watchers.Watcher; @@ -49,7 +49,7 @@ public class StackAbility extends StackObjImpl implements Ability { private UUID controllerId; private String name; private String expansionSetCode; - private TargetAdjustment targetAdjustment = TargetAdjustment.NONE; + private TargetAdjuster targetAdjuster = null; public StackAbility(Ability ability, UUID controllerId) { this.ability = ability; @@ -62,7 +62,7 @@ public class StackAbility extends StackObjImpl implements Ability { this.controllerId = stackAbility.controllerId; this.name = stackAbility.name; this.expansionSetCode = stackAbility.expansionSetCode; - this.targetAdjustment = stackAbility.targetAdjustment; + this.targetAdjuster = stackAbility.targetAdjuster; this.targetChanged = stackAbility.targetChanged; } @@ -596,12 +596,19 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void setTargetAdjustment(TargetAdjustment targetAdjustment) { - this.targetAdjustment = targetAdjustment; + public void setTargetAdjuster(TargetAdjuster targetAdjuster) { + this.targetAdjuster = targetAdjuster; } @Override - public TargetAdjustment getTargetAdjustment() { - return targetAdjustment; + public TargetAdjuster getTargetAdjuster() { + return targetAdjuster; + } + + @Override + public void adjustTargets(Game game) { + if (targetAdjuster != null) { + targetAdjuster.adjustTargets(this, game); + } } } diff --git a/Mage/src/main/java/mage/game/tournament/TournamentImpl.java b/Mage/src/main/java/mage/game/tournament/TournamentImpl.java index 071b14bda7..b1fd8ea51f 100644 --- a/Mage/src/main/java/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/main/java/mage/game/tournament/TournamentImpl.java @@ -476,7 +476,7 @@ public abstract class TournamentImpl implements Tournament { @Override public void cleanUpOnTournamentEnd() { for (TournamentPlayer tournamentPlayer : players.values()) { - tournamentPlayer.CleanUpOnTournamentEnd(); + tournamentPlayer.cleanUpOnTournamentEnd(); } } diff --git a/Mage/src/main/java/mage/game/tournament/TournamentPlayer.java b/Mage/src/main/java/mage/game/tournament/TournamentPlayer.java index 6d01e42e08..6072015d4d 100644 --- a/Mage/src/main/java/mage/game/tournament/TournamentPlayer.java +++ b/Mage/src/main/java/mage/game/tournament/TournamentPlayer.java @@ -179,7 +179,7 @@ public class TournamentPlayer { * Free resources no longer needed if tournament has ended * */ - public void CleanUpOnTournamentEnd() { + public void cleanUpOnTournamentEnd() { this.deck = null; } diff --git a/Mage/src/main/java/mage/players/Player.java b/Mage/src/main/java/mage/players/Player.java index 415dfec7c1..a730164f73 100644 --- a/Mage/src/main/java/mage/players/Player.java +++ b/Mage/src/main/java/mage/players/Player.java @@ -1,22 +1,9 @@ package mage.players; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; import mage.MageItem; import mage.MageObject; import mage.MageObjectReference; -import mage.abilities.Abilities; -import mage.abilities.Ability; -import mage.abilities.ActivatedAbility; -import mage.abilities.Mode; -import mage.abilities.Modes; -import mage.abilities.SpellAbility; -import mage.abilities.TriggeredAbility; +import mage.abilities.*; import mage.abilities.costs.AlternativeSourceCosts; import mage.abilities.costs.Cost; import mage.abilities.costs.Costs; @@ -28,13 +15,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.decks.Deck; import mage.choices.Choice; -import mage.constants.AbilityType; -import mage.constants.ManaType; -import mage.constants.Outcome; -import mage.constants.PlanarDieRoll; -import mage.constants.PlayerAction; -import mage.constants.RangeOfInfluence; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.Counter; import mage.counters.Counters; import mage.designations.Designation; @@ -56,8 +37,10 @@ import mage.target.TargetCard; import mage.target.common.TargetCardInLibrary; import mage.util.Copyable; +import java.io.Serializable; +import java.util.*; + /** - * * @author BetaSteward_at_googlemail.com */ public interface Player extends MageItem, Copyable<Player> { @@ -91,8 +74,7 @@ public interface Player extends MageItem, Copyable<Player> { void setLife(int life, Game game, UUID sourceId); /** - * - * @param amount amount of life loss + * @param amount amount of life loss * @param game * @param atCombat was the source combat damage * @return @@ -289,7 +271,7 @@ public interface Player extends MageItem, Copyable<Player> { /** * Returns false in case player don't control the game. - * + * <p> * Note: For effects like "You control target player during that player's * next turn". * @@ -299,7 +281,7 @@ public interface Player extends MageItem, Copyable<Player> { /** * Returns false in case you don't control the game. - * + * <p> * Note: For effects like "You control target player during that player's * next turn". * @@ -360,11 +342,10 @@ public interface Player extends MageItem, Copyable<Player> { boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId); /** - * * @param target * @param game * @param targetPlayerId player whose library will be searched - * @param triggerEvents whether searching will trigger any game events + * @param triggerEvents whether searching will trigger any game events * @return true if search was successful */ boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId, boolean triggerEvents); @@ -374,23 +355,22 @@ public interface Player extends MageItem, Copyable<Player> { /** * Plays a card if possible * - * @param card the card that can be cast + * @param card the card that can be cast * @param game - * @param noMana if it's a spell i can be cast without paying mana + * @param noMana if it's a spell i can be cast without paying mana * @param ignoreTiming if it's cast during the resolution of another spell - * no sorcery or play land timing restriction are checked. For a land it has - * to be the turn of the player playing that card. + * no sorcery or play land timing restriction are checked. For a land it has + * to be the turn of the player playing that card. * @return */ boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming, MageObjectReference reference); /** - * - * @param card the land card to play + * @param card the land card to play * @param game * @param ignoreTiming false - it won't be checked if the stack is empty and - * you are able to play a Sorcery. It's still checked, if you are able to - * play a land concerning the numner of lands you already played. + * you are able to play a Sorcery. It's still checked, if you are able to + * play a land concerning the numner of lands you already played. * @return */ boolean playLand(Card card, Game game, boolean ignoreTiming); @@ -536,15 +516,17 @@ public interface Player extends MageItem, Copyable<Player> { /** * Moves the cards from cards to the bottom of the players library. * - * @param cards - list of cards that have to be moved - * @param game - game + * @param cards - list of cards that have to be moved + * @param game - game * @param anyOrder - true if player can determine the order of the cards - * else random order - * @param source - source ability + * else random order + * @param source - source ability * @return */ boolean putCardsOnBottomOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder); + boolean putCardsOnBottomOfLibrary(Card card, Game game, Ability source, boolean anyOrder); + /** * Moves the card to the top x position of the library * @@ -559,10 +541,10 @@ public interface Player extends MageItem, Copyable<Player> { /** * Moves the cards from cards to the top of players library. * - * @param cards - list of cards that have to be moved - * @param game - game + * @param cards - list of cards that have to be moved + * @param game - game * @param anyOrder - true if player can determine the order of the cards - * @param source - source ability + * @param source - source ability * @return */ boolean putCardsOnTopOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder); @@ -588,8 +570,8 @@ public interface Player extends MageItem, Copyable<Player> { /** * Choose the order in which blockers get damage assigned to * - * @param blockers list of blockers where to choose the next one from - * @param combatGroup the concerning combat group + * @param blockers list of blockers where to choose the next one from + * @param combatGroup the concerning combat group * @param blockerOrder the already set order of blockers * @param game * @return blocker next to add to the blocker order @@ -728,11 +710,11 @@ public interface Player extends MageItem, Copyable<Player> { * @param toZone * @param source * @param game - * @param tapped the cards are tapped on the battlefield - * @param faceDown the cards are face down in the to zone - * @param byOwner the card is moved (or put onto battlefield) by the owner - * of the card and if target zone is battlefield controls the permanent - * (instead of the controller of the source) + * @param tapped the cards are tapped on the battlefield + * @param faceDown the cards are face down in the to zone + * @param byOwner the card is moved (or put onto battlefield) by the owner + * of the card and if target zone is battlefield controls the permanent + * (instead of the controller of the source) * @param appliedEffects * @return */ @@ -759,7 +741,6 @@ public interface Player extends MageItem, Copyable<Player> { * @param game * @param withName show the card name in the log * @return - * */ boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, boolean withName); @@ -769,7 +750,7 @@ public interface Player extends MageItem, Copyable<Player> { * list of applied effects is not saved * * @param card - * @param exileId exile zone id (optional) + * @param exileId exile zone id (optional) * @param exileName name of exile zone (optional) * @param sourceId * @param game @@ -811,7 +792,7 @@ public interface Player extends MageItem, Copyable<Player> { * @param sourceId * @param game * @param fromZone if null, this info isn't postet - * @param toTop to the top of the library else to the bottom + * @param toTop to the top of the library else to the bottom * @param withName show the card name in the log * @return */ @@ -836,10 +817,10 @@ public interface Player extends MageItem, Copyable<Player> { * without mana (null) or the mana set to manaCosts instead of its normal * mana costs. * - * @param sourceId the source that can be cast without mana + * @param sourceId the source that can be cast without mana * @param manaCosts alternate ManaCost, null if it can be cast without mana - * cost - * @param costs alternate other costs you need to pay + * cost + * @param costs alternate other costs you need to pay */ void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts<ManaCost> manaCosts, Costs<Cost> costs); @@ -870,6 +851,8 @@ public interface Player extends MageItem, Copyable<Player> { boolean scry(int value, Ability source, Game game); + boolean surveil(int value, Ability source, Game game); + /** * Only used for test player for pre-setting targets * diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index b6167fa214..2a0560ecc4 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -1,9 +1,5 @@ package mage.players; -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.Map.Entry; import mage.ConditionalMana; import mage.MageObject; import mage.MageObjectReference; @@ -31,11 +27,6 @@ import mage.cards.SplitCard; import mage.cards.decks.Deck; import mage.choices.ChoiceImpl; import mage.constants.*; -import static mage.constants.Zone.BATTLEFIELD; -import static mage.constants.Zone.EXILED; -import static mage.constants.Zone.GRAVEYARD; -import static mage.constants.Zone.HAND; -import static mage.constants.Zone.LIBRARY; import mage.counters.Counter; import mage.counters.CounterType; import mage.counters.Counters; @@ -77,6 +68,11 @@ import mage.util.GameLog; import mage.util.RandomUtil; import org.apache.log4j.Logger; +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.Map.Entry; + public abstract class PlayerImpl implements Player, Serializable { private static final Logger logger = Logger.getLogger(PlayerImpl.class); @@ -878,6 +874,11 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } + @Override + public boolean putCardsOnBottomOfLibrary(Card card, Game game, Ability source, boolean anyOrder) { + return putCardsOnBottomOfLibrary(new CardsImpl(card), game, source, anyOrder); + } + @Override public boolean putCardsOnBottomOfLibrary(Cards cardsToLibrary, Game game, Ability source, boolean anyOrder) { if (!cardsToLibrary.isEmpty()) { @@ -2562,7 +2563,7 @@ public abstract class PlayerImpl implements Player, Serializable { /** * @param game * @param appliedEffects - * @param numSides Number of sides the dice has + * @param numSides Number of sides the dice has * @return the number that the player rolled */ @Override @@ -2596,10 +2597,10 @@ public abstract class PlayerImpl implements Player, Serializable { /** * @param game * @param appliedEffects - * @param numberChaosSides The number of chaos sides the planar die - * currently has (normally 1 but can be 5) + * @param numberChaosSides The number of chaos sides the planar die + * currently has (normally 1 but can be 5) * @param numberPlanarSides The number of chaos sides the planar die - * currently has (normally 1) + * currently has (normally 1) * @return the outcome that the player rolled. Either ChaosRoll, PlanarRoll * or NilRoll */ @@ -2756,7 +2757,7 @@ public abstract class PlayerImpl implements Player, Serializable { /** * @param ability - * @param available if null, it won't be checked if enough mana is available + * @param available if null, it won't be checked if enough mana is available * @param sourceObject * @param game * @return @@ -3308,7 +3309,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean canPaySacrificeCost(Permanent permanent, UUID sourceId, - UUID controllerId, Game game + UUID controllerId, Game game ) { return sacrificeCostFilter == null || !sacrificeCostFilter.match(permanent, sourceId, controllerId, game); } @@ -3456,8 +3457,8 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCards(Card card, Zone toZone, - Ability source, Game game, - boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects + Ability source, Game game, + boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects ) { Set<Card> cardList = new HashSet<>(); if (card != null) { @@ -3468,22 +3469,22 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCards(Cards cards, Zone toZone, - Ability source, Game game + Ability source, Game game ) { return moveCards(cards.getCards(game), toZone, source, game); } @Override public boolean moveCards(Set<Card> cards, Zone toZone, - Ability source, Game game + Ability source, Game game ) { return moveCards(cards, toZone, source, game, false, false, false, null); } @Override public boolean moveCards(Set<Card> cards, Zone toZone, - Ability source, Game game, - boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects + Ability source, Game game, + boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects ) { if (cards.isEmpty()) { return true; @@ -3569,8 +3570,8 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardsToExile(Card card, Ability source, - Game game, boolean withName, UUID exileId, - String exileZoneName + Game game, boolean withName, UUID exileId, + String exileZoneName ) { Set<Card> cards = new HashSet<>(); cards.add(card); @@ -3579,8 +3580,8 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardsToExile(Set<Card> cards, Ability source, - Game game, boolean withName, UUID exileId, - String exileZoneName + Game game, boolean withName, UUID exileId, + String exileZoneName ) { if (cards.isEmpty()) { return true; @@ -3595,14 +3596,14 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardToHandWithInfo(Card card, UUID sourceId, - Game game + Game game ) { return this.moveCardToHandWithInfo(card, sourceId, game, true); } @Override public boolean moveCardToHandWithInfo(Card card, UUID sourceId, - Game game, boolean withName + Game game, boolean withName ) { boolean result = false; Zone fromZone = game.getState().getZone(card.getId()); @@ -3627,7 +3628,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public Set<Card> moveCardsToGraveyardWithInfo(Set<Card> allCards, Ability source, - Game game, Zone fromZone + Game game, Zone fromZone ) { UUID sourceId = source == null ? null : source.getSourceId(); Set<Card> movedCards = new LinkedHashSet<>(); @@ -3635,7 +3636,7 @@ public abstract class PlayerImpl implements Player, Serializable { // identify cards from one owner Cards cards = new CardsImpl(); UUID ownerId = null; - for (Iterator<Card> it = allCards.iterator(); it.hasNext();) { + for (Iterator<Card> it = allCards.iterator(); it.hasNext(); ) { Card card = it.next(); if (cards.isEmpty()) { ownerId = card.getOwnerId(); @@ -3696,7 +3697,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardToGraveyardWithInfo(Card card, UUID sourceId, - Game game, Zone fromZone + Game game, Zone fromZone ) { if (card == null) { return false; @@ -3725,8 +3726,8 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardToLibraryWithInfo(Card card, UUID sourceId, - Game game, Zone fromZone, - boolean toTop, boolean withName + Game game, Zone fromZone, + boolean toTop, boolean withName ) { if (card == null) { return false; @@ -3760,7 +3761,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, - Game game, Zone fromZone, boolean withName) { + Game game, Zone fromZone, boolean withName) { if (card == null) { return false; } @@ -3898,7 +3899,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (!cards.isEmpty()) { String text; if (cards.size() == 1) { - text = "card if you want to put it to the bottom of your library (Scry)"; + text = "card if you want to put it on the bottom of your library (Scry)"; } else { text = "cards you want to put on the bottom of your library (Scry)"; } @@ -3912,6 +3913,32 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } + @Override + public boolean surveil(int value, Ability source, Game game) { + GameEvent event = new GameEvent(GameEvent.EventType.SURVEIL, getId(), source == null ? null : source.getSourceId(), getId(), value, true); + if (game.replaceEvent(event)) { + return false; + } + game.informPlayers(getLogName() + " surveils " + event.getAmount()); + Cards cards = new CardsImpl(); + cards.addAll(getLibrary().getTopCards(game, event.getAmount())); + if (!cards.isEmpty()) { + String text; + if (cards.size() == 1) { + text = "card if you want to put it into your graveyard (Surveil)"; + } else { + text = "cards you want to put into your graveyard (Surveil)"; + } + TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard(text)); + chooseTarget(Outcome.Benefit, cards, target, source, game); + moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game); + cards.removeAll(target.getTargets()); + putCardsOnTopOfLibrary(cards, game, source, true); + } + game.fireEvent(new GameEvent(GameEvent.EventType.SURVEILED, getId(), source == null ? null : source.getSourceId(), getId(), event.getAmount(), true)); + return true; + } + @Override public boolean addTargets(Ability ability, Game game ) { diff --git a/Mage/src/main/java/mage/target/TargetImpl.java b/Mage/src/main/java/mage/target/TargetImpl.java index 4f95f3287d..110b67203c 100644 --- a/Mage/src/main/java/mage/target/TargetImpl.java +++ b/Mage/src/main/java/mage/target/TargetImpl.java @@ -149,7 +149,7 @@ public abstract class TargetImpl implements Target { @Override public boolean isRequired(UUID sourceId, Game game) { MageObject object = game.getObject(sourceId); - if (!requiredExplicitlySet && object != null && object instanceof Ability) { + if (!requiredExplicitlySet && object instanceof Ability) { return isRequired((Ability) object); } else { return isRequired(); diff --git a/Mage/src/main/java/mage/target/TargetPlayer.java b/Mage/src/main/java/mage/target/TargetPlayer.java index 53a33ab2a9..7b2d0bdf77 100644 --- a/Mage/src/main/java/mage/target/TargetPlayer.java +++ b/Mage/src/main/java/mage/target/TargetPlayer.java @@ -1,16 +1,14 @@ - package mage.target; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.filter.FilterPlayer; import mage.game.Game; import mage.players.Player; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com diff --git a/Mage/src/main/java/mage/target/TargetSource.java b/Mage/src/main/java/mage/target/TargetSource.java index b65bc14aba..e0dae36e50 100644 --- a/Mage/src/main/java/mage/target/TargetSource.java +++ b/Mage/src/main/java/mage/target/TargetSource.java @@ -60,7 +60,7 @@ public class TargetSource extends TargetObject { public void addTarget(UUID id, Ability source, Game game) { if (targets.size() < maxNumberOfTargets) { MageObject object = game.getObject(id); - if (object != null && object instanceof StackObject) { + if (object instanceof StackObject) { addTarget(((StackObject) object).getSourceId(), source, game, notTarget); } else { diff --git a/Mage/src/main/java/mage/target/common/TargetCardInYourGraveyard.java b/Mage/src/main/java/mage/target/common/TargetCardInYourGraveyard.java index a30eba6dee..e596adce26 100644 --- a/Mage/src/main/java/mage/target/common/TargetCardInYourGraveyard.java +++ b/Mage/src/main/java/mage/target/common/TargetCardInYourGraveyard.java @@ -1,4 +1,3 @@ - package mage.target.common; import java.util.HashSet; @@ -33,6 +32,10 @@ public class TargetCardInYourGraveyard extends TargetCard { this(numTargets, numTargets, filter); } + public TargetCardInYourGraveyard(int minNumTargets, int maxNumTargets) { + this(minNumTargets, maxNumTargets, StaticFilters.FILTER_CARD_FROM_YOUR_GRAVEYARD); + } + public TargetCardInYourGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { this(minNumTargets, maxNumTargets, filter, false); } diff --git a/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java new file mode 100644 index 0000000000..d3e84a8e9f --- /dev/null +++ b/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java @@ -0,0 +1,13 @@ +package mage.target.targetadjustment; + +import mage.abilities.Ability; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public interface TargetAdjuster { + + void adjustTargets(Ability ability, Game game); +} diff --git a/Mage/src/main/java/mage/target/targetadjustment/VerseCounterAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/VerseCounterAdjuster.java new file mode 100644 index 0000000000..35d1457785 --- /dev/null +++ b/Mage/src/main/java/mage/target/targetadjustment/VerseCounterAdjuster.java @@ -0,0 +1,27 @@ +package mage.target.targetadjustment; + +import mage.abilities.Ability; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public enum VerseCounterAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); + if (sourcePermanent != null) { + int xValue = sourcePermanent.getCounters(game).getCount(CounterType.VERSE); + FilterPermanent permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter(); + ability.getTargets().clear(); + ability.addTarget(new TargetPermanent(0, xValue, permanentFilter, false)); + } + } +} diff --git a/Mage/src/main/java/mage/target/targetadjustment/XCMCGraveyardAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/XCMCGraveyardAdjuster.java new file mode 100644 index 0000000000..617da884a1 --- /dev/null +++ b/Mage/src/main/java/mage/target/targetadjustment/XCMCGraveyardAdjuster.java @@ -0,0 +1,27 @@ +package mage.target.targetadjustment; + +import mage.abilities.Ability; +import mage.constants.ComparisonType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.TargetCard; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author TheElk801 + */ +public enum XCMCGraveyardAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterCard filterCard = ((TargetCard) ability.getTargets().get(0)).getFilter().copy(); + filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); + filterCard.setMessage(filterCard.getMessage().replace('X', (char) xValue)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetCardInGraveyard(filterCard)); + } +} diff --git a/Mage/src/main/java/mage/target/targetadjustment/XCMCPermanentAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/XCMCPermanentAdjuster.java new file mode 100644 index 0000000000..bc6b2b5771 --- /dev/null +++ b/Mage/src/main/java/mage/target/targetadjustment/XCMCPermanentAdjuster.java @@ -0,0 +1,28 @@ +package mage.target.targetadjustment; + +import mage.abilities.Ability; +import mage.constants.ComparisonType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public enum XCMCPermanentAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + TargetPermanent oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0); + int minTargets = oldTargetPermanent.getMinNumberOfTargets(); + int maxTargets = oldTargetPermanent.getMaxNumberOfTargets(); + FilterPermanent permanentFilter = oldTargetPermanent.getFilter().copy(); + permanentFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false)); + } +} diff --git a/Mage/src/main/java/mage/target/targetadjustment/XTargetsAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/XTargetsAdjuster.java new file mode 100644 index 0000000000..c95f3fbbe2 --- /dev/null +++ b/Mage/src/main/java/mage/target/targetadjustment/XTargetsAdjuster.java @@ -0,0 +1,22 @@ +package mage.target.targetadjustment; + +import mage.abilities.Ability; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public enum XTargetsAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterPermanent permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter(); + ability.getTargets().clear(); + ability.addTarget(new TargetPermanent(xValue, permanentFilter)); + } +} diff --git a/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java index 51ce34bcd3..97a51a225d 100644 --- a/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java @@ -37,7 +37,7 @@ public class CastSpellYourLastTurnWatcher extends Watcher { lastActivePlayer = game.getActivePlayerId(); if (event.getType() == GameEvent.EventType.SPELL_CAST) { UUID playerId = event.getPlayerId(); - if (playerId != null && lastActivePlayer != null && playerId.equals(lastActivePlayer)) { + if (playerId != null && playerId.equals(lastActivePlayer)) { amountOfSpellsCastOnCurrentTurn.putIfAbsent(playerId, 0); amountOfSpellsCastOnCurrentTurn.compute(playerId, (k, a) -> a + 1); } diff --git a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java index 7fdefbe7cb..870daa230f 100644 --- a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java @@ -71,7 +71,7 @@ public class PermanentsEnteredBattlefieldWatcher extends Watcher { return enteringBattlefield.get(playerId); } - public boolean AnotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(Permanent sourcePermanent, Game game) { + public boolean anotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(Permanent sourcePermanent, Game game) { if (enteringBattlefieldLastTurn.containsKey(sourcePermanent.getControllerId())) { for (Permanent permanent : enteringBattlefieldLastTurn.get(sourcePermanent.getControllerId())) { if (!permanent.getId().equals(sourcePermanent.getId()) diff --git a/Utils/cardClass.tmpl b/Utils/cardClass.tmpl index d7351b9c03..cfad53cb34 100644 --- a/Utils/cardClass.tmpl +++ b/Utils/cardClass.tmpl @@ -3,7 +3,7 @@ package mage.cards.[=$cardNameFirstLetter=]; import java.util.UUID;[= if ($power || $power eq 0) { if ($planeswalker eq 'true') { - $OUT .= "\nimport mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;" + $OUT .= "\nimport mage.abilities.common.PlaneswalkerEntersWithLoyalityCountersAbility;" }else { $OUT .= "\nimport mage.MageInt;" } diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 7a2646f1cb..44abc4a54c 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -242,6 +242,8 @@ foreach my $ability (@abilities) { $vars{'abilities'} .= "\n this.addAbility(" . $kw . "Ability.getInstance());"; } elsif ($keywords{$kw} eq 'new') { $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability());"; + } elsif ($keywords{$kw} eq 'card') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability(this));"; } elsif ($keywords{$kw} eq 'color') { $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability(this.color));"; } elsif ($keywords{$kw} eq 'number') { diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 437cc37021..b965d6b3ae 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -51,12 +51,14 @@ Intimidate|instance| Ingest|new| Islandcycling|cost| Islandwalk|new| +Jump-start|card| Level up|cost| Lifelink|instance| Living weapon|new| Madness|card, cost| Melee|new| Menace|new| +Mentor|new| Miracle|cost| Mountaincycling|cost| Mountainwalk|new| diff --git a/Utils/known-sets.txt b/Utils/known-sets.txt index 896efb1671..91756f8ea8 100644 --- a/Utils/known-sets.txt +++ b/Utils/known-sets.txt @@ -92,6 +92,7 @@ Gatecrash|Gatecrash| Global Series: Jiang Yanggu & Mu Yanling|JiangYangguMuYanling| Grand Prix|GrandPrix| Guildpact|Guildpact| +Guilds of Ravnica|GuildsOfRavnica| Guru|Guru| Happy Holidays|HappyHolidays| HASCON Promo 2017|HasconPromo2017| diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 2266d8210e..4859b6ceed 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -33932,11 +33932,11 @@ Loyal Unicorn|Commander 2018|4|U|{3}{W}|Creature - Unicorn|3|4|Vigilance$Lieuten Magus of the Balance|Commander 2018|5|R|{1}{W}|Creature - Human Wizard|2|2|{4}{W}, {T}, Sacrifice Magus of the Balance: Each player chooses a number of lands they control equal to the number of lands controlled by the player who controls the fewest, then sacrifices the rest. Players discard cards and sacrifice creatures the same way.| Aminatou's Augury|Commander 2018|6|R|{6}{U}{U}|Sorcery|||Exile the top eight cards of your library. You may put a land card from among them onto the battlefield. Until end of turn, for each nonland card type, you may cast a card of that type from among the exiled cards without paying its mana cost.| Echo Storm|Commander 2018|7|R|{3}{U}{U}|Sorcery|||When you cast this spell, copy it for each time you've cast your commander from the command zone this game. You may choose new targets for the copies.$Create a token that's a copy of target artifact.| -Estrid's Invocation|Commander 2018|8|R|{2}{U}|Enchantment|||You may have Estrid's Invocation enter the battlefield as a copy of any enchantment you control, except it gains "At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control."| +Estrid's Invocation|Commander 2018|8|R|{2}{U}|Enchantment|||You may have Estrid's Invocation enter the battlefield as a copy of any enchantment you control, except it has "At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control."| Ever-Watching Threshold|Commander 2018|9|R|{2}{U}|Enchantment|||Whenever an opponent attacks you and/or a planeswalker you control with one or more creatures, draw a card.| Loyal Drake|Commander 2018|10|U|{2}{U}|Creature - Drake|2|2|Flying$Lieutenant — At the beginning of combat on your turn, if you control your commander, draw a card.| Octopus Umbra|Commander 2018|11|R|{3}{U}{U}|Enchantment - Aura|||Enchant creature$Enchanted creature has base power and toughness 8/8 and has "Whenever this creature attacks, you may tap target creature with power 8 or less."$Totem armor| -Primordial Mist|Commander 2018|12|R|{4}{U}|Enchantment|||At the beginning of your end step, you may manifest the top card of your library.| +Primordial Mist|Commander 2018|12|R|{4}{U}|Enchantment|||At the beginning of your end step, you may manifest the top card of your library.$Exile a face-down permanent you control face up: You may play that card this turn.| Vedalken Humiliator|Commander 2018|13|R|{3}{U}|Creature - Vedalken Wizard|3|4|Metalcraft — Whenever Vedalken Humiliator attacks, if you control three or more artifacts, creatures your opponents control lose all abilities and have base power and toughness 1/1 until end of turn.| Bloodtracker|Commander 2018|14|R|{3}{B}|Creature - Vampire Wizard|2|2|Flying${B}, Pay 2 life: Put a +1/+1 counter on Bloodtracker.$When Bloodtracker leaves the battlefield, draw a card for each +1/+1 counter on it.| Entreat the Dead|Commander 2018|15|R|{X}{X}{B}{B}{B}|Sorcery|||Return X target creature cards from your graveyard to the battlefield.$Miracle {X}{B}{B}| @@ -33961,21 +33961,21 @@ Nylea's Colossus|Commander 2018|33|R|{6}{G}|Enchantment Creature - Giant|6|6|Con Ravenous Slime|Commander 2018|34|R|{2}{G}|Creature - Ooze|1|1|Ravenous Slime can't be blocked by creatures with power 2 or less.$If a creature an opponent controls would die, instead exile it and put a number of +1/+1 counters equal to that creature's power on Ravenous Slime.| Turntimber Sower|Commander 2018|35|R|{2}{G}|Creature - Elf Druid|3|3|Whenever one or more land cards are put into your graveyard from anywhere, create a 0/1 green Plant creature token.${G}, Sacrifice three creatures: Return target land card from your graveyard to your hand.| Whiptongue Hydra|Commander 2018|36|R|{5}{G}|Creature - Lizard Hydra|4|4|Reach$When Whiptongue Hydra enters the battlefield, destroy all creatures with flying. Put a +1/+1 counter on Whiptongue Hydra for each creature destroyed this way.| -Aminatou, the Fateshifter|Commander 2018|37|M|{W}{U}{B}|Legendary Planeswalker - Aminatou|3|+1: Draw a card, then put a card from your hand on top of your library.$-1: Exile another target permanent you own, then return it to the battlefield under your control.$-6: Choose left or right. Each player gains control of all nonland permanents other than Aminatou, the Fateshifter controlled by the next player in the chosen direction.$Aminatou, the Fateshifter can be your commander.| +Aminatou, the Fateshifter|Commander 2018|37|M|{W}{U}{B}|Legendary Planeswalker - Aminatou|3|+1: Draw a card, then put a card from your hand on top of your library.$−1: Exile another target permanent you own, then return it to the battlefield under your control.$−6: Choose left or right. Each player gains control of all nonland permanents other than Aminatou, the Fateshifter controlled by the next player in the chosen direction.$Aminatou, the Fateshifter can be your commander.| Arixmethes, Slumbering Isle|Commander 2018|38|R|{2}{G}{U}|Legendary Creature - Kraken|12|12|Arixmethes, Slumbering Isle enters the battlefield tapped with five slumber counters on it.$As long as Arixmethes has a slumber counter on it, it's a land.$Whenever you cast a spell, you may remove a slumber counter from Arixmethes.${T}: Add {G}{U}.| Brudiclad, Telchor Engineer|Commander 2018|39|M|{4}{U}{R}|Legendary Artifact Creature - Artificer|4|4|Creature tokens you control have haste.$At the beginning of combat on your turn, create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token.| -Estrid, the Masked|Commander 2018|40|M|{1}{G}{W}{U}|Legendary Planeswalker - Estrid|3|+2: Untap each enchanted permanent you control.$-1: Create a white Aura enchantment token named Mask attached to another target permanent. The token has enchant permanent and totem armor.$-7: Put the top seven cards of your library into your graveyard. Return all non-Aura enchantment cards from your graveyard to the battlefield, then do the same for Aura cards.$Estrid, the Masked can be your commander.| -Gyrus, Waker of Corpses|Commander 2018|41|M|{X}{B}{R}{G}|Legendary Creature - Hydra|0|0|Gyrus, Walker of Corpses enters the battlefield with a number of +1/+1 counters on it equal to the amount of mana spent to cast it.$Whenever Gyrus attacks, you may exile target creature card with lesser power from your graveyard. If you do, create a token that's a copy of that card and that's tapped and attacking. Exile the token at the end of combat.| +Estrid, the Masked|Commander 2018|40|M|{1}{G}{W}{U}|Legendary Planeswalker - Estrid|3|+2: Untap each enchanted permanent you control.$−1: Create a white Aura enchantment token named Mask attached to another target permanent. The token has enchant permanent and totem armor.$−7: Put the top seven cards of your library into your graveyard. Return all non-Aura enchantment cards from your graveyard to the battlefield, then do the same for Aura cards.$Estrid, the Masked can be your commander.| +Gyrus, Waker of Corpses|Commander 2018|41|M|{X}{B}{R}{G}|Legendary Creature - Hydra|0|0|Gyrus, Waker of Corpses enters the battlefield with a number of +1/+1 counters on it equal to the amount of mana spent to cast it.$Whenever Gyrus attacks, you may exile target creature card with lesser power from your graveyard. If you do, create a token that's a copy of that card and that's tapped and attacking. Exile the token at end of combat.| Kestia, the Cultivator|Commander 2018|42|M|{1}{G}{W}{U}|Legendary Enchantment Creature - Nymph|4|4|Bestow {3}{G}{W}{U}$Enchanted creature gets +4/+4.$Whenever an enchanted creature or enchantment creature you control attacks, draw a card.| -Lord Windgrace|Commander 2018|43|M|{2}{B}{R}{G}|Legendary Planeswalker - Windgrace|5|+2: Discard a card, then draw a card. If a land card is discarded this way, draw an additional card.$-3: Return up to two target land cards from your graveyard to the battlefield.$-11: Destroy up to six target nonland permanents, then create six 2/2 green Cat Warrior creature tokens with forestwalk.$Lord Windgrace can be your commander.| -Saheeli, the Gifted|Commander 2018|44|M|{2}{U}{R}|Legendary Planeswalker - Saheeli|4|+1: Create a 1/1 colorless Servo artifact creature token.$+1: The next spell you cast this turn costs {1} less to cast for each artifact you control as you cast it.$-7: For each artifact you control, create a token that's a copy of it. Those tokens gain haste. Exile those tokens at the beginning of the next end step.$Saheeli, the Gifted can be your commander.| +Lord Windgrace|Commander 2018|43|M|{2}{B}{R}{G}|Legendary Planeswalker - Windgrace|5|+2: Discard a card, then draw a card. If a land card is discarded this way, draw an additional card.$−3: Return up to two target land cards from your graveyard to the battlefield.$−11: Destroy up to six target nonland permanents, then create six 2/2 green Cat Warrior creature tokens with forestwalk.$Lord Windgrace can be your commander.| +Saheeli, the Gifted|Commander 2018|44|M|{2}{U}{R}|Legendary Planeswalker - Saheeli|4|+1: Create a 1/1 colorless Servo artifact creature token.$+1: The next spell you cast this turn costs {1} less to cast for each artifact you control as you cast it.$−7: For each artifact you control, create a token that's a copy of it. Those tokens gain haste. Exile those tokens at the beginning of the next end step.$Saheeli, the Gifted can be your commander.| Tawnos, Urza's Apprentice|Commander 2018|45|M|{U}{R}|Legendary Creature - Human Artificer|1|3|Haste${U}{R}, {T}: Copy target activated or triggered ability you control from an artifact source. You may choose new targets for the copy.| -Thantis the Warweaver|Commander 2018|46|M|{3}{B}{R}{G}|Legendary Creature - Spider|5|5|Vigilance, reach$All creatures attack each combat if able.$Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Thantis the Warweaver.| +Thantis, the Warweaver|Commander 2018|46|M|{3}{B}{R}{G}|Legendary Creature - Spider|5|5|Vigilance, reach$All creatures attack each combat if able.$Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Thantis, the Warweaver.| Tuvasa the Sunlit|Commander 2018|47|M|{G}{W}{U}|Legendary Creature - Merfolk Shaman|1|1|Tuvasa the Sunlit gets +1/+1 for each enchantment you control.$Whenever you cast your first enchantment spell each turn, draw a card.| Varina, Lich Queen|Commander 2018|48|M|{1}{W}{U}{B}|Legendary Creature - Zombie Wizard|4|4|Whenever you attack with one or more Zombies, draw that many cards, then discard that many cards. You gain that much life.${2}, Exile two cards from your graveyard: Create a tapped 2/2 black Zombie creature token.| Windgrace's Judgment|Commander 2018|49|R|{3}{B}{G}|Instant|||For any number of opponents, destroy target nonland permanent that player controls.| Xantcha, Sleeper Agent|Commander 2018|50|R|{1}{B}{R}|Legendary Creature - Minion|5|5|As Xantcha, Sleeper Agent enters the battlefield, an opponent of your choice gains control of it.$Xantcha attacks each combat if able and can't attack its owner or planeswalkers its owner controls.${3}: Xantcha's controller loses 2 life and you draw a card. Any player may activate this ability.| -Yennet, Crypt Sovereign|Commander 2018|51|M|{2}{W}{U}{B}|Legendary Creature - Sphinx|3|5|Flying, vigilance, menace$Whenever Yennet, Crypt Sovereign attacks, reveal the top card of your library. If that card's converted mana cost is odd, you may cast it without paying its mana cost. Otherwise, draw a card.| +Yennett, Cryptic Sovereign|Commander 2018|51|M|{2}{W}{U}{B}|Legendary Creature - Sphinx|3|5|Flying, vigilance, menace$Whenever Yennett, Cryptic Sovereign attacks, reveal the top card of your library. If that card's converted mana cost is odd, you may cast it without paying its mana cost. Otherwise, draw a card.| Yuriko, the Tiger's Shadow|Commander 2018|52|R|{1}{U}{B}|Legendary Creature - Human Ninja|1|3|Commander ninjutsu {U}{B}$Whenever a Ninja you control deals combat damage to a player, reveal the top card of your library and put that card into your hand. Each opponent loses life equal to that card's converted mana cost.| Ancient Stone Idol|Commander 2018|53|R|{10}|Artifact Creature - Golem|12|12|Flash$This spell costs {1} less to cast for each attacking creature.$Trample$When Ancient Stone Idol dies, create a 6/12 colorless Construct artifact creature token with trample.| Coveted Jewel|Commander 2018|54|R|{6}|Artifact|||When Coveted Jewel enters the battlefield, draw three cards.${T}: Add three mana of any one color.$Whenever one or more creatures an opponent controls attack you and aren't blocked, that player draws three cards and gains control of Coveted Jewel. Untap it.| @@ -34013,9 +34013,9 @@ Devastation Tide|Commander 2018|85|R|{3}{U}{U}|Sorcery|||Return all nonland perm Dictate of Kruphix|Commander 2018|86|R|{1}{U}{U}|Enchantment|||Flash$At the beginning of each player's draw step, that player draws an additional card.| Djinn of Wishes|Commander 2018|87|R|{3}{U}{U}|Creature - Djinn|4|4|Flying$Djinn of Wishes enters the battlefield with three wish counters on it.${2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it.| Dream Cache|Commander 2018|88|C|{2}{U}|Sorcery|||Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library.| -Eel Umbra|Commander 2018|89|C|{1}{U}|Enchantment - Aura|||Flash| +Eel Umbra|Commander 2018|89|C|{1}{U}|Enchantment - Aura|||Flash$Enchant creature$Enchanted creature gets +1/+1.$Totem armor| Etherium Sculptor|Commander 2018|90|C|{1}{U}|Artifact Creature - Vedalken Artificer|1|2|Artifact spells you cast cost {1} less to cast.| -Inkwell Leviathan|Commander 2018|91|R|{7}{U}{U}|Artifact Creature - Leviathan|7|11|Islandwalk| +Inkwell Leviathan|Commander 2018|91|R|{7}{U}{U}|Artifact Creature - Leviathan|7|11|Trample$Islandwalk$Shroud| Into the Roil|Commander 2018|92|C|{1}{U}|Instant|||Kicker {1}{U}$Return target nonland permanent to its owner's hand. If this spell was kicked, draw a card.| Jeskai Infiltrator|Commander 2018|93|R|{2}{U}|Creature - Human Monk|2|3|Jeskai Infiltrator can't be blocked as long as you control no other creatures.$When Jeskai Infiltrator deals combat damage to a player, exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards.| Mulldrifter|Commander 2018|94|U|{4}{U}|Creature - Elemental|2|2|Flying$When Mulldrifter enters the battlefield, draw two cards.$Evoke {2}{U}| @@ -34026,8 +34026,8 @@ Predict|Commander 2018|98|U|{1}{U}|Instant|||Choose a card name, then target pla Reverse Engineer|Commander 2018|99|U|{3}{U}{U}|Sorcery|||Improvise$Draw three cards.| Saheeli's Artistry|Commander 2018|100|R|{4}{U}{U}|Sorcery|||Choose one or both —$• Create a token that's a copy of target artifact.$• Create a token that's a copy of target creature, except it's an artifact in addition to its other types.| Sharding Sphinx|Commander 2018|101|R|{4}{U}{U}|Artifact Creature - Sphinx|4|4|Flying$Whenever an artifact creature you control deals combat damage to a player, you may create a 1/1 blue Thopter artifact creature token with flying.| -Sigiled Starfish|Commander 2018|102|C|{1}{U}|Creature - Starfish|0|3|{T}: Scry 1.| -Sphinx of Jwar Isle|Commander 2018|103|R|{4}{U}{U}|Creature - Sphinx|5|5|Flying$Shroud| +Sigiled Starfish|Commander 2018|102|U|{1}{U}|Creature - Starfish|0|3|{T}: Scry 1.| +Sphinx of Jwar Isle|Commander 2018|103|R|{4}{U}{U}|Creature - Sphinx|5|5|Flying$Shroud$You may look at the top card of your library.| Sphinx of Uthuun|Commander 2018|104|R|{5}{U}{U}|Creature - Sphinx|5|6|Flying$When Sphinx of Uthuun enters the battlefield, reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.| Telling Time|Commander 2018|105|C|{1}{U}|Instant|||Look at the top three cards of your library. Put one of those cards into your hand, one on top of your library, and one on the bottom of your library.| Thirst for Knowledge|Commander 2018|106|U|{2}{U}|Instant|||Draw three cards. Then discard two cards unless you discard an artifact card.| @@ -34068,15 +34068,15 @@ Eidolon of Blossoms|Commander 2018|140|R|{2}{G}{G}|Enchantment Creature - Spirit Enchantress's Presence|Commander 2018|141|R|{2}{G}|Enchantment|||Whenever you cast an enchantment spell, draw a card.| Epic Proportions|Commander 2018|142|R|{4}{G}{G}|Enchantment - Aura|||Flash$Enchant creature$Enchanted creature gets +5/+5 and has trample.| Explore|Commander 2018|143|C|{1}{G}|Sorcery|||You may play an additional land this turn.$Draw a card.| -Explosive Vegetation|Commander 2018|144|U|{3}{G}|Sorcery|||Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library.| +Explosive Vegetation|Commander 2018|144|U|{3}{G}|Sorcery|||Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.| Far Wanderings|Commander 2018|145|C|{2}{G}|Sorcery|||Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.$Threshold — If seven or more cards are in your graveyard, instead search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library.| -Farhaven Elf|Commander 2018|146|C|{2}{G}|Creature - Elf Druid|1|1|When Farhaven Elf enters the battlefield, you may search your library for a basic land card and put it onto the battlefield tapped. If you do, shuffle your library.| +Farhaven Elf|Commander 2018|146|C|{2}{G}|Creature - Elf Druid|1|1|When Farhaven Elf enters the battlefield, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| Fertile Ground|Commander 2018|147|C|{1}{G}|Enchantment - Aura|||Enchant land$Whenever enchanted land is tapped for mana, its controller adds an additional one mana of any color.| Grapple with the Past|Commander 2018|148|C|{1}{G}|Instant|||Put the top three cards of your library into your graveyard, then you may return a creature or land card from your graveyard to your hand.| Ground Seal|Commander 2018|149|R|{1}{G}|Enchantment|||When Ground Seal enters the battlefield, draw a card.$Cards in graveyards can't be the targets of spells or abilities.| -Harrow|Commander 2018|150|C|{2}{G}|Instant|||As an additional cost to cast this spell, sacrifice a land.$Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library.| +Harrow|Commander 2018|150|C|{2}{G}|Instant|||As an additional cost to cast this spell, sacrifice a land.$Search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library.| Herald of the Pantheon|Commander 2018|151|R|{1}{G}|Creature - Centaur Shaman|2|2|Enchantment spells you cast cost {1} less to cast.$Whenever you cast an enchantment spell, you gain 1 life.| -Hunting Wilds|Commander 2018|152|U|{3}{G}|Sorcery|||Kicker {3}{G}$Search your library for up to two Forest cards and put them onto the battlefield tapped. Then shuffle your library.$If this spell was kicked, untap all Forests put onto the battlefield this way. They become 3/3 green creatures with haste that are still lands.| +Hunting Wilds|Commander 2018|152|U|{3}{G}|Sorcery|||Kicker {3}{G}$Search your library for up to two Forest cards, put them onto the battlefield tapped, then shuffle your library.$If this spell was kicked, untap all Forests put onto the battlefield this way. They become 3/3 green creatures with haste that are still lands.| Hydra Omnivore|Commander 2018|153|M|{4}{G}{G}|Creature - Hydra|8|8|Whenever Hydra Omnivore deals combat damage to an opponent, it deals that much damage to each other opponent.| Khalni Heart Expedition|Commander 2018|154|C|{1}{G}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Khalni Heart Expedition.$Remove three quest counters from Khalni Heart Expedition and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.| Kruphix's Insight|Commander 2018|155|C|{2}{G}|Sorcery|||Reveal the top six cards of your library. Put up to three enchantment cards from among them into your hand and the rest of the revealed cards into your graveyard.| @@ -34090,7 +34090,7 @@ Snake Umbra|Commander 2018|162|C|{2}{G}|Enchantment - Aura|||Enchant creature$En Spawning Grounds|Commander 2018|163|R|{6}{G}{G}|Enchantment - Aura|||Enchant land$Enchanted land has "{T}: Create a 5/5 green Beast creature token with trample."| Vow of Wildness|Commander 2018|164|U|{2}{G}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +3/+3, has trample, and can't attack you or a planeswalker you control.| Wild Growth|Commander 2018|165|C|{G}|Enchantment - Aura|||Enchant land$Whenever enchanted land is tapped for mana, its controller adds an additional {G}.| -Yavimaya Elder|Commander 2018|166|C|{1}{G}{G}|Creature - Human Druid|2|1|When Yavimaya Elder dies, you may search your library for up to two basic land cards, reveal them, and put them into your hand. If you do, shuffle your library.${2}, Sacrifice Yavimaya Elder: Draw a card.| +Yavimaya Elder|Commander 2018|166|C|{1}{G}{G}|Creature - Human Druid|2|1|When Yavimaya Elder dies, you may search your library for up to two basic land cards, reveal them, put them into your hand, then shuffle your library.${2}, Sacrifice Yavimaya Elder: Draw a card.| Yavimaya Enchantress|Commander 2018|167|C|{2}{G}|Creature - Human Druid|2|2|Yavimaya Enchantress gets +1/+1 for each enchantment on the battlefield.| Aethermage's Touch|Commander 2018|168|R|{2}{W}{U}|Instant|||Reveal the top four cards of your library. You may put a creature card from among them onto the battlefield. It gains "At the beginning of your end step, return this creature to its owner's hand." Then put the rest of the cards revealed this way on the bottom of your library in any order.| Bant Charm|Commander 2018|169|U|{G}{W}{U}|Instant|||Choose one —$• Destroy target artifact.$• Put target creature on the bottom of its owner's library.$• Counter target instant spell.| @@ -34137,14 +34137,14 @@ Mimic Vat|Commander 2018|209|R|{3}|Artifact|||Imprint — Whenever a nontoken cr Mind Stone|Commander 2018|210|C|{2}|Artifact|||{T}: Add {C}.${1}, {T}, Sacrifice Mind Stone: Draw a card.| Mirrorworks|Commander 2018|211|R|{5}|Artifact|||Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. If you do, create a token that's a copy of that artifact.| Myr Battlesphere|Commander 2018|212|R|{7}|Artifact Creature - Myr Construct|4|7|When Myr Battlesphere enters the battlefield, create four 1/1 colorless Myr artifact creature tokens.$Whenever Myr Battlesphere attacks, you may tap X untapped Myr you control. If you do, Myr Battlesphere gets +X/+0 until end of turn and deals X damage to the player or planeswalker it's attacking.| -Orzhov Signet|Commander 2018|213|U|{2}|Artifact|||{1}, {T}: Add {W}{B}.| +Orzhov Signet|Commander 2018|213|C|{2}|Artifact|||{1}, {T}: Add {W}{B}.| Pilgrim's Eye|Commander 2018|214|C|{3}|Artifact Creature - Thopter|1|1|Flying$When Pilgrim's Eye enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| Prismatic Lens|Commander 2018|215|U|{2}|Artifact|||{T}: Add {C}.${1}, {T}: Add one mana of any color.| Prototype Portal|Commander 2018|216|R|{4}|Artifact|||Imprint — When Prototype Portal enters the battlefield, you may exile an artifact card from your hand.${X}, {T}: Create a token that's a copy of the exiled card. X is the converted mana cost of that card.| Psychosis Crawler|Commander 2018|217|R|{5}|Artifact Creature - Horror|*|*|Psychosis Crawler's power and toughness are each equal to the number of cards in your hand.$Whenever you draw a card, each opponent loses 1 life.| Scrabbling Claws|Commander 2018|218|U|{1}|Artifact|||{T}: Target player exiles a card from their graveyard.${1}, Sacrifice Scrabbling Claws: Exile target card from a graveyard. Draw a card.| Scuttling Doom Engine|Commander 2018|219|R|{6}|Artifact Creature - Construct|6|6|Scuttling Doom Engine can't be blocked by creatures with power 2 or less.$When Scuttling Doom Engine dies, it deals 6 damage to target opponent or planeswalker.| -Seer's Lantern|Commander 2018|220|C|{3}|Artifact|||{T}: Add {C}.| +Seer's Lantern|Commander 2018|220|C|{3}|Artifact|||{T}: Add {C}.${2}, {T}: Scry 1.| Seer's Sundial|Commander 2018|221|R|{4}|Artifact|||Landfall — Whenever a land enters the battlefield under your control, you may pay {2}. If you do, draw a card.| Sol Ring|Commander 2018|222|U|{1}|Artifact|||{T}: Add {C}{C}.| Soul of New Phyrexia|Commander 2018|223|M|{6}|Artifact Creature - Avatar|6|6|Trample${5}: Permanents you control gain indestructible until end of turn.${5}, Exile Soul of New Phyrexia from your graveyard: Permanents you control gain indestructible until end of turn.| @@ -34160,7 +34160,7 @@ Arcane Sanctum|Commander 2018|232|U||Land|||Arcane Sanctum enters the battlefiel Azorius Chancery|Commander 2018|233|U||Land|||Azorius Chancery enters the battlefield tapped.$When Azorius Chancery enters the battlefield, return a land you control to its owner's hand.${T}: Add {W}{U}.| Azorius Guildgate|Commander 2018|234|C||Land - Gate|||Azorius Guildgate enters the battlefield tapped.${T}: Add {W} or {U}.| Barren Moor|Commander 2018|235|C||Land|||Barren Moor enters the battlefield tapped.${T}: Add {B}.$Cycling {B}| -Blighted Woodland|Commander 2018|236|U||Land|||{T}: Add {C}.${3}{G}, {T}, Sacrifice Blighted Woodland: Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library.| +Blighted Woodland|Commander 2018|236|U||Land|||{T}: Add {C}.${3}{G}, {T}, Sacrifice Blighted Woodland: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.| Blossoming Sands|Commander 2018|237|C||Land|||Blossoming Sands enters the battlefield tapped.$When Blossoming Sands enters the battlefield, you gain 1 life.${T}: Add {G} or {W}.| Bojuka Bog|Commander 2018|238|C||Land|||Bojuka Bog enters the battlefield tapped.$When Bojuka Bog enters the battlefield, exile all cards from target player's graveyard.${T}: Add {B}.| Buried Ruin|Commander 2018|239|U||Land|||{T}: Add {C}.${2}, {T}, Sacrifice Buried Ruin: Return target artifact card from your graveyard to your hand.| @@ -34187,18 +34187,18 @@ Jungle Hollow|Commander 2018|259|C||Land|||Jungle Hollow enters the battlefield Jwar Isle Refuge|Commander 2018|260|U||Land|||Jwar Isle Refuge enters the battlefield tapped.$When Jwar Isle Refuge enters the battlefield, you gain 1 life.${T}: Add {U} or {B}.| Kazandu Refuge|Commander 2018|261|U||Land|||Kazandu Refuge enters the battlefield tapped.$When Kazandu Refuge enters the battlefield, you gain 1 life.${T}: Add {R} or {G}.| Khalni Garden|Commander 2018|262|C||Land|||Khalni Garden enters the battlefield tapped.$When Khalni Garden enters the battlefield, create a 0/1 green Plant creature token.${T}: Add {G}.| -Krosan Verge|Commander 2018|263|U||Land|||Krosan Verge enters the battlefield tapped.${T}: Add {C}.${2}, {T}, Sacrifice Krosan Verge: Search your library for a Forest card and a Plains card and put them onto the battlefield tapped. Then shuffle your library.| +Krosan Verge|Commander 2018|263|U||Land|||Krosan Verge enters the battlefield tapped.${T}: Add {C}.${2}, {T}, Sacrifice Krosan Verge: Search your library for a Forest card and a Plains card, put them onto the battlefield tapped, then shuffle your library.| Lonely Sandbar|Commander 2018|264|C||Land|||Lonely Sandbar enters the battlefield tapped.${T}: Add {U}.$Cycling {U}| Meandering River|Commander 2018|265|U||Land|||Meandering River enters the battlefield tapped.${T}: Add {W} or {U}.| Mortuary Mire|Commander 2018|266|C||Land|||Mortuary Mire enters the battlefield tapped.$When Mortuary Mire enters the battlefield, you may put target creature card from your graveyard on top of your library.${T}: Add {B}.| Mosswort Bridge|Commander 2018|267|R||Land|||Hideaway${T}: Add {G}.${G}, {T}: You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater.| -Mountain Valley|Commander 2018|268|U||Land|||Mountain Valley enters the battlefield tapped.${T}, Sacrifice Mountain Valley: Search your library for a Mountain or Forest card and put it onto the battlefield. Then shuffle your library.| +Mountain Valley|Commander 2018|268|U||Land|||Mountain Valley enters the battlefield tapped.${T}, Sacrifice Mountain Valley: Search your library for a Mountain or Forest card, put it onto the battlefield, then shuffle your library.| Myriad Landscape|Commander 2018|269|U||Land|||Myriad Landscape enters the battlefield tapped.${T}: Add {C}.${2}, {T}, Sacrifice Myriad Landscape: Search your library for up to two basic land cards that share a land type, put them onto the battlefield tapped, then shuffle your library.| New Benalia|Commander 2018|270|U||Land|||New Benalia enters the battlefield tapped.$When New Benalia enters the battlefield, scry 1.${T}: Add {W}.| Orzhov Basilica|Commander 2018|271|U||Land|||Orzhov Basilica enters the battlefield tapped.$When Orzhov Basilica enters the battlefield, return a land you control to its owner's hand.${T}: Add {W}{B}.| Orzhov Guildgate|Commander 2018|272|C||Land - Gate|||Orzhov Guildgate enters the battlefield tapped.${T}: Add {W} or {B}.| Rakdos Carnarium|Commander 2018|273|C||Land|||Rakdos Carnarium enters the battlefield tapped.$When Rakdos Carnarium enters the battlefield, return a land you control to its owner's hand.${T}: Add {B}{R}.| -Rocky Tar Pit|Commander 2018|274|U||Land|||Rocky Tar Pit enters the battlefield tapped.${T}, Sacrifice Rocky Tar Pit: Search your library for a Swamp or Mountain card and put it onto the battlefield. Then shuffle your library.| +Rocky Tar Pit|Commander 2018|274|U||Land|||Rocky Tar Pit enters the battlefield tapped.${T}, Sacrifice Rocky Tar Pit: Search your library for a Swamp or Mountain card, put it onto the battlefield, then shuffle your library.| Savage Lands|Commander 2018|275|U||Land|||Savage Lands enters the battlefield tapped.${T}: Add {B}, {R}, or {G}.| Scoured Barrens|Commander 2018|276|C||Land|||Scoured Barrens enters the battlefield tapped.$When Scoured Barrens enters the battlefield, you gain 1 life.${T}: Add {W} or {B}.| Seaside Citadel|Commander 2018|277|U||Land|||Seaside Citadel enters the battlefield tapped.${T}: Add {G}, {W}, or {U}.| @@ -34210,12 +34210,12 @@ Simic Growth Chamber|Commander 2018|282|U||Land|||Simic Growth Chamber enters th Submerged Boneyard|Commander 2018|283|U||Land|||Submerged Boneyard enters the battlefield tapped.${T}: Add {U} or {B}.| Swiftwater Cliffs|Commander 2018|284|C||Land|||Swiftwater Cliffs enters the battlefield tapped.$When Swiftwater Cliffs enters the battlefield, you gain 1 life.${T}: Add {U} or {R}.| Temple of the False God|Commander 2018|285|U||Land|||{T}: Add {C}{C}. Activate this ability only if you control five or more lands.| -Terramorphic Expanse|Commander 2018|286|C||Land|||{T}, Sacrifice Terramorphic Expanse: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Terramorphic Expanse|Commander 2018|286|C||Land|||{T}, Sacrifice Terramorphic Expanse: Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| Thornwood Falls|Commander 2018|287|C||Land|||Thornwood Falls enters the battlefield tapped.$When Thornwood Falls enters the battlefield, you gain 1 life.${T}: Add {G} or {U}.| Tranquil Cove|Commander 2018|288|C||Land|||Tranquil Cove enters the battlefield tapped.$When Tranquil Cove enters the battlefield, you gain 1 life.${T}: Add {W} or {U}.| Tranquil Expanse|Commander 2018|289|U||Land|||Tranquil Expanse enters the battlefield tapped.${T}: Add {G} or {W}.| Tranquil Thicket|Commander 2018|290|C||Land|||Tranquil Thicket enters the battlefield tapped.${T}: Add {G}.$Cycling {G}| -Warped Landscape|Commander 2018|291|C||Land|||{T}: Add {C}.${2}, {T}, Sacrifice Warped Landscape: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Warped Landscape|Commander 2018|291|C||Land|||{T}: Add {C}.${2}, {T}, Sacrifice Warped Landscape: Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| Woodland Stream|Commander 2018|292|C||Land|||Woodland Stream enters the battlefield tapped.${T}: Add {G} or {U}.| Plains|Commander 2018|293|C||Basic Land - Plains|||({T}: Add {W}.)| Plains|Commander 2018|294|C||Basic Land - Plains|||({T}: Add {W}.)| @@ -34298,3 +34298,281 @@ Mud Trooper|Star Wars|612|U|{B}|Creature - Human Trooper|1|1|Trooper creatures y Range Trooper|Star Wars|613|U|{3}{W}|Creature - Human Trooper|2|2|Trooper creatures you control have "When this creature enters that battlefield, you may exile target creature. Return that creature to the battlefield at the beginning of the next end step."| Tobias Beckett|Star Wars|614|R|{3}{B}|Legendary Creature - Human Hunter|4|3|When Tobias Becket enters the battlefield, put a bounty counter on target creature an opponent controls.$Bounty - Whenever a creature an opponent controls with a bounty counter on it dies, exile the top card of that player's library. You may cast cards exiled this way and spend mana as though it were mana of any type to cast that spell.| Underground Forum|Star Wars|615|U||Land|||T: Add {1}.${1}, {T}: Add {B}, {R}, or {G}.${2}, {T}: Put a bounty counter on target creature.| +Blade Instructor|Guilds of Ravnica|1|C|{2}{W}|Creature - Human Soldier|3|1|Mentor| +Bounty Agent|Guilds of Ravnica|2|R|{1}{W}|Creature - Human Soldier|2|2|Vigilance${T}, Sacrifice Bounty Agent: Destroy target legendary permanent that's an artifact, creature, or enchantment.| +Candlelight Vigil|Guilds of Ravnica|3|C|{3}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +3/+2 and has vigilance.| +Citywide Bust|Guilds of Ravnica|4|R|{1}{W}{W}|Sorcery|||Destroy all creatures with toughness 4 or greater.| +Collar the Culprit|Guilds of Ravnica|5|C|{3}{W}|Instant|||Destroy target creature with toughness 4 or greater.| +Conclave Tribunal|Guilds of Ravnica|6|U|{3}{W}|Enchantment|||Convoke$When Conclave Tribunal enters the battlefield, exile target nonland permanent an opponent controls until Conclave Tribunal leaves the battlefield.| +Crush Contraband|Guilds of Ravnica|7|U|{3}{W}|Instant|||Choose one or both —$• Exile target artifact.$• Exile target enchantment.| +Dawn of Hope|Guilds of Ravnica|8|R|{1}{W}|Enchantment|||Whenever you gain life, you may pay {2}. If you do, draw a card.${3}{W}: Create a 1/1 white Soldier creature token with lifelink.| +Demotion|Guilds of Ravnica|9|U|{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't block and its activated abilities can't be activated.| +Divine Visitation|Guilds of Ravnica|10|M|{3}{W}{W}|Enchantment|||If one or more creature tokens would be created under your control, that many 4/4 white Angel creature tokens with flying and vigilance are created instead.| +Flight of Equenauts|Guilds of Ravnica|11|U|{7}{W}|Creature - Human Knight|4|5|Convoke$Flying| +Gird for Battle|Guilds of Ravnica|12|U|{W}|Sorcery|||Put a +1/+1 counter on each of up to two target creatures.| +Haazda Marshal|Guilds of Ravnica|13|U|{W}|Creature - Human Soldier|1|1|Whenever Haazda Marshal and at least two other creatures attack, create a 1/1 white Soldier creature token with lifelink.| +Healer's Hawk|Guilds of Ravnica|14|C|{W}|Creature - Bird|1|1|Flying, lifelink| +Hunted Witness|Guilds of Ravnica|15|C|{W}|Creature - Human|1|1|When Hunted Witness dies, create a 1/1 white Soldier creature token with lifelink.| +Inspiring Unicorn|Guilds of Ravnica|16|U|{2}{W}{W}|Creature - Unicorn|2|2|Whenever Inspiring Unicorn attacks, creatures you control get +1/+1 until end of turn.| +Intrusive Packbeast|Guilds of Ravnica|17|C|{4}{W}|Creature - Beast|3|3|Vigilance$When Intrusive Packbeast enters the battlefield, tap up to two target creatures your opponents control.| +Ledev Guardian|Guilds of Ravnica|18|C|{3}{W}|Creature - Human Knight|2|4|Convoke| +Light of the Legion|Guilds of Ravnica|19|R|{4}{W}{W}|Creature - Angel|5|5|Flying$Mentor$When Light of the Legion dies, put a +1/+1 counter on each white creature you control.| +Loxodon Restorer|Guilds of Ravnica|20|C|{4}{W}{W}|Creature - Elephant Cleric|3|4|Convoke$When Loxodon Restorer enters the battlefield, you gain 4 life.| +Luminous Bonds|Guilds of Ravnica|21|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block.| +Parhelion Patrol|Guilds of Ravnica|22|C|{3}{W}|Creature - Human Knight|2|3|Flying, vigilance$Mentor| +Righteous Blow|Guilds of Ravnica|23|C|{W}|Instant|||Righteous Blow deals 2 damage to target attacking or blocking creature.| +Roc Charger|Guilds of Ravnica|24|U|{2}{W}|Creature - Bird|1|3|Flying$Whenever Roc Charger attacks, target attacking creature without flying gains flying until end of turn.| +Skyline Scout|Guilds of Ravnica|25|C|{1}{W}|Creature - Human Scout|2|1|Whenever Skyline Scout attacks, you may pay {1}{W}. If you do, it gains flying until end of turn.| +Sunhome Stalwart|Guilds of Ravnica|26|U|{1}{W}|Creature - Human Soldier|2|2|First strike$Mentor| +Sworn Companions|Guilds of Ravnica|27|C|{2}{W}|Sorcery|||Create two 1/1 white Soldier creature tokens with lifelink.| +Take Heart|Guilds of Ravnica|28|C|{W}|Instant|||Target creature gets +2/+2 until end of turn. You gain 1 life for each attacking creature you control.| +Tenth District Guard|Guilds of Ravnica|29|C|{1}{W}|Creature - Human Soldier|2|2|When Tenth District Guard enters the battlefield, target creature gets +0/+1 until end of turn.| +Venerated Loxodon|Guilds of Ravnica|30|R|{4}{W}|Creature - Elephant Cleric|4|4|Convoke$When Venerated Loxodon enters the battlefield, put a +1/+1 counter on each creature that convoked it.| +Capture Sphere|Guilds of Ravnica|31|C|{3}{U}|Enchantment - Aura|||Flash$Enchant creature$When Capture Sphere enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.| +Chemister's Insight|Guilds of Ravnica|32|U|{3}{U}|Instant|||Draw two cards.$Jump-start| +Citywatch Sphinx|Guilds of Ravnica|33|U|{5}{U}|Creature - Sphinx|5|4|Flying$When Citywatch Sphinx dies, surveil 2.| +Dazzling Lights|Guilds of Ravnica|34|C|{U}|Instant|||Target creature gets -3/-0 until end of turn.$Surveil 2.| +Devious Cover-up|Guilds of Ravnica|35|C|{2}{U}{U}|Instant|||Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.$You may shuffle up to four target cards from your graveyard into your library.| +Dimir Informant|Guilds of Ravnica|36|C|{2}{U}|Creature - Human Rogue|1|4|When Dimir Informant enters the battlefield, surveil 2.| +Disdainful Stroke|Guilds of Ravnica|37|C|{1}{U}|Instant|||Counter target spell with converted mana cost 4 or greater.| +Dream Eater|Guilds of Ravnica|38|M|{4}{U}{U}|Creature - Nightmare Sphinx|4|3|Flash$Flying$When Dream Eater enters the battlefield, surveil 4. When you do, you may return target nonland permanent an opponent controls to its owner's hand.| +Drowned Secrets|Guilds of Ravnica|39|R|{1}{U}|Enchantment|||Whenever you cast a blue spell, target player puts the top two cards of their library into their graveyard.| +Enhanced Surveillance|Guilds of Ravnica|40|U|{1}{U}|Enchantment|||You may look at an additional two cards each time you surveil.$Exile Enhanced Surveillance: Shuffle your graveyard into your library.| +Guild Summit|Guilds of Ravnica|41|U|{2}{U}|Enchantment|||When Guild Summit enters the battlefield, you may tap any number of untapped Gates you control. Draw a card for each Gate tapped this way.$Whenever a Gate enters the battlefield under your control, draw a card.| +Leapfrog|Guilds of Ravnica|42|C|{2}{U}|Creature - Frog|3|1|Leapfrog has flying as long as you've cast an instant or sorcery spell this turn.| +Maximize Altitude|Guilds of Ravnica|43|C|{U}|Sorcery|||Target creature gets +1/+1 and gains flying until end of turn.$Jump-start| +Mission Briefing|Guilds of Ravnica|44|R|{U}{U}|Instant|||Surveil 2, then choose an instant or sorcery card in your graveyard. You may cast that card this turn. If that card would be put into your graveyard this turn, exile it instead.| +Murmuring Mystic|Guilds of Ravnica|45|U|{3}{U}|Creature - Human Wizard|1|5|Whenever you cast an instant or sorcery spell, create a 1/1 blue Bird Illusion creature token with flying.| +Muse Drake|Guilds of Ravnica|46|C|{3}{U}|Creature - Drake|1|3|Flying$When Muse Drake enters the battlefield, draw a card.| +Narcomoeba|Guilds of Ravnica|47|R|{1}{U}|Creature - Illusion|1|1|Flying$When Narcomoeba is put into your graveyard from your library, you may put it onto the battlefield.| +Nightveil Sprite|Guilds of Ravnica|48|U|{1}{U}|Creature - Faerie Rogue|1|2|Flying$Whenever Nightveil Sprite attacks, surveil 1.| +Omnispell Adept|Guilds of Ravnica|49|R|{4}{U}|Creature - Human Wizard|3|4|{2}{U}, {T}: You may cast an instant or sorcery card from your hand without paying its mana cost.| +Passwall Adept|Guilds of Ravnica|50|C|{1}{U}|Creature - Human Wizard|1|3|{2}{U}: Target creature can't be blocked this turn.| +Quasiduplicate|Guilds of Ravnica|51|R|{1}{U}{U}|Sorcery|||Create a token that's a copy of target creature you control.$Jump-start| +Radical Idea|Guilds of Ravnica|52|C|{1}{U}|Instant|||Draw a card.$Jump-start| +Selective Snare|Guilds of Ravnica|53|U|{X}{U}|Sorcery|||Return X target creatures of the creature type of your choice to their owner's hand.| +Sinister Sabotage|Guilds of Ravnica|54|U|{1}{U}{U}|Instant|||Counter target spell.$Surveil 1.| +Thoughtbound Phantasm|Guilds of Ravnica|55|U|{U}|Creature - Spirit|2|2|Defender$Whenever you surveil, put a +1/+1 counter on Thoughtbound Phantasm.$As long as Thoughtbound Phantasm has three or more +1/+1 counters on it, it can attack as though it didn't have defender.| +Unexplained Disappearance|Guilds of Ravnica|56|C|{1}{U}|Instant|||Return target creature to its owner's hand.$Surveil 1.| +Vedalken Mesmerist|Guilds of Ravnica|57|C|{1}{U}|Creature - Vedalken Wizard|2|1|Whenever Vedalken Mesmerist attacks, target creature an opponent controls gets -2/-0 until end of turn.| +Wall of Mist|Guilds of Ravnica|58|C|{1}{U}|Creature - Wall|0|5|Defender| +Watcher in the Mist|Guilds of Ravnica|59|C|{3}{U}{U}|Creature - Spirit|3|4|Flying$When Watcher in the Mist enters the battlefield, surveil 2.| +Wishcoin Crab|Guilds of Ravnica|60|C|{3}{U}|Creature - Crab|2|5|| +Barrier of Bones|Guilds of Ravnica|61|C|{B}|Creature - Skeleton Wall|0|3|Defender$When Barrier of Bones enters the battlefield, surveil 1.| +Bartizan Bats|Guilds of Ravnica|62|C|{3}{B}|Creature - Bat|3|1|Flying| +Blood Operative|Guilds of Ravnica|63|R|{1}{B}{B}|Creature - Vampire Assassin|3|1|Lifelink$When Blood Operative enters the battlefield, you may exile target card from a graveyard.$Whenever you surveil, if Blood Operative is in your graveyard, you may pay 3 life. If you do, return Blood Operative to your hand.| +Burglar Rat|Guilds of Ravnica|64|C|{1}{B}|Creature - Rat|1|1|When Burglar Rat enters the battlefield, each opponent discards a card.| +Child of Night|Guilds of Ravnica|65|C|{1}{B}|Creature - Vampire|2|1|Lifelink| +Creeping Chill|Guilds of Ravnica|66|U|{3}{B}|Sorcery|||Creeping Chill deals 3 damage to each opponent and you gain 3 life.$When Creeping Chill is put into your graveyard from your library, you may exile it. If you do, Creeping Chill deals 3 damage to each opponent and you gain 3 life.| +Dead Weight|Guilds of Ravnica|67|C|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -2/-2.| +Deadly Visit|Guilds of Ravnica|68|C|{3}{B}{B}|Sorcery|||Destroy target creature.$Surveil 2.| +Doom Whisperer|Guilds of Ravnica|69|M|{3}{B}{B}|Creature - Nightmare Demon|6|6|Flying, trample$Pay 2 life: Surveil 2.| +Douser of Lights|Guilds of Ravnica|70|C|{4}{B}|Creature - Horror|4|5|| +Gruesome Menagerie|Guilds of Ravnica|71|R|{3}{B}{B}|Sorcery|||Choose a creature card with converted mana cost 1 in your graveyard, then do the same for creature cards with converted mana costs 2 and 3. Return those cards to the battlefield.| +Hired Poisoner|Guilds of Ravnica|72|C|{B}|Creature - Human Assassin|1|1|Deathtouch| +Kraul Swarm|Guilds of Ravnica|73|U|{4}{B}|Creature - Insect Warrior|4|1|Flying${2}{B}, Discard a creature card: Return Kraul Swarm from your graveyard to your hand.| +Lotleth Giant|Guilds of Ravnica|74|U|{6}{B}|Creature - Zombie Giant|6|5|Undergrowth — When Lotleth Giant enters the battlefield, it deals 1 damage to target opponent for each creature card in your graveyard.| +Mausoleum Secrets|Guilds of Ravnica|75|R|{1}{B}|Instant|||Undergrowth — Search your library for a black card with converted mana cost less than or equal to the number of creature cards in your graveyard, reveal it, put it into your hand, then shuffle your library.| +Mephitic Vapors|Guilds of Ravnica|76|C|{2}{B}|Sorcery|||All creatures get -1/-1 until end of turn.$Surveil 2.| +Midnight Reaper|Guilds of Ravnica|77|R|{2}{B}|Creature - Zombie Knight|3|2|Whenever a nontoken creature you control dies, Midnight Reaper deals 1 damage to you and you draw a card.| +Moodmark Painter|Guilds of Ravnica|78|C|{2}{B}{B}|Creature - Human Shaman|2|3|Undergrowth — When Moodmark Painter enters the battlefield, target creature gains menace and gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard.| +Necrotic Wound|Guilds of Ravnica|79|U|{B}|Instant|||Undergrowth — Target creature gets -X/-X until end of turn, where X is the number of creature cards in your graveyard. If that creature would die this turn, exile it instead.| +Never Happened|Guilds of Ravnica|80|C|{2}{B}|Sorcery|||Target opponent reveals their hand. You choose a nonland card from that player's graveyard or hand and exile it.| +Pilfering Imp|Guilds of Ravnica|81|U|{B}|Creature - Imp|1|1|Flying${1}{B}, {T}, Sacrifice Pilfering Imp: Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. Activate this ability only any time you could cast a sorcery.| +Plaguecrafter|Guilds of Ravnica|82|U|{2}{B}|Creature - Human Shaman|3|2|When Plaguecrafter enters the battlefield, each player sacrifices a creature or planeswalker. Each player who can't discards a card.| +Price of Fame|Guilds of Ravnica|83|U|{3}{B}|Instant|||This spell costs {2} less to cast if it targets a legendary creature.$Destroy target creature.$Surveil 2.| +Ritual of Soot|Guilds of Ravnica|84|R|{2}{B}{B}|Sorcery|||Destroy all creatures with converted mana cost 3 or less.| +Severed Strands|Guilds of Ravnica|85|C|{1}{B}|Sorcery|||As an additional cost to cast this spell, sacrifice a creature.$You gain life equal to the sacrificed creature's toughness. Destroy target creature an opponent controls.| +Spinal Centipede|Guilds of Ravnica|86|C|{2}{B}|Creature - Insect|3|2|When Spinal Centipede dies, put a +1/+1 counter on target creature you control.| +Undercity Necrolisk|Guilds of Ravnica|87|U|{3}{B}|Creature - Zombie Lizard|3|3|{1}, Sacrifice another creature: Put a +1/+1 counter on Undercity Necrolisk. It gains menace until end of turn. Activate this ability only any time you could cast a sorcery.| +Veiled Shade|Guilds of Ravnica|88|C|{2}{B}|Creature - Shade|2|2|{1}{B}: Veiled Shade gets +1/+1 until end of turn.| +Vicious Rumors|Guilds of Ravnica|89|C|{B}|Sorcery|||Vicious Rumors deals 1 damage to each opponent. Each opponent discards a card, then puts the top card of their library into their graveyard. You gain 1 life.| +Whispering Snitch|Guilds of Ravnica|90|U|{1}{B}|Creature - Vampire Rogue|1|3|Whenever you surveil for the first time each turn, Whispering Snitch deals 1 damage to each opponent and you gain 1 life.| +Arclight Phoenix|Guilds of Ravnica|91|M|{3}{R}|Creature - Phoenix|3|2|Flying, haste$At the beginning of combat on your turn, if you've cast three or more instant and sorcery spells this turn, you may return Arclight Phoenix from your graveyard to the battlefield.| +Barging Sergeant|Guilds of Ravnica|92|C|{4}{R}|Creature - Minotaur Soldier|4|2|Haste$Mentor| +Book Devourer|Guilds of Ravnica|93|U|{5}{R}|Creature - Beast|4|5|Trample$Whenever Book Devourer deals combat damage to a player, you may discard all the cards in your hand. If you do, draw that many cards.| +Command the Storm|Guilds of Ravnica|94|C|{4}{R}|Instant|||Command the Storm deals 5 damage to target creature.| +Cosmotronic Wave|Guilds of Ravnica|95|C|{3}{R}|Sorcery|||Cosmotronic Wave deals 1 damage to each creature your opponents control. Creatures your opponents control can't block this turn.| +Direct Current|Guilds of Ravnica|96|C|{1}{R}{R}|Sorcery|||Direct Current deals 2 damage to any target.$Jump-start| +Electrostatic Field|Guilds of Ravnica|97|U|{1}{R}|Creature - Wall|0|4|Defender$When you cast an instant or sorcery spell, Electrostatic Field deals 1 damage to each opponent.| +Erratic Cyclops|Guilds of Ravnica|98|R|{3}{R}|Creature - Cyclops Shaman|0|8|Trample$Whenever you cast an instant or sorcery spell, Erratic Cyclops gets +X/+0 until end of turn, where X is that spell's converted mana cost.| +Experimental Frenzy|Guilds of Ravnica|99|R|{3}{R}|Enchantment|||You may look at the top card of your library any time.$You may play the top card of your library.$You can't play cards from your hand.${3}{R}: Destroy Experimental Frenzy.| +Fearless Halberdier|Guilds of Ravnica|100|C|{2}{R}|Creature - Human Warrior|3|2|| +Fire Urchin|Guilds of Ravnica|101|C|{1}{R}|Creature - Elemental|1|3|Trample$Whenever you cast an instant or sorcery spell, Fire Urchin gets +1/+0 until end of turn.| +Goblin Banneret|Guilds of Ravnica|102|U|{R}|Creature - Goblin Soldier|1|1|Mentor${1}{R}: Goblin Banneret gets +2/+0 until end of turn.| +Goblin Cratermaker|Guilds of Ravnica|103|U|{1}{R}|Creature - Goblin Warrior|2|2|{1}, Sacrifice Goblin Cratermaker: Choose one —$• Goblin Cratermaker deals 2 damage to target creature.$• Destroy target colorless nonland permanent.| +Goblin Locksmith|Guilds of Ravnica|104|C|{1}{R}|Creature - Goblin Rogue|2|1|Whenever Goblin Locksmith attacks, creatures with defender can't block this turn.| +Gravitic Punch|Guilds of Ravnica|105|C|{3}{R}|Sorcery|||Target creature you control deals damage equal to its power to target player.$Jump-start| +Hellkite Whelp|Guilds of Ravnica|106|U|{4}{R}|Creature - Dragon|3|3|Flying$Whenever Hellkite Whelp attacks, it deals 1 damage to target creature defending player controls.| +Inescapable Blaze|Guilds of Ravnica|107|U|{4}{R}{R}|Instant|||This spell can't be countered.$Inescapable Blaze deals 6 damage to any target.| +Lava Coil|Guilds of Ravnica|108|U|{1}{R}|Sorcery|||Lava Coil deals 4 damage to target creature. If that creature would die this turn, exile it instead.| +Legion Warboss|Guilds of Ravnica|109|R|{2}{R}|Creature - Goblin Soldier|2|2|Mentor$At the beginning of combat on your turn, create a 1/1 red Goblin creature token. That token gains haste until end of turn and attacks this combat if able.| +Maniacal Rage|Guilds of Ravnica|110|C|{1}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2 and can't block.| +Maximize Velocity|Guilds of Ravnica|111|C|{R}|Sorcery|||Target creature gets +1/+1 and gains haste until end of turn.$Jump-start| +Ornery Goblin|Guilds of Ravnica|112|C|{1}{R}|Creature - Goblin Warrior|2|1|Whenever Ornery Goblin blocks or becomes blocked by a creature, Ornery Goblin deals 1 damage to that creature.| +Risk Factor|Guilds of Ravnica|113|R|{2}{R}|Instant|||Target opponent may have Risk Factor deal 4 damage to them. If that player doesn't, you draw three cards.$Jump-start| +Rubblebelt Boar|Guilds of Ravnica|114|C|{3}{R}|Creature - Boar|3|3|When Rubblebelt Boar enters the battlefield, target creature gets +2/+0 until end of turn.| +Runaway Steam-Kin|Guilds of Ravnica|115|R|{1}{R}|Creature - Elemental|1|1|Whenever you cast a red spell, if Runaway Steam-Kin has fewer than three +1/+1 counters on it, put a +1/+1 counter on Runaway Steam-Kin.$Remove three +1/+1 counters from Runaway Steam-Kin: Add {R}{R}{R}.| +Smelt-Ward Minotaur|Guilds of Ravnica|116|U|{2}{R}|Creature - Minotaur Warrior|2|3|Whenever you cast an instant or sorcery spell, target creature an opponent controls can't block this turn.| +Street Riot|Guilds of Ravnica|117|U|{4}{R}|Enchantment|||As long as it's your turn, creatures you control get +1/+0 and have trample.| +Sure Strike|Guilds of Ravnica|118|C|{1}{R}|Instant|||Target creature gets +3/+0 and gains first strike until end of turn.| +Torch Courier|Guilds of Ravnica|119|C|{R}|Creature - Goblin|1|1|Haste$Sacrifice Torch Courier: Another target creature gains haste until end of turn.| +Wojek Bodyguard|Guilds of Ravnica|120|C|{2}{R}|Creature - Human Soldier|3|3|Mentor$Wojek Bodyguard can't attack or block alone.| +Affectionate Indrik|Guilds of Ravnica|121|U|{5}{G}|Creature - Beast|4|4|When Affectionate Indrik enters the battlefield, you may have it fight target creature you don't control.| +Arboretum Elemental|Guilds of Ravnica|122|U|{7}{G}{G}|Creature - Elemental|7|5|Convoke$Hexproof| +Beast Whisperer|Guilds of Ravnica|123|R|{2}{G}{G}|Creature - Elf Druid|2|3|Whenever you cast a creature spell, draw a card.| +Bounty of Might|Guilds of Ravnica|124|R|{4}{G}{G}|Instant|||Target creature gets +3/+3 until end of turn.$Target creature gets +3/+3 until end of turn.$Target creature gets +3/+3 until end of turn.| +Circuitous Route|Guilds of Ravnica|125|U|{3}{G}|Sorcery|||Search your library for up to two basic land cards and/or Gate cards and put them onto the battlefield tapped, then shuffle your library.| +Crushing Canopy|Guilds of Ravnica|126|C|{2}{G}|Instant|||Choose one —$• Destroy target creature with flying.$• Destroy target enchantment.| +Devkarin Dissident|Guilds of Ravnica|127|C|{1}{G}|Creature - Elf Warrior|2|2|{4}{G}: Devkarin Dissident gets +2/+2 until end of turn.| +District Guide|Guilds of Ravnica|128|U|{2}{G}|Creature - Elf Scout|2|2|When District Guide enters the battlefield, you may search your library for a basic land card or Gate card, reveal it, put it into your hand, then shuffle your library.| +Generous Stray|Guilds of Ravnica|129|C|{2}{G}|Creature - Cat|1|2|When Generous Stray enters the battlefield, draw a card.| +Golgari Raiders|Guilds of Ravnica|130|U|{3}{G}|Creature - Elf Warrior|0|0|Haste$Undergrowth — Golgari Raiders enters the battlefield with a +1/+1 counter on it for each creature card in your graveyard.| +Grappling Sundew|Guilds of Ravnica|131|U|{1}{G}|Creature - Plant|0|4|Defender, reach${4}{G}: Grappling Sundew gains indestructible until end of turn.| +Hatchery Spider|Guilds of Ravnica|132|R|{5}{G}{G}|Creature - Spider|5|7|Reach$Undergrowth — When you cast this spell, reveal the top X cards of your library, where X is the number of creature cards in your graveyard. You may put a green permanent card with converted mana cost X or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order.| +Hitchclaw Recluse|Guilds of Ravnica|133|C|{2}{G}|Creature - Spider|1|4|Reach| +Ironshell Beetle|Guilds of Ravnica|134|C|{1}{G}|Creature - Insect|1|1|When Ironshell Beetle enters the battlefield, put a +1/+1 counter on target creature.| +Kraul Foragers|Guilds of Ravnica|135|C|{4}{G}|Creature - Insect Scout|4|4|Undergrowth — When Kraul Foragers enters the battlefield, you gain 1 life for each creature card in your graveyard.| +Kraul Harpooner|Guilds of Ravnica|136|U|{1}{G}|Creature - Insect Warrior|3|2|Reach$Undergrowth — When Kraul Harpooner enters the battlefield, choose up to one target creature with flying you don't control. Kraul Harpooner gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard, then you may have Kraul Harpooner fight that creature.| +Might of the Masses|Guilds of Ravnica|137|U|{G}|Instant|||Target creature gets +1/+1 until end of turn for each creature you control.| +Nullhide Ferox|Guilds of Ravnica|138|M|{2}{G}{G}|Creature - Beast|6|6|Hexproof$You can't cast noncreature spells.${2}: Nullhide Ferox loses all abilities until end of turn. Any player may activate this ability.$If a spell or ability an opponent controls causes you to discard Nullhide Ferox, put it onto the battlefield instead of putting it into your graveyard.| +Pack's Favor|Guilds of Ravnica|139|C|{2}{G}|Instant|||Convoke$Target creature gets +3/+3 until end of turn.| +Pause for Reflection|Guilds of Ravnica|140|C|{2}{G}|Instant|||Convoke$Prevent all combat damage that would be dealt this turn.| +Pelt Collector|Guilds of Ravnica|141|R|{G}|Creature - Elf Warrior|1|1|Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector.$As long as Pelt Collector has three or more +1/+1 counters on it, it has trample.| +Portcullis Vine|Guilds of Ravnica|142|C|{G}|Creature - Plant Wall|0|3|Defender${2}, {T}, Sacrifice a creature with defender: Draw a card.| +Prey Upon|Guilds of Ravnica|143|C|{G}|Sorcery|||Target creature you control fights target creature you don't control.| +Siege Wurm|Guilds of Ravnica|144|C|{5}{G}{G}|Creature - Wurm|5|5|Convoke$Trample| +Sprouting Renewal|Guilds of Ravnica|145|U|{2}{G}|Sorcery|||Convoke$Choose one —$• Create a 2/2 green and white Elf Knight creature token with vigilance.$• Destroy target artifact or enchantment.| +Urban Utopia|Guilds of Ravnica|146|C|{1}{G}|Enchantment - Aura|||Enchant land$When Urban Utopia enters the battlefield, draw a card.$Enchanted land has "{T}: Add one mana of any color."| +Vigorspore Wurm|Guilds of Ravnica|147|C|{5}{G}|Creature - Wurm|6|4|Undergrowth — When Vigorspore Wurm enters the battlefield, target creature gains vigilance and gets +X/+X until end of turn, where X is the number of creature cards in your graveyard.$Vigorspore Wurm can't be blocked by more than one creature.| +Vivid Revival|Guilds of Ravnica|148|R|{4}{G}|Sorcery|||Return up to three target multicolored cards from your graveyard to your hand. Exile Vivid Revival.| +Wary Okapi|Guilds of Ravnica|149|C|{2}{G}|Creature - Antelope|3|2|Vigilance| +Wild Ceratok|Guilds of Ravnica|150|C|{3}{G}|Creature - Rhino|4|3|| +Artful Takedown|Guilds of Ravnica|151|C|{2}{U}{B}|Instant|||Choose one or both —$• Tap target creature.$• Target creature gets -2/-4 until end of turn.| +Assassin's Trophy|Guilds of Ravnica|152|R|{B}{G}|Instant|||Destroy target permanent an opponent controls. Its controller may search their library for a basic land card, put it onto the battlefield, then shuffle their library.| +Aurelia, Exemplar of Justice|Guilds of Ravnica|153|M|{2}{R}{W}|Legendary Creature - Angel|2|5|Flying$Mentor$At the beginning of combat on your turn, choose up to one target creature you control. Until end of turn, that creature gets +2/+0, gains trample if it's red, and gains vigilance if it's white.| +Beacon Bolt|Guilds of Ravnica|154|U|{1}{U}{R}|Sorcery|||Beacon Bolt deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard.$Jump-start| +Beamsplitter Mage|Guilds of Ravnica|155|U|{U}{R}|Creature - Vedalken Wizard|2|2|Whenever you cast an instant or sorcery that targets only Beamsplitter Mage, if you control one or more creatures that spell could target, choose one of those creatures. Copy that spell. The copy targets the chosen creature.| +Boros Challenger|Guilds of Ravnica|156|U|{R}{W}|Creature - Human Soldier|2|3|Mentor${2}{R}{W}: Boros Challenger gets +1/+1 until end of turn.| +Camaraderie|Guilds of Ravnica|157|R|{4}{G}{W}|Sorcery|||You gain X life and draw X cards, where X is the number of creatures you control. Creatures you control get +1/+1 until end of turn.| +Centaur Peacemaker|Guilds of Ravnica|158|C|{1}{G}{W}|Creature - Centaur Cleric|3|3|When Centaur Peacemaker enters the battlefield, each player gains 4 life.| +Chance for Glory|Guilds of Ravnica|159|M|{1}{R}{W}|Instant|||Creatures you control gain indestructible. Take an extra turn after this one. At the beginning of that turn's end step, you lose the game.| +Charnel Troll|Guilds of Ravnica|160|R|{1}{B}{G}|Creature - Troll|4|4|Trample$At the beginning of your upkeep, exile a creature card from your graveyard. If you do, put a +1/+1 counter on Charnel Troll. Otherwise, sacrifice it.${B}{G}, Discard a creature card: Put a +1/+1 counter on Charnel Troll.| +Conclave Cavalier|Guilds of Ravnica|161|U|{G}{G}{W}{W}|Creature - Centaur Knight|4|4|Vigilance$When Conclave Cavalier dies, create two 2/2 green and white Elf Knight creature tokens with vigilance.| +Conclave Guildmage|Guilds of Ravnica|162|U|{G}{W}|Creature - Elf Cleric|2|2|{G}, {T}: Creatures you control gain trample until end of turn.${5}{W}, {T}: Create a 2/2 green and white Elf Knight creature token with vigilance.| +Crackling Drake|Guilds of Ravnica|163|U|{U}{U}{R}{R}|Creature - Drake|*|4|Flying$Crackling Drake's power is equal to the total number of instant and sorcery cards you own in exile and in your graveyard.$When Crackling Drake enters the battlefield, draw a card.| +Darkblade Agent|Guilds of Ravnica|164|C|{1}{U}{B}|Creature - Human Assassin|2|3|As long as you've surveilled this turn, Darkblade Agent has deathtouch and "Whenever this creature deals combat damage to a player, draw a card."| +Deafening Clarion|Guilds of Ravnica|165|R|{1}{R}{W}|Sorcery|||Choose one or both —$• Deafening Clarion deals 3 damage to each creature.$• Creatures you control gain lifelink until end of turn.| +Dimir Spybug|Guilds of Ravnica|166|U|{U}{B}|Creature - Insect|1|1|Flying$Menace$Whenever you surveil, put a +1/+1 counter on Dimir Spybug.| +Disinformation Campaign|Guilds of Ravnica|167|U|{1}{U}{B}|Enchantment|||When Disinformation Campaign enters the battlefield, you draw a card and each opponent discards a card.$Whenever you surveil, return Disinformation Campaign to its owner's hand.| +Emmara, Soul of the Accord|Guilds of Ravnica|168|R|{G}{W}|Legendary Creature - Elf Cleric|2|2|Whenever Emmara, Soul of the Accord becomes tapped, create a 1/1 white Soldier creature token with lifelink.| +Erstwhile Trooper|Guilds of Ravnica|169|C|{1}{B}{G}|Creature - Zombie Soldier|2|2|Discard a creature card: Erstwhile Trooper gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn.| +Etrata, the Silencer|Guilds of Ravnica|170|R|{2}{U}{B}|Legendary Creature - Vampire Assassin|3|5|Etrata, the Silencer can't be blocked.$Whenever Etrata deals combat damage to a player, exile target creature that player controls and put a hit counter on that card. That player loses the game if they own three or more exiled cards with hit counters on them. Etrata's owner shuffles Etrata into their library.| +Firemind's Research|Guilds of Ravnica|171|R|{U}{R}|Enchantment|||Whenever you cast an instant or sorcery spell, put a charge counter on Firemind's Research.${1}{U}, Remove two charge counters from Firemind's Research: Draw a card.${1}{R}, Remove five charge counters from Firemind's Research: It deals 5 damage to any target.| +Garrison Sergeant|Guilds of Ravnica|172|C|{3}{R}{W}|Creature - Viashino Soldier|3|3|Garrison Sergeant has double strike as long as you control a Gate.| +Glowspore Shaman|Guilds of Ravnica|173|U|{B}{G}|Creature - Elf Shaman|3|1|When Glowspore Shaman enters the battlefield, put the top three cards of your library into your graveyard. You may put a land card from your graveyard on top of your library.| +Goblin Electromancer|Guilds of Ravnica|174|C|{U}{R}|Creature - Goblin Wizard|2|2|Instant and sorcery spells you cast cost {1} less to cast.| +Golgari Findbroker|Guilds of Ravnica|175|U|{B}{B}{G}{G}|Creature - Elf Shaman|3|4|When Golgari Findbroker enters the battlefield, return target permanent card from your graveyard to your hand.| +Hammer Dropper|Guilds of Ravnica|176|C|{2}{R}{W}|Creature - Giant Soldier|5|2|Mentor| +House Guildmage|Guilds of Ravnica|177|U|{U}{B}|Creature - Human Wizard|2|2|{1}{U}, {T}: Target creature doesn't untap during its controller's next untap step.${2}{B}, {T}: Surveil 2.| +Hypothesizzle|Guilds of Ravnica|178|C|{3}{U}{R}|Instant|||Draw two cards. Then you may discard a nonland card. When you do, Hypothesizzle deals 4 damage to target creature.| +Ionize|Guilds of Ravnica|179|R|{1}{U}{R}|Instant|||Counter target spell. Ionize deals 2 damage to that spell's controller.| +Izoni, Thousand-Eyed|Guilds of Ravnica|180|R|{2}{B}{B}{G}{G}|Legendary Creature - Elf Shaman|2|3|Undergrowth — When Izoni, Thousand-Eyed enters the battlefield, create a 1/1 black and green Insect creature token for each creature card in your graveyard.${B}{G}, Sacrifice another creature: You gain 1 life and draw a card.| +Join Shields|Guilds of Ravnica|181|U|{3}{G}{W}|Instant|||Untap all creatures you control. They gain hexproof and indestructible until end of turn.| +Justice Strike|Guilds of Ravnica|182|U|{R}{W}|Instant|||Target creature deals damage to itself equal to its power.| +Knight of Autumn|Guilds of Ravnica|183|R|{1}{G}{W}|Creature - Dryad Knight|2|1|When Knight of Autumn enters the battlefield, choose one —$• Put two +1/+1 counters on Knight of Autumn.$• Destroy target artifact or enchantment.$• You gain 4 life.| +Lazav, the Multifarious|Guilds of Ravnica|184|M|{U}{B}|Legendary Creature - Shapeshifter|1|3|When Lazav, the Multifarious enters the battlefield, surveil 1.${X}: Lazav, the Multifarious becomes a copy of target creature card in your graveyard with converted mana cost X, except its name is Lazav, the Multifarious, it's legendary in addition to its other types, and it has this ability.| +League Guildmage|Guilds of Ravnica|185|U|{U}{R}|Creature - Human Wizard|2|2|{3}{U}, {T}: Draw a card.${X}{R}, {T}: Copy target instant or sorcery spell you control with converted mana cost X. You may choose new targets for the copy.| +Ledev Champion|Guilds of Ravnica|186|U|{1}{G}{W}|Creature - Elf Knight|2|2|Whenever Ledev Champion attacks, you may tap any number of untapped creatures you control. Ledev Champion gets +1/+1 until end of turn for each creature tapped this way.${3}{G}{W}: Create a 1/1 white soldier creature token with lifelink.| +Legion Guildmage|Guilds of Ravnica|187|U|{R}{W}|Creature - Human Wizard|2|2|{5}{R}, {T}: Legion Guildmage deals 3 damage to each opponent.${2}{W}, {T}: Tap another target creature.| +March of the Multitudes|Guilds of Ravnica|188|M|{X}{G}{W}{W}|Instant|||Convoke$Create X 1/1 white Soldier creature tokens with lifelink.| +Mnemonic Betrayal|Guilds of Ravnica|189|M|{1}{U}{B}|Sorcery|||Exile all card from all opponents' graveyards. You may cast those cards this turn, and you may spend mana as though it were mana of any type to cast those spells. At the beginning of the next end step, if any of those cards remain exiled, return them to their owner's graveyards.$Exile Mnemonic Betrayal.| +Molderhulk|Guilds of Ravnica|190|U|{7}{B}{G}|Creature - Fungus Zombie|6|6|Undergrowth — This spell costs {1} less to cast for each creature card in your graveyard.$When Molderhulk enters the battlefield, return target land card from your graveyard to the battlefield.| +Nightveil Predator|Guilds of Ravnica|191|U|{U}{U}{B}{B}|Creature - Vampire|3|3|Flying, deathtouch$Hexproof| +Niv-Mizzet, Parun|Guilds of Ravnica|192|R|{U}{U}{U}{R}{R}{R}|Legendary Creature - Dragon Wizard|5|5|This spell can't be countered.$Flying$Whenever you draw a card, Niv-Mizzet, Parun deals 1 damage to any target.$Whenever a player casts an instant or sorcery spell, you draw a card.| +Notion Rain|Guilds of Ravnica|193|C|{1}{U}{B}|Sorcery|||Surveil 2, then draw two cards. Notion Rain deals 2 damage to you.| +Ochran Assassin|Guilds of Ravnica|194|U|{1}{B}{G}|Creature - Elf Assassin|1|1|Deathtouch$All creatures able to block Ochran Assassin do so.| +Ral, Izzet Viceroy|Guilds of Ravnica|195|M|{3}{U}{R}|Legendary Planeswalker - Ral|5|+1: Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$-3: Ral, Izzet Viceroy deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard.$-8: You get an emblem with "Whenever you cast an instant or sorcery spell, this emblem deals 4 damage to any target and you draw two cards."| +Rhizome Lurcher|Guilds of Ravnica|196|C|{2}{B}{G}|Creature - Fungus Zombie|2|2|Undergrowth — Rhizome Lurcher enters the battlefield with a number of +1/+1 counters on it equal to the number of creature cards in your graveyard.| +Rosemane Centaur|Guilds of Ravnica|197|C|{3}{G}{W}|Creature - Centaur Soldier|4|4|Convoke$Vigilance| +Skyknight Legionnaire|Guilds of Ravnica|198|C|{1}{R}{W}|Creature - Human Knight|2|2|Flying, haste| +Sonic Assault|Guilds of Ravnica|199|C|{1}{U}{R}|Instant|||Tap target creature. Sonic Assault deals 2 damage to that creature's controller.$Jump-start| +Sumala Woodshaper|Guilds of Ravnica|200|C|{2}{G}{W}|Creature - Elf Druid|2|1|When Sumala Woodshaper enters the battlefield, look at the top four cards of your library. You may reveal a creature or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.| +Swarm Guildmage|Guilds of Ravnica|201|U|{B}{G}|Creature - Elf Shaman|2|2|{4}{B}, {T}: Creatures you control get +1/+0 and gain menace until end of turn.${1}{G}, {T}: You gain 2 life.| +Swathcutter Giant|Guilds of Ravnica|202|U|{4}{R}{W}|Creature - Giant Soldier|5|5|Vigilance$Whenever Swathcutter Giant attacks, it deals 1 damage to each creature defending player controls.| +Swiftblade Vindicator|Guilds of Ravnica|203|R|{R}{W}|Creature - Human Soldier|1|1|Double strike, vigilance, trample| +Tajic, Legion's Edge|Guilds of Ravnica|204|R|{1}{R}{W}|Legendary Creature - Human Soldier|3|2|Haste$Mentor$Prevent all noncombat damage that would be dealt to other creatures you control.${R}{W}: Tajic, Legion's Edge gains first strike until end of turn.| +Thief of Sanity|Guilds of Ravnica|205|R|{1}{U}{B}|Creature - Specter|2|2|Flying$Whenever Thief of Sanity deals combat damage to a player, look at the top three cards of that player's library, exile one of them face down, then put the rest into their graveyard. For as long as that card remains exiled, you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.| +Thought Erasure|Guilds of Ravnica|206|U|{U}{B}|Sorcery|||Target opponent reveals their hand. You choose a nonland card from it. That player discards that card.$Surveil 1.| +Thousand-Year Storm|Guilds of Ravnica|207|M|{4}{U}{R}|Enchantment|||Whenever you cast an instant or sorcery spell, copy it for each other instant and sorcery spell you've cast before it this turn. You may choose new targets for the copies.| +Trostani Discordant|Guilds of Ravnica|208|M|{3}{G}{W}|Legendary Creature - Dryad|1|4|Other creatures you control get +1/+1.$When Trostani Discordant enters the battlefield, create two 1/1 white Soldier creature tokens with lifelink.$At the beginning of your end step, each player gains control of all creatures they own.| +Truefire Captain|Guilds of Ravnica|209|U|{R}{R}{W}{W}|Creature - Human Knight|4|3|Mentor$Whenever Truefire Captain is dealt damage, it deals that much damage to target player.| +Undercity Uprising|Guilds of Ravnica|210|C|{2}{B}{G}|Sorcery|||Creatures you control gain deathtouch until end of turn. Target creature you control fights target creature you don't control.| +Underrealm Lich|Guilds of Ravnica|211|M|{3}{B}{G}|Creature - Zombie Elf Shaman|4|3|If you would draw a card, instead look at the top three cards of your library, then put one into your hand and the rest into your graveyard.$Pay 4 life: Underrealm Lich gains indestructible until end of turn. Tap it.| +Unmoored Ego|Guilds of Ravnica|212|R|{1}{U}{B}|Sorcery|||Choose a card name. Search target opponent's graveyard, hand, and library for up to four cards with that name and exile them. That player shuffles their library, then draws a card for each card exiled from their hand this way.| +Vraska, Golgari Queen|Guilds of Ravnica|213|M|{2}{B}{G}|Legendary Planeswalker - Vraska|4|+2: You may sacrifice another permanent. If you do, you gain 1 life and draw a card.$-3: Destroy target nonland permanent with converted mana cost 3 or less.$-9: You get an emblem with "Whenever a creature you control deals combat damage to a player, that player loses the game."| +Wee Dragonauts|Guilds of Ravnica|214|U|{1}{U}{R}|Creature - Faerie Wizard|1|3|Flying$Whenever you cast an instant or sorcery spell, Wee Dragonauts gets +2/+0 until end of turn.| +Worldsoul Colossus|Guilds of Ravnica|215|U|{X}{G}{W}|Creature - Elemental|0|0|Convoke$Worldsoul Colossus enters the battlefield with X +1/+1 counters on it.| +Fresh-Faced Recruit|Guilds of Ravnica|216|C|{1}{R/W}|Creature - Human Soldier|2|1|As long as it's your turn, Fresh-Faced Recruit has first strike.| +Piston-Fist Cyclops|Guilds of Ravnica|217|C|{1}{U/R}{U/R}|Creature - Cyclops|4|3|Defender$As long as you've cast an instant or sorcery spell this turn, Piston-Fist Cyclops can attack as though it didn't have defender.| +Pitiless Gorgon|Guilds of Ravnica|218|C|{1}{B/G}{B/G}|Creature - Gorgon|2|2|Deathtouch| +Vernadi Shieldmate|Guilds of Ravnica|219|C|{1}{G/W}|Creature - Human Soldier|2|2|Vigilance| +Whisper Agent|Guilds of Ravnica|220|C|{1}{U/B}{U/B}|Creature - Human Rogue|3|2|Flash$When Whisper Agent enters the battlefield, surveil 1.| +Assemble|Guilds of Ravnica|221|R|{4}{G}{W}|Instant|||Create three 2/2 green and white Elf Knight creature tokens with vigilance.| +Assure|Guilds of Ravnica|221|R|{G/W}{G/W}|Instant|||Put a +1/+1 counter on target creature. It gains indestructible until end of turn.| +Concoct|Guilds of Ravnica|222|R|{3}{U}{B}|Sorcery|||Surveil 3, then return a creature card from your graveyard to the battlefield.| +Connive|Guilds of Ravnica|222|R|{2}{U/B}{U/B}|Sorcery|||Gain control of target creature with power 2 or less.| +Discovery|Guilds of Ravnica|223|U|{1}{U/B}|Sorcery|||Surveil 2, then draw a card.| +Dispersal|Guilds of Ravnica|223|U|{3}{U}{B}|Instant|||Each opponent returns a nonland permanent they control with the highest converted mana cost among permanents they control to its owner's hand, then discards a card.| +Expansion|Guilds of Ravnica|224|R|{U/R}{U/R}|Instant|||Copy target instant or sorcery spell with converted mana cost 4 or less. You may choose new targets for the copy.| +Explosion|Guilds of Ravnica|224|R|{X}{U}{U}{R}{R}|Instant|||Explosion deals X damage to any target. Target player draws X cards.| +Finality|Guilds of Ravnica|225|R|{4}{B}{G}|Sorcery|||You may put two +1/+1 counters on a creature you control. Then all creatures get -4/-4 until end of turn.| +Find|Guilds of Ravnica|225|R|{B/G}{B/G}|Sorcery|||Return up to two target creature cards from your graveyard to your hand.| +Flourish|Guilds of Ravnica|226|U|{4}{G}{W}|Sorcery|||Creatures you control get +2/+2 until end of turn.| +Flower|Guilds of Ravnica|226|U|{G/W}|Sorcery|||Search your library for a basic Forest or Plains card, reveal it, put it into your hand, then shuffle your library.| +Integrity|Guilds of Ravnica|227|U|{R/W}|Instant|||Target creature gets +2/+2 until end of turn.| +Intervention|Guilds of Ravnica|227|U|{2}{R}{W}|Instant|||Intervention deals 3 damage to any target and you gain 3 life.| +Invent|Guilds of Ravnica|228|U|{4}{U}{R}|Instant|||Search your library for an instant card and/or a sorcery card, reveal them, put them into your hand, then shuffle your library.| +Invert|Guilds of Ravnica|228|U|{U/R}|Instant|||Switch the power and toughness of each of up to two target creatures until end of turn.| +Response|Guilds of Ravnica|229|R|{R/W}{R/W}|Instant|||Response deals 5 damage to target attacking or blocking creature.| +Resurgence|Guilds of Ravnica|229|R|{3}{R}{W}|Sorcery|||Creatures you control gain first strike and vigilance until end of turn. After this main phase, there is an additional combat phase followed by an additional main phase.| +Statue|Guilds of Ravnica|230|U|{2}{B}{G}|Instant|||Destroy target artifact, creature, or enchantment.| +Status|Guilds of Ravnica|230|U|{B/G}|Instant|||Target creature gets +1/+1 and gains deathtouch until end of turn.| +Boros Locket|Guilds of Ravnica|231|C|{3}|Artifact|||{T}: Add {R} or {W}.${R/W}{R/W}{R/W}{R/W}, {T}, Sacrifice Boros Locket: Draw two cards.| +Chamber Sentry|Guilds of Ravnica|232|R|{X}|Artifact Creature - Construct|0|0|Chamber Sentry enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.${X}, {T}, Remove X +1/+1 counters from Chamber Sentry: It deals X damage to any target.${W}{U}{B}{R}{G}: Return Chamber Sentry from your graveyard to your hand.| +Chromatic Lantern|Guilds of Ravnica|233|R|{3}|Artifact|||Lands you control have "{T}: Add one mana of any color."${T}: Add one mana of any color.| +Dimir Locket|Guilds of Ravnica|234|C|{3}|Artifact|||{T}: Add {U} or {B}.${U/B}{U/B}{U/B}{U/B}, {T}, Sacrifice Dimir Locket: Draw two cards.| +Gatekeeper Gargoyle|Guilds of Ravnica|235|U|{6}|Artifact Creature - Gargoyle|3|3|Flying$Gatekeeper Gargoyle enters the battlefield with a +1/+1 counter on it for each Gate you control.| +Glaive of the Guildpact|Guilds of Ravnica|236|U|{2}|Artifact - Equipment|||Equipped creature gets +1/+0 for each Gate you control and has vigilance and menace.$Equip {3}| +Golgari Locket|Guilds of Ravnica|237|C|{3}|Artifact|||{T}: Add {B} or {G}.${B/G}{B/G}{B/G}{B/G}, {T}, Sacrifice Golgari Locket: Draw two cards.| +Izzet Locket|Guilds of Ravnica|238|C|{3}|Artifact|||{T}: Add {U} or {R}.${U/R}{U/R}{U/R}{U/R}, {T}, Sacrifice Izzet Locket: Draw two cards.| +Rampaging Monument|Guilds of Ravnica|239|U|{4}|Artifact Creature - Cleric|0|0|Trample$Rampaging Monument enters the battlefield with three +1/+1 counters on it.$Whenever you cast a multicolored spell, put a +1/+1 counter on Rampaging Monument.| +Selesnya Locket|Guilds of Ravnica|240|C|{3}|Artifact|||{T}: Add {G} or {W}.${G/W}{G/W}{G/W}{G/W}, {T}, Sacrifice Selesnya Locket: Draw two cards.| +Silent Dart|Guilds of Ravnica|241|U|{1}|Artifact|||{4}, {T}, Sacrifice Silent Dart: It deals 3 damage to target creature.| +Wand of Vertebrae|Guilds of Ravnica|242|U|{1}|Artifact|||{T}: Put the top card of your library into your graveyard.${2}, {T}, Exile Wand of Vertebrae: Shuffle up to five target cards from your graveyard into your library.| +Boros Guildgate|Guilds of Ravnica|243|C||Land - Gate|||Boros Guildgate enters the battlefield tapped.${T}: Add {R} or {W}.| +Dimir Guildgate|Guilds of Ravnica|245|C||Land - Gate|||Dimir Guildgate enters the battlefield tapped.${T}: Add {U} or {B}.| +Gateway Plaza|Guilds of Ravnica|247|C||Land - Gate|||Gateway Plaza enters the battlefield tapped.$When Gateway Plaza enters the battlefield, sacrifice it unless you pay {1}.${T}: Add one mana of any color.| +Golgari Guildgate|Guilds of Ravnica|248|C||Land - Gate|||Golgari Guildgate enters the battlefield tapped.${T}: Add {B} or {G}.| +Guildmages' Forum|Guilds of Ravnica|250|R||Land|||{T}: Add {C}.${1}, {T}: Add one mana of any color. If that mana is spent on a multicolored creature spell, that creature enters the battlefield with an additional +1/+1 counter on it.| +Izzet Guildgate|Guilds of Ravnica|251|C||Land - Gate|||Izzet Guildgate enters the battlefield tapped.${T}: Add {U} or {R}.| +Overgrown Tomb|Guilds of Ravnica|253|R||Land - Swamp Forest|||({T}: Add {B} or {G}.)$As Overgrown Tomb enters the battlefield, you may pay 2 life. If you don't, Overgrown Tomb enters the battlefield tapped.| +Sacred Foundry|Guilds of Ravnica|254|R||Land - Mountain Plains|||({T}: Add {R} or {W}.)$As Sacred Foundry enters the battlefield, you may pay 2 life. If you don't, Sacred Foundry enters the battlefield tapped.| +Selesnya Guildgate|Guilds of Ravnica|255|C||Land - Gate|||Selesnya Guildgate enters the battlefield tapped.${T}: Add {G} or {W}.| +Steam Vents|Guilds of Ravnica|257|R||Land - Island Mountain|||({T}: Add {U} or {R}.)$As Steam Vents enters the battlefield, you may pay 2 life. If you don't, Steam Vents enters the battlefield tapped.| +Temple Garden|Guilds of Ravnica|258|R||Land - Forest Plains|||({T}: Add {G} or {W}.)$As Temple Garden enters the battlefield, you may pay 2 life. If you don't, Temple Garden enters the battlefield tapped.| +Watery Grave|Guilds of Ravnica|259|R||Land - Island Swamp|||({T}: Add {U} or {B}.)$As Watery Grave enters the battlefield, you may pay 2 life. If you don't, Watery Grave enters the battlefield tapped.| +Plains|Guilds of Ravnica|260|C||Basic Land - Plains|||({T}: Add {W}.)| +Island|Guilds of Ravnica|261|C||Basic Land - Island|||({T}: Add {U}.)| +Swamp|Guilds of Ravnica|262|C||Basic Land - Swamp|||({T}: Add {B}.)| +Mountain|Guilds of Ravnica|263|C||Basic Land - Mountain|||({T}: Add {R}.)| +Forest|Guilds of Ravnica|264|C||Basic Land - Forest|||({T}: Add {G}.)| +Ral, Caller of Storms|Guilds of Ravnica|265|M|{4}{U}{R}|Legendary Planeswalker - Ral|4|+1: Draw a card.$-2: Ral, Caller of Storms deals 3 damage divided as you choose among one, two, or three targets.$-7: Draw seven cards. Ral, Caller of Storms deals 7 damage to each creature your opponents control.| +Ral's Dispersal|Guilds of Ravnica|266|R|{3}{U}{U}|Instant|||Return target creature to its owner's hand. You may search your library and/or graveyard for a card named Ral, Caller of Storms, reveal it, and put it into your hand. If you search your library this way, shuffle it.| +Precision Bolt|Guilds of Ravnica|267|C|{2}{R}|Sorcery|||Precision Bolt deals 3 damage to any target.| +Ral's Staticaster|Guilds of Ravnica|268|U|{2}{U}{R}|Creature - Viashino Wizard|3|3|Trample$Whenever Ral's Staticaster attacks, if you control a Ral planeswalker, Ral's Staticaster gets +1/+0 for each card in your hand until end of turn.| +Vraska, Regal Gorgon|Guilds of Ravnica|269|M|{5}{B}{G}|Legendary Planeswalker - Vraska|5|+2: Put a +1/+1 counter on up to one target creature. That creature gains menace until end of turn.$-3: Destroy target creature.$-10: For each creature card in your graveyard, put a +1/+1 counter on each creature you control.| +Kraul Raider|Guilds of Ravnica|270|C|{2}{B}|Creature - Insect Warrior|2|3|Menace| +Attendant of Vraska|Guilds of Ravnica|271|U|{1}{B}{G}|Creature - Zombie Soldier|3|3|When Attendant of Vraska dies, if you control a Vraska planeswalker, you gain life equal to Attendant of Vraska's power.| +Vraska's Stoneglare|Guilds of Ravnica|272|R|{4}{B}{G}|Sorcery|||Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard for a card named Vraska, Regal Gorgon, reveal it, and put it into your hand. If you search your library this way, shuffle it.| +Impervious Greatwurm|Guilds of Ravnica|273|M|{7}{G}{G}{G}|Creature - Wurm|16|16|Convoke$Indestructible| \ No newline at end of file diff --git a/Utils/mtg-sets-data.txt b/Utils/mtg-sets-data.txt index 6cbde344ad..dde1ea9b8c 100644 --- a/Utils/mtg-sets-data.txt +++ b/Utils/mtg-sets-data.txt @@ -91,6 +91,7 @@ Fate Reforged|FRF| Future Sight|FUT| Global Series: Jiang Yanggu & Mu Yanling|GS1| Guildpact|GPT| +Guilds of Ravnica|GRN| Grand Prix|GPX| WPN Gateway|GRC| Gatecrash|GTC|