diff --git a/Mage.Client/src/main/java/mage/client/components/ColorPane.java b/Mage.Client/src/main/java/mage/client/components/ColorPane.java index c835dbf973a..370459a2664 100644 --- a/Mage.Client/src/main/java/mage/client/components/ColorPane.java +++ b/Mage.Client/src/main/java/mage/client/components/ColorPane.java @@ -17,18 +17,21 @@ import javax.swing.text.html.HTMLEditorKit; public class ColorPane extends JEditorPane { HTMLEditorKit kit = new HTMLEditorKit(); - HTMLDocument doc = new HTMLDocument(); - + HTMLDocument doc = new HTMLDocument(); + public ColorPane() { this.setEditorKit(kit); this.setDocument(doc); } + /** - * This method solves the known issue with Nimbus LAF background transparency and background color. + * This method solves the known issue with Nimbus LAF background + * transparency and background color. + * * @param color */ public void setExtBackgroundColor(Color color) { - setBackground(new Color(0,0,0,0)); + setBackground(new Color(0, 0, 0, 0)); JPanel jPanel = new JPanel(); jPanel.setBackground(color); setLayout(new BorderLayout()); @@ -73,4 +76,4 @@ public class ColorPane extends JEditorPane { super.paintChildren(g); } -} \ No newline at end of file +} diff --git a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form index 9ef7f54408f..324258710a2 100644 --- a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form @@ -1,6 +1,10 @@ -
+ + + + + @@ -85,6 +89,9 @@ + + + @@ -92,6 +99,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java index 0c96d1588b5..eff39e49483 100644 --- a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java @@ -38,13 +38,12 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import javax.swing.Icon; +import javax.swing.border.EmptyBorder; import javax.swing.table.AbstractTableModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableColumnModel; import mage.client.chat.ChatPanelBasic; import static mage.client.chat.ChatPanelBasic.CHAT_ALPHA; -import mage.client.chat.ChatPanelSeparated; -import mage.client.components.ColorPane; import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_ORDER; import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_WIDTH; import mage.client.util.MageTableRowSorter; @@ -62,8 +61,6 @@ public class PlayersChatPanel extends javax.swing.JPanel { private final List players = new ArrayList<>(); private final UserTableModel userTableModel; - private final ChatPanelSeparated userChatPanel; - private final ColorPane systemMessagesPane; private static final int[] defaultColumnsWidth = {20, 100, 100, 80, 80}; @@ -84,43 +81,26 @@ public class PlayersChatPanel extends javax.swing.JPanel { TableUtil.setColumnWidthAndOrder(jTablePlayers, defaultColumnsWidth, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); jTablePlayers.setDefaultRenderer(Icon.class, new CountryCellRenderer()); - systemMessagesPane = new ColorPane(); + jScrollPaneTalk.setSystemMessagesPane(colorPaneSystem); + jScrollPaneTalk.setOpaque(false); - userChatPanel = new ChatPanelSeparated(); - userChatPanel.setSystemMessagesPane(systemMessagesPane); - - if (jTabbedPaneText != null) { - jTabbedPaneText.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); - if (userChatPanel != null) { - userChatPanel.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); - jTabbedPaneText.addTab("Talk", userChatPanel); - } - if (systemMessagesPane != null) { - systemMessagesPane.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); - systemMessagesPane.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N - systemMessagesPane.setFocusCycleRoot(false); - systemMessagesPane.setMargin(new java.awt.Insets(2, 2, 2, 2)); - systemMessagesPane.setOpaque(false); - systemMessagesPane.setExtBackgroundColor(new Color(0, 0, 0, CHAT_ALPHA)); // Alpha = 255 not transparent - systemMessagesPane.setSelectionColor(Color.LIGHT_GRAY); - jTabbedPaneText.addTab("System", systemMessagesPane); - - } - } + jScrollPaneSystem.getViewport().setOpaque(false); + colorPaneSystem.setExtBackgroundColor(new Color(0, 0, 0, CHAT_ALPHA)); // Alpha = 255 not transparent + colorPaneSystem.setBorder(new EmptyBorder(5, 5, 5, 5)); if (jScrollPanePlayers != null) { - jScrollPanePlayers.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); jScrollPanePlayers.getViewport().setBackground(new Color(0, 0, 0, CHAT_ALPHA)); } + } public ChatPanelBasic getUserChatPanel() { - return userChatPanel; + return jScrollPaneTalk; } public void cleanUp() { TableUtil.saveColumnWidthAndOrderToPrefs(jTablePlayers, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); - userChatPanel.cleanUp(); + jScrollPaneTalk.cleanUp(); } public void setSplitDividerLocation(int location) { @@ -219,11 +199,16 @@ public class PlayersChatPanel extends javax.swing.JPanel { @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + jSpinner1 = new javax.swing.JSpinner(); jSplitPane1 = new javax.swing.JSplitPane(); jScrollPanePlayers = new javax.swing.JScrollPane(); jTablePlayers = new javax.swing.JTable(); jTabbedPaneText = new javax.swing.JTabbedPane(); + jScrollPaneTalk = new mage.client.chat.ChatPanelSeparated(); + jScrollPaneSystem = new javax.swing.JScrollPane(); + colorPaneSystem = new mage.client.components.ColorPane(); jSplitPane1.setBorder(null); jSplitPane1.setDividerSize(10); @@ -246,6 +231,26 @@ public class PlayersChatPanel extends javax.swing.JPanel { jScrollPanePlayers.setViewportView(jTablePlayers); jSplitPane1.setTopComponent(jScrollPanePlayers); + + jTabbedPaneText.setTabPlacement(javax.swing.JTabbedPane.BOTTOM); + jTabbedPaneText.addTab("Talk", jScrollPaneTalk); + + jScrollPaneSystem.setBorder(null); + jScrollPaneSystem.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jScrollPaneSystem.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + jScrollPaneSystem.setFocusable(false); + jScrollPaneSystem.setOpaque(false); + + colorPaneSystem.setEditable(false); + colorPaneSystem.setBackground(new java.awt.Color(0, 0, 0)); + colorPaneSystem.setBorder(null); + colorPaneSystem.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + colorPaneSystem.setMargin(new java.awt.Insets(0, 0, 0, 0)); + colorPaneSystem.setOpaque(false); + jScrollPaneSystem.setViewportView(colorPaneSystem); + + jTabbedPaneText.addTab("System", jScrollPaneSystem); + jSplitPane1.setRightComponent(jTabbedPaneText); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -270,7 +275,11 @@ public class PlayersChatPanel extends javax.swing.JPanel { } } // Variables declaration - do not modify//GEN-BEGIN:variables + private mage.client.components.ColorPane colorPaneSystem; private javax.swing.JScrollPane jScrollPanePlayers; + private javax.swing.JScrollPane jScrollPaneSystem; + private mage.client.chat.ChatPanelSeparated jScrollPaneTalk; + private javax.swing.JSpinner jSpinner1; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JTabbedPane jTabbedPaneText; private javax.swing.JTable jTablePlayers; diff --git a/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java b/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java index c789f94e247..2897eaaaeee 100644 --- a/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java +++ b/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java @@ -48,7 +48,7 @@ import mage.target.TargetPermanent; */ public class ArgivianBlacksmith extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("target artifact creature"); + private static final FilterPermanent filter = new FilterPermanent("artifact creature"); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java index a249d46d935..848dcaee76a 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java @@ -53,28 +53,28 @@ import mage.target.targetpointer.FixedTarget; /** * - * You may exchange control of Perplexing Chimera and any spell cast - * by an opponent, not just one with targets. + * You may exchange control of Perplexing Chimera and any spell cast by an + * opponent, not just one with targets. * - * You make the decision whether to exchange control of Perplexing Chimera - * and the spell as the triggered ability resolves. + * You make the decision whether to exchange control of Perplexing Chimera and + * the spell as the triggered ability resolves. * * If Perplexing Chimera leaves the battlefield or the spell leaves the stack * before the triggered ability resolves, you can't make the exchange. * - * Neither Perplexing Chimera nor the spell changes zones. Only control of - * them is exchanged. + * Neither Perplexing Chimera nor the spell changes zones. Only control of them + * is exchanged. * - * After the ability resolves, you control the spell. Any instance of "you" - * in that spell's text now refers to you, "an opponent" refers to one of - * your opponents, and so on. The change of control happens before new targets - * are chosen, so any targeting restrictions such as "target opponent" or - * "target creature you control" are now made in reference to you, not the - * spell's original controller. You may change those targets to be legal in - * reference to you, or, if those are the spell's only targets, the spell will - * be countered on resolution for having illegal targets. When the spell - * resolves, any illegal targets are unaffected by it and you make all decisions - * the spell's effect calls for. + * After the ability resolves, you control the spell. Any instance of "you" in + * that spell's text now refers to you, "an opponent" refers to one of your + * opponents, and so on. The change of control happens before new targets are + * chosen, so any targeting restrictions such as "target opponent" or "target + * creature you control" are now made in reference to you, not the spell's + * original controller. You may change those targets to be legal in reference to + * you, or, if those are the spell's only targets, the spell will be countered + * on resolution for having illegal targets. When the spell resolves, any + * illegal targets are unaffected by it and you make all decisions the spell's + * effect calls for. * * You may change any of the spell's targets. If you change a target, you must * choose a legal target for the spell. If you can't, you must leave the target @@ -139,7 +139,7 @@ class PerplexingChimeraTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { - for (Effect effect: this.getEffects()) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; @@ -184,7 +184,7 @@ class PerplexingChimeraControlExchangeEffect extends OneShotEffect { spell.setControllerId(controller.getId()); // and chooses new targets spell.chooseNewTargets(game, controller.getId()); - game.informPlayers(new StringBuilder(controller.getLogName()).append(" got control of ").append(spell.getName()).append(" spell.").toString()); + game.informPlayers(controller.getLogName() + " got control of " + spell.getName() + " spell."); // and spell controller get control of Perplexing Chimera if (spellCaster != null) { ContinuousEffect effect = new PerplexingChimeraControlEffect(); @@ -218,8 +218,10 @@ class PerplexingChimeraControlEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { return permanent.changeControllerId(this.getTargetPointer().getFirst(game, source), game); + } else { + discard(); // if card once left the battlefield the effect can be discarded } - return false; + return true; } } diff --git a/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java b/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java index f0909282109..81a6d12aaf7 100644 --- a/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java +++ b/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java @@ -60,8 +60,9 @@ import mage.players.Player; * @author fireshoes */ public class DaxosTheReturned extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("an enchantment spell"); + static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } @@ -80,10 +81,10 @@ public class DaxosTheReturned extends CardImpl { effect.setText("you get an experience counter"); Ability ability = new SpellCastControllerTriggeredAbility(effect, filter, false); this.addAbility(ability); - - // {1}{W}{B}: Put a white and black Spirit enchantment creature token onto the battlefield. It has + + // {1}{W}{B}: Put a white and black Spirit enchantment creature token onto the battlefield. It has // "This creature's power and toughness are each equal to the number of experience counters you have." - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DaxosSpiritToken(), 1), new ManaCostsImpl("{1}{W}{B}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DaxosSpiritToken(), 1), new ManaCostsImpl("{1}{W}{B}"))); } public DaxosTheReturned(final DaxosTheReturned card) { @@ -96,13 +97,13 @@ public class DaxosTheReturned extends CardImpl { } } - class DaxosSpiritToken extends Token { + DaxosSpiritToken() { super("Spirit", "white and black Spirit enchantment creature token with \"This creature's power and toughness are each equal to the number of experience counters you have.\""); this.setOriginalExpansionSetCode("C15"); - cardType.add(CardType.CREATURE); cardType.add(CardType.ENCHANTMENT); + cardType.add(CardType.CREATURE); color.setWhite(true); color.setBlack(true); subtype.add("Spirit"); @@ -144,4 +145,4 @@ class DaxosSpiritSetPTEffect extends ContinuousEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java b/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java index 2849a7d5c53..f3c787d3a70 100644 --- a/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java +++ b/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -69,18 +70,18 @@ public class GraspOfFate extends CardImpl { public GraspOfFate(final GraspOfFate card) { super(card); } - + @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof EntersBattlefieldTriggeredAbility) { ability.getTargets().clear(); - for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + for (UUID opponentId : game.getOpponents(ability.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { FilterPermanent filter = new FilterPermanent("nonland permanent from opponent " + opponent.getLogName()); filter.add(new ControllerIdPredicate(opponentId)); filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); - TargetPermanent target = new TargetPermanent(0, 1, filter,false); + TargetPermanent target = new TargetPermanent(0, 1, filter, false); ability.addTarget(target); } } @@ -113,7 +114,7 @@ class GraspOfFateExileEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName(), Zone.BATTLEFIELD, true).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/MonasteryLoremaster.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/MonasteryLoremaster.java index 882ee2bb04f..9557b42fbb6 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/MonasteryLoremaster.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/MonasteryLoremaster.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class MonasteryLoremaster extends CardImpl { - private static final FilterCard filter = new FilterCard("target noncreature, nonland card from your graveyard"); + private static final FilterCard filter = new FilterCard("noncreature, nonland card from your graveyard"); static { filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); diff --git a/Mage.Sets/src/mage/sets/fifthedition/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/fifthedition/DwarvenWarriors.java new file mode 100644 index 00000000000..05c7c6f80d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/DwarvenWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends mage.sets.revisededition.DwarvenWarriors { + + public DwarvenWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 222; + this.expansionSetCode = "5ED"; + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/fourthedition/DwarvenWarriors.java new file mode 100644 index 00000000000..bfa0ecb3506 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/DwarvenWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends mage.sets.revisededition.DwarvenWarriors { + + public DwarvenWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 205; + this.expansionSetCode = "4ED"; + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/ScoutingTrek.java b/Mage.Sets/src/mage/sets/invasion/ScoutingTrek.java new file mode 100644 index 00000000000..826c3dd986c --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ScoutingTrek.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; +import mage.abilities.effects.common.RecruiterEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; + +/** + * + * @author LoneFox + */ +public class ScoutingTrek extends CardImpl { + + public ScoutingTrek(UUID ownerId) { + super(ownerId, 210, "Scouting Trek", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "INV"; + + // Search your library for any number of basic land cards. Reveal those cards, then shuffle your library and put them on top of it. + this.getSpellAbility().addEffect(new RecruiterEffect(new FilterBasicLandCard("basic land cards"))); + } + + public ScoutingTrek(final ScoutingTrek card) { + super(card); + } + + @Override + public ScoutingTrek copy() { + return new ScoutingTrek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/AnuridBarkripper.java b/Mage.Sets/src/mage/sets/judgment/AnuridBarkripper.java new file mode 100644 index 00000000000..100a757e9f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/AnuridBarkripper.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class AnuridBarkripper extends CardImpl { + + public AnuridBarkripper(UUID ownerId) { + super(ownerId, 104, "Anurid Barkripper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Frog"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Threshold - Anurid Barkripper gets +2/+2 as long as seven or more cards are in your graveyard. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +2/+2")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public AnuridBarkripper(final AnuridBarkripper card) { + super(card); + } + + @Override + public AnuridBarkripper copy() { + return new AnuridBarkripper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/AvenFogbringer.java b/Mage.Sets/src/mage/sets/judgment/AvenFogbringer.java new file mode 100644 index 00000000000..4017150c20c --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/AvenFogbringer.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class AvenFogbringer extends CardImpl { + + public AvenFogbringer(UUID ownerId) { + super(ownerId, 34, "Aven Fogbringer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Bird"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Aven Fogbringer enters the battlefield, return target land to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public AvenFogbringer(final AvenFogbringer card) { + super(card); + } + + @Override + public AvenFogbringer copy() { + return new AvenFogbringer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/DwarvenBloodboiler.java b/Mage.Sets/src/mage/sets/judgment/DwarvenBloodboiler.java new file mode 100644 index 00000000000..ea616576e1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/DwarvenBloodboiler.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenBloodboiler extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an untapped Dwarf you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Dwarf")); + } + + public DwarvenBloodboiler(UUID ownerId) { + super(ownerId, 84, "Dwarven Bloodboiler", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}{R}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Dwarf"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Tap an untapped Dwarf you control: Target creature gets +2/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 0, Duration.EndOfTurn), + new TapTargetCost(new TargetControlledPermanent(1, 1, filter, false))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DwarvenBloodboiler(final DwarvenBloodboiler card) { + super(card); + } + + @Override + public DwarvenBloodboiler copy() { + return new DwarvenBloodboiler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/EmberShot.java b/Mage.Sets/src/mage/sets/judgment/EmberShot.java new file mode 100644 index 00000000000..1e9eed31283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/EmberShot.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class EmberShot extends CardImpl { + + public EmberShot(UUID ownerId) { + super(ownerId, 87, "Ember Shot", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{6}{R}"); + this.expansionSetCode = "JUD"; + + // Ember Shot deals 3 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public EmberShot(final EmberShot card) { + super(card); + } + + @Override + public EmberShot copy() { + return new EmberShot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/FledglingDragon.java b/Mage.Sets/src/mage/sets/judgment/FledglingDragon.java new file mode 100644 index 00000000000..f8e41437c54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/FledglingDragon.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FledglingDragon extends CardImpl { + + public FledglingDragon(UUID ownerId) { + super(ownerId, 90, "Fledgling Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Dragon"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Fledgling Dragon gets +3/+3 and has "{R}: Fledgling Dragon gets +1/+0 until end of turn." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +3/+3")); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(gainedAbility), + new CardsInControllerGraveCondition(7), "and has \"{R}: {this} gets +1/+0 until end of turn.\"")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public FledglingDragon(final FledglingDragon card) { + super(card); + } + + @Override + public FledglingDragon copy() { + return new FledglingDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/LiberatedDwarf.java b/Mage.Sets/src/mage/sets/judgment/LiberatedDwarf.java new file mode 100644 index 00000000000..74499bd9f7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/LiberatedDwarf.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class LiberatedDwarf extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public LiberatedDwarf(UUID ownerId) { + super(ownerId, 95, "Liberated Dwarf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Dwarf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, Sacrifice Liberated Dwarf: Target green creature gets +1/+0 and gains first strike until end of turn. + Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); + effect.setText("Target green creature gets +1/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}")); ability.addCost(new SacrificeSourceCost()); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public LiberatedDwarf(final LiberatedDwarf card) { + super(card); + } + + @Override + public LiberatedDwarf copy() { + return new LiberatedDwarf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java b/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java new file mode 100644 index 00000000000..6640eb8fc44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/SoulcatchersAerie.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class SoulcatchersAerie extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Bird"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Bird creatures"); + + static { + filter.add(new SubtypePredicate("Bird")); + filter2.add(new SubtypePredicate("Bird")); + } + + public SoulcatchersAerie(UUID ownerId) { + super(ownerId, 25, "Soulcatchers' Aerie", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "JUD"; + + // Whenever a Bird is put into your graveyard from the battlefield, put a feather counter on Soulcatchers' Aerie. + this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance()), + false, filter, false, true)); + // Bird creatures get +1/+1 for each feather counter on Soulcatchers' Aerie. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.FEATHER), + new CountersCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter2, false, + "Bird creatures get +1/+1 for each feather counter on {this}."))); + } + + public SoulcatchersAerie(final SoulcatchersAerie card) { + super(card); + } + + @Override + public SoulcatchersAerie copy() { + return new SoulcatchersAerie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java b/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java index 53ad2996a72..51ec832eccd 100644 --- a/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java +++ b/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java @@ -61,7 +61,7 @@ public class GoblinDynamo extends CardImpl { this.addAbility(ability); //{X}{R}, {T}, Sacrifice Goblin Dynamo: Goblin Dynamo deals X damage to target creature or player. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -75,4 +75,4 @@ public class GoblinDynamo extends CardImpl { public GoblinDynamo copy() { return new GoblinDynamo(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/limitedalpha/DwarvenWarriors.java new file mode 100644 index 00000000000..60298e57647 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/DwarvenWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends mage.sets.revisededition.DwarvenWarriors { + + public DwarvenWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "LEA"; + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/limitedbeta/DwarvenWarriors.java new file mode 100644 index 00000000000..41f5b80808b --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/DwarvenWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends mage.sets.revisededition.DwarvenWarriors { + + public DwarvenWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 145; + this.expansionSetCode = "LEB"; + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/ConsumingBonfire.java b/Mage.Sets/src/mage/sets/lorwyn/ConsumingBonfire.java new file mode 100644 index 00000000000..29ff49fb507 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/ConsumingBonfire.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author Poddo + */ + +public class ConsumingBonfire extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("non-Elemental creature"); + private static final FilterPermanent filter2 = new FilterPermanent("Treefolk creature"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(Predicates.not(new SubtypePredicate("Elemental"))); + filter2.add(new CardTypePredicate(CardType.CREATURE)); + filter2.add(new SubtypePredicate("Treefolk")); + } + + public ConsumingBonfire(UUID ownerId) { + super(ownerId, 161, "Consuming Bonfire", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elemental"); + + // Choose one - Consuming Bonfire deals 4 damage to target non-Elemental creature; + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + + //or Consuming Bonfire deals 7 damage to target Treefolk creature. + Mode mode = new Mode(); + mode.getEffects().add(new DamageTargetEffect(7)); + mode.getTargets().add(new TargetPermanent(filter2)); + this.getSpellAbility().addMode(mode); + } + + public ConsumingBonfire(final ConsumingBonfire card) { + super(card); + } + + @Override + public ConsumingBonfire copy() { + return new ConsumingBonfire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/DwarvenNomad.java b/Mage.Sets/src/mage/sets/mirage/DwarvenNomad.java new file mode 100644 index 00000000000..94b7214efdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/DwarvenNomad.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter.ComparisonType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenNomad extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.LessThan, 3)); + } + + public DwarvenNomad(UUID ownerId) { + super(ownerId, 170, "Dwarven Nomad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Dwarf"); + this.subtype.add("Nomad"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {T}: Target creature with power 2 or less can't be blocked this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DwarvenNomad(final DwarvenNomad card) { + super(card); + } + + @Override + public DwarvenNomad copy() { + return new DwarvenNomad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/DwarvenRecruiter.java b/Mage.Sets/src/mage/sets/odyssey/DwarvenRecruiter.java new file mode 100644 index 00000000000..bbbdf99d012 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/DwarvenRecruiter.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.RecruiterEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class DwarvenRecruiter extends CardImpl { + + private static final FilterCard filter = new FilterCard("Dwarf cards"); + + static { + filter.add(new SubtypePredicate("Dwarf")); + } + + public DwarvenRecruiter(UUID ownerId) { + super(ownerId, 186, "Dwarven Recruiter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Dwarf"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Dwarven Recruiter enters the battlefield, search your library for any number of Dwarf cards and reveal those cards. Shuffle your library, then put them on top of it in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new RecruiterEffect(filter), false)); + } + + public DwarvenRecruiter(final DwarvenRecruiter card) { + super(card); + } + + @Override + public DwarvenRecruiter copy() { + return new DwarvenRecruiter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AirborneAid.java b/Mage.Sets/src/mage/sets/onslaught/AirborneAid.java new file mode 100644 index 00000000000..c92207b1a11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AirborneAid.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class AirborneAid extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Bird on the battlefield"); + + static { + filter.add(new SubtypePredicate("Bird")); + } + + public AirborneAid(UUID ownerId) { + super(ownerId, 62, "Airborne Aid", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "ONS"; + + // Draw a card for each Bird on the battlefield. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter))); + } + + public AirborneAid(final AirborneAid card) { + super(card); + } + + @Override + public AirborneAid copy() { + return new AirborneAid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java b/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java index acc479365bf..03e51e65e2b 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java +++ b/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class SerendibSorcerer extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature other than {this}"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature other than {this}"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/sets/revisededition/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/revisededition/DwarvenWarriors.java new file mode 100644 index 00000000000..6baafc93c54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/DwarvenWarriors.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter.ComparisonType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.LessThan, 3)); + } + + public DwarvenWarriors(UUID ownerId) { + super(ownerId, 143, "Dwarven Warriors", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Dwarf"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {T}: Target creature with power 2 or less can't be blocked this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/AvenLiberator.java b/Mage.Sets/src/mage/sets/scourge/AvenLiberator.java new file mode 100644 index 00000000000..8eaefe1a5cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/AvenLiberator.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +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.common.continuous.GainProtectionFromColorTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AvenLiberator extends CardImpl { + + public AvenLiberator(UUID ownerId) { + super(ownerId, 4, "Aven Liberator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {3}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{W}"))); + // When Aven Liberator is turned face up, target creature you control gains protection from the color of your choice until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn)); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public AvenLiberator(final AvenLiberator card) { + super(card); + } + + @Override + public AvenLiberator copy() { + return new AvenLiberator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/MercurialKite.java b/Mage.Sets/src/mage/sets/scourge/MercurialKite.java new file mode 100644 index 00000000000..40e17ff9f07 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/MercurialKite.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToACreatureTriggeredAbility; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author Poddo + */ +public class MercurialKite extends CardImpl { + + public MercurialKite(UUID ownerId) { + super(ownerId, 39, "Mercurial Kite", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Mercurial Kite deals combat damage to a creature, tap that creature. That creature doesn't untap during its controller's next untap step. + Ability ability; + ability = new DealsDamageToACreatureTriggeredAbility(new TapTargetEffect("that creature"), true, false, true); + ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect("and it")); + this.addAbility(ability); + } + + public MercurialKite(final MercurialKite card) { + super(card); + } + + @Override + public MercurialKite copy() { + return new MercurialKite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/MilitantMonk.java b/Mage.Sets/src/mage/sets/torment/MilitantMonk.java new file mode 100644 index 00000000000..ff02d5b03b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/MilitantMonk.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class MilitantMonk extends CardImpl { + + public MilitantMonk(UUID ownerId) { + super(ownerId, 9, "Militant Monk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // {T}: Prevent the next 1 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public MilitantMonk(final MilitantMonk card) { + super(card); + } + + @Override + public MilitantMonk copy() { + return new MilitantMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/MysticFamiliar.java b/Mage.Sets/src/mage/sets/torment/MysticFamiliar.java new file mode 100644 index 00000000000..09e8332bf93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/MysticFamiliar.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class MysticFamiliar extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public MysticFamiliar(UUID ownerId) { + super(ownerId, 11, "Mystic Familiar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Mystic Familiar gets +1/+1 and has protection from black. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(new ProtectionAbility(filter)), + new CardsInControllerGraveCondition(7), "and has protection from black")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public MysticFamiliar(final MysticFamiliar card) { + super(card); + } + + @Override + public MysticFamiliar copy() { + return new MysticFamiliar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/NantukoBlightcutter.java b/Mage.Sets/src/mage/sets/torment/NantukoBlightcutter.java new file mode 100644 index 00000000000..efcc1700c5a --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/NantukoBlightcutter.java @@ -0,0 +1,94 @@ +/* + * 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.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class NantukoBlightcutter extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + private static final FilterPermanent filter2 = new FilterPermanent(); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + filter2.add(new ColorPredicate(ObjectColor.BLACK)); + filter2.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public NantukoBlightcutter(UUID ownerId) { + super(ownerId, 131, "Nantuko Blightcutter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Insect"); + this.subtype.add("Druid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + // Threshold - Nantuko Blightcutter gets +1/+1 for each black permanent your opponents control as long as seven or more cards are in your graveyard. + PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter2); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(count, count, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "{this} gets +1/+1 for each black permanent your opponents control as long as seven or more cards are in your graveyard")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public NantukoBlightcutter(final NantukoBlightcutter card) { + super(card); + } + + @Override + public NantukoBlightcutter copy() { + return new NantukoBlightcutter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/OrganGrinder.java b/Mage.Sets/src/mage/sets/torment/OrganGrinder.java new file mode 100644 index 00000000000..50094f39ea5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/OrganGrinder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class OrganGrinder extends CardImpl { + + public OrganGrinder(UUID ownerId) { + super(ownerId, 75, "Organ Grinder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {tap}, Exile three cards from your graveyard: Target player loses 3 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost()); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCard("three cards from your graveyard")))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public OrganGrinder(final OrganGrinder card) { + super(card); + } + + @Override + public OrganGrinder copy() { + return new OrganGrinder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Pyromania.java b/Mage.Sets/src/mage/sets/torment/Pyromania.java new file mode 100644 index 00000000000..7a7e8fe1432 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Pyromania.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class Pyromania extends CardImpl { + + public Pyromania(UUID ownerId) { + super(ownerId, 112, "Pyromania", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "TOR"; + + // {1}{R}, Discard a card at random: Pyromania deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}")); + ability.addCost(new DiscardCardCost(true)); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + // {1}{R}, Sacrifice Pyromania: Pyromania deals 1 damage to target creature or player. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public Pyromania(final Pyromania card) { + super(card); + } + + @Override + public Pyromania copy() { + return new Pyromania(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/DwarvenWarriors.java b/Mage.Sets/src/mage/sets/unlimitededition/DwarvenWarriors.java new file mode 100644 index 00000000000..00fa6ef43ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/DwarvenWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWarriors extends mage.sets.revisededition.DwarvenWarriors { + + public DwarvenWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "2ED"; + } + + public DwarvenWarriors(final DwarvenWarriors card) { + super(card); + } + + @Override + public DwarvenWarriors copy() { + return new DwarvenWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java b/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java index 9d574f3020b..4eb638f77d3 100644 --- a/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java +++ b/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java @@ -31,18 +31,13 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RecruiterEffect; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInLibrary; + /** * @@ -50,6 +45,12 @@ import mage.target.common.TargetCardInLibrary; */ public class GoblinRecruiter extends CardImpl { + private static final FilterCard filter = new FilterCard("Goblin cards"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + public GoblinRecruiter(UUID ownerId) { super(ownerId, 80, "Goblin Recruiter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "VIS"; @@ -59,7 +60,7 @@ public class GoblinRecruiter extends CardImpl { this.toughness = new MageInt(1); // When Goblin Recruiter enters the battlefield, search your library for any number of Goblin cards and reveal those cards. Shuffle your library, then put them on top of it in any order. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GoblinRecruiterEffect(), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new RecruiterEffect(filter), false)); } public GoblinRecruiter(final GoblinRecruiter card) { @@ -71,48 +72,3 @@ public class GoblinRecruiter extends CardImpl { return new GoblinRecruiter(this); } } - -class GoblinRecruiterEffect extends OneShotEffect { - - private static final FilterCard goblinFilter = new FilterCard("Goblin cards"); - - static { - goblinFilter.add(new SubtypePredicate("Goblin")); - } - - public GoblinRecruiterEffect() { - super(Outcome.Benefit); - this.staticText = "search your library for any number of Goblin cards and reveal those cards. Shuffle your library, then put them on top of it in any order."; - } - - public GoblinRecruiterEffect(final GoblinRecruiterEffect effect) { - super(effect); - } - - @Override - public GoblinRecruiterEffect copy() { - return new GoblinRecruiterEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - TargetCardInLibrary targetGoblins = new TargetCardInLibrary(0, Integer.MAX_VALUE, goblinFilter); - Cards cards = new CardsImpl(); - if (controller.searchLibrary(targetGoblins, game)) { - cards.addAll(targetGoblins.getTargets()); - } - controller.revealCards(staticText, cards, game); - controller.shuffleLibrary(game); - - int numberOfGoblins = cards.size(); - if (numberOfGoblins > 0) { - controller.putCardsOnTopOfLibrary(cards, game, source, true); - } - return true; - } - return false; - } - -} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/RoonOfTheHiddenRealmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/RoonOfTheHiddenRealmTest.java new file mode 100644 index 00000000000..8b17d0396f3 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/RoonOfTheHiddenRealmTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.exile; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class RoonOfTheHiddenRealmTest extends CardTestPlayerBase { + + /** + * Roon of the Hidden Realm is returning cards to their controler's control + * instead of the owner's control at the end of the turn. I used his ability + * on a Perplexing Chimera I gave my opponent and in the end of the turn it + * returned to the battlefield in his control. + */ + @Test + public void testReturnToBattlefieldForOwner() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // Vigilance, Trample + // {2}, {T}: Exile another target creature. Return that card to the battlefield under its owner's control at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerA, "Roon of the Hidden Realm"); + + // Whenever an opponent casts a spell, you may exchange control of Perplexing Chimera and that spell. If you do, you may choose new targets for the spell. + addCard(Zone.BATTLEFIELD, playerA, "Perplexing Chimera"); + + addCard(Zone.HAND, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); + setChoice(playerA, "Yes"); + + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}", "Perplexing Chimera"); + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertTapped("Roon of the Hidden Realm", true); + assertPermanentCount(playerA, "Roon of the Hidden Realm", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerB, "Perplexing Chimera", 0); + assertPermanentCount(playerA, "Perplexing Chimera", 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java new file mode 100644 index 00000000000..13f3a1fc26b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.Filter; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DaxosTheReturnedTest extends CardTestPlayerBase { + + /** + * Daxos the Returned 's spirit tokens are not counted as enchantment tokens + * and do not count towards experience counters like they should. + */ + @Test + public void testCounterAddAndTokenStates() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + // Whenever you cast an enchantment spell, you get an experience counter. + // {1}{W}{B}: Put a white and black Spirit enchantment creature token onto the battlefield. It has + // "This creature's power and toughness are each equal to the number of experience counters you have." + addCard(Zone.BATTLEFIELD, playerA, "Daxos the Returned"); + + // Whenever an opponent draws a card, Underworld Dreams deals 1 damage to him or her. + addCard(Zone.HAND, playerA, "Underworld Dreams", 2); // {B}{B}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{1}{W}{B}"); + setStopAt(2, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 18); + + assertPermanentCount(playerA, "Underworld Dreams", 2); + assertCounterCount(playerA, CounterType.EXPERIENCE, 2); + assertPowerToughness(playerA, "Spirit", 2, 2, Filter.ComparisonScope.All); + assertType("Spirit", CardType.ENCHANTMENT, "Spirit"); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/OmniscienceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/OmniscienceTest.java index 02ab0f8a237..c0c755ef3a5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/OmniscienceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/OmniscienceTest.java @@ -41,4 +41,27 @@ public class OmniscienceTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Knight of the White Orchid", 0); } + /** + * If you cast a card with monocolored hybrid mana with Omniscience's + * alternate casting cost, you will be asked to pay 1 colorless mana per + * monocolored hybrid mana in its cost. For example, while casting Beseech + * the Queen, you are asked to pay {1}{1}{1}. + */ + @Test + public void testMonocoloredHybridMana() { + // You may cast nonland cards from your hand without paying their mana costs. + addCard(Zone.BATTLEFIELD, playerA, "Omniscience", 1); + + // ({2B} can be paid with any two mana or with {B}. This card's converted mana cost is 6.) + // Search your library for a card with converted mana cost less than or equal to the number of lands you control, reveal it, and put it into your hand. Then shuffle your library. + addCard(Zone.HAND, playerA, "Beseech the Queen", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Beseech the Queen"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + // Beseech the Queen is cast because it is free + assertGraveyardCount(playerA, "Beseech the Queen", 1); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java b/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java index fbc1cd7518b..c27f28e03dd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java @@ -5,6 +5,7 @@ import java.util.LinkedHashMap; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.mana.BasicManaAbility; @@ -14,6 +15,7 @@ import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.Card; import mage.cards.repository.CardRepository; +import mage.util.CardUtil; import mage.util.ManaUtil; import org.junit.Assert; import org.junit.Test; @@ -125,6 +127,49 @@ public class ManaUtilTest extends CardTestPlayerBase { } + /** + * Mana.enough is used to check if a spell can be cast with an given amount + * of avalable mana + */ + @Test + public void testManaIncrease() { + // cost - reduction - rest + testManaReduction("{G}{G}", "{G}", "{G}"); + testManaReduction("{1}{G}{G}", "{G}", "{1}{G}"); + testManaReduction("{B}{B}", "{B}", "{B}"); + testManaReduction("{1}{B}{B}", "{B}", "{1}{B}"); + testManaReduction("{W}{W}", "{W}", "{W}"); + testManaReduction("{1}{W}{W}", "{W}", "{1}{W}"); + testManaReduction("{U}{U}", "{U}", "{U}"); + testManaReduction("{1}{U}{U}", "{U}", "{1}{U}"); + testManaReduction("{R}{R}", "{R}", "{R}"); + testManaReduction("{1}{R}{R}", "{R}", "{1}{R}"); + + testManaReduction("{R}{G}{B}{U}{W}", "{R}{G}{B}{U}{W}", "{0}"); + + // Hybrid Mana + testManaReduction("{2/B}{2/B}{2/B}", "{B}{B}", "{2/B}"); + testManaReduction("{2/B}{2/B}{2/B}", "{B}{B}{B}", "{0}"); + testManaReduction("{2/W}{2/W}{2/W}", "{W}{W}", "{2/W}"); + testManaReduction("{2/W}{2/W}{2/W}", "{W}{W}{W}", "{0}"); + + testManaReduction("{G/B}{G/B}{G/B}", "{B}{G}{B}", "{0}"); + } + + /** + * Checks if a given mana reduction left the expected amount of mana costs + * + * @param manaCostsToPay + * @param availablyAny + * @param available + * @param expected + */ + private void testManaReduction(String manaCostsToPay, String manaToReduce, String restMana) { + SpellAbility spellAbility = new SpellAbility(new ManaCostsImpl(manaCostsToPay), "Test"); + CardUtil.adjustCost(spellAbility, new ManaCostsImpl(manaToReduce), true); + Assert.assertTrue("The mana cost to pay " + manaCostsToPay + " reduced by " + manaToReduce + " should left " + restMana + " but the rest was " + spellAbility.getManaCostsToPay().getText(), spellAbility.getManaCostsToPay().getText().equals(restMana)); + } + /** * Common way to test ManaUtil.tryToAutoPay * diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java index 7d7556fc7cf..2fdadd898df 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -27,6 +27,7 @@ */ package mage.abilities.effects.common; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; @@ -84,18 +85,19 @@ public class DrawCardTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - int cardsToDraw = amount.calculate(game, source, this); - if (upTo) { - cardsToDraw = player.getAmount(0, cardsToDraw, "Draw how many cards?", game); + for (UUID playerId : getTargetPointer().getTargets(game, source)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int cardsToDraw = amount.calculate(game, source, this); + if (upTo) { + cardsToDraw = player.getAmount(0, cardsToDraw, "Draw how many cards?", game); + } + if (!optional || player.chooseUse(outcome, "Use draw effect?", source, game)) { + player.drawCards(cardsToDraw, game); + } } - if (!optional || player.chooseUse(outcome, "Use draw effect?", source, game)) { - player.drawCards(cardsToDraw, game); - } - return true; } - return false; + return true; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java index 0cd80c15af0..29c311eca62 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java @@ -39,6 +39,8 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.Target; +import mage.target.targetpointer.FirstTargetPointer; /** * @@ -49,6 +51,7 @@ public class ExileTargetEffect extends OneShotEffect { private Zone onlyFromZone; private String exileZone = null; private UUID exileId = null; + protected boolean multitargetHandling; public ExileTargetEffect(String effectText) { this(); @@ -64,10 +67,15 @@ public class ExileTargetEffect extends OneShotEffect { } public ExileTargetEffect(UUID exileId, String exileZone, Zone onlyFromZone) { + this(exileId, exileZone, onlyFromZone, false); + } + + public ExileTargetEffect(UUID exileId, String exileZone, Zone onlyFromZone, boolean multitargetHandling) { super(Outcome.Exile); this.exileZone = exileZone; this.exileId = exileId; this.onlyFromZone = onlyFromZone; + this.multitargetHandling = multitargetHandling; } public ExileTargetEffect(final ExileTargetEffect effect) { @@ -75,6 +83,7 @@ public class ExileTargetEffect extends OneShotEffect { this.exileZone = effect.exileZone; this.exileId = effect.exileId; this.onlyFromZone = effect.onlyFromZone; + this.multitargetHandling = effect.multitargetHandling; } @Override @@ -87,19 +96,41 @@ public class ExileTargetEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Set toExile = new LinkedHashSet<>(); - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - Zone currentZone = game.getState().getZone(permanent.getId()); - if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) { - toExile.add(permanent); + if (multitargetHandling && source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate + for (Target target : source.getTargets()) { + for (UUID targetId : target.getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + Zone currentZone = game.getState().getZone(permanent.getId()); + if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) { + toExile.add(permanent); + } + } else { + Card card = game.getCard(targetId); + if (card != null) { + Zone currentZone = game.getState().getZone(card.getId()); + if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) { + toExile.add(card); + } + } + } } - } else { - Card card = game.getCard(targetId); - if (card != null) { - Zone currentZone = game.getState().getZone(card.getId()); - if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) { - toExile.add(card); + } + } else { + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + Zone currentZone = game.getState().getZone(permanent.getId()); + if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) { + toExile.add(permanent); + } + } else { + Card card = game.getCard(targetId); + if (card != null) { + Zone currentZone = game.getState().getZone(card.getId()); + if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) { + toExile.add(card); + } } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/RecruiterEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RecruiterEffect.java new file mode 100644 index 00000000000..1ae859cff2b --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/RecruiterEffect.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class RecruiterEffect extends OneShotEffect { + + private static FilterCard filter; + + public RecruiterEffect(FilterCard filter) { + super(Outcome.Benefit); + this.filter = filter; + } + + public RecruiterEffect(final RecruiterEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } + + @Override + public RecruiterEffect copy() { + return new RecruiterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null) { + TargetCardInLibrary targetCards = new TargetCardInLibrary(0, Integer.MAX_VALUE, filter); + Cards cards = new CardsImpl(); + if (controller.searchLibrary(targetCards, game)) { + cards.addAll(targetCards.getTargets()); + } + controller.revealCards(staticText, cards, game); + controller.shuffleLibrary(game); + + if(cards.size() > 0) { + controller.putCardsOnTopOfLibrary(cards, game, source, true); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "search your library for any number of " + filter.getMessage() + + " and reveal those cards. Shuffle your library, then put them on top of it in any order."; + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java index a2b0e1ae66e..36234a508c0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java @@ -47,8 +47,9 @@ public class AddCountersControllerEffect extends OneShotEffect { /** * * @param counter Counter to add. Includes type and amount. - * @param enchantedEquipped If true, not source controller will get counter, - * but permanent's controller that source enchants or equippes. + * @param enchantedEquipped If true, not source controller will get the + * counter, but the permanent's controller that the source permanent + * enchants or equippes. */ public AddCountersControllerEffect(Counter counter, boolean enchantedEquipped) { super(Outcome.Benefit); diff --git a/Mage/src/main/java/mage/util/CardUtil.java b/Mage/src/main/java/mage/util/CardUtil.java index 807c515c911..1b4c5e9d269 100644 --- a/Mage/src/main/java/mage/util/CardUtil.java +++ b/Mage/src/main/java/mage/util/CardUtil.java @@ -45,6 +45,7 @@ import mage.abilities.costs.mana.HybridManaCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.costs.mana.MonoHybridManaCost; import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.keyword.ChangelingAbility; import mage.cards.Card; @@ -292,14 +293,21 @@ public class CardUtil { Mana reduceMana = new Mana(); for (ManaCost manaCost : manaCostsToReduce) { - reduceMana.add(manaCost.getMana()); + if (manaCost instanceof MonoHybridManaCost) { + reduceMana.add(Mana.ColorlessMana(2)); + } else { + reduceMana.add(manaCost.getMana()); + } } + ManaCosts manaCostToCheckForColorless = new ManaCostsImpl<>(); // subtract colored mana for (ManaCost newManaCost : previousCost) { Mana mana = newManaCost.getMana(); - if (mana.getColorless() > 0) { + if (!(newManaCost instanceof MonoHybridManaCost) && mana.getColorless() > 0) { + manaCostToCheckForColorless.add(newManaCost); continue; } + boolean hybridMana = newManaCost instanceof HybridManaCost; if (mana.getBlack() > 0 && reduceMana.getBlack() > 0) { if (reduceMana.getBlack() > mana.getBlack()) { reduceMana.setBlack(reduceMana.getBlack() - mana.getBlack()); @@ -308,6 +316,9 @@ public class CardUtil { mana.setBlack(mana.getBlack() - reduceMana.getBlack()); reduceMana.setBlack(0); } + if (hybridMana) { + continue; + } } if (mana.getRed() > 0 && reduceMana.getRed() > 0) { if (reduceMana.getRed() > mana.getRed()) { @@ -317,6 +328,9 @@ public class CardUtil { mana.setRed(mana.getRed() - reduceMana.getRed()); reduceMana.setRed(0); } + if (hybridMana) { + continue; + } } if (mana.getBlue() > 0 && reduceMana.getBlue() > 0) { if (reduceMana.getBlue() > mana.getBlue()) { @@ -326,6 +340,9 @@ public class CardUtil { mana.setBlue(mana.getBlue() - reduceMana.getBlue()); reduceMana.setBlue(0); } + if (hybridMana) { + continue; + } } if (mana.getGreen() > 0 && reduceMana.getGreen() > 0) { if (reduceMana.getGreen() > mana.getGreen()) { @@ -335,6 +352,9 @@ public class CardUtil { mana.setGreen(mana.getGreen() - reduceMana.getGreen()); reduceMana.setGreen(0); } + if (hybridMana) { + continue; + } } if (mana.getWhite() > 0 && reduceMana.getWhite() > 0) { if (reduceMana.getWhite() > mana.getWhite()) { @@ -344,15 +364,22 @@ public class CardUtil { mana.setWhite(mana.getWhite() - reduceMana.getWhite()); reduceMana.setWhite(0); } - } - if (newManaCost instanceof HybridManaCost) { - if (mana.count() > 1) { - adjustedCost.add(newManaCost); + if (hybridMana) { + continue; } - } else if (mana.count() > 0) { - adjustedCost.add(newManaCost); } + if (mana.count() > 0) { + if (newManaCost instanceof MonoHybridManaCost) { + if (mana.count() == 2) { + reduceMana.setColorless(reduceMana.getColorless() - 2); + continue; + } + } + manaCostToCheckForColorless.add(newManaCost); + } + } + // subtract colorless mana, use all mana that is left int reduceAmount; if (convertToGeneric) { @@ -360,23 +387,38 @@ public class CardUtil { } else { reduceAmount = reduceMana.getColorless(); } - for (ManaCost newManaCost : previousCost) { - Mana mana = newManaCost.getMana(); - if (mana.getColorless() == 0) { - continue; - } - if (mana.getColorless() > 0 && reduceAmount > 0) { - if (reduceAmount > mana.getColorless()) { - reduceAmount -= mana.getColorless(); - mana.setColorless(0); - } else { - mana.setColorless(mana.getColorless() - reduceAmount); - reduceAmount = 0; + if (reduceAmount > 0) { + for (ManaCost newManaCost : manaCostToCheckForColorless) { + Mana mana = newManaCost.getMana(); + if (mana.getColorless() == 0 || reduceAmount == 0) { + adjustedCost.add(newManaCost); + continue; + } + if (newManaCost instanceof MonoHybridManaCost) { + if (reduceAmount > 1) { + reduceAmount -= 2; + mana.clear(); + } + continue; + } + if (mana.getColorless() > 0) { + if (reduceAmount > mana.getColorless()) { + reduceAmount -= mana.getColorless(); + mana.setColorless(0); + } else { + mana.setColorless(mana.getColorless() - reduceAmount); + reduceAmount = 0; + } + } + if (mana.count() > 0) { + adjustedCost.add(0, new GenericManaCost(mana.count())); } } - if (mana.count() > 0) { - adjustedCost.add(0, new GenericManaCost(mana.count())); - } + } else { + adjustedCost.addAll(manaCostToCheckForColorless); + } + if (adjustedCost.isEmpty()) { + adjustedCost.add(new GenericManaCost(0)); // neede to check if cost was reduced to 0 } adjustedCost.setSourceFilter(previousCost.getSourceFilter()); // keep mana source restrictions spellAbility.getManaCostsToPay().clear(); diff --git a/readme.md b/readme.md index 590ae692157..01b2aa7bf10 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,7 @@ # XMage - Magic, Another Game Engine +[![Join the chat at https://gitter.im/magefree/mage](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magefree/mage?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + XMage allows you to play Magic against one or more online players or computer opponents. It includes full rules enforcement for over **10,000** unique cards (nearly 20,000 counting all cards from different editions). Starting with Eventide, all regular sets have nearly all the cards implemented ([detailed overview](http://ct-magefree.rhcloud.com/stats)). There are public servers where you can play XMage against other players. You can also host your own server to play against the AI and/or your friends.