diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java index 0eec9111ea9..ba8cbb2bf65 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java @@ -1,46 +1,39 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * ConnectDialog.java * * Created on 20-Jan-2010, 9:37:07 PM */ - package mage.client.dialog; -import mage.client.MageFrame; -import mage.client.util.Config; -import mage.remote.Connection; -import org.apache.log4j.Logger; - -import javax.swing.*; -import java.awt.*; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; @@ -63,10 +56,17 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; +import mage.client.MageFrame; +import static mage.client.dialog.PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_AUTO_CONNECT; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_FLAG; +import mage.client.util.Config; import mage.client.util.gui.countryBox.CountryItemEditor; +import mage.remote.Connection; import mage.remote.Connection.ProxyType; +import org.apache.log4j.Logger; /** * @author BetaSteward_at_googlemail.com @@ -101,11 +101,11 @@ public class ConnectDialog extends MageDialog { this.txtUserName.setText(MageFrame.getPreferences().get("userName", "")); this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get(KEY_CONNECT_AUTO_CONNECT, "false"))); this.chkForceUpdateDB.setSelected(false); // has always to be set manually to force comparison - + String selectedFlag = MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"); // set the selected country/flag for (int i = 0; i < cbFlag.getItemCount(); i++) { - String[] name = (String[])cbFlag.getItemAt(i); + String[] name = (String[]) cbFlag.getItemAt(i); if (name[1].equals(selectedFlag)) { cbFlag.setSelectedIndex(i); break; @@ -124,10 +124,9 @@ public class ConnectDialog extends MageDialog { } /** - * This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -293,7 +292,7 @@ public class ConnectDialog extends MageDialog { private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected())); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); if (task != null && !task.isDone()) { task.cancel(true); } else { @@ -329,7 +328,7 @@ public class ConnectDialog extends MageDialog { connection.setPort(Integer.valueOf(this.txtPort.getText().trim())); connection.setUsername(this.txtUserName.getText().trim()); connection.setForceDBComparison(this.chkForceUpdateDB.isSelected()); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); @@ -354,8 +353,8 @@ public class ConnectDialog extends MageDialog { } // pref settings - MageFrame.getInstance().setUserPrefsToConnection(connection); - + MageFrame.getInstance().setUserPrefsToConnection(connection); + logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort()); task = new ConnectTask(); task.execute(); @@ -385,7 +384,7 @@ public class ConnectDialog extends MageDialog { get(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); if (result) { - lblStatus.setText(""); + lblStatus.setText(""); connected(); MageFrame.getInstance().showGames(false); } else { @@ -412,7 +411,6 @@ public class ConnectDialog extends MageDialog { this.hideDialog(); } - private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped char c = evt.getKeyChar(); if (!Character.isDigit(c)) { @@ -428,8 +426,12 @@ public class ConnectDialog extends MageDialog { private void findPublicServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed BufferedReader in = null; try { - - URL serverListURL = new URL(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt")); + String serverUrl = PreferencesDialog.getCachedValue(KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt"); + if (serverUrl.contains("xmage.info/files/")) { + serverUrl = serverUrl.replace("xmage.info/files/", "xmage.de/files/"); // replace old URL if still saved + PreferencesDialog.saveValue(KEY_CONNECTION_URL_SERVER_LIST, serverUrl); + } + URL serverListURL = new URL(serverUrl); Connection.ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); Proxy p = null; @@ -465,12 +467,12 @@ public class ConnectDialog extends MageDialog { boolean URLNotFound = false; try { in = new BufferedReader(new InputStreamReader(serverListURL.openConnection(p).getInputStream())); - } catch (SocketTimeoutException |FileNotFoundException | UnknownHostException ex ) { + } catch (SocketTimeoutException | FileNotFoundException | UnknownHostException ex) { logger.warn("Could not read serverlist from: " + serverListURL.toString()); File f = new File("serverlist.txt"); if (f.exists() && !f.isDirectory()) { logger.info("Using buffered serverlist: serverlist.txt"); - URLNotFound = true; + URLNotFound = true; in = new BufferedReader(new FileReader("serverlist.txt")); } } @@ -518,7 +520,7 @@ public class ConnectDialog extends MageDialog { JOptionPane.showMessageDialog(null, "Wrong server data format."); } } - + } catch (Exception ex) { logger.error(ex, ex); } finally { @@ -539,7 +541,6 @@ public class ConnectDialog extends MageDialog { // TODO add your handling code here: }//GEN-LAST:event_chkForceUpdateDBActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; private javax.swing.JButton btnConnect; diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index 5daa90a9f71..2690ef639d3 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -47,7 +47,9 @@ import mage.client.components.MageTextArea; import mage.client.dialog.MageDialog; import mage.client.util.audio.AudioManager; import mage.client.util.gui.ArrowBuilder; -import mage.constants.Constants; +import static mage.constants.Constants.Option.ORIGINAL_ID; +import static mage.constants.Constants.Option.SECOND_MESSAGE; +import static mage.constants.Constants.Option.SPECIAL_BUTTON; import mage.constants.PlayerAction; import mage.remote.Session; import org.apache.log4j.Logger; @@ -85,6 +87,7 @@ public class FeedbackPanel extends javax.swing.JPanel { public void init(UUID gameId) { this.gameId = gameId; session = MageFrame.getSession(); + helper.init(gameId); } public void getFeedback(FeedbackMode mode, String message, boolean special, Map options, int messageId) { @@ -95,61 +98,42 @@ public class FeedbackPanel extends javax.swing.JPanel { } this.lastMessageId = messageId; } - - this.lblMessage.setText(message); - this.helper.setMessage(message); + this.helper.setBasicMessage(message); + this.helper.setOriginalId(null); // reference to the feedback causing ability + String lblText = addAdditionalText(message, options); + this.helper.setTextArea(lblText); + this.lblMessage.setText(lblText); this.mode = mode; switch (this.mode) { case INFORM: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(false); - this.helper.setState("", false, "", false); + setButtonState("", "", mode); break; case QUESTION: - this.btnLeft.setVisible(true); - this.btnLeft.setText("Yes"); - this.btnRight.setVisible(true); - this.btnRight.setText("No"); - this.helper.setState("Yes", true, "No", true); + setButtonState("Yes", "No", mode); + if (options != null && options.containsKey(ORIGINAL_ID)) { + this.helper.setOriginalId((UUID) options.get(ORIGINAL_ID)); + } break; case CONFIRM: - this.btnLeft.setVisible(true); - this.btnLeft.setText("OK"); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("Ok", true, "Cancel", true); + setButtonState("OK", "Cancel", mode); break; case CANCEL: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("", false, "Cancel", true); + setButtonState("", "Cancel", mode); this.helper.setUndoEnabled(false); break; case SELECT: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Done"); - this.helper.setState("", false, "Done", true); + setButtonState("", "Done", mode); break; case END: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Close game"); - this.helper.setState("", false, "Close game", true); + setButtonState("", "Close game", mode); ArrowBuilder.getBuilder().removeAllArrows(gameId); endWithTimeout(); break; } - if (options != null && options.containsKey(Constants.Option.SPECIAL_BUTTON)) { - String specialText = (String) options.get(Constants.Option.SPECIAL_BUTTON); - this.btnSpecial.setVisible(true); - this.btnSpecial.setText(specialText); - this.helper.setSpecial(specialText, true); + if (options != null && options.containsKey(SPECIAL_BUTTON)) { + this.setSpecial((String) options.get(SPECIAL_BUTTON), true); } else { - this.btnSpecial.setVisible(special); - this.btnSpecial.setText("Special"); - this.helper.setSpecial("Special", special); + this.setSpecial("Special", special); } requestFocusIfPossible(); @@ -162,6 +146,32 @@ public class FeedbackPanel extends javax.swing.JPanel { this.helper.setVisible(true); } + private void setButtonState(String leftText, String rightText, FeedbackMode mode) { + btnLeft.setVisible(!leftText.isEmpty()); + btnLeft.setText(leftText); + btnRight.setVisible(!rightText.isEmpty()); + btnRight.setText(rightText); + this.helper.setState(leftText, !leftText.isEmpty(), rightText, !rightText.isEmpty(), mode); + } + + private String addAdditionalText(String message, Map options) { + if (options != null && options.containsKey(SECOND_MESSAGE)) { + return message + getSmallText((String) options.get(SECOND_MESSAGE)); + } else { + return message; + } + } + + protected String getSmallText(String text) { + return "
" + text + "
"; + } + + private void setSpecial(String text, boolean visible) { + this.btnSpecial.setText(text); + this.btnSpecial.setVisible(visible); + this.helper.setSpecial(text, visible); + } + /** * Close game window by pressing OK button after 8 seconds */ diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 7ba3fae85f0..2c969192745 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -1998,7 +1998,7 @@ public final class GamePanel extends javax.swing.JPanel { } } if (event.getEventName().equals("action-consumed")) { - dialog.hideDialog(); + dialog.removeDialog(); } } }; @@ -2017,24 +2017,31 @@ public final class GamePanel extends javax.swing.JPanel { switch (e.getActionCommand()) { case CMD_AUTO_ORDER_FIRST: session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_FIRST, gameId, abilityId); + session.sendPlayerUUID(gameId, abilityId); break; case CMD_AUTO_ORDER_LAST: session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_LAST, gameId, abilityId); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities break; case CMD_AUTO_ORDER_NAME_FIRST: if (abilityRuleText != null) { session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_FIRST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, abilityId); } break; case CMD_AUTO_ORDER_NAME_LAST: if (abilityRuleText != null) { session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_LAST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities } break; case CMD_AUTO_ORDER_RESET_ALL: session.sendPlayerAction(TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); break; } + for (ShowCardsDialog dialog : pickTarget) { + dialog.removeDialog(); + } } private void initPopupMenuTriggerOrder() { diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index 829493e0e1c..8a06f33d539 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -28,17 +28,34 @@ package mage.client.game; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagLayout; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.UUID; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; +import mage.client.MageFrame; import mage.client.components.MageTextArea; +import mage.client.game.FeedbackPanel.FeedbackMode; +import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_YES; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_YES; +import mage.remote.Session; /** * Panel with buttons that copy the state of feedback panel. @@ -64,12 +81,34 @@ public class HelperPanel extends JPanel { private final int defaultDismissTimeout = ToolTipManager.sharedInstance().getDismissDelay(); private final Object tooltipBackground = UIManager.get("info"); + private static final String CMD_AUTO_ANSWER_ID_YES = "cmdAutoAnswerIdYes"; + private static final String CMD_AUTO_ANSWER_ID_NO = "cmdAutoAnswerIdNo"; + private static final String CMD_AUTO_ANSWER_NAME_YES = "cmdAutoAnswerNameYes"; + private static final String CMD_AUTO_ANSWER_NAME_NO = "cmdAutoAnswerNameNo"; + private static final String CMD_AUTO_ANSWER_RESET_ALL = "cmdAutoAnswerResetAll"; + + // popup menu for set automatic answers + private JPopupMenu popupMenuAskYes; + private JPopupMenu popupMenuAskNo; + + // originalId of feedback causing ability + private UUID originalId; + private String message; + + private UUID gameId; + private Session session; + public HelperPanel() { initComponents(); } - private void initComponents() { + public void init(UUID gameId) { + this.gameId = gameId; + session = MageFrame.getSession(); + } + private void initComponents() { + initPopupMenuTriggerOrder(); setBackground(new Color(0, 0, 0, 100)); //setLayout(new GridBagLayout()); setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); @@ -108,72 +147,44 @@ public class HelperPanel extends JPanel { btnUndo.setVisible(false); container.add(btnUndo); - btnLeft.addActionListener(new java.awt.event.ActionListener() { + MouseListener checkPopupAdapter = new MouseAdapter() { + @Override + public void mousePressed(MouseEvent me) { + checkPopupMenu(me); + } + + @Override + public void mouseReleased(MouseEvent me) { + checkPopupMenu(me); + } + + }; + + btnLeft.addMouseListener(checkPopupAdapter); + btnLeft.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkLeft != null) { - { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkLeft.doClick(); - } - }); - } - }; - worker.start(); - } + clickButton(linkLeft); } } }); - btnRight.addActionListener(new java.awt.event.ActionListener() { + btnRight.addMouseListener(checkPopupAdapter); + btnRight.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkRight != null) { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkRight.doClick(); - } - }); - } - }; - worker.start(); + clickButton(linkRight); } } }); - btnSpecial.addActionListener(new java.awt.event.ActionListener() { + btnSpecial.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkSpecial != null) { - { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkSpecial.doClick(); - } - }); - } - }; - worker.start(); - } + clickButton(linkSpecial); } } }); @@ -200,7 +211,7 @@ public class HelperPanel extends JPanel { } }); - // sets a darker background and higher simiss time fpr tooltip in the feedback / helper panel + // sets a darker background and higher simiss time fur tooltip in the feedback / helper panel textArea.addMouseListener(new MouseAdapter() { @Override @@ -217,15 +228,50 @@ public class HelperPanel extends JPanel { }); } - public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible) { + private void checkPopupMenu(MouseEvent me) { + if (me.isPopupTrigger() + && originalId != null) { // only Yes/No requests from abilities can be automated + JButton source = (JButton) me.getSource(); + if (source.getActionCommand().startsWith(QUESTION.toString())) { + showPopupMenu(me.getComponent(), source.getActionCommand()); + me.consume(); + } + } + } + + private void clickButton(final JButton button) { + Thread worker = new Thread() { + @Override + public void run() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + setState("", false, "", false, null); + setSpecial("", false); + button.doClick(); + } + }); + } + }; + worker.start(); + } + + public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible, FeedbackMode mode) { this.btnLeft.setVisible(leftVisible); if (!txtLeft.isEmpty()) { this.btnLeft.setText(txtLeft); + if (mode != null) { + this.btnLeft.setActionCommand(mode.toString() + txtLeft); + } } this.btnRight.setVisible(rightVisible); if (!txtRight.isEmpty()) { this.btnRight.setText(txtRight); + if (mode != null) { + this.btnRight.setActionCommand(mode.toString() + txtRight); + } } + } public void setSpecial(String txtSpecial, boolean specialVisible) { @@ -251,25 +297,116 @@ public class HelperPanel extends JPanel { this.linkUndo = undo; } - public void setMessage(String message) { -// if (message.startsWith("Use alternative cost")) { -// message = "Use alternative cost?"; -// } else if (message.contains("Use ")) { -// if (message.length() < this.getWidth() / 10) { -// message = getSmallText(message); -// } else { -// message = "Use ability?" + getSmallText(message.substring(0, this.getWidth() / 10)); -// } -// } - textArea.setText(message, this.getWidth()); + public void setOriginalId(UUID originalId) { + this.originalId = originalId; } - protected String getSmallText(String text) { - return "
" + text + "
"; + public void setBasicMessage(String message) { + this.message = message; + this.textArea.setText(message, this.getWidth()); + } + + public void setTextArea(String message) { + this.textArea.setText(message, this.getWidth()); } @Override public void requestFocus() { this.btnRight.requestFocus(); } + + private void initPopupMenuTriggerOrder() { + + ActionListener actionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleAutoAnswerPopupMenuEvent(e); + } + }; + + popupMenuAskYes = new JPopupMenu(); + popupMenuAskNo = new JPopupMenu(); + + // String tooltipText = ""; + JMenuItem menuItem; + menuItem = new JMenuItem("Always Yes for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_YES); + menuItem.addActionListener(actionListener); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with Yes."); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_NO); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Always Yes for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_YES); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with Yes."); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_NO); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + } + + public void handleAutoAnswerPopupMenuEvent(ActionEvent e) { + switch (e.getActionCommand()) { + case CMD_AUTO_ANSWER_ID_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_YES, gameId, originalId.toString() + "#" + message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_ID_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_NO, gameId, originalId.toString() + "#" + message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_NAME_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_YES, gameId, message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_NAME_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_NO, gameId, message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_RESET_ALL: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + break; + } + } + + private void showPopupMenu(Component callingComponent, String actionCommand) { + // Get the location of the point 'on the screen' + Point p = callingComponent.getLocationOnScreen(); + // Show the JPopupMenu via program + // Parameter desc + // ---------------- + // this - represents current frame + // 0,0 is the co ordinate where the popup + // is shown + JPopupMenu menu; + if (actionCommand.endsWith("Yes")) { + menu = popupMenuAskYes; + } else { + menu = popupMenuAskNo; + } + menu.show(this, 0, 0); + + // Now set the location of the JPopupMenu + // This location is relative to the screen + menu.setLocation(p.x, p.y + callingComponent.getHeight()); + } } diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index cdf949d1494..44f2f509b54 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -290,6 +290,18 @@ public class PlayAreaPanel extends javax.swing.JPanel { } }); + menuItem = new JMenuItem("Use requests - reset automatic answers"); + menuItem.setMnemonic(KeyEvent.VK_T); + menuItem.setToolTipText("Deletes all defined automatic answers for Yes/No usage requests."); + automaticConfirmsMenu.add(menuItem); + // Reset the replacement effcts that were auto selected for the game + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gamePanel.getSession().sendPlayerAction(PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + } + }); + JMenu handCardsMenu = new JMenu("Cards on hand"); handCardsMenu.setMnemonic(KeyEvent.VK_H); popupMenu.add(handCardsMenu); 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 83ba8b763d2..c236a42741b 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 @@ -135,10 +135,10 @@ public class MageActionCallback implements ActionCallback { ArrowUtil.drawArrowsForPairedCards(data, parentPoint); ArrowUtil.drawArrowsForEnchantPlayers(data, parentPoint); - showPopup(data, parentComponent, parentPoint); + showTooltipPopup(data, parentComponent, parentPoint); } - private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { + private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { if (data.component != null) { String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true"); if (showTooltips.equals("false")) { diff --git a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java index b513ea79665..0befa70bed9 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java @@ -11,11 +11,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.geom.Area; import java.awt.geom.GeneralPath; - import javax.swing.JFrame; import javax.swing.JPanel; public class Arrow extends JPanel { + private static final long serialVersionUID = -4631054277822828303L; private int startX; @@ -27,21 +27,25 @@ public class Arrow extends JPanel { private Composite composite; private Color color = Color.red; - public Arrow () { + public Arrow() { setOpaque(false); setOpacity(0.6f); } - protected void paintComponent (Graphics g) { + protected void paintComponent(Graphics g) { super.paintComponent(g); float ex = endX - startX; float ey = endY - startY; - if (ex == 0 && ey == 0) return; - float length = (float)Math.sqrt(ex * ex + ey * ey); - float bendPercent = (float)Math.asin(ey / length); - if (endX > startX) bendPercent = -bendPercent; + if (ex == 0 && ey == 0) { + return; + } + float length = (float) Math.sqrt(ex * ex + ey * ey); + float bendPercent = (float) Math.asin(ey / length); + if (endX > startX) { + bendPercent = -bendPercent; + } Area arrow = getArrow(length, bendPercent); - Graphics2D g2d = (Graphics2D)g; + Graphics2D g2d = (Graphics2D) g; g2d.translate(startX, startY); g2d.rotate(Math.atan2(ey, ex)); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); @@ -52,16 +56,16 @@ public class Arrow extends JPanel { g2d.draw(arrow); } - private Area getArrow (float length, float bendPercent) { + private Area getArrow(float length, float bendPercent) { float p1x = 0, p1y = 0; float p2x = length, p2y = 0; float cx = length / 2, cy = length / 8f * bendPercent; float adjSize, ex, ey, abs_e; - adjSize = (float)(bodyWidth / 2 / Math.sqrt(2)); + adjSize = (float) (bodyWidth / 2 / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath bodyPath = new GeneralPath(); @@ -71,10 +75,10 @@ public class Arrow extends JPanel { bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize); bodyPath.closePath(); - adjSize = (float)(headSize / Math.sqrt(2)); + adjSize = (float) (headSize / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath headPath = new GeneralPath(); @@ -88,23 +92,23 @@ public class Arrow extends JPanel { return area; } - public int getBodyWidth () { + public int getBodyWidth() { return bodyWidth; } - public void setBodyWidth (int bodyWidth) { + public void setBodyWidth(int bodyWidth) { this.bodyWidth = bodyWidth; } - public float getHeadSize () { + public float getHeadSize() { return headSize; } - public void setHeadSize (float headSize) { + public void setHeadSize(float headSize) { this.headSize = headSize; } - public void setArrowLocation (int startX, int startY, int endX, int endY) { + public void setArrowLocation(int startX, int startY, int endX, int endY) { this.startX = startX; this.startY = startY; this.endX = endX; @@ -112,7 +116,7 @@ public class Arrow extends JPanel { repaint(); } - public void setOpacity (float opacity) { + public void setOpacity(float opacity) { composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity); } @@ -120,7 +124,7 @@ public class Arrow extends JPanel { this.color = color; } - public static void main (String[] args) { + public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); @@ -130,11 +134,13 @@ public class Arrow extends JPanel { frame.setResizable(false); frame.setVisible(true); frame.getContentPane().addMouseMotionListener(new MouseMotionListener() { - public void mouseMoved (MouseEvent e) { + @Override + public void mouseMoved(MouseEvent e) { arrow.setArrowLocation(320, 240, e.getX(), e.getY()); } - public void mouseDragged (MouseEvent e) { + @Override + public void mouseDragged(MouseEvent e) { } }); } diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 5af245dd308..ce5970f6821 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -1,3 +1,6 @@ +#Generate|TOK:BFZ|Eldrazi Scion| +#Generate|TOK:BFZ|Elemental| + #Generate|TOK:DDP|Eldrazi Spawn 1| #Generate|TOK:DDP|Eldrazi Spawn 2| #Generate|TOK:DDP|Eldrazi Spawn 3| diff --git a/Mage.Client/src/main/resources/image.url.properties b/Mage.Client/src/main/resources/image.url.properties index 625d27d3bac..21627b43ec6 100644 --- a/Mage.Client/src/main/resources/image.url.properties +++ b/Mage.Client/src/main/resources/image.url.properties @@ -64,6 +64,6 @@ ddd=gvl unh=uh dde=pvc # Remove setname as soon as the images can be downloaded -ignore.urls=TOK,MM2,V15,BFZ,DDP +ignore.urls=TOK,V15,DDP # sets ordered by release time (newest goes first) token.lookup.order=DDP,BFZ,FVD,FVE,FVL,FVR,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC \ No newline at end of file diff --git a/Mage.Common/src/mage/constants/Constants.java b/Mage.Common/src/mage/constants/Constants.java index a5b586c63a8..965346f2819 100644 --- a/Mage.Common/src/mage/constants/Constants.java +++ b/Mage.Common/src/mage/constants/Constants.java @@ -83,6 +83,10 @@ public final class Constants { public static final String POSSIBLE_ATTACKERS = "possibleAttackers"; public static final String SPECIAL_BUTTON = "specialButton"; + // used to control automatic answers of optional effects + public static final String ORIGINAL_ID = "originalId"; + public static final String SECOND_MESSAGE = "secondMessage"; + public static final String HINT_TEXT = "hintText"; } diff --git a/Mage.Common/src/mage/remote/MageVersionException.java b/Mage.Common/src/mage/remote/MageVersionException.java index 4da5aec0ddc..33108ab2d6b 100644 --- a/Mage.Common/src/mage/remote/MageVersionException.java +++ b/Mage.Common/src/mage/remote/MageVersionException.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -38,8 +38,8 @@ public class MageVersionException extends MageException { private final MageVersion serverVersion; - public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { - super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.info or http://www.slightlymagic.net/forum/viewforum.php?f=70"); + public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { + super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.de or http://www.slightlymagic.net/forum/viewforum.php?f=70"); this.serverVersion = serverVersion; } diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index aed2451d8bd..4246c916522 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -63,6 +63,7 @@ import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.RangeOfInfluence; import mage.constants.Zone; @@ -89,6 +90,7 @@ import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetDefender; import mage.util.GameLog; import mage.util.ManaUtil; +import mage.util.MessageToClient; import org.apache.log4j.Logger; /** @@ -105,7 +107,7 @@ public class HumanPlayer extends PlayerImpl { protected static FilterBlockingCreature filterBlock = new FilterBlockingCreature(); protected final Choice replacementEffectChoice; - private static final Logger log = Logger.getLogger(HumanPlayer.class); + private static final Logger logger = Logger.getLogger(HumanPlayer.class); protected HashSet autoSelectReplacementEffects = new HashSet<>(); protected ManaCost currentlyUnpaidMana; @@ -115,6 +117,9 @@ public class HumanPlayer extends PlayerImpl { protected Set triggerAutoOrderNameFirst = new HashSet<>(); protected Set triggerAutoOrderNameLast = new HashSet<>(); + protected Map requestAutoAnswerId = new HashMap<>(); + protected Map requestAutoAnswerText = new HashMap<>(); + public HumanPlayer(String name, RangeOfInfluence range, int skill) { super(name, range); replacementEffectChoice = new ChoiceImpl(true); @@ -131,53 +136,30 @@ public class HumanPlayer extends PlayerImpl { protected void waitForResponse(Game game) { response.clear(); - log.debug("Waiting response from player: " + getId()); + logger.debug("Waiting response from player: " + getId()); game.resumeTimer(getTurnControlledBy()); synchronized (response) { try { response.wait(); - log.debug("Got response from player: " + getId()); + logger.debug("Got response from player: " + getId()); } catch (InterruptedException ex) { - ex.printStackTrace(); + logger.error("Response error for player " + getName() + " gameId: " + game.getId(), ex); } finally { game.pauseTimer(getTurnControlledBy()); } } } - protected void waitForBooleanResponse(Game game) { - do { - waitForResponse(game); - } while (response.getBoolean() == null && !abort); - } - - protected void waitForUUIDResponse(Game game) { - do { - waitForResponse(game); - } while (response.getUUID() == null && !abort); - } - - protected void waitForStringResponse(Game game) { - do { - waitForResponse(game); - } while (response.getString() == null && !abort); - } - - protected void waitForIntegerResponse(Game game) { - do { - waitForResponse(game); - } while (response.getInteger() == null && !abort); - } - @Override public boolean chooseMulligan(Game game) { updateGameStatePriority("chooseMulligan", game); int nextHandSize = game.mulliganDownTo(playerId); - game.fireAskPlayerEvent(playerId, new StringBuilder("Mulligan ") - .append(getHand().size() > nextHandSize ? "down to " : "for free, draw ") - .append(nextHandSize) - .append(nextHandSize == 1 ? " card?" : " cards?").toString()); - waitForBooleanResponse(game); + do { + game.fireAskPlayerEvent(playerId, new MessageToClient("Mulligan " + + (getHand().size() > nextHandSize ? "down to " : "for free, draw ") + + nextHandSize + (nextHandSize == 1 ? " card?" : " cards?")), null); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -186,15 +168,43 @@ public class HumanPlayer extends PlayerImpl { @Override public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + if (source != null) { + Boolean answer = requestAutoAnswerId.get(source.getOriginalId() + "#" + message); + if (answer != null) { + return answer; + } else { + answer = requestAutoAnswerText.get(message); + if (answer != null) { + return answer; + } + } + } updateGameStatePriority("chooseUse", game); - game.fireAskPlayerEvent(playerId, addSecondLineWithObjectName(message, source == null ? null : source.getSourceId(), game)); - waitForBooleanResponse(game); + do { + game.fireAskPlayerEvent(playerId, new MessageToClient(message, getRelatedObjectName(source, game)), source); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } return false; } + private String getRelatedObjectName(Ability source, Game game) { + if (source != null) { + return getRelatedObjectName(source.getSourceId(), game); + } + return null; + } + + private String getRelatedObjectName(UUID sourceId, Game game) { + MageObject mageObject = game.getObject(sourceId); + if (mageObject != null) { + return mageObject.getLogName(); + } + return null; + } + private String addSecondLineWithObjectName(String message, UUID sourceId, Game game) { if (sourceId != null) { MageObject mageObject = game.getPermanent(sourceId); @@ -232,7 +242,7 @@ public class HumanPlayer extends PlayerImpl { while (!abort) { game.fireChooseChoiceEvent(playerId, replacementEffectChoice); waitForResponse(game); - log.debug("Choose effect: " + response.getString()); + logger.debug("Choose effect: " + response.getString()); if (response.getString() != null) { if (response.getString().startsWith("#")) { autoSelectReplacementEffects.add(response.getString().substring(1)); @@ -304,7 +314,7 @@ public class HumanPlayer extends PlayerImpl { List chosen = target.getTargets(); options.put("chosen", (Serializable) chosen); - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), sourceId, game), targetIds, required, getOptions(target, options)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(sourceId, game)), targetIds, required, getOptions(target, options)); waitForResponse(game); if (response.getUUID() != null) { if (!targetIds.contains(response.getUUID())) { @@ -370,7 +380,7 @@ public class HumanPlayer extends PlayerImpl { required = false; } - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), possibleTargets, required, getOptions(target, null)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), possibleTargets, required, getOptions(target, null)); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { @@ -438,7 +448,7 @@ public class HumanPlayer extends PlayerImpl { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage()), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.canTarget(response.getUUID(), cards, game)) { @@ -492,7 +502,7 @@ public class HumanPlayer extends PlayerImpl { if (!choosable.isEmpty()) { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { // if already included remove it @@ -521,7 +531,7 @@ public class HumanPlayer extends PlayerImpl { public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { updateGameStatePriority("chooseTargetAmount", game); while (!abort) { - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), source == null ? null : source.getSourceId(), game), + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), getRelatedObjectName(source, game)), target.possibleTargets(source == null ? null : source.getSourceId(), playerId, game), target.isRequired(source), getOptions(target, null)); @@ -675,35 +685,34 @@ public class HumanPlayer extends PlayerImpl { @Override public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { - // try to set trigger auto order - List abilitiesWithNoOrderSet = new ArrayList<>(); - TriggeredAbility abilityOrderLast = null; - for (TriggeredAbility ability : abilities) { - if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { - return ability; - } - if (triggerAutoOrderNameFirst.contains(ability.getRule())) { - return ability; - } - if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { - abilityOrderLast = ability; - continue; - } - if (triggerAutoOrderNameLast.contains(ability.getRule())) { - abilityOrderLast = ability; - continue; - } - abilitiesWithNoOrderSet.add(ability); - } - if (abilitiesWithNoOrderSet.isEmpty()) { - return abilityOrderLast; - } - if (abilitiesWithNoOrderSet.size() == 1) { - return abilitiesWithNoOrderSet.iterator().next(); - } - - updateGameStatePriority("chooseTriggeredAbility", game); while (!abort) { + // try to set trigger auto order + List abilitiesWithNoOrderSet = new ArrayList<>(); + TriggeredAbility abilityOrderLast = null; + for (TriggeredAbility ability : abilities) { + if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { + return ability; + } + if (triggerAutoOrderNameFirst.contains(ability.getRule())) { + return ability; + } + if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { + abilityOrderLast = ability; + continue; + } + if (triggerAutoOrderNameLast.contains(ability.getRule())) { + abilityOrderLast = ability; + continue; + } + abilitiesWithNoOrderSet.add(ability); + } + if (abilitiesWithNoOrderSet.isEmpty()) { + return abilityOrderLast; + } + if (abilitiesWithNoOrderSet.size() == 1) { + return abilitiesWithNoOrderSet.iterator().next(); + } + updateGameStatePriority("chooseTriggeredAbility", game); game.fireSelectTargetTriggeredAbilityEvent(playerId, "Pick triggered ability (goes to the stack first)", abilitiesWithNoOrderSet); waitForResponse(game); if (response.getUUID() != null) { @@ -779,8 +788,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXMana(int min, int max, String message, Game game, Ability ability) { int xValue = 0; updateGameStatePriority("announceXMana", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -791,8 +802,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variableCost) { int xValue = 0; updateGameStatePriority("announceXCost", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -1043,7 +1056,8 @@ public class HumanPlayer extends PlayerImpl { protected void selectCombatGroup(UUID defenderId, UUID blockerId, Game game) { updateGameStatePriority("selectCombatGroup", game); TargetAttackingCreature target = new TargetAttackingCreature(); - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName("Select attacker to block", blockerId, game), target.possibleTargets(null, playerId, game), false, getOptions(target, null)); + game.fireSelectTargetEvent(playerId, new MessageToClient("Select attacker to block", getRelatedObjectName(blockerId, game)), + target.possibleTargets(null, playerId, game), false, getOptions(target, null)); waitForResponse(game); if (response.getBoolean() != null) { // do nothing @@ -1066,6 +1080,7 @@ public class HumanPlayer extends PlayerImpl { int remainingDamage = damage; while (remainingDamage > 0 && canRespond()) { Target target = new TargetCreatureOrPlayer(); + target.setNotTarget(true); if (singleTargetName != null) { target.setTargetName(singleTargetName); } @@ -1090,8 +1105,10 @@ public class HumanPlayer extends PlayerImpl { @Override public int getAmount(int min, int max, String message, Game game) { updateGameStatePriority("getAmount", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { return response.getInteger(); } else { @@ -1178,11 +1195,7 @@ public class HumanPlayer extends PlayerImpl { if (!ability.getSourceId().equals(getCastSourceIdWithAlternateMana()) && ability.getManaCostsToPay().convertedManaCost() > 0) { return true; } - if (ability instanceof ManaAbility) { - return true; - } - // if ability has no mana costs you have to pick it from ability picker - return false; + return ability instanceof ManaAbility; } return true; } @@ -1257,8 +1270,10 @@ public class HumanPlayer extends PlayerImpl { @Override public boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game) { updateGameStatePriority("choosePile", game); - game.fireChoosePileEvent(playerId, message, pile1, pile2); - waitForBooleanResponse(game); + do { + game.fireChoosePileEvent(playerId, message, pile1, pile2); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -1270,7 +1285,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setString(responseString); response.notify(); - log.debug("Got response string from player: " + getId()); + logger.debug("Got response string from player: " + getId()); } } @@ -1280,7 +1295,7 @@ public class HumanPlayer extends PlayerImpl { response.setManaType(manaType); response.setResponseManaTypePlayerId(manaTypePlayerId); response.notify(); - log.debug("Got response mana type from player: " + getId()); + logger.debug("Got response mana type from player: " + getId()); } } @@ -1289,7 +1304,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setUUID(responseUUID); response.notify(); - log.debug("Got response UUID from player: " + getId()); + logger.debug("Got response UUID from player: " + getId()); } } @@ -1298,7 +1313,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setBoolean(responseBoolean); response.notify(); - log.debug("Got response boolean from player: " + getId()); + logger.debug("Got response boolean from player: " + getId()); } } @@ -1307,7 +1322,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(responseInteger); response.notify(); - log.debug("Got response integer from player: " + getId()); + logger.debug("Got response integer from player: " + getId()); } } @@ -1316,7 +1331,7 @@ public class HumanPlayer extends PlayerImpl { abort = true; synchronized (response) { response.notify(); - log.debug("Got cancel action from player: " + getId()); + logger.debug("Got cancel action from player: " + getId()); } } @@ -1325,7 +1340,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(0); response.notify(); - log.debug("Got skip action from player: " + getId()); + logger.debug("Got skip action from player: " + getId()); } } @@ -1336,7 +1351,7 @@ public class HumanPlayer extends PlayerImpl { protected void updateGameStatePriority(String methodName, Game game) { if (game.getState().getPriorityPlayerId() != null) { // don't do it if priority was set to null before (e.g. discard in cleanaup) - log.debug("Setting game priority to " + getId() + " [" + methodName + "]"); + logger.debug("Setting game priority to " + getId() + " [" + methodName + "]"); game.getState().setPriorityPlayerId(getId()); } } @@ -1354,11 +1369,43 @@ public class HumanPlayer extends PlayerImpl { case TRIGGER_AUTO_ORDER_RESET_ALL: setTriggerAutoOrder(playerAction, game, data); break; + case REQUEST_AUTO_ANSWER_ID_NO: + case REQUEST_AUTO_ANSWER_ID_YES: + case REQUEST_AUTO_ANSWER_TEXT_NO: + case REQUEST_AUTO_ANSWER_TEXT_YES: + case REQUEST_AUTO_ANSWER_RESET_ALL: + setRequestAutoAnswer(playerAction, game, data); + break; default: super.sendPlayerAction(playerAction, game, data); } } + private void setRequestAutoAnswer(PlayerAction playerAction, Game game, Object data) { + if (playerAction.equals(REQUEST_AUTO_ANSWER_RESET_ALL)) { + requestAutoAnswerId.clear(); + requestAutoAnswerText.clear(); + return; + } + if (data instanceof String) { + String key = (String) data; + switch (playerAction) { + case REQUEST_AUTO_ANSWER_ID_NO: + requestAutoAnswerId.put(key, false); + break; + case REQUEST_AUTO_ANSWER_TEXT_NO: + requestAutoAnswerText.put(key, false); + break; + case REQUEST_AUTO_ANSWER_ID_YES: + requestAutoAnswerId.put(key, true); + break; + case REQUEST_AUTO_ANSWER_TEXT_YES: + requestAutoAnswerText.put(key, true); + break; + } + } + } + private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) { if (playerAction.equals(TRIGGER_AUTO_ORDER_RESET_ALL)) { triggerAutoOrderAbilityFirst.clear(); 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 5242a019614..eec4ea0dfe7 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -228,7 +228,7 @@ public class GameController implements GameCallback { try { switch (event.getQueryType()) { case ASK: - ask(event.getPlayerId(), event.getMessage()); + ask(event.getPlayerId(), event.getMessage(), event.getOptions()); break; case PICK_TARGET: target(event.getPlayerId(), event.getMessage(), event.getCards(), event.getPerms(), event.getTargets(), event.isRequired(), event.getOptions()); @@ -774,11 +774,11 @@ public class GameController implements GameCallback { // TODO: inform watchers about game end and who won } - private synchronized void ask(UUID playerId, final String question) throws MageException { + private synchronized void ask(UUID playerId, final String question, final Map options) throws MageException { perform(playerId, new Command() { @Override public void execute(UUID playerId) { - getGameSession(playerId).ask(question); + getGameSession(playerId).ask(question, options); } }); diff --git a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java index 157211555e0..2f93e943768 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java @@ -78,11 +78,11 @@ public class GameSessionPlayer extends GameSessionWatcher { super.CleanUp(); } - public void ask(final String question) { + public void ask(final String question, final Map options) { if (!killed) { User user = UserManager.getInstance().getUser(userId); if (user != null) { - user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question))); + user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question, options))); } } } diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java new file mode 100644 index 00000000000..6dc868b548c --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate1 extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black or artifact creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new CardTypePredicate(CardType.ARTIFACT))); + } + + public SoldeviAdnate1(UUID ownerId) { + super(ownerId, 25, "Soldevi Adnate", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice a black or artifact creature: Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public SoldeviAdnate1(final SoldeviAdnate1 card) { + super(card); + } + + @Override + public SoldeviAdnate1 copy() { + return new SoldeviAdnate1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java new file mode 100644 index 00000000000..644ac231489 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate2 extends SoldeviAdnate1 { + + public SoldeviAdnate2(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + } + + public SoldeviAdnate2(final SoldeviAdnate2 card) { + super(card); + } + + @Override + public SoldeviAdnate2 copy() { + return new SoldeviAdnate2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java new file mode 100644 index 00000000000..e648e0db971 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class PriestOfYawgmoth extends CardImpl { + + public PriestOfYawgmoth(UUID ownerId) { + super(ownerId, 49, "Priest of Yawgmoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice an artifact: Add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("artifact"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent()))); + this.addAbility(ability); + } + + public PriestOfYawgmoth(final PriestOfYawgmoth card) { + super(card); + } + + @Override + public PriestOfYawgmoth copy() { + return new PriestOfYawgmoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java new file mode 100644 index 00000000000..879a3dc6386 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.UNCOMMON; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java new file mode 100644 index 00000000000..d7214310bad --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +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.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class BarrageTyrant extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public BarrageTyrant(UUID ownerId) { + super(ownerId, 127, "Barrage Tyrant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // {2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{2}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BarrageTyrant(final BarrageTyrant card) { + super(card); + } + + @Override + public BarrageTyrant copy() { + return new BarrageTyrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java new file mode 100644 index 00000000000..2ab9d9d7361 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class BreakerOfArmies extends CardImpl { + + public BreakerOfArmies(UUID ownerId) { + super(ownerId, 3, "Breaker of Armies", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(8); + + // All creatures able to block Breaker of Armies do so. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAllSourceEffect(Duration.WhileOnBattlefield))); + } + + public BreakerOfArmies(final BreakerOfArmies card) { + super(card); + } + + @Override + public BreakerOfArmies copy() { + return new BreakerOfArmies(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java new file mode 100644 index 00000000000..15f532eb8db --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +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.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BroodButcher extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature"); + + public BroodButcher(UUID ownerId) { + super(ownerId, 199, "Brood Butcher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()), false)); + + // {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{B}{G}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BroodButcher(final BroodButcher card) { + super(card); + } + + @Override + public BroodButcher copy() { + return new BroodButcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java new file mode 100644 index 00000000000..d6fc7f74027 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CanopyVista extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CanopyVista(UUID ownerId) { + super(ownerId, 234, "Canopy Vista", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Forest"); + this.subtype.add("Plains"); + + // Canopy Vista enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + } + + public CanopyVista(final CanopyVista card) { + super(card); + } + + @Override + public CanopyVista copy() { + return new CanopyVista(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java new file mode 100644 index 00000000000..69cad63bd57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CinderGlade extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CinderGlade(UUID ownerId) { + super(ownerId, 235, "Cinder Glade", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Mountain"); + this.subtype.add("Forest"); + + // Cinder Glade enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); + } + + public CinderGlade(final CinderGlade card) { + super(card); + } + + @Override + public CinderGlade copy() { + return new CinderGlade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java new file mode 100644 index 00000000000..e1bb3d98f1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DefiantBloodlord extends CardImpl { + + public DefiantBloodlord(UUID ownerId) { + super(ownerId, 107, "Defiant Bloodlord", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you gain life, target opponent loses that much life. + DefiantBloodlordTriggeredAbility ability = new DefiantBloodlordTriggeredAbility(); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public DefiantBloodlord(final DefiantBloodlord card) { + super(card); + } + + @Override + public DefiantBloodlord copy() { + return new DefiantBloodlord(this); + } +} + +class DefiantBloodlordTriggeredAbility extends TriggeredAbilityImpl { + + public DefiantBloodlordTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + public DefiantBloodlordTriggeredAbility(final DefiantBloodlordTriggeredAbility ability) { + super(ability); + } + + @Override + public DefiantBloodlordTriggeredAbility copy() { + return new DefiantBloodlordTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.controllerId)) { + this.getEffects().clear(); + this.addEffect(new LoseLifeTargetEffect(event.getAmount())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, target opponent loses that much life."; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java new file mode 100644 index 00000000000..c577d070c32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public DominatorDrone(UUID ownerId) { + super(ownerId, 92, "Dominator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) + this.addAbility(new IngestAbility()); + + // When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life. + TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT)); + this.addAbility(new ConditionalTriggeredAbility( + triggeredAbility, + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), + "When {this} enters the battlefield, if you control another colorless creature, each opponent loses 2 life.")); + + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java new file mode 100644 index 00000000000..75c5c88beaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class EldraziDevastator extends CardImpl { + + public EldraziDevastator(UUID ownerId) { + super(ownerId, 7, "Eldrazi Devastator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(8); + this.toughness = new MageInt(9); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public EldraziDevastator(final EldraziDevastator card) { + super(card); + } + + @Override + public EldraziDevastator copy() { + return new EldraziDevastator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java new file mode 100644 index 00000000000..c6afaf9d4c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +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.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author fireshoes + */ +public class FelidarCub extends CardImpl { + + public FelidarCub(UUID ownerId) { + super(ownerId, 25, "Felidar Cub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Cat"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sacrifice Felidar Cub: Destroy target enchantment. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + } + + public FelidarCub(final FelidarCub card) { + super(card); + } + + @Override + public FelidarCub copy() { + return new FelidarCub(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java new file mode 100644 index 00000000000..45bdcdabc95 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends mage.sets.zendikarvseldrazi.ForerunnerOfSlaughter { + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId); + this.cardNumber = 204; + this.expansionSetCode = "BFZ"; + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java new file mode 100644 index 00000000000..d62397e6e1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest1 extends mage.cards.basiclands.Forest { + + public Forest1(UUID ownerId) { + super(ownerId, 270); + this.expansionSetCode = "BFZ"; + } + + public Forest1(final Forest1 card) { + super(card); + } + + @Override + public Forest1 copy() { + return new Forest1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java new file mode 100644 index 00000000000..ec7f4c906a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest2 extends mage.cards.basiclands.Forest { + + public Forest2(UUID ownerId) { + super(ownerId, 271); + this.expansionSetCode = "BFZ"; + } + + public Forest2(final Forest2 card) { + super(card); + } + + @Override + public Forest2 copy() { + return new Forest2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java new file mode 100644 index 00000000000..951dce0ba38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest3 extends mage.cards.basiclands.Forest { + + public Forest3(UUID ownerId) { + super(ownerId, 272); + this.expansionSetCode = "BFZ"; + } + + public Forest3(final Forest3 card) { + super(card); + } + + @Override + public Forest3 copy() { + return new Forest3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java new file mode 100644 index 00000000000..647fe973505 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest4 extends mage.cards.basiclands.Forest { + + public Forest4(UUID ownerId) { + super(ownerId, 273); + this.expansionSetCode = "BFZ"; + } + + public Forest4(final Forest4 card) { + super(card); + } + + @Override + public Forest4 copy() { + return new Forest4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java new file mode 100644 index 00000000000..22ed1741346 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest5 extends mage.cards.basiclands.Forest { + + public Forest5(UUID ownerId) { + super(ownerId, 274); + this.expansionSetCode = "BFZ"; + } + + public Forest5(final Forest5 card) { + super(card); + } + + @Override + public Forest5 copy() { + return new Forest5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java new file mode 100644 index 00000000000..eb6e52d3e8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.command.Emblem; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class GideonAllyOfZendikar extends CardImpl { + + public GideonAllyOfZendikar(UUID ownerId) { + super(ownerId, 29, "Gideon, Ally of Zendikar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Gideon"); + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + + // +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); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability.addEffect(effect); + this.addAbility(ability); + + // 0: Put a 2/2 white Knight Ally creature token onto the battlefield. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new KnightAllyToken()), 0)); + + // -4: You get an emblem with "Creatures you control get +1/+1." + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GideonAllyOfZendikarEmblem()), -4)); + } + + public GideonAllyOfZendikar(final GideonAllyOfZendikar card) { + super(card); + } + + @Override + public GideonAllyOfZendikar copy() { + return new GideonAllyOfZendikar(this); + } +} + +class GideonAllyOfZendikarEmblem extends Emblem { + + public GideonAllyOfZendikarEmblem() { + this.setName("EMBLEM: Gideon, Ally of Zendikar"); + BoostControlledEffect effect = new BoostControlledEffect(1, 1, Duration.EndOfGame); + Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect); + this.getAbilities().add(ability); + } +} + +class GideonAllyOfZendikarToken extends Token { + + public GideonAllyOfZendikarToken() { + super("", "5/5 Human Soldier Ally creature with indestructible"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + subtype.add("Ally"); + power = new MageInt(5); + toughness = new MageInt(5); + + addAbility(IndestructibleAbility.getInstance()); + } +} + +class KnightAllyToken extends Token { + + public KnightAllyToken() { + super("Knight Ally", "2/2 white Knight Ally creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(2); + toughness = new MageInt(2); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java new file mode 100644 index 00000000000..c12411f150e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author fireshoes + */ +public class GideonsReproach extends CardImpl { + + public GideonsReproach(UUID ownerId) { + super(ownerId, 30, "Gideon's Reproach", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + + // Gideon's Reproach deals 4 damage to target attacking or blocking creature. + getSpellAbility().addEffect(new DamageTargetEffect(4)); + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } + + public GideonsReproach(final GideonsReproach card) { + super(card); + } + + @Override + public GideonsReproach copy() { + return new GideonsReproach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java index 82e06c9f910..d82f72d6ad5 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java @@ -31,11 +31,15 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; @@ -45,13 +49,14 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; /** * * @author fireshoes */ public class GuardianOfTazeem extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { @@ -67,7 +72,7 @@ public class GuardianOfTazeem extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Landfall - Whenever a land enters the battlefield under you control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step. Ability ability = new GuardianOfTazeemTriggeredAbility(); ability.addTarget(new TargetCreaturePermanent(filter)); @@ -87,7 +92,8 @@ public class GuardianOfTazeem extends CardImpl { class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { public GuardianOfTazeemTriggeredAbility() { - super(Zone.BATTLEFIELD, null, false); + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + addEffect(new GuardianOfTazeemEffect()); } public GuardianOfTazeemTriggeredAbility(final GuardianOfTazeemTriggeredAbility ability) { @@ -107,10 +113,13 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { - addEffect(new TapTargetEffect()); - if (permanent.hasSubtype("Island")) { - addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature")); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + for (Effect effect : getEffects()) { + if (effect instanceof GuardianOfTazeemEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } } return true; } @@ -119,6 +128,37 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Landfall - Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step."; + return "Landfall - Whenever a land enters the battlefield under your control, " + super.getRule(); + } +} + +class GuardianOfTazeemEffect extends OneShotEffect { + + public GuardianOfTazeemEffect() { + super(Outcome.Benefit); + this.staticText = "If that land is an Island, that creature doesn't untap during its controller's next untap step"; + } + + public GuardianOfTazeemEffect(final GuardianOfTazeemEffect effect) { + super(effect); + } + + @Override + public GuardianOfTazeemEffect copy() { + return new GuardianOfTazeemEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (land != null && targetCreature != null) { + if (land.hasSubtype("Island")) { + ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature"); + effect.setTargetPointer(new FixedTarget(targetCreature, game)); + game.addEffect(effect, source); + } + } + return true; } } diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java new file mode 100644 index 00000000000..460abc0d4e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.Mana; +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.DrawCardSourceControllerEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class HedronArchive extends CardImpl { + + public HedronArchive(UUID ownerId) { + super(ownerId, 223, "Hedron Archive", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "BFZ"; + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + + // {2}, {T}, Sacrifice Hedron Archive: Draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public HedronArchive(final HedronArchive card) { + super(card); + } + + @Override + public HedronArchive copy() { + return new HedronArchive(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java new file mode 100644 index 00000000000..c6e27dff96f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author fireshoes + */ +public class IncubatorDrone extends CardImpl { + + public IncubatorDrone(UUID ownerId) { + super(ownerId, 60, "Incubator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()))); + } + + public IncubatorDrone(final IncubatorDrone card) { + super(card); + } + + @Override + public IncubatorDrone copy() { + return new IncubatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java new file mode 100644 index 00000000000..d7c7643785a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island1 extends mage.cards.basiclands.Island { + + public Island1(UUID ownerId) { + super(ownerId, 255); + this.expansionSetCode = "BFZ"; + } + + public Island1(final Island1 card) { + super(card); + } + + @Override + public Island1 copy() { + return new Island1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java new file mode 100644 index 00000000000..191e7a9c944 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island2 extends mage.cards.basiclands.Island { + + public Island2(UUID ownerId) { + super(ownerId, 256); + this.expansionSetCode = "BFZ"; + } + + public Island2(final Island2 card) { + super(card); + } + + @Override + public Island2 copy() { + return new Island2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java new file mode 100644 index 00000000000..d097e0fe234 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island3 extends mage.cards.basiclands.Island { + + public Island3(UUID ownerId) { + super(ownerId, 257); + this.expansionSetCode = "BFZ"; + } + + public Island3(final Island3 card) { + super(card); + } + + @Override + public Island3 copy() { + return new Island3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java new file mode 100644 index 00000000000..7346a47f65e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island4 extends mage.cards.basiclands.Island { + + public Island4(UUID ownerId) { + super(ownerId, 258); + this.expansionSetCode = "BFZ"; + } + + public Island4(final Island4 card) { + super(card); + } + + @Override + public Island4 copy() { + return new Island4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java new file mode 100644 index 00000000000..508d1081cc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island5 extends mage.cards.basiclands.Island { + + public Island5(UUID ownerId) { + super(ownerId, 259); + this.expansionSetCode = "BFZ"; + } + + public Island5(final Island5 card) { + super(card); + } + + @Override + public Island5 copy() { + return new Island5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java new file mode 100644 index 00000000000..f2542a772a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class KozileksChanneler extends CardImpl { + + public KozileksChanneler(UUID ownerId) { + super(ownerId, 10, "Kozilek's Channeler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + } + + public KozileksChanneler(final KozileksChanneler card) { + super(card); + } + + @Override + public KozileksChanneler copy() { + return new KozileksChanneler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java new file mode 100644 index 00000000000..87ee253668f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MistIntruder extends CardImpl { + + public MistIntruder(UUID ownerId) { + super(ownerId, 61, "Mist Intruder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ingest + this.addAbility(new IngestAbility()); + } + + public MistIntruder(final MistIntruder card) { + super(card); + } + + @Override + public MistIntruder copy() { + return new MistIntruder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java new file mode 100644 index 00000000000..049c251e4c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain1 extends mage.cards.basiclands.Mountain { + + public Mountain1(UUID ownerId) { + super(ownerId, 265); + this.expansionSetCode = "BFZ"; + } + + public Mountain1(final Mountain1 card) { + super(card); + } + + @Override + public Mountain1 copy() { + return new Mountain1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java new file mode 100644 index 00000000000..adb01c46713 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain2 extends mage.cards.basiclands.Mountain { + + public Mountain2(UUID ownerId) { + super(ownerId, 266); + this.expansionSetCode = "BFZ"; + } + + public Mountain2(final Mountain2 card) { + super(card); + } + + @Override + public Mountain2 copy() { + return new Mountain2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java new file mode 100644 index 00000000000..38e5f5c4b61 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain3 extends mage.cards.basiclands.Mountain { + + public Mountain3(UUID ownerId) { + super(ownerId, 267); + this.expansionSetCode = "BFZ"; + } + + public Mountain3(final Mountain3 card) { + super(card); + } + + @Override + public Mountain3 copy() { + return new Mountain3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java new file mode 100644 index 00000000000..3d72ef0dbc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain4 extends mage.cards.basiclands.Mountain { + + public Mountain4(UUID ownerId) { + super(ownerId, 268); + this.expansionSetCode = "BFZ"; + } + + public Mountain4(final Mountain4 card) { + super(card); + } + + @Override + public Mountain4 copy() { + return new Mountain4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java new file mode 100644 index 00000000000..913411db522 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain5 extends mage.cards.basiclands.Mountain { + + public Mountain5(UUID ownerId) { + super(ownerId, 269); + this.expansionSetCode = "BFZ"; + } + + public Mountain5(final Mountain5 card) { + super(card); + } + + @Override + public Mountain5 copy() { + return new Mountain5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java new file mode 100644 index 00000000000..c1fd2e8648b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class NissasRenewal extends CardImpl { + + public NissasRenewal(UUID ownerId) { + super(ownerId, 180, "Nissa's Renewal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}"); + this.expansionSetCode = "BFZ"; + + // Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true)); + this.getSpellAbility().addEffect(new GainLifeEffect(7)); + } + + public NissasRenewal(final NissasRenewal card) { + super(card); + } + + @Override + public NissasRenewal copy() { + return new NissasRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java new file mode 100644 index 00000000000..cbfc4eefa5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class OmnathLocusOfRage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Elemental"); + + static { + filter.add(new SubtypePredicate("Elemental")); + } + + public OmnathLocusOfRage(UUID ownerId) { + super(ownerId, 217, "Omnath, Locus of Rage", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + this.addAbility(new LandfallAbility(new CreateTokenEffect(new OmnathElementalToken()), false)); + + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new DamageTargetEffect(3), false, filter); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public OmnathLocusOfRage(final OmnathLocusOfRage card) { + super(card); + } + + @Override + public OmnathLocusOfRage copy() { + return new OmnathLocusOfRage(this); + } +} + +class OmnathElementalToken extends Token { + + OmnathElementalToken() { + super("Elemental", "5/5 red and green Elemental creature token"); + setTokenType(1); + setOriginalExpansionSetCode("BFZ"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + + color.setRed(true); + color.setGreen(true); + power = new MageInt(5); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java new file mode 100644 index 00000000000..b3f7679d293 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class OranRiefHydra extends CardImpl { + + public OranRiefHydra(UUID ownerId) { + super(ownerId, 181, "Oran-Rief Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Hydra"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. + // If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead. + this.addAbility(new OranRiefHydraTriggeredAbility()); + } + + public OranRiefHydra(final OranRiefHydra card) { + super(card); + } + + @Override + public OranRiefHydra copy() { + return new OranRiefHydra(this); + } +} + +class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl { + + private static final String text = "Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. " + + "If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead."; + + public OranRiefHydraTriggeredAbility() { + super(Zone.BATTLEFIELD, new OranRiefHydraEffect()); + } + + public OranRiefHydraTriggeredAbility(final OranRiefHydraTriggeredAbility ability) { + super(ability); + } + + @Override + public OranRiefHydraTriggeredAbility copy() { + return new OranRiefHydraTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent != null) + for (Effect effect : getEffects()) { + if (effect instanceof OranRiefHydraEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return text; + } +} + +class OranRiefHydraEffect extends OneShotEffect { + + public OranRiefHydraEffect() { + super(Outcome.BoostCreature); + } + + public OranRiefHydraEffect(final OranRiefHydraEffect effect) { + super(effect); + } + + @Override + public OranRiefHydraEffect copy() { + return new OranRiefHydraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (land != null && sourcePermanent != null) { + if (land.hasSubtype("Forest")) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(2), game); + } else { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(), game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java new file mode 100644 index 00000000000..4b2a1798cf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains1 extends mage.cards.basiclands.Plains { + + public Plains1(UUID ownerId) { + super(ownerId, 250); + this.expansionSetCode = "BFZ"; + } + + public Plains1(final Plains1 card) { + super(card); + } + + @Override + public Plains1 copy() { + return new Plains1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java new file mode 100644 index 00000000000..d278d488fbd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains2 extends mage.cards.basiclands.Plains { + + public Plains2(UUID ownerId) { + super(ownerId, 251); + this.expansionSetCode = "BFZ"; + } + + public Plains2(final Plains2 card) { + super(card); + } + + @Override + public Plains2 copy() { + return new Plains2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java new file mode 100644 index 00000000000..93a2b32e206 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains3 extends mage.cards.basiclands.Plains { + + public Plains3(UUID ownerId) { + super(ownerId, 252); + this.expansionSetCode = "BFZ"; + } + + public Plains3(final Plains3 card) { + super(card); + } + + @Override + public Plains3 copy() { + return new Plains3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java new file mode 100644 index 00000000000..7c95ef89458 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains4 extends mage.cards.basiclands.Plains { + + public Plains4(UUID ownerId) { + super(ownerId, 253); + this.expansionSetCode = "BFZ"; + } + + public Plains4(final Plains4 card) { + super(card); + } + + @Override + public Plains4 copy() { + return new Plains4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java new file mode 100644 index 00000000000..df7ccc8563b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains5 extends mage.cards.basiclands.Plains { + + public Plains5(UUID ownerId) { + super(ownerId, 254); + this.expansionSetCode = "BFZ"; + } + + public Plains5(final Plains5 card) { + super(card); + } + + @Override + public Plains5 copy() { + return new Plains5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java new file mode 100644 index 00000000000..872fca6ef52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class PrairieStream extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public PrairieStream(UUID ownerId) { + super(ownerId, 241, "Prairie Stream", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Plains"); + this.subtype.add("Island"); + + // Prairie Stream enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } + + public PrairieStream(final PrairieStream card) { + super(card); + } + + @Override + public PrairieStream copy() { + return new PrairieStream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java new file mode 100644 index 00000000000..6aa51bd4f38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class RetreatToEmeria extends CardImpl { + + public RetreatToEmeria(UUID ownerId) { + super(ownerId, 44, "Retreat to Emeria", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + + // Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn. + LandfallAbility ability = new LandfallAbility(new CreateTokenEffect(new KorAllyToken()), false); + Mode mode = new Mode(); + mode.getEffects().add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToEmeria(final RetreatToEmeria card) { + super(card); + } + + @Override + public RetreatToEmeria copy() { + return new RetreatToEmeria(this); + } +} + +class KorAllyToken extends Token { + + public KorAllyToken() { + super("Kor Ally", "1/1 white Kor Ally creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Kor"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java index 9e6a22241c0..8d767821c63 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java @@ -37,7 +37,7 @@ public class RetreatToKazandu extends mage.sets.zendikarvseldrazi.RetreatToKazan public RetreatToKazandu(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 186; this.expansionSetCode = "BFZ"; } diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java new file mode 100644 index 00000000000..5201f9e3cea --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RollingThunder extends mage.sets.tempestremastered.RollingThunder { + + public RollingThunder(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "BFZ"; + } + + public RollingThunder(final RollingThunder card) { + super(card); + } + + @Override + public RollingThunder copy() { + return new RollingThunder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java new file mode 100644 index 00000000000..02439832d6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class Skitterskin extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("you control another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public Skitterskin(UUID ownerId) { + super(ownerId, 97, "Skitterskin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Skitterskin can't block. + this.addAbility(new CantBlockAbility()); + + // {1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new RegenerateSourceEffect(), + new ManaCostsImpl("{1}{B}"), + new PermanentsOnTheBattlefieldCondition(filter)); + this.addAbility(ability); + } + + public Skitterskin(final Skitterskin card) { + super(card); + } + + @Override + public Skitterskin copy() { + return new Skitterskin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java new file mode 100644 index 00000000000..cf49a37bcaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SmolderingMarsh extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SmolderingMarsh(UUID ownerId) { + super(ownerId, 247, "Smoldering Marsh", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Swamp"); + this.subtype.add("Mountain"); + + // Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + } + + public SmolderingMarsh(final SmolderingMarsh card) { + super(card); + } + + @Override + public SmolderingMarsh copy() { + return new SmolderingMarsh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java new file mode 100644 index 00000000000..6a585b8ca82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SunkenHollow extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SunkenHollow(UUID ownerId) { + super(ownerId, 248, "Sunken Hollow", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Island"); + this.subtype.add("Swamp"); + + // Sunken Hollow enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + } + + public SunkenHollow(final SunkenHollow card) { + super(card); + } + + @Override + public SunkenHollow copy() { + return new SunkenHollow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java new file mode 100644 index 00000000000..bea737b3749 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp1 extends mage.cards.basiclands.Swamp { + + public Swamp1(UUID ownerId) { + super(ownerId, 260); + this.expansionSetCode = "BFZ"; + } + + public Swamp1(final Swamp1 card) { + super(card); + } + + @Override + public Swamp1 copy() { + return new Swamp1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java new file mode 100644 index 00000000000..0436899d9cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp2 extends mage.cards.basiclands.Swamp { + + public Swamp2(UUID ownerId) { + super(ownerId, 261); + this.expansionSetCode = "BFZ"; + } + + public Swamp2(final Swamp2 card) { + super(card); + } + + @Override + public Swamp2 copy() { + return new Swamp2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java new file mode 100644 index 00000000000..4bceb8a424f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp3 extends mage.cards.basiclands.Swamp { + + public Swamp3(UUID ownerId) { + super(ownerId, 262); + this.expansionSetCode = "BFZ"; + } + + public Swamp3(final Swamp3 card) { + super(card); + } + + @Override + public Swamp3 copy() { + return new Swamp3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java new file mode 100644 index 00000000000..87bd2b49c77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp4 extends mage.cards.basiclands.Swamp { + + public Swamp4(UUID ownerId) { + super(ownerId, 263); + this.expansionSetCode = "BFZ"; + } + + public Swamp4(final Swamp4 card) { + super(card); + } + + @Override + public Swamp4 copy() { + return new Swamp4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java new file mode 100644 index 00000000000..b2ebc6e3935 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp5 extends mage.cards.basiclands.Swamp { + + public Swamp5(UUID ownerId) { + super(ownerId, 264); + this.expansionSetCode = "BFZ"; + } + + public Swamp5(final Swamp5 card) { + super(card); + } + + @Override + public Swamp5 copy() { + return new Swamp5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java new file mode 100644 index 00000000000..5b6d8c45eb9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java @@ -0,0 +1,191 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class UlamogTheCeaselessHunger extends CardImpl { + + public UlamogTheCeaselessHunger(UUID ownerId) { + super(ownerId, 15, "Ulamog, the Ceaseless Hunger", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{10}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // When you cast Ulamog, the Ceaseless Hunger, exile two target permanents. + this.addAbility(new UlamogExilePermanentsOnCastAbility()); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library. + Effect effect = new UlamogExileLibraryEffect(); + effect.setText("defending player exiles the top twenty cards of his or her library"); + this.addAbility(new UlamogAttackTriggeredAbility(effect)); + } + + public UlamogTheCeaselessHunger(final UlamogTheCeaselessHunger card) { + super(card); + } + + @Override + public UlamogTheCeaselessHunger copy() { + return new UlamogTheCeaselessHunger(this); + } +} + +class UlamogExilePermanentsOnCastAbility extends TriggeredAbilityImpl { + + UlamogExilePermanentsOnCastAbility() { + super(Zone.STACK, new ExileTargetEffect("exile two target permanents")); + this.addTarget(new TargetPermanent(2, new FilterPermanent())); + } + + UlamogExilePermanentsOnCastAbility(UlamogExilePermanentsOnCastAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); + } + + @Override + public UlamogExilePermanentsOnCastAbility copy() { + return new UlamogExilePermanentsOnCastAbility(this); + } + + @Override + public String getRule() { + return "When you cast {this}, " + super.getRule(); + } +} + +class UlamogAttackTriggeredAbility extends TriggeredAbilityImpl { + + public UlamogAttackTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public UlamogAttackTriggeredAbility(final UlamogAttackTriggeredAbility ability) { + super(ability); + } + + @Override + public UlamogAttackTriggeredAbility copy() { + return new UlamogAttackTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + if (sourcePermanent != null && event.getSourceId() == this.getSourceId()) { + UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); + return true; + } + return false; + } + + @Override + public String getRule() { + return new StringBuilder("Whenever {this} attacks, ").append(super.getRule()).toString(); + } +} + +class UlamogExileLibraryEffect extends OneShotEffect { + + public UlamogExileLibraryEffect() { + super(Outcome.Exile); + this.staticText = "defending player exiles the top twenty cards of his or her library"; + } + + public UlamogExileLibraryEffect(final UlamogExileLibraryEffect effect) { + super(effect); + } + + @Override + public UlamogExileLibraryEffect copy() { + return new UlamogExileLibraryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player defender = game.getPlayer(targetPointer.getFirst(game, source)); + if (defender != null) { + int count = Math.min(defender.getLibrary().size(), 20); + for (int i = 0; i < count; i++) { + Card card = defender.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToExile(null, null, source.getSourceId(), game); + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java index d3c4b53ea7f..e46455b6092 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java @@ -37,7 +37,7 @@ public class VeteranWarleader extends mage.sets.zendikarvseldrazi.VeteranWarlead public VeteranWarleader(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 221; this.expansionSetCode = "BFZ"; } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java index def4ee17b9a..d371e9adcc1 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java @@ -90,10 +90,11 @@ class AstralCornucopiaEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index ac0d7e7614c..d1a0b5dda3c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -28,14 +28,11 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ControlPermanentCost; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; @@ -43,6 +40,10 @@ import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -54,7 +55,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class BloodthirstyOgre extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control a Demon"); + static { filter.add(new SubtypePredicate("Demon")); } @@ -71,11 +73,13 @@ public class BloodthirstyOgre extends CardImpl { // {T}: Put a devotion counter on Bloodthirsty Ogre this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost())); + // {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon. DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersCount(CounterType.DEVOTION)); - Ability ability; - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true),new TapSourceCost()); - ability.addCost(new ControlPermanentCost(filter)); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(filter)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -87,6 +91,6 @@ public class BloodthirstyOgre extends CardImpl { @Override public BloodthirstyOgre copy() { return new BloodthirstyOgre(this); - } + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java index 56a0e0acb1b..1e2e16c7413 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java @@ -91,10 +91,11 @@ class OrochiHatcheryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {; - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java new file mode 100644 index 00000000000..6011ac418d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class HeidarRimewindMaster extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public HeidarRimewindMaster(UUID ownerId) { + super(ownerId, 36, "Heidar, Rimewind Master", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}, {tap}: Return target permanent to its owner's hand. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new ReturnToHandTargetEffect(), + new GenericManaCost(2), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public HeidarRimewindMaster(final HeidarRimewindMaster card) { + super(card); + } + + @Override + public HeidarRimewindMaster copy() { + return new HeidarRimewindMaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java new file mode 100644 index 00000000000..8bef2a6f1ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RimeTransfusion extends CardImpl { + + static final String rule = "and has \"{snow}: This creature can't be blocked this turn except by snow creatures.\""; + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by snow creatures until end of turn"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Snow"))); + } + + public RimeTransfusion(UUID ownerId) { + super(ownerId, 68, "Rime Transfusion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("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/+1 and has "{snow}: This creature can't be blocked this turn except by snow creatures." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.EndOfTurn))),new ManaCostsImpl("{snow}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public RimeTransfusion(final RimeTransfusion card) { + super(card); + } + + @Override + public RimeTransfusion copy() { + return new RimeTransfusion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java new file mode 100644 index 00000000000..41775a35a3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetActivatedAbility; + +/** + * + * @author fireshoes + */ +public class RimewindCryomancer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindCryomancer(UUID ownerId) { + super(ownerId, 43, "Rimewind Cryomancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {1}, {tap}: Counter target activated ability. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new CounterTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetActivatedAbility()); + this.addAbility(ability); + } + + public RimewindCryomancer(final RimewindCryomancer card) { + super(card); + } + + @Override + public RimewindCryomancer copy() { + return new RimewindCryomancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java new file mode 100644 index 00000000000..420ca2ecc6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class RimewindTaskmage extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindTaskmage(UUID ownerId) { + super(ownerId, 44, "Rimewind Taskmage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}, {tap}: You may tap or untap target permanent. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new MayTapOrUntapTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public RimewindTaskmage(final RimewindTaskmage card) { + super(card); + } + + @Override + public RimewindTaskmage copy() { + return new RimewindTaskmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java index 569209b09f5..766fb5bd628 100644 --- a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java +++ b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java @@ -29,23 +29,20 @@ package mage.sets.commander2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.GainLifeControllerTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; /** * @@ -65,11 +62,17 @@ public class OloroAgelessAscetic extends CardImpl { // At the beginning of your upkeep, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(2), TargetController.YOU, false)); + // Whenever you gain life, you may pay {1}. If you do, draw a card and each opponent loses 1 life. - this.addAbility(new GainLifeControllerTriggeredAbility(new DoIfCostPaid(new OloroAgelessAsceticEffect(), new GenericManaCost(1)),false)); + DoIfCostPaid effect = new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(1)); + Effect effectToAdd = new LoseLifeOpponentsEffect(1); + effectToAdd.setText("and each opponent loses 1 life"); + effect.addEffect(effectToAdd); + this.addAbility(new GainLifeControllerTriggeredAbility(effect, false)); + // At the beginning of your upkeep, if Oloro, Ageless Ascetic is in the command zone, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, - new GainLifeEffect(new StaticValue(2), "if Oloro, Ageless Ascetic is in the command zone, you gain 2 life"),TargetController.YOU, false)); + new GainLifeEffect(new StaticValue(2), "if {this} is in the command zone, you gain 2 life"), TargetController.YOU, false)); } public OloroAgelessAscetic(final OloroAgelessAscetic card) { @@ -81,27 +84,3 @@ public class OloroAgelessAscetic extends CardImpl { return new OloroAgelessAscetic(this); } } - -class OloroAgelessAsceticEffect extends OneShotEffect { - - public OloroAgelessAsceticEffect() { - super(Outcome.Benefit); - this.staticText = "draw a card and each opponent loses 1 life"; - } - - public OloroAgelessAsceticEffect(final OloroAgelessAsceticEffect effect) { - super(effect); - } - - @Override - public OloroAgelessAsceticEffect copy() { - return new OloroAgelessAsceticEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - new DrawCardSourceControllerEffect(1).apply(game, source); - new DamagePlayersEffect(1, TargetController.OPPONENT).apply(game, source); - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java index fe68627ce7a..89228518820 100644 --- a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java +++ b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java @@ -94,10 +94,11 @@ class LifebloodHydraComesIntoPlayEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java index 2996412edd2..a195c86159a 100644 --- a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java +++ b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java @@ -96,10 +96,11 @@ class ApocalypseHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { if (amount < 5) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); diff --git a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java index 9a249cfa5b3..97809e24314 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java +++ b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java @@ -100,9 +100,10 @@ class AcademyEliteEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards")); int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this); if (instantsAndSorceriesCount > 0) { diff --git a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java index 5195b3ef392..e583ec71adf 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java +++ b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; @@ -94,10 +95,11 @@ class GrenzoDungeonWardenEtBEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((Ability) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java index 0492eea1491..8a23b3a4427 100644 --- a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java +++ b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java @@ -27,20 +27,30 @@ */ package mage.sets.dissension; +import java.util.Set; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.ObjectColor; +import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterSpell; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -76,9 +86,7 @@ public class MomirVigSimicVisionary extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true)); // Whenever you cast a blue creature spell, reveal the top card of your library. If it's a creature card, put that card into your hand. - Effect effect2 = new RevealLibraryPutIntoHandEffect(1, new FilterCreatureCard(), false); - effect2.setText("reveal the top card of your library. If it's a creature card, put that card into your hand"); - this.addAbility(new SpellCastControllerTriggeredAbility(effect2, filter2, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new MomirVigSimicVisionaryEffect(), filter2, false)); } @@ -91,3 +99,44 @@ public class MomirVigSimicVisionary extends CardImpl { return new MomirVigSimicVisionary(this); } } + +class MomirVigSimicVisionaryEffect extends OneShotEffect { + + public MomirVigSimicVisionaryEffect() { + super(Outcome.DrawCard); + this.staticText = "reveal the top card of your library. If it's a creature card, put that card into your hand"; + } + + public MomirVigSimicVisionaryEffect(final MomirVigSimicVisionaryEffect effect) { + super(effect); + } + + @Override + public MomirVigSimicVisionaryEffect copy() { + return new MomirVigSimicVisionaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + CardsImpl cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 1)); + controller.revealCards(sourceObject.getIdName(), cards, game); + + Set cardsList = cards.getCards(game); + Cards cardsToHand = new CardsImpl(); + for (Card card : cardsList) { + if (card.getCardType().contains(CardType.CREATURE)) { + cardsToHand.add(card); + cards.remove(card); + } + } + controller.moveCards(cardsToHand, null, Zone.HAND, source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java index 294084fe22a..1ed4e842ea6 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; @@ -95,12 +96,11 @@ class SavageBornHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java index fc751e65248..55756cd3dbf 100644 --- a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java +++ b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java @@ -1,133 +1,133 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.elvesvsgoblins; - -import java.util.UUID; -import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DoIfCostPaid; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.common.FilterPermanentCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; - -/** - * - * @author LevelX2 - */ -public class SkirkDrillSergeant extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeant(UUID ownerId) { - super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "EVG"; - this.subtype.add("Goblin"); - - this.power = new MageInt(2); - this.toughness = new MageInt(1); - - // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. - this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); - - } - - public SkirkDrillSergeant(final SkirkDrillSergeant card) { - super(card); - } - - @Override - public SkirkDrillSergeant copy() { - return new SkirkDrillSergeant(this); - } -} - -class SkirkDrillSergeantEffect extends OneShotEffect { - - private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeantEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; - } - - public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { - super(effect); - } - - @Override - public SkirkDrillSergeantEffect copy() { - return new SkirkDrillSergeantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (player == null || sourceObject == null) { - return false; - } - - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards(sourceObject.getName(), cards, game); - - if (card != null) { - if (filter.match(card, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } else { - player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); - } - } - } - return true; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.elvesvsgoblins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SkirkDrillSergeant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeant(UUID ownerId) { + super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "EVG"; + this.subtype.add("Goblin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); + + } + + public SkirkDrillSergeant(final SkirkDrillSergeant card) { + super(card); + } + + @Override + public SkirkDrillSergeant copy() { + return new SkirkDrillSergeant(this); + } +} + +class SkirkDrillSergeantEffect extends OneShotEffect { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeantEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; + } + + public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { + super(effect); + } + + @Override + public SkirkDrillSergeantEffect copy() { + return new SkirkDrillSergeantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player == null || sourceObject == null) { + return false; + } + + if (player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards(sourceObject.getName(), cards, game); + + if (card != null) { + if (filter.match(card, game)) { + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + } else { + player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java index 19558dcc7f7..19190e1ec5a 100644 --- a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java +++ b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java @@ -28,11 +28,6 @@ package mage.sets.eventide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -42,6 +37,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -57,15 +56,19 @@ public class DivinityOfPride extends CardImpl { this.subtype.add("Spirit"); this.subtype.add("Avatar"); - this.power = new MageInt(4); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Lifelink this.addAbility(LifelinkAbility.getInstance()); + + // Divinity of Pride gets +4/+4 as long as you have 25 or more life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield), - new DivinityOfPrideCondition(), - "Divinity of Pride gets +4/+4 as long as you have 25 or more life"))); + new DivinityOfPrideCondition(), + "{this} gets +4/+4 as long as you have 25 or more life"))); } public DivinityOfPride(final DivinityOfPride card) { @@ -85,4 +88,4 @@ class DivinityOfPrideCondition implements Condition { Player player = game.getPlayer(source.getControllerId()); return player != null && player.getLife() >= 25; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/exodus/HighGround.java b/Mage.Sets/src/mage/sets/exodus/HighGround.java new file mode 100644 index 00000000000..7b5c3164f32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/HighGround.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HighGround extends CardImpl { + + public HighGround(UUID ownerId) { + super(ownerId, 7, "High Ground", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "EXO"; + + // Each creature you control can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureAllEffect(1, new FilterControlledCreaturePermanent("Each creature you control"), Duration.WhileOnBattlefield))); + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/MedicineBag.java b/Mage.Sets/src/mage/sets/exodus/MedicineBag.java new file mode 100644 index 00000000000..c17bd95ef57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/MedicineBag.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MedicineBag extends CardImpl { + + public MedicineBag(UUID ownerId) { + super(ownerId, 133, "Medicine Bag", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "EXO"; + + // {1}, {tap}, Discard a card: Regenerate target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MedicineBag(final MedicineBag card) { + super(card); + } + + @Override + public MedicineBag copy() { + return new MedicineBag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/RecklessOgre.java b/Mage.Sets/src/mage/sets/exodus/RecklessOgre.java new file mode 100644 index 00000000000..b6c3cd8bef4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/RecklessOgre.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RecklessOgre extends CardImpl { + + public RecklessOgre(UUID ownerId) { + super(ownerId, 98, "Reckless Ogre", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Reckless Ogre attacks alone, it gets +3/+0 until end of turn. + this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(3, 0, Duration.EndOfTurn))); + } + + public RecklessOgre(final RecklessOgre card) { + super(card); + } + + @Override + public RecklessOgre copy() { + return new RecklessOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java b/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java new file mode 100644 index 00000000000..718847d5734 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class SkyshroudElite extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SkyshroudElite(UUID ownerId) { + super(ownerId, 123, "Skyshroud Elite", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Elf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Skyshroud Elite gets +1/+2 as long as an opponent controls a nonbasic land. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0, false), + "{this} gets +1/+2 as long as an opponent controls a nonbasic land"))); + } + + public SkyshroudElite(final SkyshroudElite card) { + super(card); + } + + @Override + public SkyshroudElite copy() { + return new SkyshroudElite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java index d2b497ee17d..46fd1e1e28f 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java +++ b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java @@ -46,7 +46,8 @@ public class Sandblast extends CardImpl { // Sandblast deals 5 damage to target attacking or blocking creature. getSpellAbility().addEffect(new DamageTargetEffect(5)); - getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); } + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } public Sandblast(final Sandblast card) { super(card); diff --git a/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java new file mode 100644 index 00000000000..06e21410275 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "5ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Feedback.java b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java new file mode 100644 index 00000000000..7b730ff3174 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "5ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Heal.java b/Mage.Sets/src/mage/sets/fifthedition/Heal.java index fd8451be21e..36445dd90be 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Heal.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Heal.java @@ -37,7 +37,7 @@ public class Heal extends mage.sets.iceage.Heal { public Heal(UUID ownerId) { super(ownerId); - this.cardNumber = 309; + this.cardNumber = 308; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java new file mode 100644 index 00000000000..ed72daee11f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 56; + this.expansionSetCode = "5ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java new file mode 100644 index 00000000000..206e8abeec2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "5ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java new file mode 100644 index 00000000000..27207beb936 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends CardImpl { + + public WarpArtifact(UUID ownerId) { + super(ownerId, 66, "Warp Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant artifact + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted artifact's controller, Warp Artifact deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java index bcc08cf0532..c056c1ec218 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java +++ b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java @@ -27,10 +27,11 @@ */ package mage.sets.fifthedition; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -49,7 +50,6 @@ public class WindsOfChange extends CardImpl { super(ownerId, 275, "Winds of Change", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "5ED"; - // Each player shuffles the cards from his or her hand into his or her library, then draws that many cards. this.getSpellAbility().addEffect(new WindsOfChangeEffect()); } @@ -84,19 +84,19 @@ class WindsOfChangeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Map permanentsCount = new HashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - int cardsHand = player.getHand().size(); - if (cardsHand > 0){ - for (Card card: player.getHand().getCards(game)) { - player.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - game.informPlayers(player.getLogName() + " shuffles the cards from his or her hand into his or her library"); - player.shuffleLibrary(game); - player.drawCards(cardsHand, game); - } + permanentsCount.put(playerId, player.getHand().size()); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.shuffleLibrary(game); + } + } + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null && permanentsCount.containsKey(playerId)) { + player.drawCards(permanentsCount.get(playerId), game); } } return true; diff --git a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java index 081b3a0bbfd..c05d454aa17 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java +++ b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class Blessing extends CardImpl { public Blessing(UUID ownerId) { - super(ownerId, 1, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); + super(ownerId, 259, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); this.expansionSetCode = "4ED"; this.subtype.add("Aura"); diff --git a/Mage.Sets/src/mage/sets/fourthedition/Conversion.java b/Mage.Sets/src/mage/sets/fourthedition/Conversion.java new file mode 100644 index 00000000000..856dc943dfb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "4ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java new file mode 100644 index 00000000000..85d57bd54d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "4ED"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java new file mode 100644 index 00000000000..0ae7aa71922 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class CursedLand extends CardImpl { + + public CursedLand(UUID ownerId) { + super(ownerId, 11, "Cursed Land", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted land's controller, Cursed Land deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Feedback.java b/Mage.Sets/src/mage/sets/fourthedition/Feedback.java new file mode 100644 index 00000000000..937483999ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "4ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java new file mode 100644 index 00000000000..3d2619efd74 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "4ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java new file mode 100644 index 00000000000..8f940308276 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 169; + this.expansionSetCode = "4ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java new file mode 100644 index 00000000000..7cac4f6ce78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "4ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java index d6ee678b76b..f8add1d6b61 100644 --- a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java +++ b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java @@ -28,6 +28,12 @@ package mage.sets.futuresight; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,12 +41,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.mana.RedManaAbility; -import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -53,6 +53,12 @@ import mage.game.permanent.Permanent; */ public class MagusOfTheMoon extends CardImpl { + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + public MagusOfTheMoon(UUID ownerId) { super(ownerId, 101, "Magus of the Moon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "FUT"; @@ -74,53 +80,49 @@ public class MagusOfTheMoon extends CardImpl { public MagusOfTheMoon copy() { return new MagusOfTheMoon(this); } -} -class MagusOfTheMoonEffect extends ContinuousEffectImpl { + class MagusOfTheMoonEffect extends ContinuousEffectImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.add(Predicates.not(new SupertypePredicate("Basic"))); - } - - MagusOfTheMoonEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - this.staticText = "Nonbasic lands are Mountains"; - } - - MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public MagusOfTheMoonEffect copy() { - return new MagusOfTheMoonEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - land.removeAllAbilities(source.getSourceId(), game); - land.addAbility(new RedManaAbility(), source.getSourceId(), game); - break; - case TypeChangingEffects_4: - land.getSubtype().clear(); - land.getSubtype().add("Mountain"); - break; - } + MagusOfTheMoonEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "Nonbasic lands are Mountains"; + } + + MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public MagusOfTheMoonEffect copy() { + return new MagusOfTheMoonEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new RedManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Mountain"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } - return true; } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; - } } diff --git a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java index a5c250207e9..75026f82f29 100644 --- a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java +++ b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java @@ -28,20 +28,21 @@ package mage.sets.futuresight; import java.util.UUID; - +import mage.Mana; import mage.abilities.Ability; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.CostImpl; -import mage.abilities.mana.BlueManaAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.ActivateIfConditionManaAbility; import mage.abilities.mana.ColorlessManaAbility; -import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; /** @@ -50,14 +51,12 @@ import mage.game.Game; */ public class NimbusMaze extends CardImpl { - private static final FilterPermanent controlIsland = new FilterPermanent("you control an Island"); - private static final FilterPermanent controlPlains = new FilterPermanent("you control a Plains"); + private static final FilterControlledPermanent controlIsland = new FilterControlledPermanent("you control an Island"); + private static final FilterControlledPermanent controlPlains = new FilterControlledPermanent("you control a Plains"); + static { controlIsland.add(new SubtypePredicate("Island")); - controlIsland.add(new ControllerPredicate(TargetController.YOU)); - controlPlains.add(new SubtypePredicate("Plains")); - controlPlains.add(new ControllerPredicate(TargetController.YOU)); } public NimbusMaze(UUID ownerId) { @@ -67,13 +66,17 @@ public class NimbusMaze extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}: Add {W} to your mana pool. Activate this ability only if you control an Island. - Ability addW = new WhiteManaAbility(); - addW.addCost(new FilterPermanentCost(controlIsland)); - this.addAbility(addW); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.WhiteMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlIsland))); // {tap}: Add {U} to your mana pool. Activate this ability only if you control a Plains. - Ability addU = new BlueManaAbility(); - addU.addCost(new FilterPermanentCost(controlPlains)); - this.addAbility(addU); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.BlueMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlPlains))); } public NimbusMaze(final NimbusMaze card) { diff --git a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java index 4e35a0f736c..dd701feb7e7 100644 --- a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java +++ b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java @@ -72,59 +72,59 @@ public class YixlidJailer extends CardImpl { public YixlidJailer copy() { return new YixlidJailer(this); } -} -class YixlidJailerEffect extends ContinuousEffectImpl { + class YixlidJailerEffect extends ContinuousEffectImpl { - YixlidJailerEffect() { - super(Duration.WhileOnBattlefield, Outcome.LoseAbility); - staticText = "Cards in graveyards lose all abilities."; - } + YixlidJailerEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseAbility); + staticText = "Cards in graveyards lose all abilities."; + } - YixlidJailerEffect(final YixlidJailerEffect effect) { - super(effect); - } + YixlidJailerEffect(final YixlidJailerEffect effect) { + super(effect); + } - @Override - public YixlidJailerEffect copy() { - return new YixlidJailerEffect(this); - } + @Override + public YixlidJailerEffect copy() { + return new YixlidJailerEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (layer == Layer.AbilityAddingRemovingEffects_6) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (UUID playerId : controller.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Card card : player.getGraveyard().getCards(game)) { - if (card != null) { - card.getAbilities(game).clear(); // Will the abilities ever come back???? - // TODO: Fix that (LevelX2) - // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); - // game.getState().resetTriggersForSourceId(card.getId()); - Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); - if (abilities != null) { - abilities.clear(); + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (layer == Layer.AbilityAddingRemovingEffects_6) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card != null) { + card.getAbilities(game).clear(); // Will the abilities ever come back???? + // TODO: Fix that (LevelX2) + // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); + // game.getState().resetTriggersForSourceId(card.getId()); + Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); + if (abilities != null) { + abilities.clear(); + } } } } } + return true; } - return true; } + return false; } - return false; - } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } } diff --git a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java index b97e56ead71..21565e11e57 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java @@ -73,20 +73,20 @@ public class DiluvianPrimordial extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Diluvian Primordial enters the battlefield, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a card cast this way would be put into a graveyard this turn, exile it instead. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(),false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(), false)); } @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof EntersBattlefieldTriggeredAbility) { ability.getTargets().clear(); - for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + for (UUID opponentId : game.getOpponents(ability.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { FilterCard filter = new FilterCard("instant or sorcery card from " + opponent.getLogName() + "'s graveyard"); filter.add(new OwnerIdPredicate(opponentId)); - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT),new CardTypePredicate(CardType.SORCERY))); - TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0,1, filter); + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); + TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0, 1, filter); ability.addTarget(target); } } @@ -123,17 +123,16 @@ class DiluvianPrimordialEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Target target: source.getTargets()) { + for (Target target : source.getTargets()) { if (target instanceof TargetCardInOpponentsGraveyard) { Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() +"?", source, game)) { - // TODO: Handle the case if the cast is not possible, so the replacement effect shouldn't be active - ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); - effect.setTargetPointer(new FixedTarget(targetCard.getId())); - game.addEffect(effect, source); - - controller.cast(targetCard.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) { + if (controller.cast(targetCard.getSpellAbility(), game, true)) { + ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); + effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId()))); + game.addEffect(effect, source); + } } } } @@ -169,7 +168,7 @@ class DiluvianPrimordialReplacementEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Card card = game.getCard(((FixedTarget)getTargetPointer()).getTarget()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { controller.moveCards(card, Zone.STACK, Zone.EXILED, source, game); return true; diff --git a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java index a47c15bc88a..e7dbf68a9cb 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java +++ b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java @@ -87,10 +87,11 @@ class NimbusSwimmerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java new file mode 100644 index 00000000000..9a721589270 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class LegionsOfLimDul extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow swamp"); + + static { + filter.add(new SupertypePredicate("Snow")); + filter.add(new SubtypePredicate("Swamp")); + } + + public LegionsOfLimDul(UUID ownerId) { + super(ownerId, 30, "Legions of Lim-Dul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Snow swampwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public LegionsOfLimDul(final LegionsOfLimDul card) { + super(card); + } + + @Override + public LegionsOfLimDul copy() { + return new LegionsOfLimDul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java new file mode 100644 index 00000000000..50e2a856a49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +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; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends CardImpl { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId, 375, "Merieke Ri Berit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}"); + this.expansionSetCode = "ICE"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Merieke Ri Berit doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // {tap}: Gain control of target creature for as long as you control Merieke Ri Berit. When Merieke Ri Berit leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated. + ConditionalContinuousEffect MeriekeRiBeritGainControlEffect = new ConditionalContinuousEffect( + new GainControlTargetEffect(Duration.Custom), + new SourceOnBattlefieldControlUnchangedCondition(), + "Gain control of target creature for as long as you control {this}"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, MeriekeRiBeritGainControlEffect, new TapSourceCost()); + ability.addTarget(new TargetPermanent(new FilterCreaturePermanent("target creature"))); + ability.addEffect(new MeriekeRiBeritCreateDelayedTriggerEffect()); + this.addAbility(ability); + + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} + +class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect { + + public MeriekeRiBeritCreateDelayedTriggerEffect() { + super(Outcome.Detriment); + this.staticText = "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } + + public MeriekeRiBeritCreateDelayedTriggerEffect(final MeriekeRiBeritCreateDelayedTriggerEffect effect) { + super(effect); + } + + @Override + public MeriekeRiBeritCreateDelayedTriggerEffect copy() { + return new MeriekeRiBeritCreateDelayedTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent controlledCreature = game.getPermanent(source.getFirstTarget()); + if (controlledCreature != null) { + DelayedTriggeredAbility delayedAbility = new MeriekeRiBeritDelayedTriggeredAbility(); + delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature.getId())); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + delayedAbility.init(game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } +} + +class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility { + + MeriekeRiBeritDelayedTriggeredAbility() { + super(new DestroyTargetEffect(true), Duration.EndOfGame, true); + } + + MeriekeRiBeritDelayedTriggeredAbility(MeriekeRiBeritDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE + || event.getType() == EventType.UNTAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId() != null) { + if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) + && event.getTargetId().equals(getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.getFromZone().equals(Zone.BATTLEFIELD); + } + } + return GameEvent.EventType.UNTAPPED.equals(event.getType()) + && event.getTargetId() != null && event.getTargetId().equals(getSourceId()); + } + + @Override + public MeriekeRiBeritDelayedTriggeredAbility copy() { + return new MeriekeRiBeritDelayedTriggeredAbility(this); + } + + @Override + public String getRule() { + return "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java new file mode 100644 index 00000000000..198a9ccadbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends CardImpl { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId, 111, "Zuran Spellcaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {T}: Zuran Spellcaster deals 1 damage to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index 94a3961d9d5..90391f49bf5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -1,131 +1,106 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.innistrad; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.TransformSourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.TransformAbility; -import mage.cards.CardImpl; -import mage.constants.ColoredManaSymbol; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.token.Token; - -/** - * - * @author Loki - */ -public class BloodlineKeeper extends CardImpl { - - public BloodlineKeeper(UUID ownerId) { - super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Vampire"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - this.canTransform = true; - this.secondSideCard = new LordOfLineage(ownerId); - - this.addAbility(FlyingAbility.getInstance()); - // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); - // {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires. - this.addAbility(new TransformAbility()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ColoredManaCost(ColoredManaSymbol.B)); - ability.addCost(new ControlFiveVampiresCost()); - this.addAbility(ability); - } - - public BloodlineKeeper(final BloodlineKeeper card) { - super(card); - } - - @Override - public BloodlineKeeper copy() { - return new BloodlineKeeper(this); - } -} - -class VampireToken extends Token { - VampireToken() { - super("Vampire", "a 2/2 black Vampire creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Vampire"); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(FlyingAbility.getInstance()); - } -} - -class ControlFiveVampiresCost extends CostImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - - static { - filter.add(new SubtypePredicate("Vampire")); - } - - public ControlFiveVampiresCost() { - this.text = "Activate this ability only if you control five or more Vampires"; - } - - public ControlFiveVampiresCost(final ControlFiveVampiresCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 5, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlFiveVampiresCost copy() { - return new ControlFiveVampiresCost(this); - } -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.innistrad; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author Loki + */ +public class BloodlineKeeper extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control five or more Vampires"); + + static { + filter.add(new SubtypePredicate("Vampire")); + } + + public BloodlineKeeper(UUID ownerId) { + super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Vampire"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + this.canTransform = true; + this.secondSideCard = new LordOfLineage(ownerId); + + this.addAbility(FlyingAbility.getInstance()); + // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); + // {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires. + this.addAbility(new TransformAbility()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new TransformSourceEffect(true), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 4)); + this.addAbility(ability); + } + + public BloodlineKeeper(final BloodlineKeeper card) { + super(card); + } + + @Override + public BloodlineKeeper copy() { + return new BloodlineKeeper(this); + } +} + +class VampireToken extends Token { + VampireToken() { + super("Vampire", "a 2/2 black Vampire creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Vampire"); + power = new MageInt(2); + toughness = new MageInt(2); + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java index b2e510508ab..c87a6c44bc4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java +++ b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java @@ -110,10 +110,11 @@ class MikaeusTheLunarchEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/invasion/RogueKavu.java b/Mage.Sets/src/mage/sets/invasion/RogueKavu.java new file mode 100644 index 00000000000..4d428a0844c --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RogueKavu.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends mage.sets.ninthedition.RogueKavu { + + public RogueKavu(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "INV"; + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java index ae267ccc250..ac166275b31 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java @@ -94,10 +94,11 @@ class BribersPurseEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(new Counter("gem", amount), game); } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java index 701624c57fd..9f577aba4dc 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java @@ -111,10 +111,11 @@ class HoodedHydraEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/legends/CosmicHorror.java b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java new file mode 100644 index 00000000000..0f0e6273f24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends CardImpl { + + public CosmicHorror(UUID ownerId) { + super(ownerId, 6, "Cosmic Horror", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Horror"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // At the beginning of your upkeep, destroy Cosmic Horror unless you pay {3}{B}{B}{B}. If Cosmic Horror is destroyed this way, it deals 7 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CosmicHorrorEffect(new ManaCostsImpl("{3}{B}{B}{B}")), TargetController.YOU, false)); + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} + +class CosmicHorrorEffect extends OneShotEffect { + + protected Cost cost; + + public CosmicHorrorEffect(Cost cost) { + super(Outcome.DestroyPermanent); + this.cost = cost; + staticText = "destroy {this} unless you pay {3}{B}{B}{B}. If {this} is destroyed this way it deals 7 damage to you"; + } + + public CosmicHorrorEffect(final CosmicHorrorEffect effect) { + super(effect); + this.cost = effect.cost.copy(); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && cosmicHorror != null) { + StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { + sb.insert(0, "Pay "); + } + if (controller.chooseUse(Outcome.Benefit, sb.toString(), source, game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + return true; + } + } + if (cosmicHorror.destroy(source.getSourceId(), game, false)) { + controller.damage(7, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public CosmicHorrorEffect copy() { + return new CosmicHorrorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java new file mode 100644 index 00000000000..6eca10aafc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +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.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class HyperionBlacksmith extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public HyperionBlacksmith(UUID ownerId) { + super(ownerId, 150, "Hyperion Blacksmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Human"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: You may tap or untap target artifact an opponent controls. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent(filter)); + this.addAbility(ability); + } + + public HyperionBlacksmith(final HyperionBlacksmith card) { + super(card); + } + + @Override + public HyperionBlacksmith copy() { + return new HyperionBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java new file mode 100644 index 00000000000..fcb7c843371 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java @@ -0,0 +1,148 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.AbilityAddingRemovingEffects_6; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.sets.futuresight.MagusOfTheMoon; + +/** + * + * @author LevelX2 + */ +public class Conversion extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountains"); + + public Conversion(UUID ownerId) { + super(ownerId, 199, "Conversion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "LEA"; + + // At the beginning of your upkeep, sacrifice Conversion unless you pay {W}{W}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{W}{W}")), TargetController.YOU, false)); + + // All Mountains are Plains. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConversionEffect())); + + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } + + class ConversionEffect extends ContinuousEffectImpl { + + ConversionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "All Mountains are Plains"; + } + + ConversionEffect(final ConversionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public ConversionEffect copy() { + return new ConversionEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Plains"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/286046-conversion-magus-of-the-moon + if (MagusOfTheMoon.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } + + } + +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java new file mode 100644 index 00000000000..d6e94cef77c --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEA"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java new file mode 100644 index 00000000000..083eb5edfaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class Feedback extends CardImpl { + + public Feedback(UUID ownerId) { + super(ownerId, 58, "Feedback", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "LEA"; + this.subtype.add("Aura"); + + // Enchant enchantment + TargetPermanent auraTarget = new TargetEnchantmentPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted enchantment's controller, Feedback deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java new file mode 100644 index 00000000000..678d76f7bc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEA"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..827c9c8a62d --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "LEA"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java new file mode 100644 index 00000000000..af28ac5b006 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEA"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java new file mode 100644 index 00000000000..0945cecfaa0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEA"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java new file mode 100644 index 00000000000..758a2d582b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEA"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java new file mode 100644 index 00000000000..ea00db87fc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "LEB"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java new file mode 100644 index 00000000000..69f25a35977 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEB"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java new file mode 100644 index 00000000000..61edab0c87a --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "LEB"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java new file mode 100644 index 00000000000..e218a2307dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEB"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..721a37aa934 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 181; + this.expansionSetCode = "LEB"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java new file mode 100644 index 00000000000..774d3949b69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEB"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java new file mode 100644 index 00000000000..037a3591fcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEB"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java new file mode 100644 index 00000000000..50673ecf58e --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEB"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index 3d0c31b8d20..1e626c76a5d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -1,37 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.magic2010; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; @@ -40,6 +38,10 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -51,10 +53,6 @@ import mage.game.permanent.token.WolfToken; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -72,7 +70,10 @@ public class MasterOfTheWildHunt extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); + // At the beginning of your upkeep, put a 2/2 green Wolf creature token onto the battlefield. this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(wolfToken))); + + // {T}: Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterOfTheWildHuntEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -116,7 +117,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { List wolves = new ArrayList<>(); Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { permanent.tap(game); target.damage(permanent.getToughness().getValue(), permanent.getId(), game, false, true); wolves.add(permanent.getId()); @@ -128,4 +129,4 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index 29285cf79c8..e84b732672a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -102,10 +102,11 @@ public class ProteanHydra extends CardImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java index ef4217d5967..3fac6066e28 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java +++ b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java @@ -27,25 +27,25 @@ */ package mage.sets.magic2010; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; +import java.util.LinkedHashSet; import java.util.Map; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.players.PlayerList; /** * @@ -57,7 +57,6 @@ public class WarpWorld extends CardImpl { super(ownerId, 163, "Warp World", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}{R}"); this.expansionSetCode = "M10"; - // Each player shuffles all permanents he or she owns into his or her library, then reveals that many cards from the top of his or her library. Each player puts all artifact, creature, and land cards revealed this way onto the battlefield, then does the same for enchantment cards, then puts all cards revealed this way that weren't put onto the battlefield on the bottom of his or her library. this.getSpellAbility().addEffect(new WarpWorldEffect()); } @@ -90,105 +89,99 @@ class WarpWorldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Map> permanentsOwned = new HashMap<>(); - + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject == null) { + return false; + } + Map> permanentsOwned = new HashMap<>(); Collection permanents = game.getBattlefield().getAllPermanents(); for (Permanent permanent : permanents) { - List list = permanentsOwned.get(permanent.getOwnerId()); - if (list == null) { - list = new ArrayList<>(); + Set set = permanentsOwned.get(permanent.getOwnerId()); + if (set == null) { + set = new LinkedHashSet<>(); } - list.add(permanent); - permanentsOwned.put(permanent.getOwnerId(), list); + set.add(permanent); + permanentsOwned.put(permanent.getOwnerId(), set); } // shuffle permanents into owner's library Map permanentsCount = new HashMap<>(); - PlayerList playerList = game.getPlayerList(); - playerList.setCurrent(game.getActivePlayerId()); - Player player = game.getPlayer(game.getActivePlayerId()); - do { - List list = permanentsOwned.remove(player.getId()); - Integer count = 0; - if (list != null) { - count = list.size(); - for (Permanent permanent : list) { - permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set set = permanentsOwned.remove(playerId); + Integer count = 0; + if (set != null) { + count = set.size(); + player.moveCards(set, Zone.BATTLEFIELD, Zone.LIBRARY, source, game); } + + if (count > 0) { + player.shuffleLibrary(game); + } + permanentsCount.put(playerId, count); } + } - if (count > 0) { - player.shuffleLibrary(game); - } - - permanentsCount.put(player.getId(), count); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or later put into play Map cardsRevealed = new HashMap<>(); // draw cards and reveal them - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); - CardsImpl cards = new CardsImpl(); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); + CardsImpl cards = new CardsImpl(); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + } } + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cards, game); + cardsRevealed.put(player.getId(), cards); } - player.revealCards("Warp World " + player.getName(), cards, game); - - cardsRevealed.put(player.getId(), cards); - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put artifacts, creaturs and lands onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && (card.getCardType().contains(CardType.ARTIFACT) - || card.getCardType().contains(CardType.CREATURE) - || card.getCardType().contains(CardType.LAND))) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && (card.getCardType().contains(CardType.ARTIFACT) + || card.getCardType().contains(CardType.CREATURE) + || card.getCardType().contains(CardType.LAND))) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put enchantments onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put the rest of the cards on buttom of the library - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - player.putCardsOnBottomOfLibrary(cards, game, source, false); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + player.putCardsOnBottomOfLibrary(cards, game, source, false); + } + } return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java index 420d7def57d..76a4fe38a78 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java +++ b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java @@ -98,10 +98,11 @@ class PrimordialHydraEntersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java index a6f7b79e94e..ef64887d860 100644 --- a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java +++ b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java @@ -29,7 +29,7 @@ package mage.sets.magic2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.AttacksAloneTriggeredAbility; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.FlyingAbility; @@ -37,12 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterControlledCreaturePermanent; /** * @@ -64,7 +59,8 @@ public class NefaroxOverlordOfGrixis extends CardImpl { // Exalted this.addAbility(new ExaltedAbility()); // Whenever Nefarox, Overlord of Grixis attacks alone, defending player sacrifices a creature. - this.addAbility(new NefaroxOverlordOfGrixisTriggeredAbility()); + this.addAbility(new AttacksAloneTriggeredAbility(new SacrificeEffect( + new FilterControlledCreaturePermanent("a creature"), 1, "defending player"))); } public NefaroxOverlordOfGrixis(final NefaroxOverlordOfGrixis card) { @@ -76,52 +72,3 @@ public class NefaroxOverlordOfGrixis extends CardImpl { return new NefaroxOverlordOfGrixis(this); } } - -class NefaroxOverlordOfGrixisTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterControlledPermanent filter; - - static { - filter = new FilterControlledPermanent(" a creature"); - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - - public NefaroxOverlordOfGrixisTriggeredAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, "defending player")); - } - - public NefaroxOverlordOfGrixisTriggeredAbility(final NefaroxOverlordOfGrixisTriggeredAbility ability) { - super(ability); - } - - @Override - public NefaroxOverlordOfGrixisTriggeredAbility copy() { - return new NefaroxOverlordOfGrixisTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DECLARED_ATTACKERS; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId) ) { - UUID nefarox = this.getSourceId(); - if (nefarox != null) { - if (game.getCombat().attacksAlone() && nefarox == game.getCombat().getAttackers().get(0)) { - UUID defender = game.getCombat().getDefenderId(nefarox); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); - return true; - } - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} attacks alone, defending player sacrifices a creature."; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java index 1face405913..128e2d989fd 100644 --- a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java +++ b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java @@ -102,10 +102,11 @@ class VastwoodHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java index 39a891f9009..af7a92c7e13 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java +++ b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java @@ -101,10 +101,10 @@ class GenesisHydraEntersBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - SpellAbility spellAbility = (SpellAbility) obj; + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java index d13a3b9fcf0..6ad3180ae6c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java @@ -48,7 +48,7 @@ import mage.game.permanent.token.ElfToken; * @author fireshoes */ public class DwynensElite extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another Elf"); static { @@ -69,7 +69,7 @@ public class DwynensElite extends CardImpl { this.addAbility(new ConditionalTriggeredAbility( triggeredAbility, new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), - "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield")); + "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield.")); } public DwynensElite(final DwynensElite card) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java index f438ef8f52f..0b0a72bf055 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java @@ -101,10 +101,11 @@ class HangarbackWalkerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java index 68e4320e8b6..c3abacd4394 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java @@ -57,7 +57,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.SupertypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.target.common.TargetCardInYourGraveyard; @@ -84,7 +83,6 @@ public class LilianaDefiantNecromancer extends CardImpl { this.color.setBlack(true); this.nightCard = true; - // this.canTransform = true; this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); @@ -97,7 +95,7 @@ public class LilianaDefiantNecromancer extends CardImpl { ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); - //-8: 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."; + //-8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."; this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new LilianaDefiantNecromancerEmblem()), -8)); } @@ -130,11 +128,7 @@ public class LilianaDefiantNecromancer extends CardImpl { class LilianaDefiantNecromancerEmblem extends Emblem { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); // 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." public LilianaDefiantNecromancerEmblem() { diff --git a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java index 3f67be9e03c..ea83725bd99 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java +++ b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java @@ -45,13 +45,13 @@ import mage.filter.predicate.mageobject.AbilityPredicate; * @author LevelX2 */ public class SeismicElemental extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures without flying"); static { filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); } - + public SeismicElemental(UUID ownerId) { super(ownerId, 161, "Seismic Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.expansionSetCode = "ORI"; diff --git a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java index 93e61a08d9e..c6fc391ddf2 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java @@ -117,10 +117,12 @@ class TheGreatAuroraEffect extends OneShotEffect { for (Permanent permanent : list) { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); } - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } } + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or put into play + // Draw cards for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..ed540f33231 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "MED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java new file mode 100644 index 00000000000..06e9dbc2523 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 137; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java new file mode 100644 index 00000000000..e72554ff411 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends mage.sets.portalsecondage.AngelOfFury { + + public AngelOfFury(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "ME2"; + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java new file mode 100644 index 00000000000..6bf9aeb6bfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DamageAsThoughNotBlockedAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolfPack extends CardImpl { + + public WolfPack(UUID ownerId) { + super(ownerId, 187, "Wolf Pack", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Wolf"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // You may have Wolf Pack assign its combat damage as though it weren't blocked. + this.addAbility(DamageAsThoughNotBlockedAbility.getInstance()); + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java new file mode 100644 index 00000000000..7c28041325d --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends mage.sets.iceage.ZuranSpellcaster { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "ME2"; + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java new file mode 100644 index 00000000000..a43202b347a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "ME3"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java new file mode 100644 index 00000000000..4ab6fb188bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends CardImpl { + + public ForcedRetreat(UUID ownerId) { + super(ownerId, 37, "Forced Retreat", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "ME3"; + + // Put target creature on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java new file mode 100644 index 00000000000..87fd01dfd43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends CardImpl { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId, 12, "Guan Yu, Sainted Warrior", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Guan Yu, Sainted Warrior is put into your graveyard from the battlefield, you may shuffle Guan Yu into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java new file mode 100644 index 00000000000..0075609f813 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends mage.sets.portalthreekingdoms.SlashingTiger { + + public SlashingTiger(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java new file mode 100644 index 00000000000..9f9001e97d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends mage.sets.portalthreekingdoms.WeiNightRaiders { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ME3"; + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java new file mode 100644 index 00000000000..8cd972b8ca2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends mage.sets.portalthreekingdoms.ZodiacDragon { + + public ZodiacDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "ME3"; + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java new file mode 100644 index 00000000000..afca2b79f50 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.RARE; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..2ae39054866 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends CardImpl { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId, 139, "Two-Headed Giant of Foriys", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Giant"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Two-Headed Giant of Foriys can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java new file mode 100644 index 00000000000..d9dfb231282 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java new file mode 100644 index 00000000000..50d791d1f02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 102; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java new file mode 100644 index 00000000000..c14f72308f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class NettletoothDjinn extends CardImpl { + + public NettletoothDjinn(UUID ownerId) { + super(ownerId, 130, "Nettletooth Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, Nettletooth Djinn deals 1 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageControllerEffect(1), TargetController.YOU, false)); } + + public NettletoothDjinn(final NettletoothDjinn card) { + super(card); + } + + @Override + public NettletoothDjinn copy() { + return new NettletoothDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java index e36d852e5ba..afab045802d 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java @@ -88,10 +88,11 @@ class ChaliceOfTheVoidEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java new file mode 100644 index 00000000000..727d367e7f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class DrossScorpion extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public DrossScorpion(UUID ownerId) { + super(ownerId, 164, "Dross Scorpion", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Scorpion"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Whenever Dross Scorpion or another artifact creature dies, you may untap target artifact. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new UntapTargetEffect(), true, filter); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public DrossScorpion(final DrossScorpion card) { + super(card); + } + + @java.lang.Override + public DrossScorpion copy() { + return new DrossScorpion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java index 64202e88ca3..3f02879da63 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java @@ -25,17 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; @@ -43,12 +45,11 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.util.functions.ApplyToPermanent; -import java.util.UUID; - /** * @author Loki */ public class Cryptoplasm extends CardImpl { + final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { @@ -64,7 +65,7 @@ public class Cryptoplasm extends CardImpl { this.toughness = new MageInt(2); // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -80,43 +81,39 @@ public class Cryptoplasm extends CardImpl { } -class CryptoplasmTransformEffect extends ContinuousEffectImpl { +class CryptoplasmEffect extends OneShotEffect { - CryptoplasmTransformEffect() { - super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.Copy); - staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; + public CryptoplasmEffect() { + super(Outcome.Copy); + this.staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; } - CryptoplasmTransformEffect(final CryptoplasmTransformEffect effect) { + public CryptoplasmEffect(final CryptoplasmEffect effect) { super(effect); } @Override - public boolean apply(Game game, final Ability source) { - Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - Permanent permanent = game.getPermanent(source.getSourceId()); - - if (creature == null || permanent == null) { - return false; - } - - game.copyPermanent(creature, permanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); - upkeepAbility.addTarget(new TargetCreaturePermanent()); - permanent.addAbility(upkeepAbility, source.getSourceId(), game); - return true; - } - }); - - - return true; + public CryptoplasmEffect copy() { + return new CryptoplasmEffect(this); } @Override - public CryptoplasmTransformEffect copy() { - return new CryptoplasmTransformEffect(this); - } + public boolean apply(Game game, final Ability source) { + Permanent creatureToCopy = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (creatureToCopy != null) { + CopyEffect effect = new CopyEffect(creatureToCopy, source.getSourceId()); + effect.setApplier(new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); + upkeepAbility.addTarget(new TargetCreaturePermanent()); + permanent.addAbility(upkeepAbility, source.getSourceId(), game); + return true; + } + }); + game.addEffect(effect, source); + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java index 3eb2340d635..31277520f32 100644 --- a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java +++ b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java @@ -136,11 +136,12 @@ public class WorldheartPhoenix extends CardImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { // TODO: No perfect solution because there could be other effects that allow to cast the card for this mana cost - if (((SpellAbility) obj).getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { + if (spellAbility.getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { permanent.addCounters(CounterType.P1P1.createInstance(2), game); } } diff --git a/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java new file mode 100644 index 00000000000..4c73889e2ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LunkErrant extends CardImpl { + + public LunkErrant(UUID ownerId) { + super(ownerId, 94, "Lunk Errant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Lunk Errant attacks alone, it gets +1/+1 and gains trample until end of turn. + Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); + effect.setText("it gets +1/+1"); + Ability ability = new AttacksAloneTriggeredAbility(effect); + effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LunkErrant(final LunkErrant card) { + super(card); + } + + @Override + public LunkErrant copy() { + return new LunkErrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java index 7ab4a6277b2..54869297d22 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java @@ -28,18 +28,15 @@ package mage.sets.newphyrexia; import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; /** * @@ -51,9 +48,16 @@ public class LeechingBite extends CardImpl { super(ownerId, 113, "Leeching Bite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "NPH"; - - this.getSpellAbility().addEffect(new LeechingBiteEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + // Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn. + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+1 until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the +1/+1 counter)"))); + effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn); + effect.setText("Another target creature gets -1/-1 until end of turn"); + effect.setTargetPointer(new SecondTargetPointer()); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the -1/-1 counter)"))); } public LeechingBite(final LeechingBite card) { @@ -65,35 +69,3 @@ public class LeechingBite extends CardImpl { return new LeechingBite(this); } } - -class LeechingBiteEffect extends ContinuousEffectImpl { - - public LeechingBiteEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - this.staticText = "Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn"; - } - - public LeechingBiteEffect(final LeechingBiteEffect effect) { - super(effect); - } - - @Override - public LeechingBiteEffect copy() { - return new LeechingBiteEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.addPower(1); - permanent.addToughness(1); - } - permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1)); - if (permanent != null) { - permanent.addPower(-1); - permanent.addToughness(-1); - } - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index ba7b8ebc634..5a9ee31b04a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -120,33 +120,44 @@ class SpellskiteEffect extends OneShotEffect { target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); } } else { - Player player = game.getPlayer(source.getControllerId()); - for (Target target : targets) { - for (UUID targetId : target.getTargets()) { - MageObject object = game.getObject(targetId); - String name; - if (object == null) { - Player targetPlayer = game.getPlayer(targetId); - name = targetPlayer.getLogName(); - } else { - name = object.getLogName(); - } - if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { - // you can't change this target to Spellskite because Spellskite is already another targetId of that target. - twoTimesTarget = true; - continue; - } - if (name != null && player.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + boolean validTargets = false; + do { + for (Target target : targets) { + for (UUID targetId : target.getTargets()) { + MageObject object = game.getObject(targetId); + String name; + if (object == null) { + Player targetPlayer = game.getPlayer(targetId); + name = targetPlayer.getLogName(); + } else { + name = object.getLogName(); + } + if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { + // you can't change this target to Spellskite because Spellskite is already another targetId of that target. + twoTimesTarget = true; + continue; + } if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.remove(targetId); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - break; + validTargets = true; + if (name != null + && controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + oldTarget = game.getObject(targetId); + target.remove(targetId); + // The source is still the spell on the stack + target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); + break; + } } } + if (oldTarget != null) { + break; + } } - } + if (oldTarget == null) { + game.informPlayer(controller, "You have to select at least one target to change to spellskite!"); + } + } while (validTargets && oldTarget == null); } if (oldTarget != null) { game.informPlayers(sourceObject.getLogName() + ": Changed target of " + stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName()); diff --git a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java index 1c4b2d5ec6c..f2df72e840b 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java +++ b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java @@ -32,16 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RevealTargetPlayerLibraryEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.players.Player; import mage.target.TargetPlayer; /** @@ -62,8 +58,9 @@ public class AvenWindreader extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // {1}{U}: Target player reveals the top card of his or her library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTopCardTargetPlayerEffect(), new ManaCostsImpl("{1}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTargetPlayerLibraryEffect(1), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } @@ -77,31 +74,3 @@ public class AvenWindreader extends CardImpl { return new AvenWindreader(this); } } - -class RevealTopCardTargetPlayerEffect extends OneShotEffect { - - public RevealTopCardTargetPlayerEffect() { - super(Outcome.Benefit); - this.staticText = "Target player reveals the top card of his or her library."; - } - - public RevealTopCardTargetPlayerEffect(final RevealTopCardTargetPlayerEffect effect) { - super(effect); - } - - @Override - public RevealTopCardTargetPlayerEffect copy() { - return new RevealTopCardTargetPlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - CardsImpl cards = new CardsImpl(); - cards.add(player.getLibrary().removeFromTop(game)); - player.revealCards("Top card of target player's library", cards, game); - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java new file mode 100644 index 00000000000..f9019b96086 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Biorhythm extends mage.sets.onslaught.Biorhythm { + + public Biorhythm(UUID ownerId) { + super(ownerId); + this.cardNumber = 231; + this.expansionSetCode = "9ED"; + } + + public Biorhythm(final Biorhythm card) { + super(card); + } + + @Override + public Biorhythm copy() { + return new Biorhythm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java new file mode 100644 index 00000000000..1db22add0bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends mage.sets.scourge.FinalPunishment { + + public FinalPunishment(UUID ownerId) { + super(ownerId); + this.cardNumber = 131; + this.expansionSetCode = "9ED"; + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java new file mode 100644 index 00000000000..88b9d47c882 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends CardImpl { + + public RogueKavu(UUID ownerId) { + super(ownerId, 213, "Rogue Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Kavu"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Rogue Kavu attacks alone, it gets +2/+0 until end of turn. + this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn))); + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java new file mode 100644 index 00000000000..433fb6e541b --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +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.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class AirdropCondor extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin creature"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public AirdropCondor(UUID ownerId) { + super(ownerId, 186, "Airdrop Condor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{1}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AirdropCondor(final AirdropCondor card) { + super(card); + } + + @Override + public AirdropCondor copy() { + return new AirdropCondor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java new file mode 100644 index 00000000000..d3ddf2be150 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class Biorhythm extends CardImpl { + + public Biorhythm(UUID ownerId) { + super(ownerId, 247, "Biorhythm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{G}{G}"); + this.expansionSetCode = "ONS"; + + // Each player's life total becomes the number of creatures he or she controls. + this.getSpellAbility().addEffect(new BiorhythmEffect()); + } + + public Biorhythm(final Biorhythm card) { + super(card); + } + + @Override + public Biorhythm copy() { + return new Biorhythm(this); + } +} + +class BiorhythmEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public BiorhythmEffect() { + super(Outcome.Neutral); + this.staticText = "Each player's life total becomes the number of creatures he or she controls"; + } + + public BiorhythmEffect(final BiorhythmEffect effect) { + super(effect); + } + + @Override + public BiorhythmEffect copy() { + return new BiorhythmEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for(UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if(player != null) { + int diff = player.getLife() - game.getBattlefield().countAll(filter, playerId, game); + if(diff > 0) { + player.loseLife(diff, game); + } + if(diff < 0) { + player.gainLife(-diff, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java new file mode 100644 index 00000000000..d0dce29fb32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author pcasaretto + */ +public class HarshMercy extends CardImpl { + + public HarshMercy(UUID ownerId) { + super(ownerId, 39, "Harsh Mercy", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "ONS"; + + // Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated. + this.getSpellAbility().addEffect(new HarshMercyEffect()); + } + + public HarshMercy(final HarshMercy card) { + super(card); + } + + @Override + public HarshMercy copy() { + return new HarshMercy(this); + } +} + +class HarshMercyEffect extends OneShotEffect { + + public HarshMercyEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated."; + } + + public HarshMercyEffect(final HarshMercyEffect effect) { + super(effect); + } + + @Override + public HarshMercyEffect copy() { + return new HarshMercyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Set chosenTypes = new HashSet<>(); + PlayerIteration: + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { + if (!player.canRespond()) { + continue PlayerIteration; + } + } + String chosenType = typeChoice.getChoice(); + if (chosenType != null) { + game.informPlayers(sourceObject.getIdName() + ": " + player.getLogName() + " has chosen " + chosenType); + chosenTypes.add(chosenType); + } + } + + FilterPermanent filter = new FilterCreaturePermanent("creatures"); + for (String type : chosenTypes) { + filter.add(Predicates.not(new SubtypePredicate(type))); + } + + return new DestroyAllEffect(filter, true).apply(game, source); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Oblation.java b/Mage.Sets/src/mage/sets/onslaught/Oblation.java index af44e16f604..5bf88ee64a5 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Oblation.java +++ b/Mage.Sets/src/mage/sets/onslaught/Oblation.java @@ -50,7 +50,6 @@ public class Oblation extends CardImpl { super(ownerId, 46, "Oblation", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "ONS"; - // The owner of target nonland permanent shuffles it into his or her library, then draws two cards. this.getSpellAbility().addEffect(new OblationEffect()); this.getSpellAbility().addTarget(new TargetNonlandPermanent()); @@ -67,21 +66,21 @@ public class Oblation extends CardImpl { } class OblationEffect extends OneShotEffect { - + OblationEffect() { super(Outcome.Removal); this.staticText = "The owner of target nonland permanent shuffles it into his or her library, then draws two cards"; } - + OblationEffect(final OblationEffect effect) { super(effect); } - + @Override public OblationEffect copy() { return new OblationEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); @@ -90,6 +89,9 @@ class OblationEffect extends OneShotEffect { if (player != null) { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); player.shuffleLibrary(game); + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw + player.drawCards(2, game); return true; } diff --git a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java index 15ec38fc4df..38ce5a39a6d 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java +++ b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java @@ -29,7 +29,7 @@ package mage.sets.onslaught; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,7 +59,7 @@ public class RotlungReanimator extends CardImpl { this.toughness = new MageInt(2); // Whenever Rotlung Reanimator or another Cleric dies, put a 2/2 black Zombie creature token onto the battlefield. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); } public RotlungReanimator(final RotlungReanimator card) { diff --git a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java index 769221d7eb9..34c051fa009 100644 --- a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java +++ b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java @@ -29,24 +29,20 @@ package mage.sets.planechase; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -55,13 +51,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author jeffwadsworth */ public class BoshIronGolem extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - + public BoshIronGolem(UUID ownerId) { super(ownerId, 108, "Bosh, Iron Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); this.expansionSetCode = "HOP"; @@ -73,10 +63,12 @@ public class BoshIronGolem extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // {3}{R}, Sacrifice an artifact: Bosh, Iron Golem deals damage equal to the sacrificed artifact's converted mana cost to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoshIronGolemEffect(), new ManaCostsImpl("{3}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + Effect effect = new DamageTargetEffect(new SacrificeCostConvertedMana("artifact")); + effect.setText("{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } @@ -90,45 +82,3 @@ public class BoshIronGolem extends CardImpl { return new BoshIronGolem(this); } } - -class BoshIronGolemEffect extends OneShotEffect { - - public BoshIronGolemEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"; - } - - public BoshIronGolemEffect(final BoshIronGolemEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost: source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getManaCost().convertedManaCost(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BoshIronGolemEffect copy() { - return new BoshIronGolemEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java index ab427c6c982..757482edb40 100644 --- a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java +++ b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java @@ -85,10 +85,10 @@ class IvyElementalEntersBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - SpellAbility spellAbility = (SpellAbility) obj; + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java index c8c9218dbdd..5a94ca0d4ee 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java +++ b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java @@ -112,11 +112,12 @@ class DralnusPetEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { int cmc = 0; - for (Cost cost : ((SpellAbility) obj).getCosts()) { + for (Cost cost : spellAbility.getCosts()) { if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) { cmc = ((DiscardCardCost) cost).getCards().get(0).getManaCost().convertedManaCost(); } diff --git a/Mage.Sets/src/mage/sets/portal/WickedPact.java b/Mage.Sets/src/mage/sets/portal/WickedPact.java new file mode 100644 index 00000000000..814ac4a641a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/WickedPact.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WickedPact extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public WickedPact(UUID ownerId) { + super(ownerId, 40, "Wicked Pact", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "POR"; + + // Destroy two target nonblack creatures. You lose 5 life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, filter, false)); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(5)); + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java new file mode 100644 index 00000000000..4b439141963 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends CardImpl { + + public AngelOfFury(UUID ownerId) { + super(ownerId, 127, "Angel of Fury", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Angel"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Angel of Fury is put into your graveyard from the battlefield, you may shuffle it into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java new file mode 100644 index 00000000000..6a651acbe73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "PO2"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java new file mode 100644 index 00000000000..e3288cd2418 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "PO2"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java new file mode 100644 index 00000000000..5f33ccffb45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class FalseMourning extends CardImpl { + + public FalseMourning(UUID ownerId) { + super(ownerId, 134, "False Mourning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "PTK"; + + // Put target card from your graveyard on top of your library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); + } + + public FalseMourning(final FalseMourning card) { + super(card); + } + + @Override + public FalseMourning copy() { + return new FalseMourning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java new file mode 100644 index 00000000000..d6c3305c138 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlankingTroops extends CardImpl { + + public FlankingTroops(UUID ownerId) { + super(ownerId, 5, "Flanking Troops", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Flanking Troops attacks, you may tap target creature. + Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FlankingTroops(final FlankingTroops card) { + super(card); + } + + @Override + public FlankingTroops copy() { + return new FlankingTroops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java new file mode 100644 index 00000000000..21f5c31634e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends mage.sets.masterseditioniii.ForcedRetreat { + + public ForcedRetreat(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "PTK"; + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java new file mode 100644 index 00000000000..a5ad17bba71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends mage.sets.masterseditioniii.GuanYuSaintedWarrior { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java new file mode 100644 index 00000000000..02d3e2c645a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MaChaoWesternWarrior extends CardImpl { + + public MaChaoWesternWarrior(UUID ownerId) { + super(ownerId, 116, "Ma Chao, Western Warrior", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Ma Chao, Western Warrior attacks alone, it can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public MaChaoWesternWarrior(final MaChaoWesternWarrior card) { + super(card); + } + + @Override + public MaChaoWesternWarrior copy() { + return new MaChaoWesternWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java new file mode 100644 index 00000000000..2ede43fdb7d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class SagesKnowledge extends CardImpl { + + public static final FilterCard filter = new FilterCard("sorcery card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public SagesKnowledge(UUID ownerId) { + super(ownerId, 52, "Sage's Knowledge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "PTK"; + + // Return target sorcery card from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + } + + public SagesKnowledge(final SagesKnowledge card) { + super(card); + } + + @Override + public SagesKnowledge copy() { + return new SagesKnowledge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java new file mode 100644 index 00000000000..30532cf1f45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuDefender extends CardImpl { + + public ShuDefender(UUID ownerId) { + super(ownerId, 20, "Shu Defender", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Shu Defender blocks, it gets +0/+2 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false)); + } + + public ShuDefender(final ShuDefender card) { + super(card); + } + + @Override + public ShuDefender copy() { + return new ShuDefender(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java new file mode 100644 index 00000000000..fa80e8677c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends CardImpl { + + public SlashingTiger(UUID ownerId) { + super(ownerId, 145, "Slashing Tiger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Slashing Tiger becomes blocked, it gets +2/+2 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java new file mode 100644 index 00000000000..655f5825eb1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class TaoistMystic extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public TaoistMystic(UUID ownerId) { + super(ownerId, 151, "Taoist Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Mystic"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Taoist Mystic can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public TaoistMystic(final TaoistMystic card) { + super(card); + } + + @Override + public TaoistMystic copy() { + return new TaoistMystic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java new file mode 100644 index 00000000000..51fe695f0c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TrainedCheetah extends CardImpl { + + public TrainedCheetah(UUID ownerId) { + super(ownerId, 154, "Trained Cheetah", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Trained Cheetah becomes blocked, it gets +1/+1 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public TrainedCheetah(final TrainedCheetah card) { + super(card); + } + + @Override + public TrainedCheetah copy() { + return new TrainedCheetah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java new file mode 100644 index 00000000000..6b5af019f7b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiAmbushForce extends CardImpl { + + public WeiAmbushForce(UUID ownerId) { + super(ownerId, 85, "Wei Ambush Force", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Wei Ambush Force attacks, it gets +2/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false)); + } + + public WeiAmbushForce(final WeiAmbushForce card) { + super(card); + } + + @Override + public WeiAmbushForce copy() { + return new WeiAmbushForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java new file mode 100644 index 00000000000..5b20e8e973e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends CardImpl { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId, 89, "Wei Night Raiders", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Wei Night Raiders deals damage to an opponent, that player discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java new file mode 100644 index 00000000000..89dd5e32a52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WolfPack extends mage.sets.masterseditionii.WolfPack { + + public WolfPack(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "PTK"; + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java new file mode 100644 index 00000000000..9e21e745d98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +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.common.LookAtTargetPlayerHandEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class WuScout extends CardImpl { + + public WuScout(UUID ownerId) { + super(ownerId, 62, "Wu Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Wu Scout enters the battlefield, look at target opponent's hand. + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("look at target opponent's hand"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public WuScout(final WuScout card) { + super(card); + } + + @Override + public WuScout copy() { + return new WuScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java new file mode 100644 index 00000000000..7b082db19ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YuanShaosInfantry extends CardImpl { + + public YuanShaosInfantry(UUID ownerId) { + super(ownerId, 129, "Yuan Shao's Infantry", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Yuan Shao's Infantry attacks alone, Yuan Shao's Infantry can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public YuanShaosInfantry(final YuanShaosInfantry card) { + super(card); + } + + @Override + public YuanShaosInfantry copy() { + return new YuanShaosInfantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java new file mode 100644 index 00000000000..21d68409404 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZhangHeWeiGeneral extends CardImpl { + + public ZhangHeWeiGeneral(UUID ownerId) { + super(ownerId, 95, "Zhang He, Wei General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhang He, Wei General attacks, each other creature you control gets +1/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, + new FilterCreaturePermanent(), true), false)); + } + + public ZhangHeWeiGeneral(final ZhangHeWeiGeneral card) { + super(card); + } + + @Override + public ZhangHeWeiGeneral copy() { + return new ZhangHeWeiGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java new file mode 100644 index 00000000000..7d3cd947403 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhangLiaoHeroOfHefei extends CardImpl { + + public ZhangLiaoHeroOfHefei(UUID ownerId) { + super(ownerId, 96, "Zhang Liao, Hero of Hefei", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Zhang Liao, Hero of Hefei deals damage to an opponent, that opponent discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + } + + public ZhangLiaoHeroOfHefei(final ZhangLiaoHeroOfHefei card) { + super(card); + } + + @Override + public ZhangLiaoHeroOfHefei copy() { + return new ZhangLiaoHeroOfHefei(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java new file mode 100644 index 00000000000..221dd7ec38c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhaoZilongTigerGeneral extends CardImpl { + + public ZhaoZilongTigerGeneral(UUID ownerId) { + super(ownerId, 33, "Zhao Zilong, Tiger General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhao Zilong, Tiger General blocks, it gets +1/+1 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public ZhaoZilongTigerGeneral(final ZhaoZilongTigerGeneral card) { + super(card); + } + + @Override + public ZhaoZilongTigerGeneral copy() { + return new ZhaoZilongTigerGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java new file mode 100644 index 00000000000..3b6459ec951 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends CardImpl { + + public ZodiacDragon(UUID ownerId) { + super(ownerId, 131, "Zodiac Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{R}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // When Zodiac Dragon is put into your graveyard from the battlefield, you may return it to your hand. + this.addAbility(new DiesTriggeredAbility(new ReturnToHandSourceEffect(), true)); + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java new file mode 100644 index 00000000000..a85f7893719 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class ZuoCiTheMockingSage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public ZuoCiTheMockingSage(UUID ownerId) { + super(ownerId, 165, "Zuo Ci, the Mocking Sage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + // Zuo Ci, the Mocking Sage can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public ZuoCiTheMockingSage(final ZuoCiTheMockingSage card) { + super(card); + } + + @Override + public ZuoCiTheMockingSage copy() { + return new ZuoCiTheMockingSage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java index 4ab45ecce4c..76703050bb3 100644 --- a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java +++ b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java @@ -30,8 +30,10 @@ package mage.sets.ravnica; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -40,15 +42,14 @@ import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * * @author LoneFox - + * */ public class FollowedFootsteps extends CardImpl { @@ -99,10 +100,9 @@ class FollowedFootstepsEffect extends OneShotEffect { Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); if (target != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(target); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; + Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); + return effect.apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java index 8aaa3abe553..2470858d5d4 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java @@ -1,88 +1,88 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.sets.returntoravnica; - -import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -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.continuous.BoostEnchantedEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.cards.CardImpl; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class DeviantGlee extends CardImpl { - - static final String rule = "and has \"{R}: This creature gains trample until end of turn"; - - public DeviantGlee (UUID ownerId) { - super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); - this.expansionSetCode = "RTR"; - this.subtype.add("Aura"); - this.color.setBlack(true); - - // 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/+1 and has "{R}: This creature gains trample until end of turn." - SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); - Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); - ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); - this.addAbility(ability2); - } - - public DeviantGlee (final DeviantGlee card) { - super(card); - } - - @Override - public DeviantGlee copy() { - return new DeviantGlee(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.returntoravnica; + +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.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DeviantGlee extends CardImpl { + + static final String rule = "and has \"{R}: This creature gains trample until end of turn.\""; + + public DeviantGlee (UUID ownerId) { + super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Aura"); + this.color.setBlack(true); + + // 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/+1 and has "{R}: This creature gains trample until end of turn." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public DeviantGlee (final DeviantGlee card) { + super(card); + } + + @Override + public DeviantGlee copy() { + return new DeviantGlee(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java index 155244c026e..f0d423cd6f4 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java @@ -100,12 +100,13 @@ class ManaBloomEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { // delete to prevent using it again if put into battlefield from other effect setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); return true; diff --git a/Mage.Sets/src/mage/sets/revisededition/Conversion.java b/Mage.Sets/src/mage/sets/revisededition/Conversion.java new file mode 100644 index 00000000000..d5ad6eb5c9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "3ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/CursedLand.java b/Mage.Sets/src/mage/sets/revisededition/CursedLand.java new file mode 100644 index 00000000000..bae229c5d22 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "3ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Feedback.java b/Mage.Sets/src/mage/sets/revisededition/Feedback.java new file mode 100644 index 00000000000..31cd18bffbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "3ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java new file mode 100644 index 00000000000..acce4e3f6e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 34; + this.expansionSetCode = "3ED"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java new file mode 100644 index 00000000000..9053aa1522e --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +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.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public SorceressQueen(UUID ownerId) { + super(ownerId, 39, "Sorceress Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature other than Sorceress Queen becomes 0/2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..f47eda8e13d --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "3ED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java new file mode 100644 index 00000000000..522ce6f4bf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "3ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java new file mode 100644 index 00000000000..d0db483889a --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "3ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index d01d66c5968..45fdec326b5 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -29,10 +29,6 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; @@ -40,11 +36,15 @@ import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; -import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TurnPhase; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.TappedPredicate; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java index fa2c2afda1e..028f9299594 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java @@ -97,10 +97,11 @@ class MagaTraitorToMortalsEnterBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java index e554b7b6c37..6ca59c6d7b8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java @@ -92,10 +92,11 @@ class ChimericMassEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java index 42122cfa4cc..2f8ea8af1a8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java @@ -101,6 +101,9 @@ class MoltenPsycheEffect extends OneShotEffect { player.shuffleLibrary(game); } } + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw action + for (UUID playerId : cardsToDraw.keySet()) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java index 65d7927c47c..e49932fcb04 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,14 +20,25 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.scarsofmirrodin; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,16 +46,10 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.ActivatedAbility; -import mage.abilities.StaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.sets.futuresight.YixlidJailer; /** * @@ -60,7 +65,8 @@ public class NecroticOoze extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(3); - this.addAbility(new NecroticOozeAbility()); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NecroticOozeEffect())); } public NecroticOoze(final NecroticOoze card) { @@ -72,48 +78,27 @@ public class NecroticOoze extends CardImpl { return new NecroticOoze(this); } -} + class NecroticOozeEffect extends ContinuousEffectImpl { -class NecroticOozeAbility extends StaticAbility { + public NecroticOozeEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; + } - public NecroticOozeAbility() { - super(Zone.BATTLEFIELD, new NecroticOozeEffect()); - } + public NecroticOozeEffect(final NecroticOozeEffect effect) { + super(effect); + } - public NecroticOozeAbility(final NecroticOozeAbility ability) { - super(ability); - } - - @Override - public NecroticOozeAbility copy() { - return new NecroticOozeAbility(this); - } - -} - -class NecroticOozeEffect extends ContinuousEffectImpl { - - public NecroticOozeEffect() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; - } - - public NecroticOozeEffect(final NecroticOozeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + @Override + public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { + for (Card card : player.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof ActivatedAbility) { perm.addAbility(ability, game); } @@ -122,15 +107,31 @@ class NecroticOozeEffect extends ContinuousEffectImpl { } } } + return true; } - return true; + return false; + } + + @Override + public NecroticOozeEffect copy() { + return new NecroticOozeEffect(this); + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/285211-yixlid-jailer-vs-necrotic-ooze + if (YixlidJailer.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; } - return false; } - @Override - public NecroticOozeEffect copy() { - return new NecroticOozeEffect(this); - } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java new file mode 100644 index 00000000000..6fe0446b51b --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; +import mage.target.TargetPlayer; +import mage.watchers.common.AmountOfDamageAPlayerReceivedThisTurnWatcher; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends CardImpl { + + public FinalPunishment(UUID ownerId) { + super(ownerId, 67, "Final Punishment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "SCG"; + + // Target player loses life equal to the damage already dealt to him or her this turn. + Effect effect = new LoseLifeTargetEffect(new FinalPunishmentAmount()); + effect.setText("target player loses life equal to the damage already dealt to him or her this turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addWatcher(new AmountOfDamageAPlayerReceivedThisTurnWatcher()); + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} + +class FinalPunishmentAmount implements DynamicValue { + + @Override + public int calculate(Game game, Ability source, Effect effect) { + AmountOfDamageAPlayerReceivedThisTurnWatcher watcher + = (AmountOfDamageAPlayerReceivedThisTurnWatcher) game.getState().getWatchers().get("AmountOfDamageReceivedThisTurn"); + if(watcher != null) { + return watcher.getAmountOfDamageReceivedThisTurn(source.getFirstTarget()); + } + return 0; + } + + @Override + public FinalPunishmentAmount copy() { + return new FinalPunishmentAmount(); + } + + @Override + public String getMessage() { + return "the damage already dealt to him or her this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/VengefulDead.java b/Mage.Sets/src/mage/sets/scourge/VengefulDead.java new file mode 100644 index 00000000000..702ee27ee90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/VengefulDead.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class VengefulDead extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Zombie"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public VengefulDead(UUID ownerId) { + super(ownerId, 80, "Vengeful Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Vengeful Dead or another Zombie dies, each opponent loses 1 life. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter)); + } + + public VengefulDead(final VengefulDead card) { + super(card); + } + + @Override + public VengefulDead copy() { + return new VengefulDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java index f90471ad704..9590020f571 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java @@ -54,7 +54,6 @@ public class EnchantedEvening extends CardImpl { super(ownerId, 140, "Enchanted Evening", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W/U}{W/U}"); this.expansionSetCode = "SHM"; - // All permanents are enchantments in addition to their other types. Effect effect = new EnchangedEveningEffect(CardType.ENCHANTMENT, Duration.WhileOnBattlefield, new FilterPermanent()); effect.setText("All permanents are enchantments in addition to their other types"); @@ -70,37 +69,38 @@ public class EnchantedEvening extends CardImpl { public EnchantedEvening copy() { return new EnchantedEvening(this); } -} -class EnchangedEveningEffect extends ContinuousEffectImpl { + // need to be enclosed class for dependent check of continuous effects + class EnchangedEveningEffect extends ContinuousEffectImpl { - private final CardType addedCardType; - private final FilterPermanent filter; + private final CardType addedCardType; + private final FilterPermanent filter; - public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { - super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); - this.addedCardType = addedCardType; - this.filter = filter; - } - - public EnchangedEveningEffect(final EnchangedEveningEffect effect) { - super(effect); - this.addedCardType = effect.addedCardType; - this.filter = effect.filter; - } - - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { - if (permanent != null && !permanent.getCardType().contains(addedCardType)) { - permanent.getCardType().add(addedCardType); - } + public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { + super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + this.addedCardType = addedCardType; + this.filter = filter; } - return true; - } - @Override - public EnchangedEveningEffect copy() { - return new EnchangedEveningEffect(this); + public EnchangedEveningEffect(final EnchangedEveningEffect effect) { + super(effect); + this.addedCardType = effect.addedCardType; + this.filter = effect.filter; + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { + if (permanent != null && !permanent.getCardType().contains(addedCardType)) { + permanent.getCardType().add(addedCardType); + } + } + return true; + } + + @Override + public EnchangedEveningEffect copy() { + return new EnchangedEveningEffect(this); + } } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index fdbce5bbd6d..900fb98760c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -1,148 +1,123 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.Mana; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.mana.SimpleManaAbility; -import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.players.Player; -import mage.players.Players; - -/** - * - * @author jeffwadsworth - */ -public class LeechriddenSwamp extends CardImpl { - - public LeechriddenSwamp(UUID ownerId) { - super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Swamp"); - - // ({tap}: Add {B} to your mana pool.) - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); - - // Leechridden Swamp enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LeechriddenSwampLoseLifeEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new TapSourceCost()); - ability.addCost(new ControlTwoOrMoreBlackPermanentsCost()); - this.addAbility(ability); - } - - public LeechriddenSwamp(final LeechriddenSwamp card) { - super(card); - } - - @Override - public LeechriddenSwamp copy() { - return new LeechriddenSwamp(this); - } -} - -class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public ControlTwoOrMoreBlackPermanentsCost() { - this.text = "Activate this ability only if you control two or more black permanents"; - } - - public ControlTwoOrMoreBlackPermanentsCost(final ControlTwoOrMoreBlackPermanentsCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 2, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlTwoOrMoreBlackPermanentsCost copy() { - return new ControlTwoOrMoreBlackPermanentsCost(this); - } -} - -class LeechriddenSwampLoseLifeEffect extends OneShotEffect { - - private static final String effectText = "each opponent loses 1 life"; - - LeechriddenSwampLoseLifeEffect ( ) { - super(Outcome.Damage); - staticText = effectText; - } - - LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Players players = game.getPlayers(); - for ( Player player : players.values() ) { - if ( !player.getId().equals(source.getControllerId()) ) { - player.loseLife(1, game); - } - } - return true; - } - - @Override - public LeechriddenSwampLoseLifeEffect copy() { - return new LeechriddenSwampLoseLifeEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.players.Players; + +/** + * + * @author jeffwadsworth + */ +public class LeechriddenSwamp extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control two or more black permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public LeechriddenSwamp(UUID ownerId) { + super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Swamp"); + + // ({tap}: Add {B} to your mana pool.) + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); + + // Leechridden Swamp enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new LeechriddenSwampLoseLifeEffect(), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public LeechriddenSwamp(final LeechriddenSwamp card) { + super(card); + } + + @Override + public LeechriddenSwamp copy() { + return new LeechriddenSwamp(this); + } +} + +class LeechriddenSwampLoseLifeEffect extends OneShotEffect { + + private static final String effectText = "each opponent loses 1 life"; + + LeechriddenSwampLoseLifeEffect ( ) { + super(Outcome.Damage); + staticText = effectText; + } + + LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Players players = game.getPlayers(); + for ( Player player : players.values() ) { + if ( !player.getId().equals(source.getControllerId()) ) { + player.loseLife(1, game); + } + } + return true; + } + + @Override + public LeechriddenSwampLoseLifeEffect copy() { + return new LeechriddenSwampLoseLifeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java index eb94b65c287..b106cfe9c93 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.ShuffleLibrarySourceEffect; -import mage.abilities.mana.RedManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class MadblindMountain extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.RED)); - } - - public MadblindMountain(UUID ownerId) { - super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Mountain"); - - // ({tap}: Add {R} to your mana pool.) - this.addAbility(new RedManaAbility()); - - // Madblind Mountain enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ShuffleLibrarySourceEffect(), new ManaCostsImpl("{R}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public MadblindMountain(final MadblindMountain card) { - super(card); - } - - @Override - public MadblindMountain copy() { - return new MadblindMountain(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.ShuffleLibrarySourceEffect; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class MadblindMountain extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public MadblindMountain(UUID ownerId) { + super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Mountain"); + + // ({tap}: Add {R} to your mana pool.) + this.addAbility(new RedManaAbility()); + + // Madblind Mountain enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new ShuffleLibrarySourceEffect(), + new ManaCostsImpl("{R}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public MadblindMountain(final MadblindMountain card) { + super(card); + } + + @Override + public MadblindMountain copy() { + return new MadblindMountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java index 4f087d879c2..4dc1458dcbf 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java @@ -1,88 +1,91 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; -import mage.abilities.mana.BlueManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.target.TargetPlayer; - -/** - * - * @author jeffwadsworth - */ -public class MoonringIsland extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLUE)); - } - - public MoonringIsland(UUID ownerId) { - super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Island"); - - // ({tap}: Add {U} to your mana pool.) - this.addAbility(new BlueManaAbility()); - - // Moonring Island enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new LookLibraryTopCardTargetPlayerEffect(), new ManaCostsImpl("{U}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - - } - - public MoonringIsland(final MoonringIsland card) { - super(card); - } - - @Override - public MoonringIsland copy() { - return new MoonringIsland(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author jeffwadsworth + */ +public class MoonringIsland extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public MoonringIsland(UUID ownerId) { + super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Island"); + + // ({tap}: Add {U} to your mana pool.) + this.addAbility(new BlueManaAbility()); + + // Moonring Island enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new LookLibraryTopCardTargetPlayerEffect(), + new ManaCostsImpl("{U}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + } + + public MoonringIsland(final MoonringIsland card) { + super(card); + } + + @Override + public MoonringIsland copy() { + return new MoonringIsland(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java index 9ae7bb434cb..96f78b9329b 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.mana.GreenManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class SapseepForest extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.GREEN)); - } - - public SapseepForest(UUID ownerId) { - super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Forest"); - - // ({tap}: Add {G} to your mana pool.) - this.addAbility(new GreenManaAbility()); - - // Sapseep Forest enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{G}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public SapseepForest(final SapseepForest card) { - super(card); - } - - @Override - public SapseepForest copy() { - return new SapseepForest(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class SapseepForest extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public SapseepForest(UUID ownerId) { + super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Forest"); + + // ({tap}: Add {G} to your mana pool.) + this.addAbility(new GreenManaAbility()); + + // Sapseep Forest enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new GainLifeEffect(1), + new ManaCostsImpl("{G}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public SapseepForest(final SapseepForest card) { + super(card); + } + + @Override + public SapseepForest copy() { + return new SapseepForest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java index 781d2d7608f..27c846f33a5 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java @@ -32,7 +32,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.ruleModifying.CantRegenerateTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,10 +58,10 @@ public class Tatterkite extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Tatterkite can't have counters placed on it. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield, "it"))); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield))); + } public Tatterkite(final Tatterkite card) { @@ -77,7 +76,7 @@ public class Tatterkite extends CardImpl { class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { - public CantHaveCountersSourceEffect(Duration duration, String objectText) { + public CantHaveCountersSourceEffect(Duration duration) { super(duration, Outcome.Detriment); staticText = "{this} can't have counters placed on it"; } @@ -91,14 +90,9 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { return new CantHaveCountersSourceEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ADD_COUNTER; + return event.getType() == EventType.ADD_COUNTERS; } @Override @@ -109,4 +103,4 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java index c79740b735f..a6d8eeda839 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -96,10 +97,11 @@ class FeralHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java index a5c433e5948..dc7aa39b6e6 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java @@ -93,10 +93,11 @@ class SigilOfDistinctionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); return true; diff --git a/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java new file mode 100644 index 00000000000..fe93c5366f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "S99"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java new file mode 100644 index 00000000000..26853ac7abd --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "S99"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/WickedPact.java b/Mage.Sets/src/mage/sets/starter1999/WickedPact.java new file mode 100644 index 00000000000..0812593a4eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/WickedPact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "S99"; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java new file mode 100644 index 00000000000..d03181f9334 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class KnightOfDawn extends CardImpl { + + public KnightOfDawn(UUID ownerId) { + super(ownerId, 238, "Knight of Dawn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {W}{W}: Knight of Dawn gains protection from the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public KnightOfDawn(final KnightOfDawn card) { + super(card); + } + + @Override + public KnightOfDawn copy() { + return new KnightOfDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Krakilin.java b/Mage.Sets/src/mage/sets/tempest/Krakilin.java index 5b7ee1a1c49..55ac185a0ef 100644 --- a/Mage.Sets/src/mage/sets/tempest/Krakilin.java +++ b/Mage.Sets/src/mage/sets/tempest/Krakilin.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; @@ -90,10 +91,11 @@ class KrakilinEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java index c518a21d95d..c9036a60213 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java @@ -25,20 +25,17 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -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.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,10 +43,18 @@ import mage.game.stack.Spell; */ public class AngelsFeather extends CardImpl { + private final static FilterSpell filter = new FilterSpell("a white spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + public AngelsFeather(UUID ownerId) { super(ownerId, 311, "Angel's Feather", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "10E"; - this.addAbility(new AngelsFeatherAbility()); + + // Whenever a player casts a white spell, you may gain 1 life. + this.addAbility(new SpellCastAllTriggeredAbility(new GainLifeEffect(1), filter, true)); } public AngelsFeather(final AngelsFeather card) { @@ -62,36 +67,3 @@ public class AngelsFeather extends CardImpl { } } - -class AngelsFeatherAbility extends TriggeredAbilityImpl { - - public AngelsFeatherAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - public AngelsFeatherAbility(final AngelsFeatherAbility ability) { - super(ability); - } - - @Override - public AngelsFeatherAbility copy() { - return new AngelsFeatherAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isWhite(); - } - - @Override - public String getRule() { - return "Whenever a player casts a white spell, you may gain 1 life."; - } - -} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java new file mode 100644 index 00000000000..744f4560a1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + + static{ + filter.add(new AnotherPredicate()); + } + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId, 80, "Denizen of the Deep", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + this.expansionSetCode = "10E"; + this.subtype.add("Serpent"); + this.power = new MageInt(11); + this.toughness = new MageInt(11); + + // When Denizen of the Deep enters the battlefield, return each other creature you control to its owner's hand. + Effect effect = new ReturnToHandFromBattlefieldAllEffect(filter); + effect.setText("return each other creature you control to its owner's hand"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/HighGround.java b/Mage.Sets/src/mage/sets/tenthedition/HighGround.java new file mode 100644 index 00000000000..dc2e0954cb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/HighGround.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HighGround extends mage.sets.exodus.HighGround { + + public HighGround(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "10E"; + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java index 501b8084e9a..7fa563f6761 100644 --- a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java +++ b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java @@ -34,6 +34,7 @@ import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.CantBeCounteredAbility; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.ProtectionAbility; @@ -102,10 +103,11 @@ class MistcutterHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java new file mode 100644 index 00000000000..a97d6ac8e5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends mage.sets.iceage.MeriekeRiBerit { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java new file mode 100644 index 00000000000..5f61f2899cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 200; + this.expansionSetCode = "2ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java new file mode 100644 index 00000000000..7ee2487d278 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "2ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java new file mode 100644 index 00000000000..0d7fd8ae9f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "2ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java new file mode 100644 index 00000000000..b62d1a7e564 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.common.DynamicManaEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends CardImpl { + + public Sacrifice(UUID ownerId) { + super(ownerId, 33, "Sacrifice", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "2ED"; + + // As an additional cost to cast Sacrifice, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + // Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost")); + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..5ae29d3df23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "2ED"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..ba1a2326a2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java @@ -0,0 +1,130 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends CardImpl { + + private static final String rule = "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains \"At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability.\""; + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId, 88, "Vesuvan Doppelganger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // You may have Vesuvan Doppelganger enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new VesuvanDoppelgangerCopyEffect(), rule, true)); + this.addAbility(ability); + + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} + +class VesuvanDoppelgangerCopyEffect extends OneShotEffect { + + private static final String rule2 = "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability."; + + public VesuvanDoppelgangerCopyEffect() { + super(Outcome.Copy); + } + + public VesuvanDoppelgangerCopyEffect(final VesuvanDoppelgangerCopyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + final Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + Target target = new TargetPermanent(new FilterCreaturePermanent("target creature (you copy from)")); + target.setRequired(true); + if (source instanceof SimpleStaticAbility) { + target = new TargetPermanent(new FilterCreaturePermanent("creature (you copy from)")); + target.setRequired(false); + target.setNotTarget(true); + } + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + controller.choose(Outcome.Copy, target, source.getSourceId(), game); + Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); + if (copyFromPermanent != null) { + game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + permanent.getColor(game).setColor(sourcePermanent.getColor(game)); + permanent.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); + return true; + } + }); + return true; + } + } + } + return false; + } + + @Override + public VesuvanDoppelgangerCopyEffect copy() { + return new VesuvanDoppelgangerCopyEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java new file mode 100644 index 00000000000..be640016ad2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends CardImpl { + + public Wanderlust(UUID ownerId) { + super(ownerId, 135, "Wanderlust", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted creature's controller, Wanderlust deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java new file mode 100644 index 00000000000..0afbd74f63b --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "2ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java index 1fa8d58f38f..b760233b1b6 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java @@ -1,121 +1,77 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.urzasdestiny; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.common.TargetCreatureOrPlayer; - -/** - * - * @author Backfir3 - */ -public class BloodshotCyclops extends CardImpl { - - public BloodshotCyclops(UUID ownerId) { - super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); - this.expansionSetCode = "UDS"; - this.subtype.add("Cyclops"); - this.subtype.add("Giant"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed - // creature's power to target creature or player. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BloodshotCyclopsEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } - - public BloodshotCyclops(final BloodshotCyclops card) { - super(card); - } - - @Override - public BloodshotCyclops copy() { - return new BloodshotCyclops(this); - } -} - -class BloodshotCyclopsEffect extends OneShotEffect { - - public BloodshotCyclopsEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } - - public BloodshotCyclopsEffect(final BloodshotCyclopsEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BloodshotCyclopsEffect copy() { - return new BloodshotCyclopsEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Backfir3 + */ +public class BloodshotCyclops extends CardImpl { + + public BloodshotCyclops(UUID ownerId) { + super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Cyclops"); + this.subtype.add("Giant"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed + // creature's power to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(new SacrificeCostCreaturesPower()), + new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BloodshotCyclops(final BloodshotCyclops card) { + super(card); + } + + @Override + public BloodshotCyclops copy() { + return new BloodshotCyclops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java index 977547a474a..cd11bb83449 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java @@ -27,9 +27,13 @@ */ package mage.sets.urzasdestiny; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,6 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.sets.shadowmoor.EnchantedEvening; /** * @@ -58,7 +63,6 @@ public class Opalescence extends CardImpl { super(ownerId, 13, "Opalescence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "UDS"; - // Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OpalescenceEffect())); @@ -72,19 +76,21 @@ public class Opalescence extends CardImpl { public Opalescence copy() { return new Opalescence(this); } + } class OpalescenceEffect extends ContinuousEffectImpl { private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment"); + static { filter.add(Predicates.not(new SubtypePredicate("Aura"))); filter.add(new AnotherPredicate()); } - + public OpalescenceEffect() { super(Duration.WhileOnBattlefield, Outcome.BecomeCreature); - staticText = "Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost"; + staticText = "Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost"; } public OpalescenceEffect(final OpalescenceEffect effect) { @@ -125,10 +131,22 @@ class OpalescenceEffect extends ContinuousEffectImpl { return false; } - @Override public boolean hasLayer(Layer layer) { return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + if (EnchantedEvening.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java new file mode 100644 index 00000000000..37a52580727 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledEnchantmentPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class FaithHealer extends CardImpl { + + public FaithHealer(UUID ownerId) { + super(ownerId, 14, "Faith Healer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice an enchantment: You gain life equal to the sacrificed enchantment's converted mana cost. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new SacrificeCostConvertedMana("enchantment")), + new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledEnchantmentPermanent())))); + } + + public FaithHealer(final FaithHealer card) { + super(card); + } + + @Override + public FaithHealer copy() { + return new FaithHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java new file mode 100644 index 00000000000..c164794333d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends CardImpl { + + public JaggedLightning(UUID ownerId) { + super(ownerId, 200, "Jagged Lightning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "USG"; + + // Jagged Lightning deals 3 damage to each of two target creatures. + this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "each of two target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent(), false)); + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java index 96c5998fc59..e06229d3abb 100644 --- a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java +++ b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java @@ -96,10 +96,11 @@ class PhyrexianMarauderEntersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((Ability) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java new file mode 100644 index 00000000000..063c15a260d --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StripedBears extends CardImpl { + + public StripedBears(UUID ownerId) { + super(ownerId, 82, "Striped Bears", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Bear"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Striped Bears enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + } + + public StripedBears(final StripedBears card) { + super(card); + } + + @Override + public StripedBears copy() { + return new StripedBears(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java new file mode 100644 index 00000000000..99555127b42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends mage.sets.battleforzendikar.DominatorDrone { + + public DominatorDrone(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "DDP"; + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java new file mode 100644 index 00000000000..4a411beb283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creature"); + + static { + filter.add(new ColorlessPredicate()); + } + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId, 64, "Forerunner of Slaughter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{R}"); + this.expansionSetCode = "DDP"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid (This card has no color.) + this.addAbility(new DevoidAbility(this.color)); + + // {1}: Target colorless creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(1)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java index d14393676f2..7ec428ccede 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java @@ -52,6 +52,10 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Silvercoat Lion", 1); } + /** + * This test fails sometimes, probably because two plains are tapped for the + * first creature + */ @Test public void testSimpleCast2() { addCard(Zone.HAND, playerA, "Silvercoat Lion"); @@ -100,6 +104,35 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Blazing Specter", 1); } + @Test + public void testSimpleCast5() { + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 3); + addCard(Zone.HAND, playerA, "Soul Warden"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Soul Warden", 1); + } + + @Test + public void testSimpleCast6() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 2); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + addCard(Zone.HAND, playerA, "Pillarfield Ox", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + @Test public void testCast4Creature() { addCard(Zone.LIBRARY, playerA, "Swamp", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java index 31a037b721b..4859e3af03f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java @@ -63,7 +63,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { /** * Check that the AI does not cast Rack and Ruin if it would destroy the - * owly creature on the battlefield owned by the AI + * only creature on the battlefield owned by the AI */ @Test public void testRackAndRuin2() { @@ -196,7 +196,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } /** - * Test that AI counters creatire spell + * Test that AI counters creature spell */ @Test @Ignore // counter spells don't seem to be cast by AI @@ -222,4 +222,13 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } + /** + * Target selection from EntersTheBattlefield is not varied in the AI + * calculation, so value is only calculated for the one selected target set. + * + * E.g. If AI casts an Eyeblight Assassin and opponent has a 3/1 and a 2/2, + * the AI should target the 3/1. + * + * Add test to check such situations + */ } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java index 4b8729e65f1..d1f5ab38482 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java @@ -37,21 +37,23 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class InfectTest extends CardTestPlayerBase { /** - - 702.89. Infect - 702.89a Infect is a static ability. - 702.89b Damage dealt to a player by a source with infect doesn’t cause that player to lose life. Rather, it causes the player to get that many poison counters. See rule 119.3. - 702.89c Damage dealt to a creature by a source with infect isn’t marked on that creature. Rather, it causes that many -1/-1 counters to be put on that creature. See rule 119.3. - 702.89d If a permanent leaves the battlefield before an effect causes it to deal damage, its last known information is used to determine whether it had infect. - 702.89e The infect rules function no matter what zone an object with infect deals damage from. - 702.89f Multiple instances of infect on the same object are redundant. - + * + * 702.89. Infect 702.89a Infect is a static ability. 702.89b Damage dealt + * to a player by a source with infect doesn’t cause that player to lose + * life. Rather, it causes the player to get that many poison counters. See + * rule 119.3. 702.89c Damage dealt to a creature by a source with infect + * isn’t marked on that creature. Rather, it causes that many -1/-1 counters + * to be put on that creature. See rule 119.3. 702.89d If a permanent leaves + * the battlefield before an effect causes it to deal damage, its last known + * information is used to determine whether it had infect. 702.89e The + * infect rules function no matter what zone an object with infect deals + * damage from. 702.89f Multiple instances of infect on the same object are + * redundant. + * */ - @Test public void testNormalUse() { addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect @@ -64,16 +66,15 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 2); assertLife(playerA, 20); - assertLife(playerB, 20); - + assertLife(playerB, 20); + } - @Test public void testLoseInfectUse() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect attack(2, playerB, "Tine Shrike"); @@ -84,23 +85,29 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 18); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + /** - * Inkmoth Nexus has no effect it he attacks becaus it has infect but there are no counters added + * Inkmoth Nexus has no effect it he attacks becaus it has infect but there + * are no counters added * http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/296553-melira-sylvok-outcast-vs-inkmoth-nexus */ @Test public void testInkmothNexusLoseInfect() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - - addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); - addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + // Creatures your opponents control lose infect. + // Creatures you control can't have -1/-1 counters placed on them. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + // Put a -1/-1 counter on target creature. When that creature dies this turn, its controller gets a poison counter. + addCard(Zone.HAND, playerA, "Virulent Wound"); // Instant {B} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); - // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. + addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Virulent Wound", "Melira, Sylvok Outcast"); + // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. // (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: {this} becomes"); attack(2, playerB, "Inkmoth Nexus"); @@ -108,13 +115,15 @@ public class InfectTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertGraveyardCount(playerA, "Virulent Wound", 1); + assertPowerToughness(playerA, "Melira, Sylvok Outcast", 2, 2); assertTapped("Plains", true); assertTapped("Inkmoth Nexus", true); assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 20); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java index a5c8ac00991..f7768675288 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java @@ -198,4 +198,34 @@ public class PersistTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Glen Elendra Archmage", 1); assertPowerToughness(playerA, "Glen Elendra Archmage", 1, 1); } + + @Test + public void testMeliraSylvokOutcast() { + + // You can't get poison counters. + // Creatures you control can't have -1/-1 counters placed on them. + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast", 1); // 2/2 + // When Murderous Redcap enters the battlefield, it deals damage equal to its power to target creature or player. + // Persist + addCard(Zone.HAND, playerA, "Murderous Redcap", 1); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 2); + assertPowerToughness(playerA, "Murderous Redcap", 2, 2); // Got no -1/-1 after returning because of Melira in play + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java index eca34b84cd3..31fc57868bf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java @@ -11,7 +11,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class UndyingTest extends CardTestPlayerBase { /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithBoost() { @@ -29,7 +30,8 @@ public class UndyingTest extends CardTestPlayerBase { } /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithMassBoost() { @@ -62,7 +64,7 @@ public class UndyingTest extends CardTestPlayerBase { // Target creature gets -3/-3 until end of turn. addCard(Zone.HAND, playerA, "Last Gasp"); // Undying Evil - // Target creature gains undying until end of turn. + // Target creature gains undying until end of turn. // When it dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) addCard(Zone.HAND, playerA, "Undying Evil"); @@ -76,9 +78,9 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Elite Vanguard", 3, 2); } - /** - * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist died it returns to the bf under opponent's control." + * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist + * died it returns to the bf under opponent's control." */ @Test public void testUndyingControlledReturnsToOwner() { @@ -105,18 +107,20 @@ public class UndyingTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.END_TURN); execute(); - assertGraveyardCount(playerB, "Threads of Disloyalty", 1); - assertGraveyardCount(playerA, "Lightning Bolt",1); + assertGraveyardCount(playerB, "Threads of Disloyalty", 1); + assertGraveyardCount(playerA, "Lightning Bolt", 1); assertPermanentCount(playerB, "Strangleroot Geist", 0); assertPermanentCount(playerA, "Strangleroot Geist", 1); assertPowerToughness(playerA, "Strangleroot Geist", 3, 2); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield + * + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndying() { @@ -125,7 +129,7 @@ public class UndyingTest extends CardTestPlayerBase { // Creature - Zombie, 1/1 {1}{B} // Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) addCard(Zone.HAND, playerA, "Butcher Ghoul"); - + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.HAND, playerB, "Lightning Bolt"); // Anafenza, the Foremost @@ -141,17 +145,18 @@ public class UndyingTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Anafenza, the Foremost", 1); assertGraveyardCount(playerB, "Lightning Bolt", 1); - + assertPermanentCount(playerA, "Butcher Ghoul", 0); assertExileCount("Butcher Ghoul", 1); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * if both leave the battlefield at the same time + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield if both leave the battlefield at the same time * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndyingWrath() { @@ -208,4 +213,33 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); } + + /** + * Tatterkite is getting counters on it, i have him in a edh deck with + * Mikaeus, the Lunarch and when Tatterkite dies it triggers the undying and + * he gets the +1/+1 counters + */ + @Test + public void testUndyingMikaeusAndTatterkite() { + addCard(Zone.HAND, playerA, "Lightning Bolt", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + // Whenever a Human deals damage to you, destroy it. + // Other non-Human creatures you control get +1/+1 and have undying. + addCard(Zone.BATTLEFIELD, playerA, "Mikaeus, the Unhallowed", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Tatterkite", 1); // Artifact Creature - Scarecrow 2/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Tatterkite"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerA, "Tatterkite", 1); + assertPermanentCount(playerA, "Mikaeus, the Unhallowed", 1); + assertPowerToughness(playerA, "Tatterkite", 3, 2); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java index ecd169b3272..599b9f7f0aa 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class AddingCountersToPermanentsTest extends CardTestPlayerBase { @Test @@ -47,7 +46,7 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library. addCard(Zone.HAND, playerA, "Black Sun's Zenith", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Witch's Familiar", 1); @@ -59,14 +58,13 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Silvercoat Lion", 1); assertGraveyardCount(playerB, "Silvercoat Lion", 1); - - assertPermanentCount(playerA, "Witch's Familiar", 1); + + assertPermanentCount(playerA, "Witch's Familiar", 1); assertPowerToughness(playerA, "Witch's Familiar", 0, 1); - assertPermanentCount(playerB, "Witch's Familiar", 1); + assertPermanentCount(playerB, "Witch's Familiar", 1); assertPowerToughness(playerB, "Witch's Familiar", 0, 1); - } -} \ No newline at end of file +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java index 0c2a6912486..395b217c589 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java @@ -36,14 +36,31 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PlayFromNonHandZoneTest extends CardTestPlayerBase { + @Test + public void testWorldheartPhoenixNormal() { + // Creature - Phoenix {3}{R} + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // If you do, it enters the battlefield with two +1/+1 counters on it. + addCard(Zone.HAND, playerA, "Worldheart Phoenix"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Worldheart Phoenix"); // can only be cast by {W}{U}{B}{R}{G} + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPowerToughness(playerA, "Worldheart Phoenix", 2, 2); + + } + @Test public void testWorldheartPhoenixNoMana() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); @@ -53,16 +70,15 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 0); - - } + assertPermanentCount(playerA, "Worldheart Phoenix", 0); + } @Test public void testWorldheartPhoenix() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); @@ -76,11 +92,10 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 1); - - } - - + assertPermanentCount(playerA, "Worldheart Phoenix", 1); + + } + @Test public void testNarsetEnlightenedMaster() { // First strike @@ -90,38 +105,36 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { skipInitShuffling(); addCard(Zone.LIBRARY, playerB, "Silvercoat Lion"); - addCard(Zone.LIBRARY, playerB, "Abzan Banner"); + addCard(Zone.LIBRARY, playerB, "Abzan Banner"); // Ferocious - If you control a creature with power 4 or greater, you may cast Dragon Grip as though it had flash. (You may cast it any time you could cast an instant.) // Enchant creature // Enchanted creature gets +2/+0 and has first strike. - addCard(Zone.LIBRARY, playerB, "Dragon Grip"); + addCard(Zone.LIBRARY, playerB, "Dragon Grip"); // You gain 2 life for each creature you control. - addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); - addCard(Zone.LIBRARY, playerB, "Plains"); - + addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); + addCard(Zone.LIBRARY, playerB, "Plains"); + attack(2, playerB, "Narset, Enlightened Master"); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Silvercoat Lion"); // can't be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Abzan Banner"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Dragon Grip", "Narset, Enlightened Master"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Peach Garden Oath"); // can be cast from exile - + setStopAt(2, PhaseStep.END_TURN); execute(); assertExileCount("Silvercoat Lion", 1); - assertPermanentCount(playerB, "Abzan Banner", 1); - assertPermanentCount(playerB, "Dragon Grip", 1); + assertPermanentCount(playerB, "Abzan Banner", 1); + assertPermanentCount(playerB, "Dragon Grip", 1); assertGraveyardCount(playerB, "Peach Garden Oath", 1); - + assertPowerToughness(playerB, "Narset, Enlightened Master", 5, 2); - + assertHandCount(playerB, "Plains", 1); assertLife(playerA, 17); assertLife(playerB, 22); - - - } - - + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java new file mode 100644 index 00000000000..e844aacf1f8 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java @@ -0,0 +1,176 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.abilities.Ability; +import mage.constants.AbilityType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DependentEffectsTest extends CardTestPlayerBase { + + /** + * Opalescence plus Enchanted Evening are still not wiping any lands. + */ + @Test + public void testLandsAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Opalescence", 1); // {2}{W}{W} + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 9); + addCard(Zone.BATTLEFIELD, playerA, "War Horn", 1); + + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enchanted Evening"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + assertPowerToughness(playerA, "War Horn", 3, 3); + + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + /** + * Opalescense is dependent on Enchanted Evening, so it will be applied + * after it regardless of timestamp. + * + * Tokens can also have mana costs, and as a consequence of that, converted + * mana costs. A token created with Rite of Replication would have the mana + * cost of the creature it targeted. Most tokens do not have mana costs + * though. + * + * Tokens with no mana costs would be 0/0, as you said, and would indeed be + * put into owner's graveyard next time State Based Actionas are performed. + * Tokens with mana costs would naturally have whatever power and toughness + * their CMC indicated. + */ + @Test + public void testTokensAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.BATTLEFIELD, playerA, "Opalescence", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + // Kicker {5} + // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. + addCard(Zone.HAND, playerA, "Rite of Replication", 1); // This token can have a cmc + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Cobblebrute", 1); // 5/2 cmc = 4 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // Put two 1/1 white Soldier creature tokens onto the battlefield. + addCard(Zone.HAND, playerB, "Raise the Alarm"); // Instant {1}{W} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of Replication", "Cobblebrute"); + setChoice(playerA, "No"); // no kicker + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Raise the Alarm"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Enchanted Evening"); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Rite of Replication", 1); + assertGraveyardCount(playerB, "Raise the Alarm", 1); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + + assertPowerToughness(playerB, "Cobblebrute", 4, 4); + assertPowerToughness(playerA, "Cobblebrute", 4, 4); + + assertPermanentCount(playerB, "Soldier", 0); + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + @Test + public void testYixlidJailerAndNecroticOozeBasic() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("Two abilities for Necrotic Ooze", 2, numberOfActivatedAbilities); + } + + @Test + public void testYixlidJailerAndNecroticOozeLooseAll() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + // Cards in graveyards lose all abilities. + addCard(Zone.HAND, playerA, "Yixlid Jailer", 1); // Creature - {1}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yixlid Jailer"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Yixlid Jailer", 1); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("All abilities from cards in graveyard are removed - so no abilities for Necrotic Ooze", 0, numberOfActivatedAbilities); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java index 1242402d45e..f57e5f93424 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java @@ -19,4 +19,99 @@ public class CryptoplasmTest extends CardTestPlayerBase { assertLife(playerB, 20); assertPermanentCount(playerA, "Craw Wurm", 2); } + + /** + * I have a Cryptoplasm in play, currently copying a Sigiled Paladin, and I + * enchant it with a Followed Footsteps. Next turn the aura triggers (the + * Crypto is still copying the same creature) and places a token on the + * battlefield, except the token is an untransformed Cryptoplasm, when it + * should be a Sigiled Paladin with Cryptoplasm's ability (as per rule + * 706.3), since that's what the enchanted creature currently is. + * + * 6/1/2011 If another creature becomes a copy of Cryptoplasm, it will + * become a copy of whatever Cryptoplasm is currently copying (if anything), + * plus it will have Cryptoplasm's triggered ability. + */ + @Test + public void testFollowedFootsteps() { + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Sigiled Paladin", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // Enchant creature + // At the beginning of your upkeep, put a token that's a copy of enchanted creature onto the battlefield. + addCard(Zone.HAND, playerB, "Followed Footsteps", 1); // {3}{U}{U} + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 1); // {1}{U}{U} + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Followed Footsteps"); + addTarget(playerB, "Sigiled Paladin[only copy]"); + + setStopAt(4, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerB, "Followed Footsteps", 1); + assertPermanentCount(playerB, "Cryptoplasm", 0); + assertPermanentCount(playerB, "Sigiled Paladin", 2); + } + + /** + * I'm at 8 life, opponent (AI) is at 21. I have a Cryptoplasm currently + * copying my opponent's Divinity of Pride, the Crypto also has my Followed + * Footsteps attached to it. Additionally, I have another Cryptoplasm on the + * battlefield also copying the same Divinity, and a Clever Impersonator + * that ETB copying the first Cryptoplasm and is currently also a copy of + * the Divinity. + * + * Opponent attacks with his only Divinity of Pride (4/4) and a Serra + * Avenger (3/3). I block the Divinity with two of my Divinity copies (the + * Clever Impersonator and unenchanted Cryptoplasm) and the Avenger with the + * enchanted Divinity (originally a Cryptoplasm). My opponent's Divinity + * kills my two copies and dies, and then his Avenger dies and kills the + * Divinity blocking it, also sending my Followed Footsteps down with it. + * + * How does any of that add up? Not only should his Divinity only kill one + * of mine since it was a 4/4 and only becomes an 8/8 after dealing its + * damage (at which point it should be too late to go back and say the 4 + * damage are now 8, since it was that exact damage that put him at 25 + * life), but even more confusing is how the Serra Avenger, which is a 3/3, + * somehow kills my 4/4 that had suffered no other damage that turn. + * + * No other permanents in play at that moment had any influence in this + * either, they were only basic lands and a couple of creatures with no + * relevant abilities. + * + * I won't put aside me completely missing something here, but I really + * can't see any other explanation to this other than a game bug. + */ + @Test + public void testDamageLifelink() { + setLife(playerA, 21); + setLife(playerB, 8); + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Divinity of Pride", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 2); // {1}{U}{U} + addTarget(playerB, "Divinity of Pride"); + addTarget(playerB, "Divinity of Pride"); + + attack(3, playerA, "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerB, "Cryptoplasm", 0); + + assertPermanentCount(playerA, "Divinity of Pride", 0); + assertPermanentCount(playerB, "Divinity of Pride", 1); + + assertLife(playerB, 16); + assertLife(playerA, 25); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java index 0c211862d2c..103cd628814 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java @@ -125,11 +125,11 @@ public class EmblemsTest extends CardTestPlayerBase { /** * Liliana, Defiant Necromancer: -8: 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."; + * creature dies, return it to the battlefield under your control at the + * beginning of the next end step."; * - * Tests "Whenever a creature you control dies, return it to the battlefield - * under your control at the beginning of the next end step." + * Tests "Whenever a creature dies, return it to the battlefield under your + * control at the beginning of the next end step." */ @Test public void testLilianaDefiantNecromancer() { @@ -152,7 +152,7 @@ public class EmblemsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1); assertPermanentCount(playerA, "Elite Vanguard", 1); - assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertHandCount(playerA, 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java new file mode 100644 index 00000000000..e0056f8638c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class TargetedTriggeredTest extends CardTestPlayerBase { + + /** + * Tests that the first spell that targets Kira, Great Glass-Spinner is + * countered. + * + */ + @Test + @Ignore + // this does currently not work in test, because the target event will be fired earlier during tests, + // so the zone change counter for the fixed target of the counterspell will not work + public void testKiraGreatGlassSpinnerFirstSpellTurn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + addCard(Zone.BATTLEFIELD, playerB, "Kira, Great Glass-Spinner", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Kira, Great Glass-Spinner"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerB, "Kira, Great Glass-Spinner", 1); + } + +} diff --git a/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java new file mode 100644 index 00000000000..bcbf272c1ec --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.common; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + */ +public class AttacksAloneTriggeredAbility extends TriggeredAbilityImpl { + + public AttacksAloneTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public AttacksAloneTriggeredAbility(final AttacksAloneTriggeredAbility ability) { + super(ability); + } + + @Override + public AttacksAloneTriggeredAbility copy() { + return new AttacksAloneTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if(game.getActivePlayerId().equals(this.controllerId) ) { + UUID creatureId = this.getSourceId(); + if(creatureId != null) { + if(game.getCombat().attacksAlone() && creatureId == game.getCombat().getAttackers().get(0)) { + UUID defender = game.getCombat().getDefenderId(creatureId); + if(defender != null) { + for(Effect effect: getEffects()) { + effect.setTargetPointer(new FixedTarget(defender)); + } + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks alone, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java index 26196743f86..1a7e9fc3938 100644 --- a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java +++ b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java @@ -30,11 +30,11 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; - /** - * Checks if the player has its commander in play + * Checks if the player has its commander in play and controls it * * @author LevelX2 */ @@ -42,7 +42,8 @@ public class CommanderInPlayCondition implements Condition { private static CommanderInPlayCondition fInstance = null; - private CommanderInPlayCondition() {} + private CommanderInPlayCondition() { + } public static Condition getInstance() { if (fInstance == null) { @@ -55,7 +56,8 @@ public class CommanderInPlayCondition implements Condition { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - return game.getPermanent(controller.getCommanderId()) != null; + Permanent commander = game.getPermanent(controller.getCommanderId()); + return commander != null && commander.getControllerId().equals(source.getControllerId()); } return false; } @@ -65,4 +67,4 @@ public class CommanderInPlayCondition implements Condition { return "As long as you control your commander"; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java new file mode 100644 index 00000000000..5de2bff16dc --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author LoneFox + */ +public class SacrificeCostConvertedMana implements DynamicValue { + + private final String type; + + public SacrificeCostConvertedMana(String type) { + this.type = type; + } + + public SacrificeCostConvertedMana(SacrificeCostConvertedMana value) { + this.type = value.type; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + for(Cost cost : sourceAbility.getCosts()) { + if(cost instanceof SacrificeTargetCost) { + SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost; + int totalCMC = 0; + for(Permanent permanent : sacrificeCost.getPermanents()) { + totalCMC += permanent.getManaCost().convertedManaCost(); + } + return totalCMC; + } + } + return 0; + } + + @Override + public SacrificeCostConvertedMana copy() { + return new SacrificeCostConvertedMana(this); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the sacrificed " + type + "'s converted mana cost"; + } +} diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java index 5f6987ab47c..355ff4347a5 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffect.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java @@ -1,34 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import java.util.List; +import java.util.Set; +import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; import mage.constants.Duration; @@ -43,25 +44,42 @@ import mage.game.Game; public interface ContinuousEffect extends Effect { boolean isUsed(); + boolean isDiscarded(); + void discard(); + Duration getDuration(); + long getOrder(); + void setOrder(long order); + boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game); + boolean hasLayer(Layer layer); + boolean isInactive(Ability source, Game game); + void init(Ability source, Game game); + Layer getLayer(); + SubLayer getSublayer(); + void overrideRuleText(String text); + List getAffectedObjects(); + Set isDependentTo(List allEffectsInLayer); + @Override void newId(); + @Override ContinuousEffect copy(); - + boolean isTemporary(); + void setTemporary(boolean temporary); } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java index e793058a81d..48bd0bf8a27 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java @@ -29,6 +29,7 @@ package mage.abilities.effects; import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; @@ -250,4 +251,9 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.temporary = temporary; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + return null; + } + } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index a6030dc051b..8871ea4658f 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -38,6 +38,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import mage.MageObject; @@ -851,8 +852,9 @@ public class ContinuousEffects implements Serializable { //20091005 - 613 public void apply(Game game) { removeInactiveEffects(game); - List layerEffects = getLayeredEffects(game); - List layer = filterLayeredEffects(layerEffects, Layer.CopyEffects_1); + List activeLayerEffects = getLayeredEffects(game); + + List layer = filterLayeredEffects(activeLayerEffects, Layer.CopyEffects_1); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -861,10 +863,10 @@ public class ContinuousEffects implements Serializable { } //Reload layerEffect if copy effects were applied if (layer.size() > 0) { - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); } - layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); + layer = filterLayeredEffects(activeLayerEffects, Layer.ControlChangingEffects_2); // apply control changing effects multiple times if it's needed // for cases when control over permanents with change control abilities is changed // e.g. Mind Control is controlled by Steal Enchantment @@ -882,55 +884,72 @@ public class ContinuousEffects implements Serializable { // reset control before reapplying control changing effects game.getBattlefield().resetPermanentsControl(); } - layer = filterLayeredEffects(layerEffects, Layer.TextChangingEffects_3); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TextChangingEffects_3, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.TypeChangingEffects_4); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TypeChangingEffects_4, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.ColorChangingEffects_5); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.ColorChangingEffects_5, SubLayer.NA, ability, game); - } - } - Map> appliedEffects = new HashMap<>(); + applyLayer(activeLayerEffects, Layer.TextChangingEffects_3, game); + applyLayer(activeLayerEffects, Layer.TypeChangingEffects_4, game); + applyLayer(activeLayerEffects, Layer.ColorChangingEffects_5, game); + + Map> appliedEffectAbilities = new HashMap<>(); boolean done = false; + Map> waitingEffects = new LinkedHashMap<>(); + Set appliedEffects = new HashSet<>(); while (!done) { // loop needed if a added effect adds again an effect (e.g. Level 5- of Joraga Treespeaker) done = true; - layer = filterLayeredEffects(layerEffects, Layer.AbilityAddingRemovingEffects_6); + layer = filterLayeredEffects(activeLayerEffects, Layer.AbilityAddingRemovingEffects_6); for (ContinuousEffect effect : layer) { - if (layerEffects.contains(effect)) { - List appliedAbilities = appliedEffects.get(effect); + if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + List appliedAbilities = appliedEffectAbilities.get(effect); HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { if (appliedAbilities == null || !appliedAbilities.contains(ability)) { if (appliedAbilities == null) { appliedAbilities = new ArrayList<>(); - appliedEffects.put(effect, appliedAbilities); + appliedEffectAbilities.put(effect, appliedAbilities); } appliedAbilities.add(ability); effect.apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); done = false; // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(effect.getId()); + + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Iterator>> iterator = waitingEffects.entrySet().iterator(); iterator.hasNext();) { + Map.Entry> entry = iterator.next(); + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + appliedAbilities = appliedEffectAbilities.get(entry.getKey()); + abilities = layeredEffects.getAbility(entry.getKey().getId()); + for (Ability ability : abilities) { + if (appliedAbilities == null || !appliedAbilities.contains(ability)) { + if (appliedAbilities == null) { + appliedAbilities = new ArrayList<>(); + appliedEffectAbilities.put(entry.getKey(), appliedAbilities); + } + appliedAbilities.add(ability); + entry.getKey().apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); + done = false; + // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(entry.getKey().getId()); + iterator.remove(); + } } } } } } - layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); + layer = filterLayeredEffects(activeLayerEffects, Layer.PTChangingEffects_7); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -952,14 +971,14 @@ public class ContinuousEffects implements Serializable { effect.apply(Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.PlayerEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.PlayerEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { effect.apply(Layer.PlayerEffects, SubLayer.NA, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.RulesEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.RulesEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -968,6 +987,42 @@ public class ContinuousEffects implements Serializable { } } + private void applyLayer(List activeLayerEffects, Layer currentLayer, Game game) { + List layer = filterLayeredEffects(activeLayerEffects, currentLayer); + if (!layer.isEmpty()) { + int numberOfEffects = layer.size(); + Set appliedEffects = new HashSet<>(); + Map> waitingEffects = new LinkedHashMap<>(); + for (ContinuousEffect effect : layer) { + if (numberOfEffects > 1) { // If an effect is dependent to not applied effects yet of this layer, so wait to apply this effect + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + } + applyContinuousEffect(effect, currentLayer, game); + appliedEffects.add(effect.getId()); + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Entry> entry : waitingEffects.entrySet()) { + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + applyContinuousEffect(entry.getKey(), currentLayer, game); + appliedEffects.add(entry.getKey().getId()); + } + } + } + } + } + } + + private void applyContinuousEffect(ContinuousEffect effect, Layer currentLayer, Game game) { + HashSet abilities = layeredEffects.getAbility(effect.getId()); + for (Ability ability : abilities) { + effect.apply(currentLayer, SubLayer.NA, ability, game); + } + } + /** * Adds a continuous ability with a reference to a sourceId. It's used for * effects that cease to exist again So this effects were removed again diff --git a/Mage/src/mage/abilities/effects/common/CipherEffect.java b/Mage/src/mage/abilities/effects/common/CipherEffect.java index d4bbdb20a20..89e6b391124 100644 --- a/Mage/src/mage/abilities/effects/common/CipherEffect.java +++ b/Mage/src/mage/abilities/effects/common/CipherEffect.java @@ -28,8 +28,6 @@ package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -38,6 +36,9 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.Card; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -46,37 +47,37 @@ import mage.target.targetpointer.FixedTarget; /** * FAQ 2013/01/11 - * + * * 702.97. Cipher * - * 702.97a Cipher appears on some instants and sorceries. It represents two static - * abilities, one that functions while the spell is on the stack and one that functions - * while the card with cipher is in the exile zone. "Cipher" means "If this spell is - * represented by a card, you may exile this card encoded on a creature you control" - * and "As long as this card is encoded on that creature, that creature has 'Whenever - * this creature deals combat damage to a player, you may copy this card and you may - * cast the copy without paying its mana cost.'" + * 702.97a Cipher appears on some instants and sorceries. It represents two + * static abilities, one that functions while the spell is on the stack and one + * that functions while the card with cipher is in the exile zone. "Cipher" + * means "If this spell is represented by a card, you may exile this card + * encoded on a creature you control" and "As long as this card is encoded on + * that creature, that creature has 'Whenever this creature deals combat damage + * to a player, you may copy this card and you may cast the copy without paying + * its mana cost.'" * - * 702.97b The term "encoded" describes the relationship between the card with cipher - * while in the exile zone and the creature chosen when the spell represented by that - * card resolves. + * 702.97b The term "encoded" describes the relationship between the card with + * cipher while in the exile zone and the creature chosen when the spell + * represented by that card resolves. * - * 702.97c The card with cipher remains encoded on the chosen creature as long as the - * card with cipher remains exiled and the creature remains on the battlefield. The - * card remains encoded on that object even if it changes controller or stops being - * a creature, as long as it remains on the battlefield. + * 702.97c The card with cipher remains encoded on the chosen creature as long + * as the card with cipher remains exiled and the creature remains on the + * battlefield. The card remains encoded on that object even if it changes + * controller or stops being a creature, as long as it remains on the + * battlefield. * * TODO: Implement Cipher as two static abilities concerning the rules. * * @author LevelX2 */ - - public class CipherEffect extends OneShotEffect { public CipherEffect() { super(Outcome.Copy); - staticText ="

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; + staticText = "

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; } public CipherEffect(final CipherEffect effect) { @@ -86,10 +87,11 @@ public class CipherEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); if (controller != null) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); if (target.canChoose(source.getControllerId(), game) - && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { + && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { controller.chooseTarget(outcome, target, source, game); Card sourceCard = game.getCard(source.getSourceId()); Permanent targetCreature = game.getPermanent(target.getFirstTarget()); @@ -99,9 +101,10 @@ public class CipherEffect extends OneShotEffect { ContinuousEffect effect = new GainAbilityTargetEffect(ability, Duration.Custom); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": Spell ciphered to ").append(targetCreature.getLogName()).toString()); - return sourceCard.moveToExile(null, "", source.getSourceId(), game); + } + return controller.moveCards(sourceCard, null, Zone.EXILED, source, game); } else { return false; } @@ -119,7 +122,7 @@ public class CipherEffect extends OneShotEffect { class CipherStoreEffect extends OneShotEffect { - private UUID cipherCardId; + private final UUID cipherCardId; public CipherStoreEffect(UUID cipherCardId, String ruleText) { super(Outcome.Copy); @@ -141,13 +144,13 @@ class CipherStoreEffect extends OneShotEffect { SpellAbility ability = copyCard.getSpellAbility(); // remove the cipher effect from the copy Effect cipherEffect = null; - for (Effect effect :ability.getEffects()) { + for (Effect effect : ability.getEffects()) { if (effect instanceof CipherEffect) { cipherEffect = effect; } } ability.getEffects().remove(cipherEffect); - if (ability != null && ability instanceof SpellAbility) { + if (ability instanceof SpellAbility) { controller.cast(ability, game, true); } } diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java index f9199f93724..6546b17f8ae 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.abilities.Ability; @@ -49,8 +48,7 @@ public class DestroyAllEffect extends OneShotEffect { this.noRegen = noRegen; if (noRegen) { staticText = "destroy all " + filter.getMessage() + ". They can't be regenerated"; - } - else { + } else { staticText = "destroy all " + filter.getMessage(); } } @@ -72,6 +70,7 @@ public class DestroyAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, noRegen); } diff --git a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java index c2a40e79706..5fb44e58499 100644 --- a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java @@ -27,11 +27,11 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.Outcome; @@ -42,9 +42,8 @@ import mage.util.CardUtil; /** * - * @author anonymous + * @author Luna Skyrise */ - public class RevealTargetPlayerLibraryEffect extends OneShotEffect { private DynamicValue amountCards; @@ -73,28 +72,18 @@ public class RevealTargetPlayerLibraryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - - if (player == null || targetPlayer == null) { + MageObject sourceObject = source.getSourceObject(game); + if (player == null || targetPlayer == null || sourceObject == null) { return false; } Cards cards = new CardsImpl(Zone.LIBRARY); - int count = Math.min(targetPlayer.getLibrary().size(), amountCards.calculate(game, source, this)); - for (int i = 0; i < count; i++) { - Card card = targetPlayer.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); - } - } - - player.lookAtCards("Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); - + cards.addAll(player.getLibrary().getTopCards(game, amountCards.calculate(game, source, this))); + player.revealCards(sourceObject.getIdName() + " - Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); return true; } private String setText() { - StringBuilder sb = new StringBuilder("Reveal the top "); - sb.append(CardUtil.numberToText(amountCards.toString())).append(" cards of target player's library."); - return sb.toString(); + return "Reveal the top " + CardUtil.numberToText(amountCards.toString()) + " cards of target player's library."; } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java new file mode 100644 index 00000000000..0ee881c3773 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java @@ -0,0 +1,57 @@ +/* + * 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.effects.common.continuous; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class LoseAbilityAllEffect extends ContinuousEffectImpl { + + protected final FilterPermanent filter; + protected final Ability ability; + + public LoseAbilityAllEffect(FilterPermanent filter, Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.filter = filter; + this.ability = ability; + staticText = filter.getMessage() + " lose " + ability.toString() + (duration.toString().isEmpty() ? "" : " " + duration.toString()); + } + + public LoseAbilityAllEffect(final LoseAbilityAllEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + this.ability = effect.ability; + } + + @Override + public LoseAbilityAllEffect copy() { + return new LoseAbilityAllEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (permanent != null) { + while (permanent.getAbilities().contains(ability)) { + permanent.getAbilities().remove(ability); + } + } + } + return true; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java index 54115e932f1..2e2020eda6c 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java @@ -1,52 +1,50 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.continuous; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffectImpl; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; - /** * * @author LevelX2 */ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { - private FilterPermanent filter; + private final FilterPermanent filter; public LoseAllAbilitiesAllEffect(FilterPermanent filter, Duration duration) { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); @@ -65,7 +63,7 @@ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (permanent != null) { permanent.removeAllAbilities(source.getSourceId(), game); } diff --git a/Mage/src/mage/abilities/keyword/DevoidAbility.java b/Mage/src/mage/abilities/keyword/DevoidAbility.java new file mode 100644 index 00000000000..ec25acc9727 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/DevoidAbility.java @@ -0,0 +1,41 @@ +/* + * 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.keyword; + +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class DevoidAbility extends SimpleStaticAbility { + + public DevoidAbility(ObjectColor color) { + super(Zone.ALL, null); + color.setBlack(false); + color.setWhite(false); + color.setGreen(false); + color.setBlue(false); + color.setRed(false); + } + + public DevoidAbility(final DevoidAbility ability) { + super(ability); + } + + @Override + public DevoidAbility copy() { + return new DevoidAbility(this); + } + + @Override + public String getRule() { + return "Devoid (This card has no color.)"; + } + +} diff --git a/Mage/src/mage/abilities/keyword/IngestAbility.java b/Mage/src/mage/abilities/keyword/IngestAbility.java new file mode 100644 index 00000000000..40f68dc4b8f --- /dev/null +++ b/Mage/src/mage/abilities/keyword/IngestAbility.java @@ -0,0 +1,71 @@ +/* + * 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.keyword; + +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class IngestAbility extends DealsCombatDamageToAPlayerTriggeredAbility { + + public IngestAbility() { + super(new IngestEffect(), false, true); + + } + + public IngestAbility(IngestAbility ability) { + super(ability); + } + + @Override + public String getRule() { + return "Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)"; + } + + @Override + public IngestAbility copy() { + return new IngestAbility(this); + } +} + +class IngestEffect extends OneShotEffect { + + public IngestEffect() { + super(Outcome.Exile); + this.staticText = "that player exiles the top card of his or her library"; + } + + public IngestEffect(final IngestEffect effect) { + super(effect); + } + + @Override + public IngestEffect copy() { + return new IngestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + Card card = targetPlayer.getLibrary().getFromTop(game); + if (card != null) { + targetPlayer.moveCards(card, Zone.LIBRARY, Zone.EXILED, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index b72b534d449..54db7c4463f 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -366,7 +366,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { break; case STACK: StackObject stackObject = game.getStack().getSpell(getId()); - if (stackObject == null && (this instanceof SplitCard)) { // handle if half od Split cast is on the stack + if (stackObject == null && (this instanceof SplitCard)) { // handle if half of Split cast is on the stack stackObject = game.getStack().getSpell(((SplitCard) this).getLeftHalfCard().getId()); if (stackObject == null) { stackObject = game.getStack().getSpell(((SplitCard) this).getRightHalfCard().getId()); @@ -602,10 +602,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card { PermanentCard permanent = new PermanentCard(this, event.getPlayerId(), game); // make sure the controller of all continuous effects of this card are switched to the current controller game.getContinuousEffects().setController(objectId, event.getPlayerId()); - // check if there are counters to add to the permanent (e.g. from non replacement effects like Persist) - checkForCountersToAdd(permanent, game); game.addPermanent(permanent); setZone(Zone.BATTLEFIELD, game); + // check if there are counters to add to the permanent (e.g. from non replacement effects like Persist) + checkForCountersToAdd(permanent, game); game.setScopeRelevant(true); permanent.setTapped(tapped); permanent.setFaceDown(facedown, game); diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index 7aef9b2756d..27b093adee1 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -60,16 +60,32 @@ public abstract class SplitCard extends CardImpl { public SplitCard(SplitCard card) { super(card); - this.leftHalfCard = card.leftHalfCard.copy(); + this.leftHalfCard = card.getLeftHalfCard().copy(); + ((SplitCardHalf) leftHalfCard).setParentCard(this); this.rightHalfCard = card.rightHalfCard.copy(); + ((SplitCardHalf) rightHalfCard).setParentCard(this); } - public Card getLeftHalfCard() { - return leftHalfCard; + public SplitCardHalf getLeftHalfCard() { + return (SplitCardHalf) leftHalfCard; } - public Card getRightHalfCard() { - return rightHalfCard; + public SplitCardHalf getRightHalfCard() { + return (SplitCardHalf) rightHalfCard; + } + + @Override + public void assignNewId() { + super.assignNewId(); + leftHalfCard.assignNewId(); + rightHalfCard.assignNewId(); + } + + @Override + public void setCopy(boolean isCopy) { + super.setCopy(isCopy); + leftHalfCard.setCopy(isCopy); + rightHalfCard.setCopy(isCopy); } @Override diff --git a/Mage/src/mage/cards/SplitCardHalf.java b/Mage/src/mage/cards/SplitCardHalf.java index 52fa1086bb6..f1ec3976601 100644 --- a/Mage/src/mage/cards/SplitCardHalf.java +++ b/Mage/src/mage/cards/SplitCardHalf.java @@ -12,5 +12,7 @@ package mage.cards; public interface SplitCardHalf extends Card { @Override - Card copy(); + SplitCardHalf copy(); + + void setParentCard(SplitCard card); } diff --git a/Mage/src/mage/cards/SplitCardHalfImpl.java b/Mage/src/mage/cards/SplitCardHalfImpl.java index af6cc3f6ab6..818d539c4af 100644 --- a/Mage/src/mage/cards/SplitCardHalfImpl.java +++ b/Mage/src/mage/cards/SplitCardHalfImpl.java @@ -62,7 +62,7 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public Card getMainCard() { + public SplitCard getMainCard() { return splitCardParent; } @@ -74,8 +74,13 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public SplitCardHalfImpl copy() { + public SplitCardHalf copy() { return new SplitCardHalfImpl(this); } + @Override + public void setParentCard(SplitCard card) { + this.splitCardParent = card; + } + } diff --git a/Mage/src/mage/cards/mock/MockSplitCard.java b/Mage/src/mage/cards/mock/MockSplitCard.java index fd9e8a06181..e1c03601f41 100644 --- a/Mage/src/mage/cards/mock/MockSplitCard.java +++ b/Mage/src/mage/cards/mock/MockSplitCard.java @@ -50,13 +50,13 @@ public class MockSplitCard extends SplitCard { } CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card)); - if(leftHalf != null) { - this.leftHalfCard = new MockCard(leftHalf); + if (leftHalf != null) { + this.leftHalfCard = new MockSplitCardHalf(leftHalf); } CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card)); - if(rightHalf != null) { - this.rightHalfCard = new MockCard(rightHalf); + if (rightHalf != null) { + this.rightHalfCard = new MockSplitCardHalf(rightHalf); } } diff --git a/Mage/src/mage/cards/mock/MockSplitCardHalf.java b/Mage/src/mage/cards/mock/MockSplitCardHalf.java new file mode 100644 index 00000000000..4eefd3d0b1a --- /dev/null +++ b/Mage/src/mage/cards/mock/MockSplitCardHalf.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.mock; + +import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; +import mage.cards.repository.CardInfo; + +/** + * + * @author LevelX2 + */ +public class MockSplitCardHalf extends MockCard implements SplitCardHalf { + + public MockSplitCardHalf(CardInfo card) { + super(card); + } + + public MockSplitCardHalf(final MockSplitCardHalf card) { + super(card); + } + + @Override + public MockSplitCardHalf copy() { + return new MockSplitCardHalf(this); + } + + @Override + public void setParentCard(SplitCard card) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/Mage/src/mage/constants/PlayerAction.java b/Mage/src/mage/constants/PlayerAction.java index e572a6f2b65..746db8f13ad 100644 --- a/Mage/src/mage/constants/PlayerAction.java +++ b/Mage/src/mage/constants/PlayerAction.java @@ -60,5 +60,11 @@ public enum PlayerAction { ADD_PERMISSION_TO_ROLLBACK_TURN, DENY_PERMISSON_TO_ROLLBACK_TURN, PERMISSION_REQUESTS_ALLOWED_ON, - PERMISSION_REQUESTS_ALLOWED_OFF + PERMISSION_REQUESTS_ALLOWED_OFF, + REQUEST_AUTO_ANSWER_ID_YES, + REQUEST_AUTO_ANSWER_ID_NO, + REQUEST_AUTO_ANSWER_TEXT_YES, + REQUEST_AUTO_ANSWER_TEXT_NO, + REQUEST_AUTO_ANSWER_RESET_ALL, + } diff --git a/Mage/src/mage/filter/FilterCard.java b/Mage/src/mage/filter/FilterCard.java index 97cb529a055..2995a693184 100644 --- a/Mage/src/mage/filter/FilterCard.java +++ b/Mage/src/mage/filter/FilterCard.java @@ -64,30 +64,29 @@ public class FilterCard extends FilterObject { } //20130711 708.6c - /* If anything performs a comparison involving multiple characteristics or - * values of one or more split cards in any zone other than the stack or - * involving multiple characteristics or values of one or more fused split - * spells, each characteristic or value is compared separately. If each of - * the individual comparisons would return a “yes” answer, the whole + /* If anything performs a comparison involving multiple characteristics or + * values of one or more split cards in any zone other than the stack or + * involving multiple characteristics or values of one or more fused split + * spells, each characteristic or value is compared separately. If each of + * the individual comparisons would return a “yes” answer, the whole * comparison returns a “yes” answer. The individual comparisons may involve * different halves of the same split card. */ - @Override public boolean match(Card card, Game game) { - if(card.isSplitCard()){ - return super.match(((SplitCard)card).getLeftHalfCard(), game) || - super.match(((SplitCard)card).getRightHalfCard(), game); - } - else{ - return super.match(card, game); + if (card.isSplitCard()) { + return super.match(((SplitCard) card).getLeftHalfCard(), game) + || super.match(((SplitCard) card).getRightHalfCard(), game); + } else { + return super.match(card, game); } } + public boolean match(Card card, UUID playerId, Game game) { if (!this.match(card, game)) { return false; } - + return Predicates.and(extraPredicates).apply(new ObjectPlayer(card, playerId), game); } @@ -111,7 +110,7 @@ public class FilterCard extends FilterObject { } return filtered; } - + public boolean hasPredicates() { return predicates.size() > 0; } diff --git a/Mage/src/mage/game/Exile.java b/Mage/src/mage/game/Exile.java index 688a2727586..42b513092f3 100644 --- a/Mage/src/mage/game/Exile.java +++ b/Mage/src/mage/game/Exile.java @@ -100,7 +100,7 @@ public class Exile implements Serializable, Copyable { } public List getAllCards(Game game) { - List cards = new ArrayList(); + List cards = new ArrayList<>(); for (ExileZone exile : exileZones.values()) { cards.addAll(exile.getCards(game)); } diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 0c10ca220a6..e558dc02ad7 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -73,6 +73,7 @@ import mage.game.turn.Turn; import mage.players.Player; import mage.players.PlayerList; import mage.players.Players; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; public interface Game extends MageItem, Serializable { @@ -221,13 +222,13 @@ public interface Game extends MageItem, Serializable { void addPlayerQueryEventListener(Listener listener); - void fireAskPlayerEvent(UUID playerId, String message); + void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source); void fireChooseChoiceEvent(UUID playerId, Choice choice); - void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options); - void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options); void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index bddd512b7bb..dbaf2085082 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -67,6 +67,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; import mage.cards.decks.Deck; import mage.choices.Choice; import mage.constants.CardType; @@ -118,6 +119,7 @@ import mage.target.Target; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.util.GameLog; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; import mage.watchers.Watchers; import mage.watchers.common.BlockedAttackerWatcher; @@ -1524,6 +1526,9 @@ public abstract class GameImpl implements Game, Serializable { Iterator copiedCards = this.getState().getCopiedCards().iterator(); while (copiedCards.hasNext()) { Card card = copiedCards.next(); + if (card instanceof SplitCardHalf) { + continue; // only the main card is moves, not the halves + } Zone zone = state.getZone(card.getId()); if (zone != Zone.BATTLEFIELD && zone != Zone.STACK) { switch (zone) { @@ -1886,11 +1891,11 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireAskPlayerEvent(UUID playerId, String message) { + public void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source) { if (simulation) { return; } - playerQueryEventSource.ask(playerId, message); + playerQueryEventSource.ask(playerId, message.getMessage(), source, addMessageToOptions(message, null)); } @Override @@ -1914,19 +1919,19 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, targets, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), targets, required, addMessageToOptions(message, options)); } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, cards, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), cards, required, addMessageToOptions(message, options)); } /** @@ -2692,4 +2697,19 @@ public abstract class GameImpl implements Game, Serializable { return enterWithCounters.get(sourceId); } + private Map addMessageToOptions(MessageToClient message, Map options) { + if (message.getSecondMessage() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("secondMessage", message.getSecondMessage()); + } + if (message.getHintText() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("hintText", message.getHintText()); + } + return options; + } } diff --git a/Mage/src/mage/game/events/PlayerQueryEvent.java b/Mage/src/mage/game/events/PlayerQueryEvent.java index 6b299f2085e..ea9b9434512 100644 --- a/Mage/src/mage/game/events/PlayerQueryEvent.java +++ b/Mage/src/mage/game/events/PlayerQueryEvent.java @@ -149,8 +149,14 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.playerId = playerId; } - public static PlayerQueryEvent askEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, null); + public static PlayerQueryEvent askEvent(UUID playerId, String message, Ability source, Map options) { + if (source != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("originalId", source.getOriginalId()); + } + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, options); } public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, String objectName, List choices) { diff --git a/Mage/src/mage/game/events/PlayerQueryEventSource.java b/Mage/src/mage/game/events/PlayerQueryEventSource.java index 7620ed1657c..ea5f0aed97e 100644 --- a/Mage/src/mage/game/events/PlayerQueryEventSource.java +++ b/Mage/src/mage/game/events/PlayerQueryEventSource.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.TriggeredAbility; import mage.cards.Card; @@ -58,8 +59,8 @@ public class PlayerQueryEventSource implements EventSource, Se dispatcher.removeAllListener(); } - public void ask(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message)); + public void ask(UUID playerId, String message, Ability source, Map options) { + dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message, source, options)); } public void select(UUID playerId, String message) { diff --git a/Mage/src/mage/game/permanent/token/EldraziScionToken.java b/Mage/src/mage/game/permanent/token/EldraziScionToken.java new file mode 100644 index 00000000000..1b8e1cd6a74 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/EldraziScionToken.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game.permanent.token; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class EldraziScionToken extends Token { + + public EldraziScionToken() { + super("Eldrazi Scion", "1/1 colorless Eldrazi Scion creature token with \"Sacrifice this creature: Add {1} to your mana pool.\""); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + subtype.add("Scion"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana, new SacrificeSourceCost())); + this.setOriginalExpansionSetCode("BFZ"); + } + +} diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 631b5614a3c..dbcd6373b2e 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2983,8 +2983,8 @@ public abstract class PlayerImpl implements Player, Serializable { case LIBRARY: for (Card card : cards) { fromZone = game.getState().getZone(card.getId()); - boolean withName = fromZone.equals(Zone.BATTLEFIELD) || !card.isFaceDown(game); - if (moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, withName)) { + boolean hideCard = fromZone.equals(Zone.HAND) || fromZone.equals(Zone.LIBRARY); + if (moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, !hideCard)) { successfulMovedCards.add(card); } } diff --git a/Mage/src/mage/util/MessageToClient.java b/Mage/src/mage/util/MessageToClient.java new file mode 100644 index 00000000000..fca0e289063 --- /dev/null +++ b/Mage/src/mage/util/MessageToClient.java @@ -0,0 +1,43 @@ +/* + * 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.util; + +/** + * + * @author LevelX2 + */ +public class MessageToClient { + + private String message; + private String secondMessage; + private String hintText; + + public MessageToClient(String message) { + this(message, null); + } + + public MessageToClient(String message, String secondMessage) { + this(message, secondMessage, null); + } + + public MessageToClient(String message, String secondMessage, String hintText) { + this.message = message; + this.secondMessage = secondMessage; + this.hintText = hintText; + } + + public String getMessage() { + return message; + } + + public String getSecondMessage() { + return secondMessage; + } + + public String getHintText() { + return hintText; + } +} diff --git a/Mage/src/mage/util/TreeNode.java b/Mage/src/mage/util/TreeNode.java index 7463b7addc6..b9d4620629a 100644 --- a/Mage/src/mage/util/TreeNode.java +++ b/Mage/src/mage/util/TreeNode.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.util; import java.util.ArrayList; @@ -34,14 +33,16 @@ import java.util.List; /** * * @author BetaSteward_at_googlemail.com + * @param */ public class TreeNode { + protected T data; protected List> children; public TreeNode() { super(); - children = new ArrayList>(); + children = new ArrayList<>(); } public TreeNode(T data) { @@ -70,7 +71,7 @@ public class TreeNode { } public void addChild(T child) { - children.add(new TreeNode(child)); + children.add(new TreeNode<>(child)); } public void addChildAt(int index, TreeNode child) throws IndexOutOfBoundsException { @@ -93,7 +94,7 @@ public class TreeNode { return this.data; } - public void setData(T data) { + private void setData(T data) { this.data = data; } @@ -116,10 +117,7 @@ public class TreeNode { return false; } final TreeNode other = (TreeNode) obj; - if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) { - return false; - } - return true; + return !(this.data != other.data && (this.data == null || !this.data.equals(other.data))); } } diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index 001c8188202..0c1e2957d03 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -61,24 +61,24 @@ public class CopyTokenFunction implements Function { if (source instanceof PermanentToken) { sourceObj = ((PermanentToken) source).getToken(); // to show the source image, the original values have to be used - target.setOriginalExpansionSetCode(((Token)sourceObj).getOriginalExpansionSetCode()); - target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber()); - target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard()); + target.setOriginalExpansionSetCode(((Token) sourceObj).getOriginalExpansionSetCode()); + target.setOriginalCardNumber(((Token) sourceObj).getOriginalCardNumber()); + target.setCopySourceCard(((PermanentToken) source).getToken().getCopySourceCard()); } else if (source instanceof PermanentCard) { - if (((PermanentCard)source).isMorphed() || ((PermanentCard)source).isManifested()) { + if (((PermanentCard) source).isMorphed() || ((PermanentCard) source).isManifested()) { MorphAbility.setPermanentToFaceDownCreature(target); return target; } else { - sourceObj = ((PermanentCard) source).getCard(); - target.setOriginalExpansionSetCode(source.getExpansionSetCode()); - target.setOriginalCardNumber(source.getCardNumber()); - target.setCopySourceCard((Card)sourceObj); + sourceObj = ((PermanentCard) source).getCard(); + target.setOriginalExpansionSetCode(source.getExpansionSetCode()); + target.setOriginalCardNumber(source.getCardNumber()); + target.setCopySourceCard((Card) sourceObj); } } else { target.setOriginalExpansionSetCode(source.getExpansionSetCode()); target.setOriginalCardNumber(source.getCardNumber()); if (source instanceof Card) { - target.setCopySourceCard((Card)source); + target.setCopySourceCard((Card) source); } } diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index d18b670427a..880b8d13ab2 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -1,245 +1,247 @@ -#!/usr/bin/perl -w - -#author: North - -use Text::Template; -use strict; - - -my $authorFile = 'author.txt'; -my $dataFile = 'mtg-cards-data.txt'; -my $setsFile = 'mtg-sets-data.txt'; -my $knownSetsFile = 'known-sets.txt'; -my $keywordsFile = 'keywords.txt'; - - -my %cards; -my %sets; -my %knownSets; -my %keywords; - -sub toCamelCase { - my $string = $_[0]; - $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; - $string =~ s/[-,\s\']//g; - $string; -} - -sub fixCost { - my $string = $_[0]; - $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; - $string; -} - -my $author; -if (-e $authorFile) { - open (DATA, $authorFile); - $author = ; - chomp $author; - close(DATA); -} else { - $author = 'anonymous'; -} - -open (DATA, $dataFile) || die "can't open $dataFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $cards{$data[0]}{$data[1]} = \@data; -} -close(DATA); - -open (DATA, $setsFile) || die "can't open $setsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $sets{$data[0]}= $data[1]; - #print "$data[0]--$data[1]\n" -} -close(DATA); - -open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $knownSets{$data[0]}= $data[1]; -} -close(DATA); - -open (DATA, $keywordsFile) || die "can't open $keywordsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $keywords{toCamelCase($data[0])}= $data[1]; -} -close(DATA); - -my %cardTypes; -$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; -$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; -$cardTypes{'Creature'} = 'CardType.CREATURE'; -$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; -$cardTypes{'Instant'} = 'CardType.INSTANT'; -$cardTypes{'Land'} = 'CardType.LAND'; -$cardTypes{'Sorcery'} = 'CardType.SORCERY'; -$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; -$cardTypes{'Tribal'} = 'CardType.TRIBAL'; - -my %raritiesConversion; -$raritiesConversion{'C'} = 'COMMON'; -$raritiesConversion{'U'} = 'UNCOMMON'; -$raritiesConversion{'R'} = 'RARE'; -$raritiesConversion{'M'} = 'MYTHIC'; -$raritiesConversion{'Special'} = 'SPECIAL'; -$raritiesConversion{'Bonus'} = 'BONUS'; - -# Get card name -my $cardName = $ARGV[0]; -if(!$cardName) { - print 'Enter a card name: '; - $cardName = ; - chomp $cardName; -} - -if (!exists $cards{$cardName}) { - die "Card name doesn't exist: $cardName\n"; -} - -# Check if card is already implemented -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - if(-e $fileName) { - die "$cardName is already implemented (set found in: $setName).\n"; - } - } -} - -# Generate the cards -my $simpleOnly = $ARGV[1] || 'false'; -my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my %vars; - -$vars{'author'} = $author; -$vars{'name'} = $cardName; -$vars{'className'} = toCamelCase($cardName); - -if ($simpleOnly ne 'true') { - print "Files generated:\n"; -} -my $baseRarity = ''; -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - my $result; - - $vars{'set'} = $knownSets{$setName}; - $vars{'expansionSetCode'} = $sets{$setName}; - $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; - $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; - - if (!$baseRarity) { - $baseRarity = $cards{$cardName}{$setName}[3]; - - $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); - $vars{'power'} = $cards{$cardName}{$setName}[6]; - $vars{'toughness'} = $cards{$cardName}{$setName}[7]; - - my @types; - $vars{'subType'} = ''; - my $type = $cards{$cardName}{$setName}[5]; - while ($type =~ m/([a-zA-Z]+)( )*/g) { - if (exists($cardTypes{$1})) { - push(@types, $cardTypes{$1}); - } else { - if (@types) { - $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; - } else { - $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; - } - } - } - $vars{'type'} = join(', ', @types); - - $vars{'abilitiesImports'} = ''; - $vars{'abilities'} = ''; - - my @abilities = split('\$', $cards{$cardName}{$setName}[8]); - foreach my $ability (@abilities) { - $ability =~ s/ .+?<\/i>//g; - - my $notKeyWord; - foreach my $keyword (keys %keywords) { - if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { - $notKeyWord = 'false'; - my @ka = split(', ', $ability); - foreach my $kw (@ka) { - my $kwUnchanged = $kw; - foreach my $kk (keys %keywords) { - if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { - $kw = $kk; - } - } - if ($keywords{$kw}) { - $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); - if ($keywords{$kw} eq 'instance') { - $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 'number') { - $ability =~ m/(\b\d+?\b)/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; - } elsif ($keywords{$kw} eq 'cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } elsif ($keywords{$kw} eq 'card, manaString') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; - } elsif ($keywords{$kw} eq 'card, cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } - - - $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; - } else { - $vars{'abilities'} .= "\n // $kwUnchanged"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - } - } - - if (!$notKeyWord) { - $vars{'abilities'} .= "\n // $ability"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - if ($vars{'abilities'}) { - $vars{'abilities'} = "\n" . $vars{'abilities'}; - } - - $vars{'baseSet'} = $vars{'set'}; - $vars{'baseClassName'} = $vars{'className'}; - - $result = $template->fill_in(HASH => \%vars); - } else { - $vars{'rarityExtended'} = ''; - if ($baseRarity ne $cards{$cardName}{$setName}[3]) { - $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; - } - $result = $templateExtended->fill_in(HASH => \%vars); - } - - open CARD, "> $fileName"; - print CARD $result; - close CARD; - - print "$vars{'set'}.$vars{'className'}\n"; - } else { - print "Set not found in known sets: $setName\n"; - } -} +#!/usr/bin/perl -w + +#author: North + +use Text::Template; +use strict; + + +my $authorFile = 'author.txt'; +my $dataFile = 'mtg-cards-data.txt'; +my $setsFile = 'mtg-sets-data.txt'; +my $knownSetsFile = 'known-sets.txt'; +my $keywordsFile = 'keywords.txt'; + + +my %cards; +my %sets; +my %knownSets; +my %keywords; + +sub toCamelCase { + my $string = $_[0]; + $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; + $string =~ s/[-,\s\']//g; + $string; +} + +sub fixCost { + my $string = $_[0]; + $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; + $string; +} + +my $author; +if (-e $authorFile) { + open (DATA, $authorFile); + $author = ; + chomp $author; + close(DATA); +} else { + $author = 'anonymous'; +} + +open (DATA, $dataFile) || die "can't open $dataFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $cards{$data[0]}{$data[1]} = \@data; +} +close(DATA); + +open (DATA, $setsFile) || die "can't open $setsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $sets{$data[0]}= $data[1]; + #print "$data[0]--$data[1]\n" +} +close(DATA); + +open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $knownSets{$data[0]}= $data[1]; +} +close(DATA); + +open (DATA, $keywordsFile) || die "can't open $keywordsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $keywords{toCamelCase($data[0])}= $data[1]; +} +close(DATA); + +my %cardTypes; +$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; +$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; +$cardTypes{'Creature'} = 'CardType.CREATURE'; +$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; +$cardTypes{'Instant'} = 'CardType.INSTANT'; +$cardTypes{'Land'} = 'CardType.LAND'; +$cardTypes{'Sorcery'} = 'CardType.SORCERY'; +$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; +$cardTypes{'Tribal'} = 'CardType.TRIBAL'; + +my %raritiesConversion; +$raritiesConversion{'C'} = 'COMMON'; +$raritiesConversion{'U'} = 'UNCOMMON'; +$raritiesConversion{'R'} = 'RARE'; +$raritiesConversion{'M'} = 'MYTHIC'; +$raritiesConversion{'Special'} = 'SPECIAL'; +$raritiesConversion{'Bonus'} = 'BONUS'; + +# Get card name +my $cardName = $ARGV[0]; +if(!$cardName) { + print 'Enter a card name: '; + $cardName = ; + chomp $cardName; +} + +if (!exists $cards{$cardName}) { + die "Card name doesn't exist: $cardName\n"; +} + +# Check if card is already implemented +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + if(-e $fileName) { + die "$cardName is already implemented (set found in: $setName).\n"; + } + } +} + +# Generate the cards +my $simpleOnly = $ARGV[1] || 'false'; +my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my %vars; + +$vars{'author'} = $author; +$vars{'name'} = $cardName; +$vars{'className'} = toCamelCase($cardName); + +if ($simpleOnly ne 'true') { + print "Files generated:\n"; +} +my $baseRarity = ''; +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + my $result; + + $vars{'set'} = $knownSets{$setName}; + $vars{'expansionSetCode'} = $sets{$setName}; + $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; + $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; + + if (!$baseRarity) { + $baseRarity = $cards{$cardName}{$setName}[3]; + + $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); + $vars{'power'} = $cards{$cardName}{$setName}[6]; + $vars{'toughness'} = $cards{$cardName}{$setName}[7]; + + my @types; + $vars{'subType'} = ''; + my $type = $cards{$cardName}{$setName}[5]; + while ($type =~ m/([a-zA-Z]+)( )*/g) { + if (exists($cardTypes{$1})) { + push(@types, $cardTypes{$1}); + } else { + if (@types) { + $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; + } else { + $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; + } + } + } + $vars{'type'} = join(', ', @types); + + $vars{'abilitiesImports'} = ''; + $vars{'abilities'} = ''; + + my @abilities = split('\$', $cards{$cardName}{$setName}[8]); + foreach my $ability (@abilities) { + $ability =~ s/ .+?<\/i>//g; + + my $notKeyWord; + foreach my $keyword (keys %keywords) { + if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { + $notKeyWord = 'false'; + my @ka = split(', ', $ability); + foreach my $kw (@ka) { + my $kwUnchanged = $kw; + foreach my $kk (keys %keywords) { + if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { + $kw = $kk; + } + } + if ($keywords{$kw}) { + $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); + if ($keywords{$kw} eq 'instance') { + $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 'color') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability(this.color));"; + } elsif ($keywords{$kw} eq 'number') { + $ability =~ m/(\b\d+?\b)/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; + } elsif ($keywords{$kw} eq 'cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } elsif ($keywords{$kw} eq 'card, manaString') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; + } elsif ($keywords{$kw} eq 'card, cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } + + + $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; + } else { + $vars{'abilities'} .= "\n // $kwUnchanged"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + } + } + + if (!$notKeyWord) { + $vars{'abilities'} .= "\n // $ability"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + if ($vars{'abilities'}) { + $vars{'abilities'} = "\n" . $vars{'abilities'}; + } + + $vars{'baseSet'} = $vars{'set'}; + $vars{'baseClassName'} = $vars{'className'}; + + $result = $template->fill_in(HASH => \%vars); + } else { + $vars{'rarityExtended'} = ''; + if ($baseRarity ne $cards{$cardName}{$setName}[3]) { + $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; + } + $result = $templateExtended->fill_in(HASH => \%vars); + } + + open CARD, "> $fileName"; + print CARD $result; + close CARD; + + print "$vars{'set'}.$vars{'className'}\n"; + } else { + print "Set not found in known sets: $setName\n"; + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 0e7ad4bea2d..dd3fd7f5942 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -11,6 +11,7 @@ Dash|card, manaString| Deathtouch|instance| Delve|new| Dethrone|new| +Devoid|color| Defender|instance| Double Strike|instance| Dredge|number| @@ -32,6 +33,7 @@ Hexproof|instance| Indestructible|instance| Infect|instance| Intimidate|instance| +Ingest|new| Islandcycling|cost| Islandwalk|new| Level up|cost| diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 31debb5a353..21372f8ee9f 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27324,11 +27324,67 @@ Swamp|Duel Decks: Zendikar vs. Eldrazi|72|L||Basic Land - Swamp|||B| Mountain|Duel Decks: Zendikar vs. Eldrazi|73|L||Basic Land - Mountain|||M| Mountain|Duel Decks: Zendikar vs. Eldrazi|74|L||Basic Land - Mountain|||M| Mountain|Duel Decks: Zendikar vs. Eldrazi|75|L||Basic Land - Mountain|||M| -Sheer Drop|Battle for Zendikar|999|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| -Dominator Drone|Battle for Zendikar|999|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| -Retreat to Kazandu|Battle for Zendikar|999||U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| -Forerunner of Slaughter|Battle for Zendikar|999|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| -Veteran Warleader|Battle for Zendikar|999|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| -Oblivion Sower|Battle for Zendikar|999|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| +Blight Herder|Battle for Zendikar|2|R|{5}|Creature - Eldrazi Processor|4|5|When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Breaker of Armies|Battle for Zendikar|3|U|{8}|Creature - Eldrazi|10|8|All creatures able to block Breaker of Armies do so.| +Eldrazi Devastator|Battle for Zendikar|7|C|{8}|Creature - Eldrazi|8|9|Trample| +Kozilek's Channeler|Battle for Zendikar|10|C|{5}|Creature - Eldrazi|4|4|{T}: Add {2} to your mana pool.| +Oblivion Sower|Battle for Zendikar|11|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| +Titan's Presence|Battle for Zendikar|14|U|{3}|Instant|||As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand.$Exile target creature if its power is less than or equal to the revealed card's power.| +Ulamog, the Ceaseless Hunger|Battle for Zendikar|15|M|{10}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| +Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice Felidar Cub: Destroy target enchantment.| +Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|||+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.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| +Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| +Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4|3|Rally - Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn.| +Lantern Scout|Battle for Zendikar|37|R|{2}{W}|Creature - Human Scout Ally|3|2|Rally - Whenever Lantern Scout or another Ally enters the battlefield under your control, creatures you control gain lifelink until end of turn.| +Retreat to Emeria|Battle for Zendikar|44|U|{3}{W}|Enchantment|||Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn.| +Sheer Drop|Battle for Zendikar|48|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Incubator Drone|Battle for Zendikar|60|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Mist Intruder|Battle for Zendikar|61|C|{1}{U}|Creature - Eldrazi Drone|1|2|Devoid (This card has no color.)$Flying$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| +Coastal Discovery|Battle for Zendikar|73|U|{3}{U}|Sorcery|||Draw two cards.$Awaken 4 - {5}U} If you cast this spell for {5}{U}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| Guardian of Tazeem|Battle for Zendikar|78|R|{3}{U}{U}|Creature - Sphinx|4|5|Flying$Landfall - Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step.| -Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| \ No newline at end of file +Dominator Drone|Battle for Zendikar|92|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| +Skitterskin|Battle for Zendikar|97|U|{3}{B}|Creature - Eldrazi Drone|4|3|Devoid (This card has no color.)$Skitterskin can't block.${1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature.| +Defiant Bloodlord|Battle for Zendikar|107|R|{5}{B}{B}|Creature - Vampire|4|5|Flying$Whenever you gain life, target opponent loses that much life.| +Ruinous Path|Battle for Zendikar|123|R|{1}{B}{B}|Sorcery|||Destroy target creature or planeswalker.$Awaken 4-{5}{B}{B} (If you cast this spell for {5}{B}{B}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Barrage Tyrant|Battle for Zendikar|127|R|{4}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)${2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player.| +Radiant Flames|Battle for Zendikar|151|R|{2}{R}|Sorcery||Converge - Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.| +Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players.| +Nissa's Renewal|Battle for Zendikar|180|R|{5}{G}|Sorcery|||Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life.| +Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| +Retreat to Kazandu|Battle for Zendikar|186||U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| +Brood Butcher|Battle for Zendikar|199|R|{3}{B}{G}|Creature - Eldrazi Drone|3|3|Devoid (This card has no color.)$When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."${B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn.| +Forerunner of Slaughter|Battle for Zendikar|204|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| +Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| +Veteran Warleader|Battle for Zendikar|221|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| +Hedron Archive|Battle for Zendikar|223|U|{4}|Artifact|||{T}: Add {2} to your mana pool.${2}, {T}, Sacrifice Hedron Archive: Draw two cards.| +Canopy Vista|Battle for Zendikar|234|R||Land - Forest Plains|||Canopy Vista enters the battlefield tapped unless you control two or more basic lands.| +Cinder Glade|Battle for Zendikar|235|R||Land - Mountain Forest|||Cinder Glade enters the battlefield tapped unless you control two or more basic lands.| +Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Prairie Stream|Battle for Zendikar|241|R||Land - Plains Island|||Prairie Stream enters the battlefield tapped unless you control two or more basic lands.| +Smoldering Marsh|Battle for Zendikar|247|R||Land - Swamp Mountain|||Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands.| +Sunken Hollow|Battle for Zendikar|248|R||Land - Island Swamp|||Sunken Hollow enters the battlefield tapped unless you control two or more basic lands.| +Plains|Battle for Zendikar|250|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|251|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|252|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|253|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|254|L||Basic Land - Forest|||W| +Island|Battle for Zendikar|255|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|256|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|257|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|258|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|259|L||Basic Land - Forest|||U| +Swamp|Battle for Zendikar|260|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|261|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|262|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|263|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|264|L||Basic Land - Forest|||B| +Mountain|Battle for Zendikar|265|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|266|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|267|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|268|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|269|L||Basic Land - Forest|||R| +Forest|Battle for Zendikar|270|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|271|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|272|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|273|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|274|L||Basic Land - Forest|||G| \ No newline at end of file