Merge pull request #1 from magefree/master

Updating to master.
This commit is contained in:
Eagle0600 2015-08-20 17:23:18 +10:00
commit 2e7c251c32
487 changed files with 22821 additions and 2810 deletions

View file

@ -1,37 +1,36 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 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 * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * 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 * 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 * 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 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * 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 * 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 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
/* /*
* ShowCardsDialog.java * ShowCardsDialog.java
* *
* Created on 3-Feb-2010, 8:59:11 PM * Created on 3-Feb-2010, 8:59:11 PM
*/ */
package mage.client.dialog; package mage.client.dialog;
import java.awt.Component; import java.awt.Component;
@ -41,7 +40,6 @@ import java.awt.event.MouseListener;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import javax.swing.ImageIcon;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import mage.cards.CardDimensions; import mage.cards.CardDimensions;
@ -54,29 +52,25 @@ import mage.client.util.gui.GuiDisplayUtil;
import mage.view.CardsView; import mage.view.CardsView;
import mage.view.SimpleCardsView; import mage.view.SimpleCardsView;
import org.mage.card.arcane.CardPanel; import org.mage.card.arcane.CardPanel;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
/** /**
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class ShowCardsDialog extends MageDialog implements MouseListener { public class ShowCardsDialog extends MageDialog implements MouseListener {
// remember if this dialog was already auto positioned, so don't do it after the first time // remember if this dialog was already auto positioned, so don't do it after the first time
private boolean positioned; private boolean positioned;
/** /**
* Creates new form ShowCardsDialog * Creates new form ShowCardsDialog
*/ */
public ShowCardsDialog() { public ShowCardsDialog() {
this.positioned = false; this.positioned = false;
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
initComponents(); initComponents();
this.setModal(false); this.setModal(false);
} }
public void cleanUp() { public void cleanUp() {
@ -96,18 +90,18 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) {
loadCards(name, showCards, bigCard, dimension, gameId, modal, null); loadCards(name, showCards, bigCard, dimension, gameId, modal, null);
} }
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options) { public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options) {
this.title = name; this.title = name;
this.setTitelBarToolTip(name); this.setTitelBarToolTip(name);
cardArea.loadCards(showCards, bigCard, dimension, gameId, this); cardArea.loadCards(showCards, bigCard, dimension, gameId, this);
if (options != null) { if (options != null) {
if (options.containsKey("chosen")) { if (options.containsKey("chosen")) {
java.util.List<UUID> chosenCards = (java.util.List<UUID>)options.get("chosen"); java.util.List<UUID> chosenCards = (java.util.List<UUID>) options.get("chosen");
cardArea.selectCards(chosenCards); cardArea.selectCards(chosenCards);
} }
if (options.containsKey("choosable")) { if (options.containsKey("choosable")) {
java.util.List<UUID> choosableCards = (java.util.List<UUID>)options.get("choosable"); java.util.List<UUID> choosableCards = (java.util.List<UUID>) options.get("choosable");
cardArea.markCards(choosableCards); cardArea.markCards(choosableCards);
} }
} }
@ -115,7 +109,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) { if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) {
MageFrame.getDesktop().add(this, JLayeredPane.DEFAULT_LAYER); MageFrame.getDesktop().add(this, JLayeredPane.DEFAULT_LAYER);
} }
pack(); pack();
this.revalidate(); this.revalidate();
this.repaint(); this.repaint();
@ -156,7 +150,9 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
this.hideDialog(); if (e.getSource() instanceof CardPanel) {
this.hideDialog();
}
} }
@Override @Override

View file

@ -31,7 +31,6 @@
* *
* Created on Jan 7, 2011, 2:15:48 PM * Created on Jan 7, 2011, 2:15:48 PM
*/ */
package mage.client.draft; package mage.client.draft;
import java.awt.Component; import java.awt.Component;
@ -123,14 +122,16 @@ public class DraftPanel extends javax.swing.JPanel {
private static final CardsView emptyView = new CardsView(); private static final CardsView emptyView = new CardsView();
/** Creates new form DraftPanel */ /**
* Creates new form DraftPanel
*/
public DraftPanel() { public DraftPanel() {
initComponents(); initComponents();
draftBooster.setOpaque(false); draftBooster.setOpaque(false);
draftPicks.setSortSetting(SortSettingDraft.getInstance()); draftPicks.setSortSetting(SortSettingDraft.getInstance());
draftPicks.setOpaque(false); draftPicks.setOpaque(false);
popupMenuPickedArea = new JPopupMenu(); popupMenuPickedArea = new JPopupMenu();
addPopupMenuPickArea(); addPopupMenuPickArea();
this.add(popupMenuPickedArea); this.add(popupMenuPickedArea);
@ -142,18 +143,17 @@ public class DraftPanel extends javax.swing.JPanel {
draftLeftPane.setOpaque(false); draftLeftPane.setOpaque(false);
countdown = new Timer(1000, countdown = new Timer(1000,
new ActionListener() { new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (--timeout > 0) { if (--timeout > 0) {
setTimeout(timeout); setTimeout(timeout);
} } else {
else { setTimeout(0);
setTimeout(0); countdown.stop();
countdown.stop(); }
} }
} }
}
); );
} }
@ -192,13 +192,13 @@ public class DraftPanel extends javax.swing.JPanel {
} }
} }
public void updateDraft(DraftView draftView) { public void updateDraft(DraftView draftView) {
if (draftView.getSets().size() != 3){ if (draftView.getSets().size() != 3) {
// Random draft // Random draft
this.txtPack1.setText("Random Boosters"); this.txtPack1.setText("Random Boosters");
this.txtPack2.setText("Random Boosters"); this.txtPack2.setText("Random Boosters");
this.txtPack3.setText("Random Boosters"); this.txtPack3.setText("Random Boosters");
}else{ } else {
this.txtPack1.setText(draftView.getSets().get(0)); this.txtPack1.setText(draftView.getSets().get(0));
this.txtPack2.setText(draftView.getSets().get(1)); this.txtPack2.setText(draftView.getSets().get(1));
this.txtPack3.setText(draftView.getSets().get(2)); this.txtPack3.setText(draftView.getSets().get(2));
@ -215,13 +215,13 @@ public class DraftPanel extends javax.swing.JPanel {
int left = draftView.getPlayers().size() - right; int left = draftView.getPlayers().size() - right;
int height = left * 18; int height = left * 18;
lblTableImage.setSize(new Dimension(lblTableImage.getWidth(), height)); lblTableImage.setSize(new Dimension(lblTableImage.getWidth(), height));
Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_left.png":"/draft/table_right.png"); Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_left.png" : "/draft/table_right.png");
BufferedImage resizedTable = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(tableImage, BufferedImage.TYPE_INT_ARGB), lblTableImage.getWidth()); BufferedImage resizedTable = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(tableImage, BufferedImage.TYPE_INT_ARGB), lblTableImage.getWidth());
lblTableImage.setIcon(new ImageIcon(resizedTable)); lblTableImage.setIcon(new ImageIcon(resizedTable));
int count = 0; int count = 0;
int numberPlayers = draftView.getPlayers().size(); int numberPlayers = draftView.getPlayers().size();
for(String playerName: draftView.getPlayers()) { for (String playerName : draftView.getPlayers()) {
count++; count++;
setPlayerNameToLabel(playerName, count, numberPlayers); setPlayerNameToLabel(playerName, count, numberPlayers);
} }
@ -232,13 +232,13 @@ public class DraftPanel extends javax.swing.JPanel {
int right = players / 2; int right = players / 2;
int left = players - right; int left = players - right;
if (index <= left) { if (index <= left) {
// left side down (1 - 8) // left side down (1 - 8)
tablePosition = index; tablePosition = index;
} else { } else {
// right side up (16 - 9) // right side up (16 - 9)
tablePosition = 9 + right - (index - left); tablePosition = 9 + right - (index - left);
} }
switch(tablePosition) { switch (tablePosition) {
case 1: case 1:
lblPlayer01.setText(name); lblPlayer01.setText(name);
break; break;
@ -296,46 +296,46 @@ public class DraftPanel extends javax.swing.JPanel {
loadCardsToPickedCardsArea(draftPickView.getPicks()); loadCardsToPickedCardsArea(draftPickView.getPicks());
this.draftPicks.clearCardEventListeners(); this.draftPicks.clearCardEventListeners();
this.draftPicks.addCardEventListener(new Listener<Event> () { this.draftPicks.addCardEventListener(new Listener<Event>() {
@Override @Override
public void event(Event event) { public void event(Event event) {
if (event.getEventName().equals("show-popup-menu")) { if (event.getEventName().equals("show-popup-menu")) {
if (event.getSource() != null) { if (event.getSource() != null) {
// Popup Menu Card // Popup Menu Card
cardIdPopupMenu = ((SimpleCardView)event.getSource()).getId(); cardIdPopupMenu = ((SimpleCardView) event.getSource()).getId();
popupMenuCardPanel.show(event.getComponent(), event.getxPos(), event.getyPos()); popupMenuCardPanel.show(event.getComponent(), event.getxPos(), event.getyPos());
} else { } else {
// Popup Menu area // Popup Menu area
popupMenuPickedArea.show(event.getComponent(), event.getxPos(), event.getyPos()); popupMenuPickedArea.show(event.getComponent(), event.getxPos(), event.getyPos());
}
} }
} }
} }
}
); );
// lower area that shows the booster // lower area that shows the booster
draftBooster.loadBooster(CardsViewUtil.convertSimple(draftPickView.getBooster()), bigCard); draftBooster.loadBooster(CardsViewUtil.convertSimple(draftPickView.getBooster()), bigCard);
this.draftBooster.clearCardEventListeners(); this.draftBooster.clearCardEventListeners();
this.draftBooster.addCardEventListener( this.draftBooster.addCardEventListener(
new Listener<Event> () { new Listener<Event>() {
@Override @Override
public void event(Event event) { public void event(Event event) {
if (event.getEventName().equals("pick-a-card")) { if (event.getEventName().equals("pick-a-card")) {
SimpleCardView source = (SimpleCardView) event.getSource(); SimpleCardView source = (SimpleCardView) event.getSource();
DraftPickView view = session.sendCardPick(draftId, source.getId(), cardsHidden); DraftPickView view = session.sendCardPick(draftId, source.getId(), cardsHidden);
if (view != null) { if (view != null) {
loadCardsToPickedCardsArea(view.getPicks()); loadCardsToPickedCardsArea(view.getPicks());
draftBooster.loadBooster(emptyView, bigCard); draftBooster.loadBooster(emptyView, bigCard);
Plugins.getInstance().getActionCallback().hidePopup(); Plugins.getInstance().getActionCallback().hidePopup();
setMessage("Waiting for other players"); setMessage("Waiting for other players");
}
}
if (event.getEventName().equals("mark-a-card")) {
SimpleCardView source = (SimpleCardView) event.getSource();
session.sendCardMark(draftId, source.getId());
} }
} }
if (event.getEventName().equals("mark-a-card")) {
SimpleCardView source = (SimpleCardView) event.getSource();
session.sendCardMark(draftId, source.getId());
}
} }
}
); );
setMessage("Pick a card"); setMessage("Pick a card");
if (!MageFrame.getInstance().isActive()) { if (!MageFrame.getInstance().isActive()) {
@ -352,7 +352,7 @@ public class DraftPanel extends javax.swing.JPanel {
private void loadCardsToPickedCardsArea(SimpleCardsView pickedCards) { private void loadCardsToPickedCardsArea(SimpleCardsView pickedCards) {
this.pickedCards = pickedCards; this.pickedCards = pickedCards;
for (Map.Entry<UUID,SimpleCardView> entry: pickedCards.entrySet()) { for (Map.Entry<UUID, SimpleCardView> entry : pickedCards.entrySet()) {
if (!cardsHidden.contains(entry.getKey())) { if (!cardsHidden.contains(entry.getKey())) {
pickedCardsShown.put(entry.getKey(), entry.getValue()); pickedCardsShown.put(entry.getKey(), entry.getValue());
} }
@ -360,22 +360,22 @@ public class DraftPanel extends javax.swing.JPanel {
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null); draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
} }
private void setTimeout(int s){ private void setTimeout(int s) {
int minute = s/60; int minute = s / 60;
int second = s - (minute*60); int second = s - (minute * 60);
String text; String text;
if(minute < 10){ if (minute < 10) {
text = "0" + Integer.toString(minute) + ":"; text = "0" + Integer.toString(minute) + ":";
}else{ } else {
text = Integer.toString(minute) + ":"; text = Integer.toString(minute) + ":";
} }
if(second < 10){ if (second < 10) {
text = text + "0" + Integer.toString(second); text = text + "0" + Integer.toString(second);
}else{ } else {
text = text + Integer.toString(second); text = text + Integer.toString(second);
} }
this.txtTimeRemaining.setText(text); this.txtTimeRemaining.setText(text);
if (s==6 && !draftBooster.isEmptyGrid()) { if (s == 6 && !draftBooster.isEmptyGrid()) {
AudioManager.playOnCountdown1(); AudioManager.playOnCountdown1();
} }
} }
@ -386,7 +386,7 @@ public class DraftPanel extends javax.swing.JPanel {
c = c.getParent(); c = c.getParent();
} }
if (c != null) { if (c != null) {
((DraftPane)c).removeDraft(); ((DraftPane) c).removeDraft();
} }
} }
@ -420,7 +420,6 @@ public class DraftPanel extends javax.swing.JPanel {
}); });
// popupMenuPickedArea.addSeparator(); // popupMenuPickedArea.addSeparator();
} }
private void addPopupMenuCardPanel() { private void addPopupMenuCardPanel() {
@ -439,7 +438,6 @@ public class DraftPanel extends javax.swing.JPanel {
}); });
// popupMenuCardPanel.addSeparator(); // popupMenuCardPanel.addSeparator();
} }
private void hideThisCard(UUID card) { private void hideThisCard(UUID card) {
@ -472,7 +470,7 @@ public class DraftPanel extends javax.swing.JPanel {
} }
if (currentBooster != null) { if (currentBooster != null) {
String lastPick = getCardName(getLastPick(pickView.getPicks().values())); String lastPick = getCardName(getLastPick(pickView.getPicks().values()));
if (lastPick != null) { if (lastPick != null && currentBooster.length > 1) {
logPick(lastPick); logPick(lastPick);
} }
currentBooster = null; currentBooster = null;
@ -490,7 +488,7 @@ public class DraftPanel extends javax.swing.JPanel {
private void setCurrentBoosterForLog(SimpleCardsView booster) { private void setCurrentBoosterForLog(SimpleCardsView booster) {
LinkedList<String> cards = new LinkedList<>(); LinkedList<String> cards = new LinkedList<>();
for (SimpleCardView simple: booster.values()) { for (SimpleCardView simple : booster.values()) {
String cardName = getCardName(simple); String cardName = getCardName(simple);
if (cardName != null) { if (cardName != null) {
cards.add(cardName); cards.add(cardName);
@ -515,7 +513,7 @@ public class DraftPanel extends javax.swing.JPanel {
private Path pathToDraftLog() { private Path pathToDraftLog() {
File saveDir = new File("gamelogs"); File saveDir = new File("gamelogs");
if(!saveDir.exists()) { if (!saveDir.exists()) {
saveDir.mkdirs(); saveDir.mkdirs();
} }
return new File(saveDir, logFilename).toPath(); return new File(saveDir, logFilename).toPath();
@ -545,11 +543,10 @@ public class DraftPanel extends javax.swing.JPanel {
return cardInfo != null ? cardInfo.getName() : null; return cardInfo != null ? cardInfo.getName() : null;
} }
/**
/** This method is called from within the constructor to * This method is called from within the constructor to initialize the form.
* initialize the form. * WARNING: Do NOT modify this code. The content of this method is always
* WARNING: Do NOT modify this code. The content of this method is * regenerated by the Form Editor.
* always regenerated by the Form Editor.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents

View file

@ -36,7 +36,7 @@ public class GathererSets implements Iterable<DownloadJob> {
private static final String[] withMythics = {"M10", "M11", "M12", "M13", "M14", "M15", "ORI", private static final String[] withMythics = {"M10", "M11", "M12", "M13", "M14", "M15", "ORI",
"DDF", "DDG", "DDH", "DDI", "DDJ", "DDK", "DDL", "DDM", "DDN", "DDF", "DDG", "DDH", "DDI", "DDJ", "DDK", "DDL", "DDM", "DDN",
"DD3", "DD3B", "DDO", "DD3", "DD3B", "DDO", "DDP",
"FVD", "FVE", "FVL", "FVR", "FVD", "FVE", "FVL", "FVR",
"V12", "V13", "V14", "V15", "V12", "V13", "V14", "V15",
"ALA", "CON", "ARB", "ALA", "CON", "ARB",

View file

@ -103,6 +103,7 @@ public class MagicCardsImageSource implements CardImageSource {
put("DDM", "duel-decks-jace-vs-vraska"); put("DDM", "duel-decks-jace-vs-vraska");
put("DDN", "duel-decks-speed-vs-cunning"); put("DDN", "duel-decks-speed-vs-cunning");
put("DDO", "duel-decks-elspeth-vs-kiora"); put("DDO", "duel-decks-elspeth-vs-kiora");
put("DDP", "duel-decks-zendikar-vs-eldrazi");
} }
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };

View file

@ -123,6 +123,7 @@ public class WizardCardsImageSource implements CardImageSource {
setsAliases.put("DDM", "Duel Decks: Jace vs. Vraska"); setsAliases.put("DDM", "Duel Decks: Jace vs. Vraska");
setsAliases.put("DDN", "Duel Decks: Speed vs. Cunning"); setsAliases.put("DDN", "Duel Decks: Speed vs. Cunning");
setsAliases.put("DDO", "Duel Decks: Elspeth vs. Kiora"); setsAliases.put("DDO", "Duel Decks: Elspeth vs. Kiora");
setsAliases.put("DDP", "Duel Decks: Zendikar vs. Eldrazi");
setsAliases.put("DGM", "Dragon's Maze"); setsAliases.put("DGM", "Dragon's Maze");
setsAliases.put("DIS", "Dissension"); setsAliases.put("DIS", "Dissension");
setsAliases.put("DKA", "Dark Ascension"); setsAliases.put("DKA", "Dark Ascension");

View file

@ -1,3 +1,9 @@
#Generate|TOK:DDP|Eldrazi Spawn 1|
#Generate|TOK:DDP|Eldrazi Spawn 2|
#Generate|TOK:DDP|Eldrazi Spawn 3|
#Generate|TOK:DDP|Hellion|
#Generate|TOK:DDP|Plant|
#Generate|TOK:MM2|Eldrazi Spawn 1| #Generate|TOK:MM2|Eldrazi Spawn 1|
#Generate|TOK:MM2|Eldrazi Spawn 2| #Generate|TOK:MM2|Eldrazi Spawn 2|
#Generate|TOK:MM2|Eldrazi Spawn 3| #Generate|TOK:MM2|Eldrazi Spawn 3|

View file

@ -64,6 +64,6 @@ ddd=gvl
unh=uh unh=uh
dde=pvc dde=pvc
# Remove setname as soon as the images can be downloaded # Remove setname as soon as the images can be downloaded
ignore.urls=TOK,MM2,V15,BFZ ignore.urls=TOK,MM2,V15,BFZ,DDP
# sets ordered by release time (newest goes first) # sets ordered by release time (newest goes first)
token.lookup.order=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 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

View file

@ -41,7 +41,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 3; public final static int MAGE_VERSION_PATCH = 3;
public final static String MAGE_VERSION_MINOR_PATCH = "v0"; public final static String MAGE_VERSION_MINOR_PATCH = "v2";
public final static String MAGE_VERSION_INFO = ""; public final static String MAGE_VERSION_INFO = "";
private final int major; private final int major;

View file

@ -152,6 +152,9 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
for (UUID uuid : abilityTargets) { for (UUID uuid : abilityTargets) {
MageObject mageObject = game.getObject(uuid); MageObject mageObject = game.getObject(uuid);
if (mageObject != null) { if (mageObject != null) {
if ((mageObject instanceof Card) && ((Card) mageObject).isFaceDown(game)) {
continue;
}
names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject)); names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject));
} }
} }

View file

@ -53,6 +53,7 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.StackAbility; import mage.game.stack.StackAbility;
import mage.players.Player; import mage.players.Player;
import mage.players.net.UserData;
import mage.target.Target; import mage.target.Target;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -75,6 +76,7 @@ public class SimulatedPlayer2 extends ComputerPlayer {
pass.setControllerId(playerId); pass.setControllerId(playerId);
this.isSimulatedPlayer = isSimulatedPlayer; this.isSimulatedPlayer = isSimulatedPlayer;
this.suggested = suggested; this.suggested = suggested;
this.userData = UserData.getDefaultUserDataView();
} }
public SimulatedPlayer2(final SimulatedPlayer2 player) { public SimulatedPlayer2(final SimulatedPlayer2 player) {

View file

@ -74,6 +74,7 @@ import mage.abilities.mana.ManaAbility;
import mage.abilities.mana.ManaOptions; import mage.abilities.mana.ManaOptions;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.decks.Deck; import mage.cards.decks.Deck;
import mage.cards.repository.CardCriteria; import mage.cards.repository.CardCriteria;
import mage.cards.repository.CardInfo; import mage.cards.repository.CardInfo;
@ -161,7 +162,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
private transient final static Logger log = Logger.getLogger(ComputerPlayer.class); private transient final static Logger log = Logger.getLogger(ComputerPlayer.class);
protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble
protected boolean ALLOW_INTERRUPT = true; // change this for test / debugging purposes to false to switch off interrupts while debugging protected boolean ALLOW_INTERRUPT = true; // change this for test / debugging purposes to false to switch off interrupts while debugging
private transient Map<Mana, Card> unplayable = new TreeMap<>(); private transient Map<Mana, Card> unplayable = new TreeMap<>();
private transient List<Card> playableNonInstant = new ArrayList<>(); private transient List<Card> playableNonInstant = new ArrayList<>();
@ -522,8 +523,11 @@ public class ComputerPlayer extends PlayerImpl implements Player {
} }
if (target instanceof TargetDiscard || target instanceof TargetCardInHand) { if (target instanceof TargetDiscard || target instanceof TargetCardInHand) {
if (outcome.isGood()) { if (outcome.isGood()) {
ArrayList<Card> cardsInHand = new ArrayList<>(hand.getCards(game)); Cards cards = new CardsImpl(target.possibleTargets(source.getSourceId(), getId(), game));
while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() > target.getTargets().size()) { ArrayList<Card> cardsInHand = new ArrayList<>(cards.getCards(game));
while (!target.isChosen()
&& target.possibleTargets(source.getSourceId(), getId(), game).size() > 0
&& target.getMaxNumberOfTargets() > target.getTargets().size()) {
Card card = pickBestCard(cardsInHand, null, target, source, game); Card card = pickBestCard(cardsInHand, null, target, source, game);
if (card != null) { if (card != null) {
if (target.canTarget(getId(), card.getId(), source, game)) { if (target.canTarget(getId(), card.getId(), source, game)) {
@ -684,17 +688,6 @@ public class ComputerPlayer extends PlayerImpl implements Player {
} }
return target.isChosen(); return target.isChosen();
} }
if (target instanceof TargetCardInHand) {
List<Card> cards = new ArrayList<>();
cards.addAll(this.hand.getCards(game));
while (!target.isChosen() && !cards.isEmpty()) {
Card pick = pickTarget(cards, outcome, target, source, game);
if (pick != null) {
target.addTarget(pick.getId(), source, game);
}
}
return target.isChosen();
}
if (target instanceof TargetSpell) { if (target instanceof TargetSpell) {
if (game.getStack().size() > 0) { if (game.getStack().size() > 0) {
Iterator<StackObject> it = game.getStack().iterator(); Iterator<StackObject> it = game.getStack().iterator();
@ -709,6 +702,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return false; return false;
} }
if (target instanceof TargetSpellOrPermanent) { if (target instanceof TargetSpellOrPermanent) {
// TODO: Also check if a spell should be selected
List<Permanent> targets; List<Permanent> targets;
boolean outcomeTargets = true; boolean outcomeTargets = true;
if (outcome.isGood()) { if (outcome.isGood()) {
@ -720,10 +714,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = threats(null, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets()); targets = threats(null, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets());
Collections.reverse(targets); Collections.reverse(targets);
outcomeTargets = false; outcomeTargets = false;
//targets = game.getBattlefield().getActivePermanents(((TargetPermanent)target).getFilter(), playerId, game);
} }
for (Permanent permanent : targets) { for (Permanent permanent : targets) {
if (((TargetPermanent) target).canTarget(abilityControllerId, permanent.getId(), source, game)) { if (((TargetSpellOrPermanent) target).canTarget(abilityControllerId, permanent.getId(), source, game)) {
target.addTarget(permanent.getId(), source, game); target.addTarget(permanent.getId(), source, game);
if (!outcomeTargets || target.getMaxNumberOfTargets() <= target.getTargets().size()) { if (!outcomeTargets || target.getMaxNumberOfTargets() <= target.getTargets().size()) {
return true; return true;

View file

@ -629,21 +629,23 @@ public class HumanPlayer extends PlayerImpl {
if (object != null) { if (object != null) {
Zone zone = game.getState().getZone(object.getId()); Zone zone = game.getState().getZone(object.getId());
if (zone != null) { if (zone != null) {
if (object instanceof Card && ((Card) object).isFaceDown(game)) { if (object instanceof Card
revealFaceDownCard((Card) object, game); && ((Card) object).isFaceDown(game)
&& lookAtFaceDownCard((Card) object, game)) {
result = true; result = true;
} } else {
Player actingPlayer = null; Player actingPlayer = null;
if (game.getPriorityPlayerId().equals(playerId)) { if (game.getPriorityPlayerId().equals(playerId)) {
actingPlayer = this; actingPlayer = this;
} else if (getPlayersUnderYourControl().contains(game.getPriorityPlayerId())) { } else if (getPlayersUnderYourControl().contains(game.getPriorityPlayerId())) {
actingPlayer = game.getPlayer(game.getPriorityPlayerId()); actingPlayer = game.getPlayer(game.getPriorityPlayerId());
} }
if (actingPlayer != null) { if (actingPlayer != null) {
LinkedHashMap<UUID, ActivatedAbility> useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game); LinkedHashMap<UUID, ActivatedAbility> useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game);
if (useableAbilities != null && useableAbilities.size() > 0) { if (useableAbilities != null && useableAbilities.size() > 0) {
activateAbility(useableAbilities, object, game); activateAbility(useableAbilities, object, game);
result = true; result = true;
}
} }
} }
} }

View file

@ -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;
import java.util.GregorianCalendar;
import mage.cards.ExpansionSet;
import mage.constants.SetType;
/**
*
* @author fireshoes
*/
public class ZendikarVsEldrazi extends ExpansionSet {
private static final ZendikarVsEldrazi fINSTANCE = new ZendikarVsEldrazi();
public static ZendikarVsEldrazi getInstance() {
return fINSTANCE;
}
private ZendikarVsEldrazi() {
super("Duel Decks: Zendikar vs. Eldrazi", "DDP", "mage.sets.zendikarvseldrazi", new GregorianCalendar(2015, 8, 28).getTime(), SetType.SUPPLEMENTAL);
this.blockName = "Duel Decks";
this.hasBasicLands = false;
}
}

View file

@ -43,6 +43,7 @@ import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -56,10 +57,6 @@ public class SlaveOfBolas extends CardImpl {
super(ownerId, 136, "Slave of Bolas", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U/R}{B}"); super(ownerId, 136, "Slave of Bolas", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U/R}{B}");
this.expansionSetCode = "ARB"; this.expansionSetCode = "ARB";
// Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step. // Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step.
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect()); this.getSpellAbility().addEffect(new UntapTargetEffect());
@ -96,13 +93,17 @@ class SlaveOfBolasEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this"); Permanent permanent = game.getPermanent(source.getFirstTarget());
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); if (permanent != null) {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
delayedAbility.setSourceId(source.getSourceId()); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
delayedAbility.setControllerId(source.getControllerId()); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceObject(source.getSourceObject(game), game); delayedAbility.setSourceId(source.getSourceId());
game.addDelayedTriggeredAbility(delayedAbility); delayedAbility.setControllerId(source.getControllerId());
return true; delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
return false;
} }
} }

View file

@ -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.alliances;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class AgentOfStromgald1 extends CardImpl {
public AgentOfStromgald1(UUID ownerId) {
super(ownerId, 94, "Agent of Stromgald", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "ALL";
this.subtype.add("Human");
this.subtype.add("Knight");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {R}: Add {B} to your mana pool.
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new ManaCostsImpl("{R}")));
}
public AgentOfStromgald1(final AgentOfStromgald1 card) {
super(card);
}
@Override
public AgentOfStromgald1 copy() {
return new AgentOfStromgald1(this);
}
}

View file

@ -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 AgentOfStromgald2 extends AgentOfStromgald1 {
public AgentOfStromgald2(UUID ownerId) {
super(ownerId);
this.cardNumber = 95;
}
public AgentOfStromgald2(final AgentOfStromgald2 card) {
super(card);
}
@Override
public AgentOfStromgald2 copy() {
return new AgentOfStromgald2(this);
}
}

View file

@ -37,16 +37,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import mage.target.targetpointer.SecondTargetPointer;
/** /**
* *
@ -65,15 +62,13 @@ public class LordOfTresserhorn extends CardImpl {
// When Lord of Tresserhorn enters the battlefield, you lose 2 life, you sacrifice two creatures, and target opponent draws two cards. // When Lord of Tresserhorn enters the battlefield, you lose 2 life, you sacrifice two creatures, and target opponent draws two cards.
Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(2), false); Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(2), false);
ability.addEffect(new SacrificeTargetEffect(", you sacrifice two creatures")); ability.addEffect(new SacrificeControllerEffect(new FilterControlledCreaturePermanent("creatures"), 2, "you"));
Target target = new TargetControlledCreaturePermanent(2,2, new FilterControlledCreaturePermanent(), true);
ability.addTarget(target);
Effect effect = new DrawCardTargetEffect(2); Effect effect = new DrawCardTargetEffect(2);
effect.setText(", and target opponent draws two cards"); effect.setText(", and target opponent draws two cards");
effect.setTargetPointer(new SecondTargetPointer());
ability.addEffect(effect); ability.addEffect(effect);
ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetOpponent());
this.addAbility(ability); this.addAbility(ability);
// {B}: Regenerate Lord of Tresserhorn. // {B}: Regenerate Lord of Tresserhorn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")));
} }

View file

@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.effects.common.DamageControllerEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
@ -54,10 +54,8 @@ public class PhyrexianWarBeast1 extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// When Phyrexian War Beast leaves the battlefield, sacrifice a land and Phyrexian War Beast deals 1 damage to you. // When Phyrexian War Beast leaves the battlefield, sacrifice a land and Phyrexian War Beast deals 1 damage to you.
Effect effect = new SacrificeTargetEffect(); Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterControlledLandPermanent(), 1, ""), false);
effect.setText("sacrifice a land"); Effect effect = new DamageControllerEffect(1);
Ability ability = new LeavesBattlefieldTriggeredAbility(effect, false);
effect = new DamageControllerEffect(1);
effect.setText("and {this} deals 1 damage to you"); effect.setText("and {this} deals 1 damage to you");
ability.addEffect(effect); ability.addEffect(effect);
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));

View file

@ -8,6 +8,7 @@ package mage.sets.antiquities;
import java.util.UUID; import java.util.UUID;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.ActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.effects.common.cost.CostModificationEffectImpl;
@ -32,48 +33,46 @@ import mage.util.CardUtil;
* @author nick.myers * @author nick.myers
*/ */
public class PowerArtifact extends CardImpl { public class PowerArtifact extends CardImpl {
public PowerArtifact(UUID ownerId) { public PowerArtifact(UUID ownerId) {
super(ownerId, 55, "Power Artifact", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); super(ownerId, 55, "Power Artifact", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
this.expansionSetCode = "ATQ"; this.expansionSetCode = "ATQ";
this.subtype.add("Aura"); this.subtype.add("Aura");
// Enchant artifact // Enchant artifact
TargetPermanent auraTarget = new TargetArtifactPermanent(); TargetPermanent auraTarget = new TargetArtifactPermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// The activation cost of target artifact is reduced by {2}. If this would reduce target // Enchanted artifact's activated abilities cost less to activate.
// artifact's activation cost below {1}, target artifact's activation cost becomes {1}. // This effect can't reduce the amount of mana an ability costs to activate to less than one mana.
// Power Artifact has no effect on artifacts that have no activation cost or whose activation this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PowerArtifactCostModificationEffect()));
// cost is {0}.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PowerArtifactCostModificationEffect()));
} }
public PowerArtifact(final PowerArtifact card) { public PowerArtifact(final PowerArtifact card) {
super(card); super(card);
} }
@Override @Override
public PowerArtifact copy() { public PowerArtifact copy() {
return new PowerArtifact(this); return new PowerArtifact(this);
} }
} }
class PowerArtifactCostModificationEffect extends CostModificationEffectImpl { class PowerArtifactCostModificationEffect extends CostModificationEffectImpl {
PowerArtifactCostModificationEffect() { PowerArtifactCostModificationEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "The activation cost of target artifact is reduced by {2}. If this would reduce target artifact's activation cost below {1}, target artifact's activation cost becomes {1}. Power artifact has no effect on artifacts that have no activation cost or whose activation cost is {0}."; staticText = "The activation cost of target artifact is reduced by {2}. If this would reduce target artifact's activation cost below {1}, target artifact's activation cost becomes {1}. Power artifact has no effect on artifacts that have no activation cost or whose activation cost is {0}.";
} }
PowerArtifactCostModificationEffect(PowerArtifactCostModificationEffect effect) { PowerArtifactCostModificationEffect(PowerArtifactCostModificationEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
Player controller = game.getPlayer(abilityToModify.getControllerId()); Player controller = game.getPlayer(abilityToModify.getControllerId());
@ -90,21 +89,22 @@ class PowerArtifactCostModificationEffect extends CostModificationEffectImpl {
} }
return true; return true;
} }
@Override @Override
public boolean applies(Ability abilityToModify, Ability source, Game game) { public boolean applies(Ability abilityToModify, Ability source, Game game) {
Permanent artifact = game.getPermanent(abilityToModify.getSourceId()); Permanent artifact = game.getPermanent(abilityToModify.getSourceId());
if (artifact != null && artifact.getAttachments().contains(source.getSourceId())) { if (artifact != null && artifact.getAttachments().contains(source.getSourceId())) {
if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)) { if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)
|| (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) {
return true; return true;
} }
} }
return false; return false;
} }
@Override @Override
public PowerArtifactCostModificationEffect copy() { public PowerArtifactCostModificationEffect copy() {
return new PowerArtifactCostModificationEffect(this); return new PowerArtifactCostModificationEffect(this);
} }
} }

View file

@ -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 LoneFox
*/
public class JununEfreet extends mage.sets.fourthedition.JununEfreet {
public JununEfreet(UUID ownerId) {
super(ownerId);
this.cardNumber = 8;
this.expansionSetCode = "ARN";
this.rarity = Rarity.RARE;
}
public JununEfreet(final JununEfreet card) {
super(card);
}
@Override
public JununEfreet copy() {
return new JununEfreet(this);
}
}

View file

@ -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.archenemy;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class BatteringCraghorn extends CardImpl {
public BatteringCraghorn(UUID ownerId) {
super(ownerId, 30, "Battering Craghorn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "ARC";
this.subtype.add("Goat");
this.subtype.add("Beast");
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// Morph {1}{R}{R}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{R}{R}")));
}
public BatteringCraghorn(final BatteringCraghorn card) {
super(card);
}
@Override
public BatteringCraghorn copy() {
return new BatteringCraghorn(this);
}
}

View file

@ -50,7 +50,7 @@ public class SpinIntoMyth extends CardImpl {
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
Effect effect = new FatesealEffect(2); Effect effect = new FatesealEffect(2);
effect.setText("then fateseal 2. <i>(To fateseal 2, look at the top two cards of an opponent's library, then put any number of them on the bottom of that player's library and the rest on top in any order.)</i>"); effect.setText(", then fateseal 2. <i>(To fateseal 2, look at the top two cards of an opponent's library, then put any number of them on the bottom of that player's library and the rest on top in any order.)</i>");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
} }

View file

@ -28,17 +28,14 @@
package mage.sets.avacynrestored; package mage.sets.avacynrestored;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.discard.DiscardHandAllEffect;
import mage.abilities.keyword.MiracleAbility; import mage.abilities.keyword.MiracleAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/** /**
* *
@ -50,9 +47,11 @@ public class ReforgeTheSoul extends CardImpl {
super(ownerId, 151, "Reforge the Soul", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); super(ownerId, 151, "Reforge the Soul", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
this.expansionSetCode = "AVR"; this.expansionSetCode = "AVR";
// Each player discards his or her hand, then draws seven cards. // Each player discards his or her hand, then draws seven cards.
this.getSpellAbility().addEffect(new ReforgeTheSoulEffect()); this.getSpellAbility().addEffect(new DiscardHandAllEffect());
Effect effect = new DrawCardAllEffect(7);
effect.setText(", then draws seven cards");
this.getSpellAbility().addEffect(effect);
// Miracle {1}{R} // Miracle {1}{R}
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{R}"))); this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{R}")));
@ -67,39 +66,3 @@ public class ReforgeTheSoul extends CardImpl {
return new ReforgeTheSoul(this); return new ReforgeTheSoul(this);
} }
} }
class ReforgeTheSoulEffect extends OneShotEffect {
public ReforgeTheSoulEffect() {
super(Outcome.DrawCard);
this.staticText = "Each player discards his or her hand, then draws seven cards";
}
public ReforgeTheSoulEffect(final ReforgeTheSoulEffect effect) {
super(effect);
}
@Override
public ReforgeTheSoulEffect copy() {
return new ReforgeTheSoulEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
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.getHand().getCards(game)) {
player.discard(card, source, game);
}
player.drawCards(7, game);
}
}
return true;
}
return false;
}
}

View file

@ -28,9 +28,6 @@
package mage.sets.avacynrestored; package mage.sets.avacynrestored;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -40,7 +37,11 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -54,7 +55,6 @@ public class ThatcherRevolt extends CardImpl {
super(ownerId, 158, "Thatcher Revolt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); super(ownerId, 158, "Thatcher Revolt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}");
this.expansionSetCode = "AVR"; this.expansionSetCode = "AVR";
// Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step. // Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step.
this.getSpellAbility().addEffect(new ThatcherRevoltEffect()); this.getSpellAbility().addEffect(new ThatcherRevoltEffect());
} }
@ -90,14 +90,16 @@ class ThatcherRevoltEffect extends OneShotEffect {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
RedHumanToken token = new RedHumanToken(); RedHumanToken token = new RedHumanToken();
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
Permanent permanent = game.getPermanent(token.getLastAddedToken());
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token"); if (permanent != null) {
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token", source.getControllerId());
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
delayedAbility.setSourceId(source.getSourceId()); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setSourceObject(source.getSourceObject(game), game); delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility); delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
} }
return true; return true;
} }

View file

@ -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 RetreatToKazandu extends mage.sets.zendikarvseldrazi.RetreatToKazandu {
public RetreatToKazandu(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.expansionSetCode = "BFZ";
}
public RetreatToKazandu(final RetreatToKazandu card) {
super(card);
}
@Override
public RetreatToKazandu copy() {
return new RetreatToKazandu(this);
}
}

View file

@ -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 VeteranWarleader extends mage.sets.zendikarvseldrazi.VeteranWarleader {
public VeteranWarleader(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.expansionSetCode = "BFZ";
}
public VeteranWarleader(final VeteranWarleader card) {
super(card);
}
@Override
public VeteranWarleader copy() {
return new VeteranWarleader(this);
}
}

View file

@ -28,14 +28,18 @@
package mage.sets.betrayersofkamigawa; package mage.sets.betrayersofkamigawa;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.SetPlayerLifeAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.abilities.Ability; import mage.filter.FilterPermanent;
import mage.abilities.effects.OneShotEffect; import mage.filter.predicate.other.OwnerIdPredicate;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -50,9 +54,12 @@ public class SwayOfTheStars extends CardImpl {
super(ownerId, 54, "Sway of the Stars", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{8}{U}{U}"); super(ownerId, 54, "Sway of the Stars", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{8}{U}{U}");
this.expansionSetCode = "BOK"; this.expansionSetCode = "BOK";
// Each player shuffles his or her hand, graveyard, and permanents he or she owns into his or her library, then draws seven cards. Each player's life total becomes 7. // Each player shuffles his or her hand, graveyard, and permanents he or she owns into his or her library, then draws seven cards. Each player's life total becomes 7.
this.getSpellAbility().addEffect(new SwayOfTheStarsEffect()); this.getSpellAbility().addEffect(new SwayOfTheStarsEffect());
Effect effect = new DrawCardAllEffect(7);
effect.setText(", then draws seven cards");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new SetPlayerLifeAllEffect(7));
} }
@ -66,7 +73,6 @@ public class SwayOfTheStars extends CardImpl {
} }
} }
class SwayOfTheStarsEffect extends OneShotEffect { class SwayOfTheStarsEffect extends OneShotEffect {
public SwayOfTheStarsEffect() { public SwayOfTheStarsEffect() {
@ -80,24 +86,19 @@ class SwayOfTheStarsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player sourcePlayer = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
}
for (UUID playerId: sourcePlayer.getInRange()) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
for (Card card: player.getHand().getCards(game)) { player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game);
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); player.moveCards(player.getGraveyard(), Zone.GRAVEYARD, Zone.LIBRARY, source, game);
} FilterPermanent filter = new FilterPermanent();
for (Card card: player.getGraveyard().getCards(game)) { filter.add(new OwnerIdPredicate(playerId));
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, controller.getId(), source.getSourceId(), game)) {
} permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
}
player.shuffleLibrary(game); player.shuffleLibrary(game);
player.drawCards(7, game);
player.setLife(7, game);
} }
} }
return true; return true;
@ -108,4 +109,4 @@ class SwayOfTheStarsEffect extends OneShotEffect {
return new SwayOfTheStarsEffect(this); return new SwayOfTheStarsEffect(this);
} }
} }

View file

@ -77,6 +77,7 @@ public class AstralCornucopia extends CardImpl {
} }
class AstralCornucopiaEffect extends OneShotEffect { class AstralCornucopiaEffect extends OneShotEffect {
public AstralCornucopiaEffect() { public AstralCornucopiaEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
} }
@ -90,9 +91,8 @@ class AstralCornucopiaEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
// delete to prevent using it again if put into battlefield from other effect && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); permanent.addCounters(CounterType.CHARGE.createInstance(amount), game);
@ -130,7 +130,7 @@ class AstralCornucopiaManaAbility extends ManaAbility {
if (sourcePermanent != null) { if (sourcePermanent != null) {
int counters = sourcePermanent.getCounters().getCount(CounterType.CHARGE.getName()); int counters = sourcePermanent.getCounters().getCount(CounterType.CHARGE.getName());
if (counters > 0) { if (counters > 0) {
netMana.add(new Mana(0,0,0,0,0,0,counters)); netMana.add(new Mana(0, 0, 0, 0, 0, 0, counters));
} }
} }
return netMana; return netMana;

View file

@ -29,19 +29,22 @@ package mage.sets.bornofthegods;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasSubtypeCondition;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.BestowAbility; import mage.abilities.keyword.BestowAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/** /**
* *
@ -60,12 +63,7 @@ public class EverflameEidolon extends CardImpl {
// Bestow {2}{R} // Bestow {2}{R}
this.addAbility(new BestowAbility(this, "{2}{R}")); this.addAbility(new BestowAbility(this, "{2}{R}"));
// {R}: Everflame Eidolon gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead. // {R}: Everflame Eidolon gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EverflameEidolonEffect(), new ManaCostsImpl("{R}")));
new BoostEnchantedEffect(1, 0, Duration.EndOfTurn),
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
new SourceHasSubtypeCondition("Aura"),
"{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead"),
new ManaCostsImpl("{R}")));
// Enchanted creature gets +1/+1. // Enchanted creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)));
} }
@ -79,3 +77,34 @@ public class EverflameEidolon extends CardImpl {
return new EverflameEidolon(this); return new EverflameEidolon(this);
} }
} }
class EverflameEidolonEffect extends OneShotEffect {
public EverflameEidolonEffect() {
super(Outcome.BoostCreature);
this.staticText = "{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead";
}
public EverflameEidolonEffect(final EverflameEidolonEffect effect) {
super(effect);
}
@Override
public EverflameEidolonEffect copy() {
return new EverflameEidolonEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourceObject != null) {
if (sourceObject.getSubtype().contains("Aura")) {
new BoostEnchantedEffect(1, 0, Duration.EndOfTurn).apply(game, source);
} else {
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
}
return true;
}
return false;
}
}

View file

@ -25,13 +25,9 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.championsofkamigawa; package mage.sets.championsofkamigawa;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -41,8 +37,10 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game; import mage.game.Game;
@ -58,8 +56,8 @@ public class JunkyoBell extends CardImpl {
public JunkyoBell(UUID ownerId) { public JunkyoBell(UUID ownerId) {
super(ownerId, 258, "Junkyo Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); super(ownerId, 258, "Junkyo Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "CHK"; this.expansionSetCode = "CHK";
// At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn, // At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn,
// where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step. // where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step.
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent());
Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn), TargetController.YOU, true); Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn), TargetController.YOU, true);
@ -77,37 +75,36 @@ public class JunkyoBell extends CardImpl {
return new JunkyoBell(this); return new JunkyoBell(this);
} }
private class JunkyoBellSacrificeEffect extends OneShotEffect {
private class JunkyoBellSacrificeEffect extends OneShotEffect {
public JunkyoBellSacrificeEffect() { public JunkyoBellSacrificeEffect() {
super(Outcome.Sacrifice); super(Outcome.Sacrifice);
this.staticText = "If you do, sacrifice that creature at the beginning of the next end step"; this.staticText = "If you do, sacrifice that creature at the beginning of the next end step";
} }
public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) { public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public JunkyoBellSacrificeEffect copy() { public JunkyoBellSacrificeEffect copy() {
return new JunkyoBellSacrificeEffect(this); return new JunkyoBellSacrificeEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget()); Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) { if (creature != null) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName()); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game); delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility); game.addDelayedTriggeredAbility(delayedAbility);
return true; return true;
}
return false;
} }
return false;
} }
} }
}

View file

@ -28,10 +28,6 @@
package mage.sets.championsofkamigawa; package mage.sets.championsofkamigawa;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
@ -42,7 +38,10 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SupertypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate;
@ -124,8 +123,7 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
token.addAbility(HasteAbility.getInstance()); token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step");
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceId(source.getSourceId());

View file

@ -30,22 +30,26 @@ package mage.sets.championsofkamigawa;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.continuous.SetCardSubtypeAttachedEffect; import mage.abilities.effects.common.continuous.SetCardSubtypeAttachedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; 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.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -54,7 +58,8 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public class OniPossession extends CardImpl { public class OniPossession extends CardImpl {
private static final List<String> setSubtypes = new ArrayList<String>(); private static final List<String> setSubtypes = new ArrayList<>();
static { static {
setSubtypes.add("Demon"); setSubtypes.add("Demon");
setSubtypes.add("Spirit"); setSubtypes.add("Spirit");
@ -67,13 +72,14 @@ public class OniPossession extends CardImpl {
// Enchant creature // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// At the beginning of your upkeep, sacrifice a creature. // At the beginning of your upkeep, sacrifice a creature.
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), TargetController.YOU, false); Ability ability2 = new BeginningOfUpkeepTriggeredAbility(
ability2.addTarget(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent(),false)); new SacrificeControllerEffect(new FilterControlledCreaturePermanent(), 1, ""), TargetController.YOU, false);
this.addAbility(ability2); this.addAbility(ability2);
// Enchanted creature gets +3/+3 and has trample. // Enchanted creature gets +3/+3 and has trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));

View file

@ -1,16 +1,16 @@
/* /*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 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 * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * 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 * 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 * 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 * 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 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
@ -28,10 +28,6 @@
package mage.sets.championsofkamigawa; package mage.sets.championsofkamigawa;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
@ -43,6 +39,10 @@ import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl; 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.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -61,7 +61,7 @@ public class OrochiHatchery extends CardImpl {
this.addAbility(new EntersBattlefieldAbility(new OrochiHatcheryEffect(), "with X charge counters on it")); this.addAbility(new EntersBattlefieldAbility(new OrochiHatcheryEffect(), "with X charge counters on it"));
// {5}, {T}: Put a 1/1 green Snake creature token onto the battlefield for each charge counter on Orochi Hatchery. // {5}, {T}: Put a 1/1 green Snake creature token onto the battlefield for each charge counter on Orochi Hatchery.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(),new CountersCount(CounterType.CHARGE)), new GenericManaCost(5)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), new CountersCount(CounterType.CHARGE)), new GenericManaCost(5));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
this.addAbility(ability); this.addAbility(ability);
} }
@ -78,6 +78,7 @@ public class OrochiHatchery extends CardImpl {
} }
class OrochiHatcheryEffect extends OneShotEffect { class OrochiHatcheryEffect extends OneShotEffect {
public OrochiHatcheryEffect() { public OrochiHatcheryEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
} }
@ -91,9 +92,8 @@ class OrochiHatcheryEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
// delete to prevent using it again if put into battlefield from other effect && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {;
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); permanent.addCounters(CounterType.CHARGE.createInstance(amount), game);
@ -107,4 +107,4 @@ class OrochiHatcheryEffect extends OneShotEffect {
public OrochiHatcheryEffect copy() { public OrochiHatcheryEffect copy() {
return new OrochiHatcheryEffect(this); return new OrochiHatcheryEffect(this);
} }
} }

View file

@ -63,7 +63,6 @@ public class ThroughTheBreach extends CardImpl {
this.expansionSetCode = "CHK"; this.expansionSetCode = "CHK";
this.subtype.add("Arcane"); this.subtype.add("Arcane");
// You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
this.getSpellAbility().addEffect(new ThroughTheBreachEffect()); this.getSpellAbility().addEffect(new ThroughTheBreachEffect());
// Splice onto Arcane {2}{R}{R} // Splice onto Arcane {2}{R}{R}
@ -81,7 +80,7 @@ public class ThroughTheBreach extends CardImpl {
} }
class ThroughTheBreachEffect extends OneShotEffect { class ThroughTheBreachEffect extends OneShotEffect {
private static final String choiceText = "Put a creature card from your hand onto the battlefield?"; private static final String choiceText = "Put a creature card from your hand onto the battlefield?";
public ThroughTheBreachEffect() { public ThroughTheBreachEffect() {
@ -111,10 +110,10 @@ class ThroughTheBreachEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(card.getId()); Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) { if (permanent != null) {
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
effect.setTargetPointer(new FixedTarget(permanent.getId())); effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source); game.addEffect(effect, source);
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setControllerId(source.getControllerId());

View file

@ -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.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
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.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class LovisaColdeyes extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control that's a Barbarian, a Warrior, or a Berserker");
static {
filter.add(Predicates.or(new SubtypePredicate("Barbarian"), new SubtypePredicate("Warrior"), new SubtypePredicate("Berserker")));
}
public LovisaColdeyes(UUID ownerId) {
super(ownerId, 90, "Lovisa Coldeyes", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
this.expansionSetCode = "CSP";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2 and has haste.
Effect effect = new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, false);
effect.setText("Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
effect = new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect.setText("and has haste");
ability.addEffect(effect);
this.addAbility(ability);
}
public LovisaColdeyes(final LovisaColdeyes card) {
super(card);
}
@Override
public LovisaColdeyes copy() {
return new LovisaColdeyes(this);
}
}

View file

@ -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.coldsnap;
import java.util.UUID;
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.target.TargetPermanent;
/**
*
* @author fireshoes
*/
public class MysticMelting extends CardImpl {
public MysticMelting(UUID ownerId) {
super(ownerId, 114, "Mystic Melting", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}");
this.expansionSetCode = "CSP";
// Destroy target artifact or enchantment.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
// Draw a card at the beginning of the next turn's upkeep.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(
new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false));
}
public MysticMelting(final MysticMelting card) {
super(card);
}
@Override
public MysticMelting copy() {
return new MysticMelting(this);
}
}

View file

@ -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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.abilities.keyword.FearAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class PhobianPhantasm extends CardImpl {
public PhobianPhantasm(UUID ownerId) {
super(ownerId, 66, "Phobian Phantasm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.expansionSetCode = "CSP";
this.subtype.add("Illusion");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying; fear
this.addAbility(FlyingAbility.getInstance());
this.addAbility(FearAbility.getInstance());
// Cumulative upkeep {B}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{B}")));
}
public PhobianPhantasm(final PhobianPhantasm card) {
super(card);
}
@Override
public PhobianPhantasm copy() {
return new PhobianPhantasm(this);
}
}

View file

@ -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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SupertypePredicate;
/**
*
* @author LoneFox
*/
public class RonomHulk extends CardImpl {
private static final FilterCard filter = new FilterCard("snow");
static {
filter.add(new SupertypePredicate("Snow"));
}
public RonomHulk(UUID ownerId) {
super(ownerId, 119, "Ronom Hulk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.expansionSetCode = "CSP";
this.subtype.add("Beast");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Protection from snow
this.addAbility(new ProtectionAbility(filter));
// Cumulative upkeep {1}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
}
public RonomHulk(final RonomHulk card) {
super(card);
}
@Override
public RonomHulk copy() {
return new RonomHulk(this);
}
}

View file

@ -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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class SteamSpitter extends CardImpl {
public SteamSpitter(UUID ownerId) {
super(ownerId, 124, "Steam Spitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.expansionSetCode = "CSP";
this.subtype.add("Spider");
this.power = new MageInt(1);
this.toughness = new MageInt(5);
// Reach
this.addAbility(ReachAbility.getInstance());
// {R}: Steam Spitter gets +1/+0 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
}
public SteamSpitter(final SteamSpitter card) {
super(card);
}
@Override
public SteamSpitter copy() {
return new SteamSpitter(this);
}
}

View file

@ -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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventDamageToSourceEffect;
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;
/**
*
* @author LoneFox
*/
public class UrsineFylgja extends CardImpl {
public UrsineFylgja(UUID ownerId) {
super(ownerId, 22, "Ursine Fylgja", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.expansionSetCode = "CSP";
this.subtype.add("Spirit");
this.subtype.add("Bear");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Ursine Fylgja enters the battlefield with four healing counters on it.
Effect effect = new AddCountersSourceEffect(CounterType.HEALING.createInstance(4));
effect.setText("with four healing counters on it.");
this.addAbility(new EntersBattlefieldAbility(effect));
// Remove a healing counter from Ursine Fylgja: Prevent the next 1 damage that would be dealt to Ursine Fylgja this turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToSourceEffect(Duration.EndOfTurn, 1),
new RemoveCountersSourceCost(CounterType.HEALING.createInstance(1))));
// {2}{W}: Put a healing counter on Ursine Fylgja.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.HEALING.createInstance(1)),
new ManaCostsImpl("{2}{W}")));
}
public UrsineFylgja(final UrsineFylgja card) {
super(card);
}
@Override
public UrsineFylgja copy() {
return new UrsineFylgja(this);
}
}

View file

@ -1,112 +1,110 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 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 * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * 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 * 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 * 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 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * 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 * 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 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.commander; package mage.sets.commander;
import java.util.UUID; import java.util.UUID;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect; import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; import mage.abilities.effects.common.ClashEffect;
import mage.abilities.effects.common.ClashEffect; import mage.cards.CardImpl;
import mage.cards.CardImpl; import mage.constants.CardType;
import mage.constants.CardType; import mage.constants.Outcome;
import mage.constants.Outcome; import mage.constants.Rarity;
import mage.constants.Rarity; import mage.constants.TargetController;
import mage.constants.TargetController; import mage.game.Game;
import mage.game.Game; import mage.game.stack.Spell;
import mage.game.stack.Spell; import mage.players.Player;
import mage.players.Player; import mage.target.TargetSpell;
import mage.target.TargetSpell;
import mage.target.targetpointer.FixedTarget; /**
*
/** * @author LevelX2
* */
* @author LevelX2 public class ScatteringStroke extends CardImpl {
*/
public class ScatteringStroke extends CardImpl { public ScatteringStroke(UUID ownerId) {
super(ownerId, 60, "Scattering Stroke", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
public ScatteringStroke(UUID ownerId) { this.expansionSetCode = "CMD";
super(ownerId, 60, "Scattering Stroke", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
this.expansionSetCode = "CMD";
// Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost.
this.getSpellAbility().addEffect(new ScatteringStrokeEffect());
// Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost. this.getSpellAbility().addTarget(new TargetSpell());
this.getSpellAbility().addEffect(new ScatteringStrokeEffect()); }
this.getSpellAbility().addTarget(new TargetSpell());
} public ScatteringStroke(final ScatteringStroke card) {
super(card);
public ScatteringStroke(final ScatteringStroke card) { }
super(card);
} @Override
public ScatteringStroke copy() {
@Override return new ScatteringStroke(this);
public ScatteringStroke copy() { }
return new ScatteringStroke(this); }
}
}
class ScatteringStrokeEffect extends OneShotEffect {
class ScatteringStrokeEffect extends OneShotEffect { public ScatteringStrokeEffect() {
super(Outcome.Benefit);
public ScatteringStrokeEffect() { this.staticText = "Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost";
super(Outcome.Benefit); }
this.staticText = "Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost";
} public ScatteringStrokeEffect(final ScatteringStrokeEffect effect) {
super(effect);
public ScatteringStrokeEffect(final ScatteringStrokeEffect effect) { }
super(effect);
} @Override
public ScatteringStrokeEffect copy() {
@Override return new ScatteringStrokeEffect(this);
public ScatteringStrokeEffect copy() { }
return new ScatteringStrokeEffect(this);
} @Override
public boolean apply(Game game, Ability source) {
@Override Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source));
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId());
Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); if (controller != null && spell != null) {
Player controller = game.getPlayer(source.getControllerId()); game.getStack().counter(spell.getId(), source.getSourceId(), game);
if (controller != null && spell != null) { if (ClashEffect.getInstance().apply(game, source)) {
game.getStack().counter(spell.getId(), source.getSourceId(), game); Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0,0,0,0,0,spell.getConvertedManaCost(),0));
if (ClashEffect.getInstance().apply(game, source)) { AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility =
Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0,0,0,0,0,spell.getConvertedManaCost(),0)); new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN);
AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility = delayedAbility.setSourceId(source.getSourceId());
new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN); delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.setControllerId(source.getControllerId()); game.addDelayedTriggeredAbility(delayedAbility);
delayedAbility.setSourceObject(source.getSourceObject(game), game); }
game.addDelayedTriggeredAbility(delayedAbility); return true;
} }
return true; return false;
} }
return false;
}
} }

View file

@ -28,9 +28,11 @@
package mage.sets.commander2013; package mage.sets.commander2013;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.abilities.effects.common.CreateTokenTargetEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
@ -44,6 +46,7 @@ import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.ZombieToken; import mage.game.permanent.token.ZombieToken;
import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -59,7 +62,6 @@ public class CurseOfShallowGraves extends CardImpl {
this.subtype.add("Aura"); this.subtype.add("Aura");
this.subtype.add("Curse"); this.subtype.add("Curse");
// Enchant player // Enchant player
TargetPlayer auraTarget = new TargetPlayer(); TargetPlayer auraTarget = new TargetPlayer();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
@ -83,7 +85,7 @@ public class CurseOfShallowGraves extends CardImpl {
class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl { class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl {
public CurseOfShallowTriggeredAbility() { public CurseOfShallowTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false), true); super(Zone.BATTLEFIELD, new CurseOfShallowEffect());
} }
public CurseOfShallowTriggeredAbility(Effect effect, boolean optional, String text) { public CurseOfShallowTriggeredAbility(Effect effect, boolean optional, String text) {
@ -105,7 +107,7 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl {
if (enchantment != null if (enchantment != null
&& enchantment.getAttachedTo() != null && enchantment.getAttachedTo() != null
&& game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
for (Effect effect: this.getEffects()) { for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId()));
} }
return true; return true;
@ -124,3 +126,31 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl {
} }
} }
class CurseOfShallowEffect extends OneShotEffect {
public CurseOfShallowEffect() {
super(Outcome.Benefit);
this.staticText = "that attacking player may put a 2/2 black Zombie creature token onto the battlefield tapped";
}
public CurseOfShallowEffect(final CurseOfShallowEffect effect) {
super(effect);
}
@Override
public CurseOfShallowEffect copy() {
return new CurseOfShallowEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (attacker != null && attacker.chooseUse(outcome, "Put a 2/2 black Zombie creature token onto the battlefield tapped?", source, game)) {
Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false);
effect.setTargetPointer(targetPointer);
return effect.apply(game, source);
}
return false;
}
}

View file

@ -27,6 +27,8 @@
*/ */
package mage.sets.commander2013; package mage.sets.commander2013;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -54,8 +56,7 @@ public class IncendiaryCommand extends CardImpl {
super(ownerId, 113, "Incendiary Command", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); super(ownerId, 113, "Incendiary Command", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
this.expansionSetCode = "C13"; this.expansionSetCode = "C13";
// Choose two -
// Choose two -
this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMinModes(2);
this.getSpellAbility().getModes().setMaxModes(2); this.getSpellAbility().getModes().setMaxModes(2);
// Incendiary Command deals 4 damage to target player; // Incendiary Command deals 4 damage to target player;
@ -107,16 +108,23 @@ class IncendiaryCommandDrawEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
for (UUID playerId : controller.getInRange()) { Map<UUID, Integer> cardsToDraw = new HashMap<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
int cards = player.getHand().size(); int cardsInHand = player.getHand().size();
if (cards > 0) { player.discard(cardsInHand, false, source, game);
player.discard(cards, source, game); if (cardsInHand > 0) {
player.drawCards(cards, game); cardsToDraw.put(playerId, cardsInHand);
} }
} }
} }
for (UUID playerId : cardsToDraw.keySet()) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.drawCards(cardsToDraw.get(playerId), game);
}
}
return true; return true;
} }
return false; return false;

View file

@ -46,6 +46,7 @@ import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken; import mage.game.permanent.token.EmptyToken;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -113,15 +114,16 @@ class FeldonOfTheThirdPathEffect extends OneShotEffect {
} }
token.addAbility(HasteAbility.getInstance()); token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
Permanent permanent = game.getPermanent(token.getLastAddedToken());
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); if (permanent != null) {
sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step"); SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game); delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility); game.addDelayedTriggeredAbility(delayedAbility);
}
return true; return true;
} }

View file

@ -61,7 +61,7 @@ public class LifebloodHydra extends CardImpl {
// Trample // Trample
this.addAbility(TrampleAbility.getInstance()); this.addAbility(TrampleAbility.getInstance());
// Lifeblood Hydra enters the battlefield with X +1/+1 counters on it. // Lifeblood Hydra enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new LifebloodHydraComesIntoPlayEffect(), "with X +1/+1 counters on it")); this.addAbility(new EntersBattlefieldAbility(new LifebloodHydraComesIntoPlayEffect(), "with X +1/+1 counters on it"));
@ -95,7 +95,8 @@ class LifebloodHydraComesIntoPlayEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && !permanent.isFaceDown(game)) { if (permanent != null && !permanent.isFaceDown(game)) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
&& permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game); permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
@ -111,6 +112,7 @@ class LifebloodHydraComesIntoPlayEffect extends OneShotEffect {
} }
} }
class LifebloodHydraEffect extends OneShotEffect { class LifebloodHydraEffect extends OneShotEffect {
public LifebloodHydraEffect() { public LifebloodHydraEffect() {

View file

@ -33,7 +33,6 @@ import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -64,7 +63,6 @@ public class WakeTheDead extends CardImpl {
super(ownerId, 31, "Wake the Dead", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{B}{B}"); super(ownerId, 31, "Wake the Dead", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{B}{B}");
this.expansionSetCode = "C14"; this.expansionSetCode = "C14";
// Cast Wake the Dead only during combat on an opponent's turn. // Cast Wake the Dead only during combat on an opponent's turn.
Ability ability = new SimpleStaticAbility(Zone.ALL, new WakeTheDeadEffect()); Ability ability = new SimpleStaticAbility(Zone.ALL, new WakeTheDeadEffect());
ability.setRuleAtTheTop(true); ability.setRuleAtTheTop(true);
@ -72,7 +70,7 @@ public class WakeTheDead extends CardImpl {
// Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step. // Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step.
this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
} }
@Override @Override
@ -80,7 +78,7 @@ public class WakeTheDead extends CardImpl {
if (ability instanceof SpellAbility) { if (ability instanceof SpellAbility) {
int xValue = ability.getManaCostsToPay().getX(); int xValue = ability.getManaCostsToPay().getX();
ability.getTargets().clear(); ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard"))); ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
} }
} }
@ -159,8 +157,8 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
permanent.changeControllerId(source.getControllerId(), game); permanent.changeControllerId(source.getControllerId(), game);
Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step"); Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId());
effect.setTargetPointer(new FixedTarget(permanent.getId())); effect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setControllerId(source.getControllerId());

View file

@ -27,8 +27,7 @@
*/ */
package mage.sets.conflux; package mage.sets.conflux;
import mage.constants.CardType; import java.util.UUID;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
@ -40,15 +39,15 @@ import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
/** /**
* *
* @author Loki * @author Loki
@ -83,6 +82,7 @@ public class ApocalypseHydra extends CardImpl {
} }
class ApocalypseHydraEffect extends OneShotEffect { class ApocalypseHydraEffect extends OneShotEffect {
ApocalypseHydraEffect() { ApocalypseHydraEffect() {
super(Outcome.BoostCreature); super(Outcome.BoostCreature);
staticText = "with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it"; staticText = "with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it";
@ -97,10 +97,9 @@ class ApocalypseHydraEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
// delete to prevent using it again if put into battlefield from other effect && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
if (amount < 5) { if (amount < 5) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game); permanent.addCounters(CounterType.P1P1.createInstance(amount), game);

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.conspiracy; package mage.sets.conspiracy;
import java.util.UUID; import java.util.UUID;
@ -49,14 +48,13 @@ import mage.counters.CounterType;
import mage.filter.common.FilterInstantOrSorceryCard; import mage.filter.common.FilterInstantOrSorceryCard;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
/** /**
* *
* @author andyfries * @author andyfries
*/ */
public class AcademyElite extends CardImpl { public class AcademyElite extends CardImpl {
public AcademyElite(UUID ownerId) { public AcademyElite(UUID ownerId) {
super(ownerId, 20, "Academy Elite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); super(ownerId, 20, "Academy Elite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "CNS"; this.expansionSetCode = "CNS";
@ -76,7 +74,6 @@ public class AcademyElite extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
} }
public AcademyElite(final AcademyElite card) { public AcademyElite(final AcademyElite card) {
super(card); super(card);
} }
@ -104,7 +101,8 @@ class AcademyEliteEffect1 extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
&& permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards")); CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards"));
int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this); int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this);
if (instantsAndSorceriesCount > 0) { if (instantsAndSorceriesCount > 0) {
@ -120,4 +118,3 @@ class AcademyEliteEffect1 extends OneShotEffect {
return new AcademyEliteEffect1(this); return new AcademyEliteEffect1(this);
} }
} }

View file

@ -64,7 +64,7 @@ public class GrenzoDungeonWarden extends CardImpl {
// Grenzo, Dungeon Warden enters the battlefield with X +1/+1 counters on it. // Grenzo, Dungeon Warden enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new GrenzoDungeonWardenEtBEffect())); this.addAbility(new EntersBattlefieldAbility(new GrenzoDungeonWardenEtBEffect()));
// {2}: Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to Grenzo's power, put it onto the battlefield. // {2}: Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to Grenzo's power, put it onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrenzoDungeonWardenEffect(), new GenericManaCost(2))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrenzoDungeonWardenEffect(), new GenericManaCost(2)));
} }
@ -95,9 +95,8 @@ class GrenzoDungeonWardenEtBEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
// delete to prevent using it again if put into battlefield from other effect && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
int amount = ((Ability) obj).getManaCostsToPay().getX(); int amount = ((Ability) obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game); permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
@ -114,21 +113,21 @@ class GrenzoDungeonWardenEtBEffect extends OneShotEffect {
} }
class GrenzoDungeonWardenEffect extends OneShotEffect { class GrenzoDungeonWardenEffect extends OneShotEffect {
GrenzoDungeonWardenEffect() { GrenzoDungeonWardenEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
this.staticText = "Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to {this}'s power, put it onto the battlefield"; this.staticText = "Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to {this}'s power, put it onto the battlefield";
} }
GrenzoDungeonWardenEffect(final GrenzoDungeonWardenEffect effect) { GrenzoDungeonWardenEffect(final GrenzoDungeonWardenEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public GrenzoDungeonWardenEffect copy() { public GrenzoDungeonWardenEffect copy() {
return new GrenzoDungeonWardenEffect(this); return new GrenzoDungeonWardenEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());

View file

@ -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.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CanBlockOnlyFlyingAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class HoverguardObserver extends CardImpl {
public HoverguardObserver(UUID ownerId) {
super(ownerId, 22, "Hoverguard Observer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.expansionSetCode = "DST";
this.subtype.add("Drone");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Hoverguard Observer can block only creatures with flying.
this.addAbility(new CanBlockOnlyFlyingAbility());
}
public HoverguardObserver(final HoverguardObserver card) {
super(card);
}
@Override
public HoverguardObserver copy() {
return new HoverguardObserver(this);
}
}

View file

@ -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.dissension;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class VesperGhoul extends CardImpl {
public VesperGhoul(UUID ownerId) {
super(ownerId, 57, "Vesper Ghoul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.expansionSetCode = "DIS";
this.subtype.add("Zombie");
this.subtype.add("Druid");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}, Pay 1 life: Add one mana of any color to your mana pool.
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addCost(new PayLifeCost(1));
this.addAbility(ability);
}
public VesperGhoul(final VesperGhoul card) {
super(card);
}
@Override
public VesperGhoul copy() {
return new VesperGhoul(this);
}
}

View file

@ -28,10 +28,6 @@
package mage.sets.dragonsmaze; package mage.sets.dragonsmaze;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
@ -42,7 +38,10 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -63,10 +62,10 @@ public class SavagebornHydra extends CardImpl {
// Double strike // Double strike
this.addAbility(DoubleStrikeAbility.getInstance()); this.addAbility(DoubleStrikeAbility.getInstance());
// Savageborn Hydra enters the battlefield with X +1/+1 counters on it. // Savageborn Hydra enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new SavageBornHydraEffect(), true)); this.addAbility(new EntersBattlefieldAbility(new SavageBornHydraEffect(), true));
// {1}{RG}: Put a +1/+1 counter on Savageborn Hydra. Activate this ability only any time you could cast a sorcery. // {1}{RG}: Put a +1/+1 counter on Savageborn Hydra. Activate this ability only any time you could cast a sorcery.
this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R/G}"))); this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R/G}")));
} }
@ -97,10 +96,11 @@ class SavageBornHydraEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { 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 // delete to prevent using it again if put into battlefield from other effect
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game); permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
} }
@ -113,4 +113,4 @@ class SavageBornHydraEffect extends OneShotEffect {
public SavageBornHydraEffect copy() { public SavageBornHydraEffect copy() {
return new SavageBornHydraEffect(this); return new SavageBornHydraEffect(this);
} }
} }

View file

@ -25,21 +25,20 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.dragonsmaze; package mage.sets.dragonsmaze;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
@ -51,18 +50,17 @@ import mage.target.common.TargetCreaturePermanent;
* *
* @author LevelX2 * @author LevelX2
*/ */
public class UbulSarGatekeepers extends CardImpl { public class UbulSarGatekeepers extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent(); private static final FilterControlledPermanent filter = new FilterControlledPermanent();
private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.add(new SubtypePredicate("Gate")); filter.add(new SubtypePredicate("Gate"));
targetFilter.add(new ControllerPredicate(TargetController.OPPONENT)); targetFilter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public UbulSarGatekeepers (UUID ownerId) { public UbulSarGatekeepers(UUID ownerId) {
super(ownerId, 30, "Ubul Sar Gatekeepers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); super(ownerId, 30, "Ubul Sar Gatekeepers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "DGM"; this.expansionSetCode = "DGM";
this.subtype.add("Zombie"); this.subtype.add("Zombie");
@ -73,7 +71,7 @@ public class UbulSarGatekeepers extends CardImpl {
// Whenever Ubul Sar Gatekeepers enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn. // Whenever Ubul Sar Gatekeepers enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn.
Ability ability = new ConditionalTriggeredAbility( Ability ability = new ConditionalTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(2))), new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)),
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
"Whenever {this} enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn."); "Whenever {this} enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn.");
Target target = new TargetCreaturePermanent(targetFilter); Target target = new TargetCreaturePermanent(targetFilter);
@ -81,7 +79,7 @@ public class UbulSarGatekeepers extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
} }
public UbulSarGatekeepers (final UbulSarGatekeepers card) { public UbulSarGatekeepers(final UbulSarGatekeepers card) {
super(card); super(card);
} }

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.eventide; package mage.sets.eventide;
import java.util.UUID; import java.util.UUID;
@ -51,19 +50,20 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public class AshlingTheExtinguisher extends CardImpl { public class AshlingTheExtinguisher extends CardImpl {
public AshlingTheExtinguisher (UUID ownerId) { public AshlingTheExtinguisher(UUID ownerId) {
super(ownerId, 33, "Ashling, the Extinguisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); super(ownerId, 33, "Ashling, the Extinguisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.expansionSetCode = "EVE"; this.expansionSetCode = "EVE";
this.supertype.add("Legendary"); this.supertype.add("Legendary");
this.subtype.add("Elemental"); this.subtype.add("Elemental");
this.subtype.add("Shaman"); this.subtype.add("Shaman");
// Whenever Ashling, the Extinguisher deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature.
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.addAbility(new AshlingTheExtinguisherTriggeredAbility()); this.addAbility(new AshlingTheExtinguisherTriggeredAbility());
} }
public AshlingTheExtinguisher (final AshlingTheExtinguisher card) { public AshlingTheExtinguisher(final AshlingTheExtinguisher card) {
super(card); super(card);
} }
@ -75,6 +75,7 @@ public class AshlingTheExtinguisher extends CardImpl {
} }
class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl { class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl {
public AshlingTheExtinguisherTriggeredAbility() { public AshlingTheExtinguisherTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeTargetEffect()); super(Zone.BATTLEFIELD, new SacrificeTargetEffect());
this.addTarget(new TargetCreaturePermanent()); this.addTarget(new TargetCreaturePermanent());
@ -115,4 +116,4 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() { public String getRule() {
return "Whenever {this} deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature."; return "Whenever {this} deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature.";
} }
} }

View file

@ -60,7 +60,7 @@ import mage.watchers.Watcher;
* *
*/ */
public class GroundlingPouncer extends CardImpl { public class GroundlingPouncer extends CardImpl {
private String rule = "{this} gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying."; private String rule = "{this} gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying.";
public GroundlingPouncer(UUID ownerId) { public GroundlingPouncer(UUID ownerId) {
@ -118,7 +118,7 @@ class GroundingPouncerCondition implements Condition {
class ActivatedAbilityUsedThisTurnWatcher extends Watcher { class ActivatedAbilityUsedThisTurnWatcher extends Watcher {
public Set<UUID> activatedThisTurn = new HashSet<UUID>(); public Set<UUID> activatedThisTurn = new HashSet<>();
public ActivatedAbilityUsedThisTurnWatcher() { public ActivatedAbilityUsedThisTurnWatcher() {
super("ActivatedAbilityUsedThisTurn", WatcherScope.GAME); super("ActivatedAbilityUsedThisTurn", WatcherScope.GAME);
@ -156,4 +156,4 @@ class ActivatedAbilityUsedThisTurnWatcher extends Watcher {
super.reset(); super.reset();
this.activatedThisTurn.clear(); this.activatedThisTurn.clear();
} }
} }

View file

@ -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.exodus;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author LoneFox
*/
public class SchoolOfPiranha extends CardImpl {
public SchoolOfPiranha(UUID ownerId) {
super(ownerId, 45, "School of Piranha", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "EXO";
this.subtype.add("Fish");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, sacrifice School of Piranha unless you pay {1}{U}.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{1}{U}")), TargetController.YOU, false));
}
public SchoolOfPiranha(final SchoolOfPiranha card) {
super(card);
}
@Override
public SchoolOfPiranha copy() {
return new SchoolOfPiranha(this);
}
}

View file

@ -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.fallenempires;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public class ElvishFarmer extends mage.sets.masterseditionii.ElvishFarmer {
public ElvishFarmer(UUID ownerId) {
super(ownerId);
this.cardNumber = 71;
this.expansionSetCode = "FEM";
}
public ElvishFarmer(final ElvishFarmer card) {
super(card);
}
@Override
public ElvishFarmer copy() {
return new ElvishFarmer(this);
}
}

View file

@ -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.fallenempires;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventDamageByTargetEffect;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
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.filter.predicate.permanent.AttackingPredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LoneFox
*/
public class ElvishScout1 extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("attacking creature you control");
static {
filter.add(new AttackingPredicate());
}
public ElvishScout1(UUID ownerId) {
super(ownerId, 75, "Elvish Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "FEM";
this.subtype.add("Elf");
this.subtype.add("Scout");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {G}, {tap}: Untap target attacking creature you control. Prevent all combat damage that would be dealt to and dealt by it this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{G}"));
ability.addCost(new TapSourceCost());
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
effect.setText("Prevent all combat damage that would be dealt to");
ability.addEffect(effect);
effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true);
effect.setText("and dealt by it this turn");
ability.addEffect(effect);
ability.addTarget(new TargetControlledCreaturePermanent(filter));
this.addAbility(ability);
}
public ElvishScout1(final ElvishScout1 card) {
super(card);
}
@Override
public ElvishScout1 copy() {
return new ElvishScout1(this);
}
}

View file

@ -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.fallenempires;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public class ElvishScout2 extends ElvishScout1 {
public ElvishScout2(UUID ownerId) {
super(ownerId);
this.cardNumber = 76;
}
public ElvishScout2(final ElvishScout2 card) {
super(card);
}
@Override
public ElvishScout2 copy() {
return new ElvishScout2(this);
}
}

View file

@ -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.fallenempires;
import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class ElvishScout3 extends ElvishScout1 {
public ElvishScout3(UUID ownerId) {
super(ownerId);
this.cardNumber = 77;
}
public ElvishScout3(final ElvishScout3 card) {
super(card);
}
@Override
public ElvishScout3 copy() {
return new ElvishScout3(this);
}
}

View file

@ -27,6 +27,8 @@
*/ */
package mage.sets.fatereforged; package mage.sets.fatereforged;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -81,16 +83,23 @@ class DarkDealEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
for (UUID playerId : controller.getInRange()) { Map<UUID, Integer> cardsToDraw = new LinkedHashMap<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
int cardsInHand = player.getHand().size(); int cardsInHand = player.getHand().size();
player.discard(cardsInHand, false, source, game); player.discard(cardsInHand, false, source, game);
if (cardsInHand > 1) { if (cardsInHand > 1) {
player.drawCards(cardsInHand - 1, game); cardsToDraw.put(playerId, cardsInHand - 1);
} }
} }
} }
for (UUID playerId : cardsToDraw.keySet()) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.drawCards(cardsToDraw.get(playerId), game);
}
}
return true; return true;
} }
return false; return false;

View file

@ -50,6 +50,7 @@ import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -68,8 +69,8 @@ public class OutpostSiege extends CardImpl {
this.expansionSetCode = "FRF"; this.expansionSetCode = "FRF";
// As Outpost Siege enters the battlefield, choose Khans or Dragons. // As Outpost Siege enters the battlefield, choose Khans or Dragons.
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true, this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true,
"As {this} enters the battlefield, choose Khans or Dragons.","")); "As {this} enters the battlefield, choose Khans or Dragons.", ""));
// * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card. // * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(
@ -80,10 +81,10 @@ public class OutpostSiege extends CardImpl {
// * Dragons - Whenever a creature you control leaves the battlefield, Outpost Siege deals 1 damage to target creature or player. // * Dragons - Whenever a creature you control leaves the battlefield, Outpost Siege deals 1 damage to target creature or player.
Ability ability2 = new ConditionalTriggeredAbility( Ability ability2 = new ConditionalTriggeredAbility(
new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, null, new DamageTargetEffect(1), new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, null, new DamageTargetEffect(1),
new FilterControlledCreaturePermanent(), "", false), new FilterControlledCreaturePermanent(), "", false),
new ModeChoiceSourceCondition("Dragons"), new ModeChoiceSourceCondition("Dragons"),
ruleTrigger2); ruleTrigger2);
ability2.addTarget(new TargetCreatureOrPlayer()); ability2.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability2); this.addAbility(ability2);
} }
@ -117,13 +118,15 @@ class OutpostSiegeExileEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && sourcePermanent != null) {
Card card = controller.getLibrary().getFromTop(game); Card card = controller.getLibrary().getFromTop(game);
if (card != null) { if (card != null) {
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); String exileName = sourcePermanent.getIdName() + " <this card may be played the turn it was exiled";
controller.moveCardsToExile(card, source, game, true, source.getSourceId(), exileName);
if (game.getState().getZone(card.getId()) == Zone.EXILED) { if (game.getState().getZone(card.getId()) == Zone.EXILED) {
ContinuousEffect effect = new CastFromNonHandZoneTargetEffect(Duration.EndOfTurn); ContinuousEffect effect = new CastFromNonHandZoneTargetEffect(Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(card.getId())); effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
game.addEffect(effect, source); game.addEffect(effect, source);
} }
} }
@ -156,8 +159,8 @@ class CastFromNonHandZoneTargetEffect extends AsThoughEffectImpl {
@Override @Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (getTargetPointer().getTargets(game, source).contains(objectId) && if (getTargetPointer().getTargets(game, source).contains(objectId)
source.getControllerId().equals(affectedControllerId)) { && source.getControllerId().equals(affectedControllerId)) {
Card card = game.getCard(objectId); Card card = game.getCard(objectId);
if (card != null) { if (card != null) {
return true; return true;

View file

@ -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.fifthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class DeathSpeakers extends mage.sets.homelands.DeathSpeakers {
public DeathSpeakers(UUID ownerId) {
super(ownerId);
this.cardNumber = 300;
this.expansionSetCode = "5ED";
this.rarity = Rarity.COMMON;
}
public DeathSpeakers(final DeathSpeakers card) {
super(card);
}
@Override
public DeathSpeakers copy() {
return new DeathSpeakers(this);
}
}

View file

@ -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 fireshoes
*/
public class Enervate extends mage.sets.masterseditionii.Enervate {
public Enervate(UUID ownerId) {
super(ownerId);
this.cardNumber = 84;
this.expansionSetCode = "5ED";
}
public Enervate(final Enervate card) {
super(card);
}
@Override
public Enervate copy() {
return new Enervate(this);
}
}

View file

@ -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.fifthedition;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author LoneFox
*/
public class HungryMist extends CardImpl {
public HungryMist(UUID ownerId) {
super(ownerId, 164, "Hungry Mist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.expansionSetCode = "5ED";
this.subtype.add("Elemental");
this.power = new MageInt(6);
this.toughness = new MageInt(2);
// At the beginning of your upkeep, sacrifice Hungry Mist unless you pay {G}{G}.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{G}{G}")), TargetController.YOU, false));
}
public HungryMist(final HungryMist card) {
super(card);
}
@Override
public HungryMist copy() {
return new HungryMist(this);
}
}

View file

@ -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.fifthedition;
import java.util.UUID;
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetPlayer;
/**
*
* @author fireshoes
*/
public class MindRavel extends CardImpl {
public MindRavel(UUID ownerId) {
super(ownerId, 38, "Mind Ravel", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}");
this.expansionSetCode = "5ED";
// Target player discards a card.
this.getSpellAbility().addEffect(new DiscardTargetEffect(1));
this.getSpellAbility().addTarget(new TargetPlayer());
// Draw a card at the beginning of the next turn's upkeep.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false));
}
public MindRavel(final MindRavel card) {
super(card);
}
@Override
public MindRavel copy() {
return new MindRavel(this);
}
}

View file

@ -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 SeaSprite extends mage.sets.homelands.SeaSprite {
public SeaSprite(UUID ownerId) {
super(ownerId);
this.cardNumber = 120;
this.expansionSetCode = "5ED";
}
public SeaSprite(final SeaSprite card) {
super(card);
}
@Override
public SeaSprite copy() {
return new SeaSprite(this);
}
}

View file

@ -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 fireshoes
*/
public class TouchOfDeath extends mage.sets.iceage.TouchOfDeath {
public TouchOfDeath(UUID ownerId) {
super(ownerId);
this.cardNumber = 62;
this.expansionSetCode = "5ED";
}
public TouchOfDeath(final TouchOfDeath card) {
super(card);
}
@Override
public TouchOfDeath copy() {
return new TouchOfDeath(this);
}
}

View file

@ -28,13 +28,13 @@
package mage.sets.fifthedition; package mage.sets.fifthedition;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.dynamicvalue.common.UrzaTerrainValue;
import mage.abilities.mana.DynamicManaAbility; import mage.abilities.mana.DynamicManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/** /**
* *
@ -43,7 +43,8 @@ import mage.cards.CardImpl;
public class UrzasMine extends CardImpl { public class UrzasMine extends CardImpl {
public UrzasMine(UUID ownerId) { public UrzasMine(UUID ownerId) {
super(ownerId, 447, "Urza's Mine", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); super(ownerId, 447, "Urza's Mine", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
this.subtype.add("Urza's Mine"); this.subtype.add("Urza's");
this.subtype.add("Mine");
this.expansionSetCode = "5ED"; this.expansionSetCode = "5ED";
// {T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead. // {T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead.

View file

@ -28,13 +28,13 @@
package mage.sets.fifthedition; package mage.sets.fifthedition;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.dynamicvalue.common.UrzaTerrainValue;
import mage.abilities.mana.DynamicManaAbility; import mage.abilities.mana.DynamicManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/** /**
* *
@ -43,7 +43,8 @@ import mage.cards.CardImpl;
public class UrzasPowerPlant extends CardImpl { public class UrzasPowerPlant extends CardImpl {
public UrzasPowerPlant(UUID ownerId) { public UrzasPowerPlant(UUID ownerId) {
super(ownerId, 448, "Urza's Power Plant", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); super(ownerId, 448, "Urza's Power Plant", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
this.subtype.add("Urza's Power-Plant"); this.subtype.add("Urza's");
this.subtype.add("Power-Plant");
this.expansionSetCode = "5ED"; this.expansionSetCode = "5ED";
// {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead. // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead.

View file

@ -28,13 +28,13 @@
package mage.sets.fifthedition; package mage.sets.fifthedition;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.dynamicvalue.common.UrzaTerrainValue;
import mage.abilities.mana.DynamicManaAbility; import mage.abilities.mana.DynamicManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/** /**
* *
@ -43,7 +43,8 @@ import mage.cards.CardImpl;
public class UrzasTower extends CardImpl { public class UrzasTower extends CardImpl {
public UrzasTower(UUID ownerId) { public UrzasTower(UUID ownerId) {
super(ownerId, 449, "Urza's Tower", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); super(ownerId, 449, "Urza's Tower", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
this.subtype.add("Urza's Tower"); this.subtype.add("Urza's");
this.subtype.add("Tower");
this.expansionSetCode = "5ED"; this.expansionSetCode = "5ED";
// {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead. // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead.

View file

@ -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.fourthedition;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author LoneFox
*/
public class JununEfreet extends CardImpl {
public JununEfreet(UUID ownerId) {
super(ownerId, 27, "Junún Efreet", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.expansionSetCode = "4ED";
this.subtype.add("Efreet");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, sacrifice Junún Efreet unless you pay {B}{B}.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}{B}")), TargetController.YOU, false));
}
public JununEfreet(final JununEfreet card) {
super(card);
}
@Override
public JununEfreet copy() {
return new JununEfreet(this);
}
}

View file

@ -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.fourthedition;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class SistersOfTheFlame extends CardImpl {
public SistersOfTheFlame(UUID ownerId) {
super(ownerId, 239, "Sisters of the Flame", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.expansionSetCode = "4ED";
this.subtype.add("Human");
this.subtype.add("Shaman");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {tap}: Add {R} to your mana pool.
this.addAbility(new RedManaAbility());
}
public SistersOfTheFlame(final SistersOfTheFlame card) {
super(card);
}
@Override
public SistersOfTheFlame copy() {
return new SistersOfTheFlame(this);
}
}

View file

@ -31,45 +31,45 @@ import mage.util.CardUtil;
* @author nick.myers * @author nick.myers
*/ */
public class CloudKey extends CardImpl { public class CloudKey extends CardImpl {
public CloudKey(UUID ownerId) { public CloudKey(UUID ownerId) {
super(ownerId, 160, "Cloud Key", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); super(ownerId, 160, "Cloud Key", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "FUT"; this.expansionSetCode = "FUT";
// As Cloud Key enters the battlefield, choose artifact, creature, // As Cloud Key enters the battlefield, choose artifact, creature,
// enchantment, instant, or sorcery. // enchantment, instant, or sorcery.
this.addAbility(new AsEntersBattlefieldAbility(new CloudKeyChooseTypeEffect())); this.addAbility(new AsEntersBattlefieldAbility(new CloudKeyChooseTypeEffect()));
// Spells of the chosen type cost {1} less to cast // Spells of the chosen type cost {1} less to cast
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CloudKeyCostModificationEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CloudKeyCostModificationEffect()));
} }
@Override @Override
public CloudKey copy() { public CloudKey copy() {
return new CloudKey(this); return new CloudKey(this);
} }
public CloudKey(final CloudKey card) { public CloudKey(final CloudKey card) {
super(card); super(card);
} }
} }
class CloudKeyChooseTypeEffect extends OneShotEffect { class CloudKeyChooseTypeEffect extends OneShotEffect {
public CloudKeyChooseTypeEffect() { public CloudKeyChooseTypeEffect() {
super(Outcome.Neutral); super(Outcome.Neutral);
this.staticText = "Choose a spell type"; this.staticText = "choose artifact, creature, enchantment, instant, or sorcery.";
} }
public CloudKeyChooseTypeEffect(final CloudKeyChooseTypeEffect effect) { public CloudKeyChooseTypeEffect(final CloudKeyChooseTypeEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public CloudKeyChooseTypeEffect copy() { public CloudKeyChooseTypeEffect copy() {
return new CloudKeyChooseTypeEffect(this); return new CloudKeyChooseTypeEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
@ -90,20 +90,20 @@ class CloudKeyChooseTypeEffect extends OneShotEffect {
} }
return false; return false;
} }
} }
class CloudKeyCostModificationEffect extends CostModificationEffectImpl { class CloudKeyCostModificationEffect extends CostModificationEffectImpl {
public CloudKeyCostModificationEffect() { public CloudKeyCostModificationEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
this.staticText = "choose artifact, creature, enchantment, instant, or sorcery. Spells of the chosen type cost {1} less to cast."; this.staticText = "Spells of the chosen type cost {1} less to cast.";
} }
public CloudKeyCostModificationEffect(final CloudKeyCostModificationEffect effect) { public CloudKeyCostModificationEffect(final CloudKeyCostModificationEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public CloudKeyCostModificationEffect copy() { public CloudKeyCostModificationEffect copy() {
return new CloudKeyCostModificationEffect(this); return new CloudKeyCostModificationEffect(this);
@ -118,15 +118,15 @@ class CloudKeyCostModificationEffect extends CostModificationEffectImpl {
@Override @Override
public boolean applies(Ability abilityToModify, Ability source, Game game) { public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) { if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) {
Card card = game.getCard(abilityToModify.getSourceId()); Card card = game.getCard(abilityToModify.getSourceId());
if (card.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) { if (card.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) {
return true; return true;
} }
} }
return false; return false;
} }
} }

View file

@ -77,7 +77,7 @@ public class GoldmeadowLookout extends CardImpl {
class GoldmeadowHarrierToken extends Token { class GoldmeadowHarrierToken extends Token {
public GoldmeadowHarrierToken() { public GoldmeadowHarrierToken() {
super("Goldmeadow Harrier", "1/1 white Kithkin Soldier creature token named Goldmeadow Harrier with \"{W}, {tap}: Tap target creature.\""); super("Goldmeadow Harrier", "1/1 white Kithkin Soldier creature token named Goldmeadow Harrier with \"{W}, {T}: Tap target creature.\"");
this.setOriginalExpansionSetCode("FUT"); this.setOriginalExpansionSetCode("FUT");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
color.setWhite(true); color.setWhite(true);
@ -91,4 +91,4 @@ class GoldmeadowHarrierToken extends Token {
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }
} }

View file

@ -73,15 +73,15 @@ public class HeartwoodStoryteller extends CardImpl {
} }
class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl {
HeartwoodStorytellerTriggeredAbility() { HeartwoodStorytellerTriggeredAbility() {
super(Zone.BATTLEFIELD, new HeartwoodStorytellerEffect(), false); super(Zone.BATTLEFIELD, new HeartwoodStorytellerEffect(), false);
} }
HeartwoodStorytellerTriggeredAbility(final HeartwoodStorytellerTriggeredAbility ability) { HeartwoodStorytellerTriggeredAbility(final HeartwoodStorytellerTriggeredAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public HeartwoodStorytellerTriggeredAbility copy() { public HeartwoodStorytellerTriggeredAbility copy() {
return new HeartwoodStorytellerTriggeredAbility(this); return new HeartwoodStorytellerTriggeredAbility(this);
@ -91,7 +91,7 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkEventType(GameEvent event, Game game) { public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SPELL_CAST; return event.getType() == EventType.SPELL_CAST;
} }
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
Spell spell = game.getStack().getSpell(event.getTargetId()); Spell spell = game.getStack().getSpell(event.getTargetId());
@ -103,7 +103,7 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl {
} }
return false; return false;
} }
@Override @Override
public String getRule() { public String getRule() {
return "Whenever a player casts a noncreature spell, each of that player's opponents may draw a card."; return "Whenever a player casts a noncreature spell, each of that player's opponents may draw a card.";
@ -111,27 +111,29 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl {
} }
class HeartwoodStorytellerEffect extends OneShotEffect { class HeartwoodStorytellerEffect extends OneShotEffect {
HeartwoodStorytellerEffect() { HeartwoodStorytellerEffect() {
super(Outcome.DrawCard); super(Outcome.DrawCard);
this.staticText = "Each of that player's opponents may draw a card"; this.staticText = "Each of that player's opponents may draw a card";
} }
HeartwoodStorytellerEffect(final HeartwoodStorytellerEffect effect) { HeartwoodStorytellerEffect(final HeartwoodStorytellerEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public HeartwoodStorytellerEffect copy() { public HeartwoodStorytellerEffect copy() {
return new HeartwoodStorytellerEffect(this); return new HeartwoodStorytellerEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getOpponents(this.getTargetPointer().getFirst(game, source))) { for (UUID playerId : game.getOpponents(this.getTargetPointer().getFirst(game, source))) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
player.drawCards(1, game); if (player.chooseUse(outcome, "Draw a card?", source, game)) {
player.drawCards(1, game);
}
} }
} }
return true; return true;

View file

@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent;
* @author anonymous * @author anonymous
*/ */
public class LymphSliver extends CardImpl { public class LymphSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures");
public LymphSliver(UUID ownerId) { public LymphSliver(UUID ownerId) {
@ -57,7 +57,8 @@ public class LymphSliver extends CardImpl {
// All Sliver creatures have absorb 1. // All Sliver creatures have absorb 1.
Ability absorb = new SimpleStaticAbility(Zone.BATTLEFIELD, new SliverAbsorbEffect()); Ability absorb = new SimpleStaticAbility(Zone.BATTLEFIELD, new SliverAbsorbEffect());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(absorb, Duration.WhileOnBattlefield, filter, "absorb 1. <i>(If a source would deal damage to a Sliver, prevent 1 of that damage.)</i>"))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(absorb,
Duration.WhileOnBattlefield, filter, "All Sliver creatures have absorb 1. <i>(If a source would deal damage to a Sliver, prevent 1 of that damage.)</i>")));
} }
public LymphSliver(final LymphSliver card) { public LymphSliver(final LymphSliver card) {
@ -73,7 +74,7 @@ public class LymphSliver extends CardImpl {
class SliverAbsorbEffect extends PreventionEffectImpl { class SliverAbsorbEffect extends PreventionEffectImpl {
public SliverAbsorbEffect() { public SliverAbsorbEffect() {
super(Duration.WhileOnBattlefield, 1, false, false); super(Duration.WhileOnBattlefield, 1, false, false);
this.staticText = "If a source would deal damage to a Sliver, prevent 1 of that damage"; this.staticText = "Absorb 1 <i>(If a source would deal damage to this creature, prevent 1 of that damage.</i>)";
} }
public SliverAbsorbEffect(SliverAbsorbEffect effect) { public SliverAbsorbEffect(SliverAbsorbEffect effect) {
@ -84,4 +85,4 @@ class SliverAbsorbEffect extends PreventionEffectImpl {
public SliverAbsorbEffect copy() { public SliverAbsorbEffect copy() {
return new SliverAbsorbEffect(this); return new SliverAbsorbEffect(this);
} }
} }

View file

@ -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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.MorphAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.counters.CounterType;
/**
*
* @author LoneFox
*/
public class MaelstromDjinn extends CardImpl {
public MaelstromDjinn(UUID ownerId) {
super(ownerId, 39, "Maelstrom Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Djinn");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Morph {2}{U}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}")));
// When Maelstrom Djinn is turned face up, put two time counters on it and it gains vanishing.
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
Effect effect = new GainAbilitySourceEffect(new VanishingUpkeepAbility(0), Duration.WhileOnBattlefield);
effect.setText("and it gains vanishing");
ability.addEffect(effect);
effect = new GainAbilitySourceEffect(new VanishingSacrificeAbility(), Duration.WhileOnBattlefield);
effect.setText("");
ability.addEffect(effect);
this.addAbility(ability);
}
public MaelstromDjinn(final MaelstromDjinn card) {
super(card);
}
@Override
public MaelstromDjinn copy() {
return new MaelstromDjinn(this);
}
}

View file

@ -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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.KickerAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
/**
*
* @author LoneFox
*/
public class RavagingRiftwurm extends CardImpl {
public RavagingRiftwurm(UUID ownerId) {
super(ownerId, 135, "Ravaging Riftwurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
this.expansionSetCode = "FUT";
this.subtype.add("Wurm");
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Kicker {4}
this.addAbility(new KickerAbility("{4}"));
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
// If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)),
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
}
public RavagingRiftwurm(final RavagingRiftwurm card) {
super(card);
}
@Override
public RavagingRiftwurm copy() {
return new RavagingRiftwurm(this);
}
}

View file

@ -0,0 +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.futuresight;
import java.util.UUID;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.TapEnchantedEffect;
import mage.abilities.effects.common.UntapEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class SecondWind extends CardImpl {
public SecondWind(UUID ownerId) {
super(ownerId, 57, "Second Wind", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Untap));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// {tap}: Tap enchanted creature.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapEnchantedEffect(), new TapSourceCost()));
// {tap}: Untap enchanted creature.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new TapSourceCost()));
}
public SecondWind(final SecondWind card) {
super(card);
}
@Override
public SecondWind copy() {
return new SecondWind(this);
}
}

View file

@ -47,9 +47,9 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/ */
public class SliverLegion extends CardImpl { public class SliverLegion extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures");
private static final FilterPermanent countfilter = new FilterPermanent("Sliver","each other sliver"); private static final FilterPermanent countfilter = new FilterPermanent("Sliver", " for each other Sliver on the battlefield");
static { static {
countfilter.add(new AnotherPredicate()); countfilter.add(new AnotherPredicate());

View file

@ -43,7 +43,7 @@ import mage.game.permanent.token.Token;
/** /**
* *
* @author anonymous * @author Luna Skyrise
*/ */
public class Sliversmith extends CardImpl { public class Sliversmith extends CardImpl {
@ -55,7 +55,7 @@ public class Sliversmith extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {1}, {tap}, Discard a card: Put a 1/1 colorless Sliver artifact creature token named Metallic Sliver onto the battlefield. // {1}, {tap}, Discard a card: Put a 1/1 colorless Sliver artifact creature token named Metallic Sliver onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.HAND, new CreateTokenEffect(new MetallicSliverToken()), new ManaCostsImpl("{1}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliversmithToken()), new ManaCostsImpl("{1}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost()); ability.addCost(new DiscardCardCost());
this.addAbility(ability); this.addAbility(ability);
@ -71,10 +71,10 @@ public class Sliversmith extends CardImpl {
} }
} }
class MetallicSliverToken extends Token { class SliversmithToken extends Token {
MetallicSliverToken() { SliversmithToken() {
super("Metallic Sliver", "a 1/1 colorless Sliver creature token"); super("Metallic Sliver", "a 1/1 colorless Sliver creature token named Metallic Sliver");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
cardType.add(CardType.ARTIFACT); cardType.add(CardType.ARTIFACT);
subtype.add("Sliver"); subtype.add("Sliver");

View file

@ -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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.SaprolingToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author fireshoes
*/
public class UtopiaMycon extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Saproling");
static {
filter.add(new SubtypePredicate("Saproling"));
}
public UtopiaMycon(UUID ownerId) {
super(ownerId, 140, "Utopia Mycon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "FUT";
this.subtype.add("Fungus");
this.power = new MageInt(0);
this.toughness = new MageInt(2);
// At the beginning of your upkeep, put a spore counter on Utopia Mycon.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false));
// Remove three spore counters from Utopia Mycon: Put a 1/1 green Saproling creature token onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3))));
// Sacrifice a Saproling: Add one mana of any color to your mana pool.
Ability ability = new AnyColorManaAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, false)));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public UtopiaMycon(final UtopiaMycon card) {
super(card);
}
@Override
public UtopiaMycon copy() {
return new UtopiaMycon(this);
}
}

View file

@ -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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class WhipSpineDrake extends CardImpl {
public WhipSpineDrake(UUID ownerId) {
super(ownerId, 62, "Whip-Spine Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Drake");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Morph {2}{W}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{W}")));
}
public WhipSpineDrake(final WhipSpineDrake card) {
super(card);
}
@Override
public WhipSpineDrake copy() {
return new WhipSpineDrake(this);
}
}

View file

@ -30,12 +30,6 @@ package mage.sets.gatecrash;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -48,8 +42,12 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards; import mage.constants.AsThoughEffectType;
import mage.cards.CardsImpl; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.game.ExileZone; import mage.game.ExileZone;
import mage.game.Game; import mage.game.Game;
@ -62,29 +60,31 @@ import mage.util.CardUtil;
/** /**
* Gatecrash FAQ (01.2013) * Gatecrash FAQ (01.2013)
* *
* If Bane Alley Broker's first ability resolves when you have no cards in your hand, * If Bane Alley Broker's first ability resolves when you have no cards in your
* you'll draw a card and then exile it. You won't have the opportunity to cast that * hand, you'll draw a card and then exile it. You won't have the opportunity to
* card (or do anything else with it) before exiling it. * cast that card (or do anything else with it) before exiling it.
* *
* Due to a recent rules change, once you are allowed to look at a face-down card in * Due to a recent rules change, once you are allowed to look at a face-down
* exile, you are allowed to look at that card as long as it's exiled. If you no longer * card in exile, you are allowed to look at that card as long as it's exiled.
* control Bane Alley Broker when its last ability resolves, you can continue to look * If you no longer control Bane Alley Broker when its last ability resolves,
* at the relevant cards in exile to choose one to return. * you can continue to look at the relevant cards in exile to choose one to
* return.
* *
* Bane Alley Broker's second and third abilities apply to cards exiled with that * Bane Alley Broker's second and third abilities apply to cards exiled with
* specific Bane Alley Broker, not any other creature named Bane Alley Broker. * that specific Bane Alley Broker, not any other creature named Bane Alley
* You should keep cards exiled by different Bane Alley Brokers separate. * Broker. You should keep cards exiled by different Bane Alley Brokers
* separate.
* *
* If Bane Alley Broker leaves the battlefield, the cards exiled with it will be * If Bane Alley Broker leaves the battlefield, the cards exiled with it will be
* exiled indefinitely. If it later returns to the battlefield, it will be a new * exiled indefinitely. If it later returns to the battlefield, it will be a new
* object with no connection to the cards exiled with it in its previous existence. * object with no connection to the cards exiled with it in its previous
* You won't be able to use the "new" Bane Alley Broker to return cards exiled with * existence. You won't be able to use the "new" Bane Alley Broker to return
* the "old" one. * cards exiled with the "old" one.
* *
* Even if not all players can look at the exiled cards, each card's owner is still * Even if not all players can look at the exiled cards, each card's owner is
* known. It is advisable to keep cards owned by different players in distinct piles * still known. It is advisable to keep cards owned by different players in
* in case another player gains control of Bane Alley Broker and exiles one or more * distinct piles in case another player gains control of Bane Alley Broker and
* cards with it. * exiles one or more cards with it.
* *
* @author LevelX2 * @author LevelX2
*/ */
@ -99,9 +99,9 @@ public class BaneAlleyBroker extends CardImpl {
this.power = new MageInt(0); this.power = new MageInt(0);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// {tap}: Draw a card, then exile a card from your hand face down. // {tap}: Draw a card, then exile a card from your hand face down.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BaneAlleyBrokerDrawExileEffect(), new TapSourceCost())); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BaneAlleyBrokerDrawExileEffect(), new TapSourceCost()));
// You may look at cards exiled with Bane Alley Broker. // You may look at cards exiled with Bane Alley Broker.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BaneAlleyBrokerLookAtCardEffect())); this.addAbility(new SimpleStaticAbility(Zone.ALL, new BaneAlleyBrokerLookAtCardEffect()));
@ -126,44 +126,44 @@ public class BaneAlleyBroker extends CardImpl {
class BaneAlleyBrokerDrawExileEffect extends OneShotEffect { class BaneAlleyBrokerDrawExileEffect extends OneShotEffect {
public BaneAlleyBrokerDrawExileEffect() { public BaneAlleyBrokerDrawExileEffect() {
super(Outcome.DrawCard); super(Outcome.DrawCard);
staticText = "Draw a card, then exile a card from your hand face down"; staticText = "Draw a card, then exile a card from your hand face down";
} }
public BaneAlleyBrokerDrawExileEffect(final BaneAlleyBrokerDrawExileEffect effect) { public BaneAlleyBrokerDrawExileEffect(final BaneAlleyBrokerDrawExileEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
controller.drawCards(1, game); controller.drawCards(1, game);
Target target = new TargetCardInHand(new FilterCard("card to exile")); Target target = new TargetCardInHand(new FilterCard("card to exile"));
if (controller.chooseTarget(outcome, target, source, game)) { if (controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (card != null && sourceObject != null) { if (card != null && sourceObject != null) {
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) { if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) {
card.setFaceDown(true, game); card.setFaceDown(true, game);
return true; return true;
} }
} }
} }
} }
return false; return false;
} }
@Override @Override
public BaneAlleyBrokerDrawExileEffect copy() { public BaneAlleyBrokerDrawExileEffect copy() {
return new BaneAlleyBrokerDrawExileEffect(this); return new BaneAlleyBrokerDrawExileEffect(this);
} }
} }
class TargetCardInBaneAlleyBrokerExile extends TargetCard { class TargetCardInBaneAlleyBrokerExile extends TargetCard {
public TargetCardInBaneAlleyBrokerExile(UUID CardId) { public TargetCardInBaneAlleyBrokerExile(UUID CardId) {
super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker")); super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker"));
} }
public TargetCardInBaneAlleyBrokerExile(final TargetCardInBaneAlleyBrokerExile target) { public TargetCardInBaneAlleyBrokerExile(final TargetCardInBaneAlleyBrokerExile target) {
@ -223,7 +223,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCard {
class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl { class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl {
public BaneAlleyBrokerLookAtCardEffect() { public BaneAlleyBrokerLookAtCardEffect() {
super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
staticText = "You may look at cards exiled with {this}"; staticText = "You may look at cards exiled with {this}";
} }
@ -252,13 +252,7 @@ class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl {
} }
UUID exileId = CardUtil.getCardExileZoneId(game, source); UUID exileId = CardUtil.getCardExileZoneId(game, source);
ExileZone exile = game.getExile().getExileZone(exileId); ExileZone exile = game.getExile().getExileZone(exileId);
if (exile != null && exile.contains(objectId)) { return exile != null && exile.contains(objectId);
Cards cards = new CardsImpl(card);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.lookAtCards("Exiled with " + sourceObject.getName(), cards, game);
}
}
} }
} }
return false; return false;

View file

@ -28,9 +28,6 @@
package mage.sets.gatecrash; package mage.sets.gatecrash;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
@ -38,7 +35,9 @@ import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -89,10 +88,9 @@ class NimbusSwimmerEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) { if (obj != null && obj instanceof SpellAbility
// delete to prevent using it again if put into battlefield from other effect && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {
setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
if (amount > 0) { if (amount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game); permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
} }

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.guildpact; package mage.sets.guildpact;
import java.util.UUID; import java.util.UUID;
@ -49,19 +48,18 @@ import mage.target.TargetPlayer;
*/ */
public class BurningTreeShaman extends CardImpl { public class BurningTreeShaman extends CardImpl {
public BurningTreeShaman (UUID ownerId) { public BurningTreeShaman(UUID ownerId) {
super(ownerId, 105, "Burning-Tree Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); super(ownerId, 105, "Burning-Tree Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}");
this.expansionSetCode = "GPT"; this.expansionSetCode = "GPT";
this.subtype.add("Centaur"); this.subtype.add("Centaur");
this.subtype.add("Shaman"); this.subtype.add("Shaman");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.addAbility(new BurningTreeShamanTriggeredAbility()); this.addAbility(new BurningTreeShamanTriggeredAbility());
} }
public BurningTreeShaman (final BurningTreeShaman card) { public BurningTreeShaman(final BurningTreeShaman card) {
super(card); super(card);
} }
@ -72,6 +70,7 @@ public class BurningTreeShaman extends CardImpl {
} }
class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
BurningTreeShamanTriggeredAbility() { BurningTreeShamanTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
this.addTarget(new TargetPlayer()); this.addTarget(new TargetPlayer());
@ -94,7 +93,7 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) { if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) {
this.getTargets().get(0).add(event.getPlayerId(), game); this.getTargets().get(0).add(event.getPlayerId(), game);
return true; return true;
} }
@ -105,4 +104,4 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() { public String getRule() {
return "Whenever a player activates an ability that isn't a mana ability, {this} deals 1 damage to that player."; return "Whenever a player activates an ability that isn't a mana ability, {this} deals 1 damage to that player.";
} }
} }

View file

@ -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.guildpact;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
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.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class Schismotivate extends CardImpl {
public Schismotivate(UUID ownerId) {
super(ownerId, 129, "Schismotivate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{R}");
this.expansionSetCode = "GPT";
// Target creature gets +4/+0 until end of turn. Another target creature gets -4/-0 until end of turn.
this.getSpellAbility().addEffect(new SchismotivateEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
}
public Schismotivate(final Schismotivate card) {
super(card);
}
@Override
public Schismotivate copy() {
return new Schismotivate(this);
}
}
class SchismotivateEffect extends ContinuousEffectImpl {
public SchismotivateEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.staticText = "Target creature gets +4/+0 until end of turn. Another target creature gets -4/-0 until end of turn";
}
public SchismotivateEffect(final SchismotivateEffect effect) {
super(effect);
}
@Override
public SchismotivateEffect copy() {
return new SchismotivateEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.addPower(4);
}
permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1));
if (permanent != null) {
permanent.addPower(-4);
}
return true;
}
}

View file

@ -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.guildpact;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CanBlockOnlyFlyingAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class Stratozeppelid extends CardImpl {
public Stratozeppelid(UUID ownerId) {
super(ownerId, 36, "Stratozeppelid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
this.expansionSetCode = "GPT";
this.subtype.add("Beast");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Stratozeppelid can block only creatures with flying.
this.addAbility(new CanBlockOnlyFlyingAbility());
}
public Stratozeppelid(final Stratozeppelid card) {
super(card);
}
@Override
public Stratozeppelid copy() {
return new Stratozeppelid(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class DeathSpeakers extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DeathSpeakers(UUID ownerId) {
super(ownerId, 109, "Death Speakers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "HML";
this.subtype.add("Human");
this.subtype.add("Cleric");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
}
public DeathSpeakers(final DeathSpeakers card) {
super(card);
}
@Override
public DeathSpeakers copy() {
return new DeathSpeakers(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public class HungryMist1 extends mage.sets.fifthedition.HungryMist {
public HungryMist1(UUID ownerId) {
super(ownerId);
this.cardNumber = 60;
this.expansionSetCode = "HML";
}
public HungryMist1(final HungryMist1 card) {
super(card);
}
@Override
public HungryMist1 copy() {
return new HungryMist1(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public class HungryMist2 extends mage.sets.fifthedition.HungryMist {
public HungryMist2(UUID ownerId) {
super(ownerId);
this.cardNumber = 61;
this.expansionSetCode = "HML";
}
public HungryMist2(final HungryMist2 card) {
super(card);
}
@Override
public HungryMist2 copy() {
return new HungryMist2(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class Narwhal extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public Narwhal(UUID ownerId) {
super(ownerId, 44, "Narwhal", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.expansionSetCode = "HML";
this.subtype.add("Whale");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
}
public Narwhal(final Narwhal card) {
super(card);
}
@Override
public Narwhal copy() {
return new Narwhal(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
import mage.abilities.effects.common.TapEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
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.AbilityPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class Roots extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying");
static {
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
}
public Roots(UUID ownerId) {
super(ownerId, 68, "Roots", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
this.expansionSetCode = "HML";
this.subtype.add("Aura");
// Enchant creature without flying
TargetPermanent auraTarget = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// When Roots enters the battlefield, tap enchanted creature.
this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect()));
// Enchanted creature doesn't untap during its controller's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect()));
}
public Roots(final Roots card) {
super(card);
}
@Override
public Roots copy() {
return new Roots(this);
}
}

View file

@ -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.homelands;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class SeaSprite extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public SeaSprite(UUID ownerId) {
super(ownerId, 48, "Sea Sprite", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "HML";
this.subtype.add("Faerie");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
}
public SeaSprite(final SeaSprite card) {
super(card);
}
@Override
public SeaSprite copy() {
return new SeaSprite(this);
}
}

View file

@ -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.iceage;
import java.util.UUID;
import mage.ObjectColor;
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.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class BattleFrenzy extends CardImpl {
private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("green creatures");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("nongreen creatures");
static {
filter1.add(new ColorPredicate(ObjectColor.GREEN));
filter2.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN)));
}
public BattleFrenzy(UUID ownerId) {
super(ownerId, 175, "Battle Frenzy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}");
this.expansionSetCode = "ICE";
// Green creatures you control get +1/+1 until end of turn.
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, filter1));
// Nongreen creatures you control get +1/+0 until end of turn.
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter2));
}
public BattleFrenzy(final BattleFrenzy card) {
super(card);
}
@Override
public BattleFrenzy copy() {
return new BattleFrenzy(this);
}
}

View file

@ -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.iceage;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class Enervate extends mage.sets.masterseditionii.Enervate {
public Enervate(UUID ownerId) {
super(ownerId);
this.cardNumber = 67;
this.expansionSetCode = "ICE";
}
public Enervate(final Enervate card) {
super(card);
}
@Override
public Enervate copy() {
return new Enervate(this);
}
}

View file

@ -0,0 +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.iceage;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleEvasionAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
import mage.abilities.keyword.CumulativeUpkeepAbility;
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.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class FlowOfMaggots extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creatures");
static {
filter.add(Predicates.not(new SubtypePredicate("Wall")));
}
public FlowOfMaggots(UUID ownerId) {
super(ownerId, 13, "Flow of Maggots", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.expansionSetCode = "ICE";
this.subtype.add("Insect");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Cumulative upkeep {1}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
// Flow of Maggots can't be blocked by non-Wall creatures.
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
}
public FlowOfMaggots(final FlowOfMaggots card) {
super(card);
}
@Override
public FlowOfMaggots copy() {
return new FlowOfMaggots(this);
}
}

View file

@ -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.iceage;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class IllusionaryForces extends mage.sets.mastersedition.IllusionaryForces {
public IllusionaryForces(UUID ownerId) {
super(ownerId);
this.cardNumber = 75;
this.expansionSetCode = "ICE";
this.rarity = Rarity.COMMON;
}
public IllusionaryForces(final IllusionaryForces card) {
super(card);
}
@Override
public IllusionaryForces copy() {
return new IllusionaryForces(this);
}
}

View file

@ -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.iceage;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public class IllusionaryWall extends mage.sets.mastersedition.IllusionaryWall {
public IllusionaryWall(UUID ownerId) {
super(ownerId);
this.cardNumber = 78;
this.expansionSetCode = "ICE";
}
public IllusionaryWall(final IllusionaryWall card) {
super(card);
}
@Override
public IllusionaryWall copy() {
return new IllusionaryWall(this);
}
}

Some files were not shown because too many files have changed in this diff Show more