Merge branch 'master' into master

This commit is contained in:
LevelX2 2017-07-10 13:18:58 +02:00 committed by GitHub
commit 1fe841e6d9
200 changed files with 2088 additions and 1663 deletions

View file

@ -474,6 +474,7 @@ public class NewTableDialog extends MageDialog {
switch (options.getDeckType()) { switch (options.getDeckType()) {
case "Variant Magic - Commander": case "Variant Magic - Commander":
case "Variant Magic - Duel Commander": case "Variant Magic - Duel Commander":
case "Variant Magic - MTGO 1v1 Commander":
if (!options.getGameType().startsWith("Commander")) { if (!options.getGameType().startsWith("Commander")) {
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Commander needs also a Commander game type", "Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Commander needs also a Commander game type", "Error", JOptionPane.ERROR_MESSAGE);
return false; return false;
@ -495,7 +496,9 @@ public class NewTableDialog extends MageDialog {
switch (options.getGameType()) { switch (options.getGameType()) {
case "Commander Two Player Duel": case "Commander Two Player Duel":
case "Commander Free For All": case "Commander Free For All":
if (!options.getDeckType().equals("Variant Magic - Commander") && !options.getDeckType().equals("Variant Magic - Duel Commander")) { if (!options.getDeckType().equals("Variant Magic - Commander")
&& !options.getDeckType().equals("Variant Magic - Duel Commander")
&& !options.getDeckType().equals("Variant Magic - MTGO 1v1 Commander")) {
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Commander needs also a Commander game type", "Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Commander needs also a Commander game type", "Error", JOptionPane.ERROR_MESSAGE);
return false; return false;
} }
@ -585,7 +588,7 @@ public class NewTableDialog extends MageDialog {
setGameOptions(); setGameOptions();
this.setLocation(150, 100); this.setLocation(150, 100);
} }
currentSettingVersion = 0; currentSettingVersion = 0;
setGameSettingsFromPrefs(currentSettingVersion); setGameSettingsFromPrefs(currentSettingVersion);
this.setVisible(true); this.setVisible(true);
} }
@ -611,7 +614,7 @@ public class NewTableDialog extends MageDialog {
/** /**
* set the table settings from java prefs * set the table settings from java prefs
*/ */
int currentSettingVersion = 0; int currentSettingVersion = 0;
private void setGameSettingsFromPrefs(int version) { private void setGameSettingsFromPrefs(int version) {
currentSettingVersion = version; currentSettingVersion = version;
String versionStr = ""; String versionStr = "";
@ -721,9 +724,9 @@ public class NewTableDialog extends MageDialog {
TablePlayerPanel tpp = (TablePlayerPanel) player; TablePlayerPanel tpp = (TablePlayerPanel) player;
playerTypesString.append(tpp.getPlayerType()); playerTypesString.append(tpp.getPlayerType());
} }
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PLAYER_TYPES + versionStr, playerTypesString.toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PLAYER_TYPES + versionStr, playerTypesString.toString());
} }
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel; private javax.swing.JButton btnCancel;
private javax.swing.JButton btnOK; private javax.swing.JButton btnOK;

View file

@ -150,7 +150,7 @@
<Property name="toolTipText" type="java.lang.String" value="Write the card&apos;s name on the card to make the card name more recognizable."/> <Property name="toolTipText" type="java.lang.String" value="Write the card&apos;s name on the card to make the card name more recognizable."/>
<Property name="actionCommand" type="java.lang.String" value=""/> <Property name="actionCommand" type="java.lang.String" value=""/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Default Cursor"/> <Color id="Standardcursor"/>
</Property> </Property>
</Properties> </Properties>
<Events> <Events>
@ -516,8 +516,8 @@
<Component class="javax.swing.JLabel" name="labelDialogFont"> <Component class="javax.swing.JLabel" name="labelDialogFont">
<Properties> <Properties>
<Property name="horizontalAlignment" type="int" value="0"/> <Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Messages and menues"/> <Property name="text" type="java.lang.String" value="Messages and menus"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the font of messages and menues"/> <Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the font of messages and menus"/>
</Properties> </Properties>
<AccessibilityProperties> <AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="&lt;HTML&gt;The size of the font used to display messages or menus."/> <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="&lt;HTML&gt;The size of the font used to display messages or menus."/>

View file

@ -620,7 +620,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.add(main_cardLayout.createSequentialGroup() .add(main_cardLayout.createSequentialGroup()
.add(6, 6, 6) .add(6, 6, 6)
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 308, Short.MAX_VALUE) .add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, showCardName) .add(org.jdesktop.layout.GroupLayout.LEADING, showCardName)
.add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
@ -904,8 +904,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
guiSizeBasic.add(sliderDialogFont, gridBagConstraints); guiSizeBasic.add(sliderDialogFont, gridBagConstraints);
labelDialogFont.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelDialogFont.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
labelDialogFont.setText("Messages and menues"); labelDialogFont.setText("Messages and menus");
labelDialogFont.setToolTipText("<HTML>The size of the font of messages and menues"); labelDialogFont.setToolTipText("<HTML>The size of the font of messages and menus");
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1; gridBagConstraints.gridy = 1;

View file

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

View file

@ -0,0 +1,44 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.deck;
import mage.cards.decks.Constructed;
/**
*
* @author fireshoes
*/
public class AmonkhetBlock extends Constructed {
public AmonkhetBlock() {
super("Constructed - Amonkhet Block");
setCodes.add("AKH");
setCodes.add("HOU");
}
}

View file

@ -34,7 +34,6 @@ package mage.deck;
public class DuelCommander extends Commander { public class DuelCommander extends Commander {
public DuelCommander() { public DuelCommander() {
super("Duel Commander");
banned.add("Ancestral Recall"); banned.add("Ancestral Recall");
banned.add("Ancient Tomb"); banned.add("Ancient Tomb");
banned.add("Back to Basics"); banned.add("Back to Basics");
@ -67,7 +66,7 @@ public class DuelCommander extends Commander {
banned.add("Mox Sapphire"); banned.add("Mox Sapphire");
banned.add("Mystical Tutor"); banned.add("Mystical Tutor");
banned.add("Natural Order"); banned.add("Natural Order");
banned.add("Necrotic Oooze"); banned.add("Necrotic Ooze");
banned.add("Oath of Druids"); banned.add("Oath of Druids");
banned.add("Protean Hulk"); banned.add("Protean Hulk");
banned.add("Sensei's Divining Top"); banned.add("Sensei's Divining Top");

View file

@ -0,0 +1,95 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.deck;
/**
*
* @author fireshoes
*/
public class MTGO1v1Commander extends Commander {
public MTGO1v1Commander() {
super("MTGO 1v1 Commander");
banned.add("Ancestral Recall");
banned.add("Arcum Dagsson");
banned.add("Back to Basics");
banned.add("Balance");
banned.add("Bazaar of Baghdad");
banned.add("Black Lotus");
banned.add("Braids, Cabal Minion");
banned.add("Brainstorm");
banned.add("Channel");
banned.add("Derevi, Empyrial Tactician");
banned.add("Dig Through Time");
banned.add("Edric, Spymaster of Trest");
banned.add("Entomb");
banned.add("Fastbond");
banned.add("Food Chain");
banned.add("Gaea's Cradle");
banned.add("Gifts Ungiven");
banned.add("Griselbrand");
banned.add("Hermit Druid");
banned.add("Humility");
banned.add("Karakas");
banned.add("Library of Alexandria");
banned.add("Mana Crypt");
banned.add("Mana Drain");
banned.add("Mana Vault");
banned.add("Mind Twist");
banned.add("Mishra's Workshop");
banned.add("Moat");
banned.add("Mox Emerald");
banned.add("Mox Jet");
banned.add("Mox Pearl");
banned.add("Mox Ruby");
banned.add("Mox Sapphire");
banned.add("Natural Order");
banned.add("Necropotence");
banned.add("Oath of Druids");
banned.add("Ponder");
banned.add("Preordain");
banned.add("Protean Hulk");
banned.add("Rofellos, Llanowar Emissary");
banned.add("Sensei's Divining Top");
banned.add("Serra Ascendant");
banned.add("Sol Ring");
banned.add("Strip Mine");
banned.add("Survival of the Fittest");
banned.add("The Tabernacle at Pendrell Vale");
banned.add("Time Vault");
banned.add("Time Walk");
banned.add("Tinker");
banned.add("Tolarian Academy");
banned.add("Treachery");
banned.add("Treasure Cruise");
banned.add("Vial Smasher the Fierce");
banned.add("Yamgmoth's Bargain");
banned.add("Yisan, the Wanderer Bard");
banned.add("Zur the Enchanter");
}
}

View file

@ -51,6 +51,10 @@ public class CommanderDuelMatch extends MatchImpl {
alsoHand = true; // commander going to hand allowed to go to command zone effective July 17, 2015 alsoHand = true; // commander going to hand allowed to go to command zone effective July 17, 2015
checkCommanderDamage = false; // since nov 16 duel commander uses no longer commander damage rule checkCommanderDamage = false; // since nov 16 duel commander uses no longer commander damage rule
} }
if (options.getDeckType().equals("Variant Magic - MTGO 1v1 Commander")) {
startLife = 30;
alsoHand = true; // commander going to hand allowed to go to command zone effective July 17, 2015
}
CommanderDuel game = new CommanderDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife); CommanderDuel game = new CommanderDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife);
game.setCheckCommanderDamage(checkCommanderDamage); game.setCheckCommanderDamage(checkCommanderDamage);
game.setStartMessage(this.createGameStartMessage()); game.setStartMessage(this.createGameStartMessage());

View file

@ -141,11 +141,14 @@
<deckType name="Constructed - Freeform" jar="mage-deck-constructed.jar" className="mage.deck.Freeform"/> <deckType name="Constructed - Freeform" jar="mage-deck-constructed.jar" className="mage.deck.Freeform"/>
<deckType name="Constructed - Old School 93/94" jar="mage-deck-constructed.jar" className="mage.deck.OldSchool9394"/> <deckType name="Constructed - Old School 93/94" jar="mage-deck-constructed.jar" className="mage.deck.OldSchool9394"/>
<deckType name="Constructed - Australian Highlander" jar="mage-deck-constructed.jar" className="mage.deck.AusHighlander"/> <deckType name="Constructed - Australian Highlander" jar="mage-deck-constructed.jar" className="mage.deck.AusHighlander"/>
<deckType name="Constructed - Canadian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.CanadianHighlander"/>
<deckType name="Constructed - Freeform" jar="mage-deck-constructed.jar" className="mage.deck.Freeform"/>
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/> <deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/> <deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/>
<deckType name="Variant Magic - MTGO 1v1 Commander" jar="mage-deck-constructed.jar" className="mage.deck.MTGO1v1Commander"/>
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/> <deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/>
<deckType name="Variant Magic - Canadian Highlander" jar="mage-deck-constructed.jar" className="mage.deck.CanadianHighlander"/>
<deckType name="Variant Magic - Momir Basic" jar="mage-deck-constructed.jar" className="mage.deck.Momir"/> <deckType name="Variant Magic - Momir Basic" jar="mage-deck-constructed.jar" className="mage.deck.Momir"/>
<deckType name="Block Constructed - Amonkhet" jar="mage-deck-constructed.jar" className="mage.deck.AmonkhetBlock"/>
<deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/> <deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/>
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/> <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/>
<deckType name="Block Constructed - Kaladesh" jar="mage-deck-constructed.jar" className="mage.deck.KaladeshBlock"/> <deckType name="Block Constructed - Kaladesh" jar="mage-deck-constructed.jar" className="mage.deck.KaladeshBlock"/>

View file

@ -139,11 +139,13 @@
<deckType name="Constructed - Old School 93/94" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.OldSchool9394"/> <deckType name="Constructed - Old School 93/94" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.OldSchool9394"/>
<deckType name="Constructed - Australian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.AusHighlander"/> <deckType name="Constructed - Australian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.AusHighlander"/>
<deckType name="Constructed - Canadian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.CanadianHighlander"/> <deckType name="Constructed - Canadian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.CanadianHighlander"/>
<deckType name="Constructed - Freeform" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Freeform"/>
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Commander"/> <deckType name="Variant Magic - Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Commander"/>
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.DuelCommander"/> <deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.DuelCommander"/>
<deckType name="Variant Magic - MTGO 1v1 Commander" jar="mage-deck-constructed.jar" className="mage.deck.MTGO1v1Commander"/>
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.TinyLeaders"/> <deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.TinyLeaders"/>
<deckType name="Variant Magic - Canadian Highlander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.CanadianHighlander"/>
<deckType name="Variant Magic - Momir Basic" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Momir"/> <deckType name="Variant Magic - Momir Basic" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Momir"/>
<deckType name="Block Constructed - Amonkhet" jar="mage-deck-constructed.jar" className="mage.deck.AmonkhetBlock"/>
<deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/> <deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/>
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.InnistradBlock"/> <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.InnistradBlock"/>
<deckType name="Block Constructed - Kaladesh" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KaladeshBlock"/> <deckType name="Block Constructed - Kaladesh" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KaladeshBlock"/>

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.counters.Counter; import mage.counters.Counter;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -61,7 +61,7 @@ public class AlteredEgo extends CardImpl {
this.addAbility(new CantBeCounteredAbility()); this.addAbility(new CantBeCounteredAbility());
// You may have Altered Ego enter the battlefield as a copy of any creature on the battlefield, except it enters with an additional X +1/+1 counters on it. // You may have Altered Ego enter the battlefield as a copy of any creature on the battlefield, except it enters with an additional X +1/+1 counters on it.
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), null); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, null);
effect.setText("a copy of any creature on the battlefield"); effect.setText("a copy of any creature on the battlefield");
EntersBattlefieldAbility ability = new EntersBattlefieldAbility(effect, true); EntersBattlefieldAbility ability = new EntersBattlefieldAbility(effect, true);
effect = new AlteredEgoAddCountersEffect(CounterType.P1P1.createInstance()); effect = new AlteredEgoAddCountersEffect(CounterType.P1P1.createInstance());

View file

@ -39,7 +39,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -60,7 +60,7 @@ public class AnkleShanker extends CardImpl {
// Haste // Haste
this.addAbility(HasteAbility.getInstance()); this.addAbility(HasteAbility.getInstance());
// Whenever Ankle Shanker attacks, creatures you control gain first strike and deathtouch until end of turn. // Whenever Ankle Shanker attacks, creatures you control gain first strike and deathtouch until end of turn.
Effect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures")); Effect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText("creatures you control gain first strike"); effect.setText("creatures you control gain first strike");
Ability ability = new AttacksTriggeredAbility(effect, false); Ability ability = new AttacksTriggeredAbility(effect, false);
effect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn); effect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn);

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -64,7 +65,7 @@ public class ArchetypeOfAggression extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Creatures you control have trample. // Creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose trample and can't have or gain trample. // Creatures your opponents control lose trample and can't have or gain trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter)));

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -63,7 +64,7 @@ public class ArchetypeOfCourage extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Creatures you control have first strike. // Creatures you control have first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose first strike and can't have or gain first strike. // Creatures your opponents control lose first strike and can't have or gain first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
} }

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -63,7 +64,7 @@ public class ArchetypeOfEndurance extends CardImpl {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Creatures you control have hexproof. // Creatures you control have hexproof.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose hexproof and can't have or gain hexproof. // Creatures your opponents control lose hexproof and can't have or gain hexproof.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, filter)));

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -63,7 +64,7 @@ public class ArchetypeOfFinality extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Creatures you control have deathtouch. // Creatures you control have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose deathtouch and can't have or gain deathtouch. // Creatures your opponents control lose deathtouch and can't have or gain deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter)));

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -63,7 +64,7 @@ public class ArchetypeOfImagination extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Creatures you control have flying. // Creatures you control have flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose flying and can't have or gain flying. // Creatures your opponents control lose flying and can't have or gain flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter)));

View file

@ -40,7 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.permanent.token.SpiritToken; import mage.game.permanent.token.SpiritToken;
import java.util.UUID; import java.util.UUID;
@ -51,12 +51,10 @@ import java.util.UUID;
*/ */
public class BakuAltar extends CardImpl { public class BakuAltar extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public BakuAltar(UUID ownerId, CardSetInfo setInfo) { public BakuAltar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Baku Altar. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Baku Altar.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance(1)), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance(1)), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// {2}, {tap}, Remove a ki counter from Baku Altar: Create a 1/1 colorless Spirit creature token. // {2}, {tap}, Remove a ki counter from Baku Altar: Create a 1/1 colorless Spirit creature token.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SpiritToken(), 1), new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SpiritToken(), 1), new GenericManaCost(2));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());

View file

@ -29,34 +29,32 @@
package mage.cards.b; package mage.cards.b;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import java.util.UUID; import java.util.UUID;
/** /**
* @author LevelX2 * @author LevelX2
*/ */
public class BlademaneBaku extends CardImpl { public class BlademaneBaku extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public BlademaneBaku(UUID ownerId, CardSetInfo setInfo) { public BlademaneBaku(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -65,7 +63,7 @@ public class BlademaneBaku extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Skullmane Baku. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Skullmane Baku.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// {1}, Remove X ki counters from Blademane Baku: For each counter removed, Blademane Baku gets +2/+0 until end of turn. // {1}, Remove X ki counters from Blademane Baku: For each counter removed, Blademane Baku gets +2/+0 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlademaneBakuBoostEffect(), new GenericManaCost(1)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlademaneBakuBoostEffect(), new GenericManaCost(1));

View file

@ -38,7 +38,7 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
@ -63,7 +63,7 @@ public class BounteousKirin extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever you cast a Spirit or Arcane spell, you may gain life equal to that spell's converted mana cost. // Whenever you cast a Spirit or Arcane spell, you may gain life equal to that spell's converted mana cost.
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new BounteousKirinEffect(), new FilterSpiritOrArcaneCard(), true, true)); this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new BounteousKirinEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, true, true));
} }
public BounteousKirin(final BounteousKirin card) { public BounteousKirin(final BounteousKirin card) {

View file

@ -35,7 +35,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -46,8 +46,6 @@ import java.util.UUID;
*/ */
public class BriarknitKami extends CardImpl { public class BriarknitKami extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public BriarknitKami(UUID ownerId, CardSetInfo setInfo) { public BriarknitKami(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -55,7 +53,7 @@ public class BriarknitKami extends CardImpl {
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Whenever you cast a Spirit or Arcane spell, put a +1/+1 counter on target creature. // Whenever you cast a Spirit or Arcane spell, put a +1/+1 counter on target creature.
Ability ability = new SpellCastControllerTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -46,7 +46,7 @@ import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -59,8 +59,6 @@ import java.util.UUID;
*/ */
public class BudokaPupil extends CardImpl { public class BudokaPupil extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public BudokaPupil(UUID ownerId, CardSetInfo setInfo) { public BudokaPupil(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
this.subtype.add("Human"); this.subtype.add("Human");
@ -72,7 +70,7 @@ public class BudokaPupil extends CardImpl {
this.flipCardName = "Ichiga, Who Topples Oaks"; this.flipCardName = "Ichiga, Who Topples Oaks";
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Budoka Pupil. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Budoka Pupil.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it. // At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it.
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(

View file

@ -45,7 +45,7 @@ import mage.constants.CardType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.TargetSpell; import mage.target.TargetSpell;
@ -58,8 +58,6 @@ import java.util.UUID;
*/ */
public class CallowJushi extends CardImpl { public class CallowJushi extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public CallowJushi(UUID ownerId, CardSetInfo setInfo) { public CallowJushi(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
this.subtype.add("Human"); this.subtype.add("Human");
@ -71,7 +69,7 @@ public class CallowJushi extends CardImpl {
this.flipCardName = "Jaraku the Interloper"; this.flipCardName = "Jaraku the Interloper";
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Callow Jushi. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Callow Jushi.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Callow Jushi, you may flip it. // At the beginning of the end step, if there are two or more ki counters on Callow Jushi, you may flip it.
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(

View file

@ -29,19 +29,15 @@ package mage.cards.c;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
@ -66,7 +62,7 @@ public class CelestialKirin extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever you cast a Spirit or Arcane spell, destroy all permanents with that spell's converted mana cost. // Whenever you cast a Spirit or Arcane spell, destroy all permanents with that spell's converted mana cost.
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new CelestialKirinEffect(), new FilterSpiritOrArcaneCard(), false, true)); this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new CelestialKirinEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, false, true));
} }
public CelestialKirin(final CelestialKirin card) { public CelestialKirin(final CelestialKirin card) {

View file

@ -34,8 +34,7 @@ import mage.cards.*;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -69,7 +68,6 @@ public class CerebralEruption extends CardImpl {
class CerebralEruptionEffect extends OneShotEffect { class CerebralEruptionEffect extends OneShotEffect {
private static FilterPermanent filter = new FilterCreaturePermanent();
CerebralEruptionEffect() { CerebralEruptionEffect() {
super(Outcome.Damage); super(Outcome.Damage);
@ -91,7 +89,7 @@ class CerebralEruptionEffect extends OneShotEffect {
game.getState().setValue(source.getSourceId().toString(), card); game.getState().setValue(source.getSourceId().toString(), card);
int damage = card.getConvertedManaCost(); int damage = card.getConvertedManaCost();
player.damage(damage, source.getSourceId(), game, false, true); player.damage(damage, source.getSourceId(), game, false, true);
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, player.getId(), game)) {
perm.damage(damage, source.getSourceId(), game, false, true); perm.damage(damage, source.getSourceId(), game, false, true);
} }
if (card.isLand()) { if (card.isLand()) {

View file

@ -42,7 +42,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.token.ElementalToken; import mage.game.permanent.token.ElementalToken;
import mage.players.Player; import mage.players.Player;
@ -69,7 +69,7 @@ public class ChandraFlamecaller extends CardImpl {
this.addAbility(new LoyaltyAbility(new ChandraDrawEffect(), 0)); this.addAbility(new LoyaltyAbility(new ChandraDrawEffect(), 0));
// -X: Chandra, Flamecaller deals X damage to each creature. // -X: Chandra, Flamecaller deals X damage to each creature.
this.addAbility(new LoyaltyAbility(new DamageAllEffect(ChandraXValue.getDefault(), new FilterCreaturePermanent("creature")))); this.addAbility(new LoyaltyAbility(new DamageAllEffect(ChandraXValue.getDefault(), StaticFilters.FILTER_PERMANENT_CREATURE)));
} }
public ChandraFlamecaller(final ChandraFlamecaller card) { public ChandraFlamecaller(final ChandraFlamecaller card) {

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -49,13 +49,12 @@ import java.util.UUID;
*/ */
public class ChronomanticEscape extends CardImpl { public class ChronomanticEscape extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures");
public ChronomanticEscape(UUID ownerId, CardSetInfo setInfo) { public ChronomanticEscape(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}{W}");
// Until your next turn, creatures can't attack you. Exile Chronomantic Escape with three time counters on it. // Until your next turn, creatures can't attack you. Exile Chronomantic Escape with three time counters on it.
getSpellAbility().addEffect(new CantAttackYouAllEffect(Duration.UntilYourNextTurn, filter)); getSpellAbility().addEffect(new CantAttackYouAllEffect(Duration.UntilYourNextTurn, StaticFilters.FILTER_PERMANENT_CREATURES));
getSpellAbility().addEffect(ExileSpellEffect.getInstance()); getSpellAbility().addEffect(ExileSpellEffect.getInstance());
Effect effect = new AddCountersSourceEffect(CounterType.TIME.createInstance(), new StaticValue(3), true, true); Effect effect = new AddCountersSourceEffect(CounterType.TIME.createInstance(), new StaticValue(3), true, true);
effect.setText("with 3 time counters on it"); effect.setText("with 3 time counters on it");

View file

@ -38,7 +38,7 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
@ -65,7 +65,7 @@ public class CloudhoofKirin extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever you cast a Spirit or Arcane spell, you may have target player put the top X cards of his or her library into his or her graveyard, where X is that spell's converted mana cost. // Whenever you cast a Spirit or Arcane spell, you may have target player put the top X cards of his or her library into his or her graveyard, where X is that spell's converted mana cost.
Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new CloudhoofKirinEffect(), new FilterSpiritOrArcaneCard(), true, true); Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new CloudhoofKirinEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, true, true);
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -34,7 +34,7 @@ import mage.abilities.keyword.ChangelingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.util.CardUtil; import mage.util.CardUtil;
@ -67,9 +67,7 @@ public class CoatOfArms extends CardImpl {
class CoatOfArmsEffect extends ContinuousEffectImpl { class CoatOfArmsEffect extends ContinuousEffectImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public CoatOfArmsEffect() {
public CoatOfArmsEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.staticText = "Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it"; this.staticText = "Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it";
} }
@ -85,7 +83,7 @@ class CoatOfArmsEffect extends ContinuousEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
int amount = getAmount(permanents, permanent, game); int amount = getAmount(permanents, permanent, game);
permanent.addPower(amount); permanent.addPower(amount);

View file

@ -36,7 +36,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -52,7 +52,7 @@ public class ConcordantCrossroads extends CardImpl {
// All creatures have haste. // All creatures have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
} }
public ConcordantCrossroads(final ConcordantCrossroads card) { public ConcordantCrossroads(final ConcordantCrossroads card) {

View file

@ -40,7 +40,6 @@ import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
@ -107,7 +106,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().hasCards()) { if (you != null && you.getLibrary().hasCards()) {
if (you.searchLibrary(targetWhite, game)) { if (you.searchLibrary(targetWhite, game)) {
if (!targetWhite.getTargets().isEmpty()) { if (!targetWhite.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetWhite.getTargets()) { for (UUID cardId : targetWhite.getTargets()) {
Card card = you.getLibrary().remove(cardId, game); Card card = you.getLibrary().remove(cardId, game);
if (card != null) { if (card != null) {
cards.add(card); cards.add(card);
@ -119,7 +118,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().hasCards()) { if (you != null && you.getLibrary().hasCards()) {
if (you.searchLibrary(targetBlue, game)) { if (you.searchLibrary(targetBlue, game)) {
if (!targetBlue.getTargets().isEmpty()) { if (!targetBlue.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetBlue.getTargets()) { for (UUID cardId : targetBlue.getTargets()) {
Card card = you.getLibrary().remove(cardId, game); Card card = you.getLibrary().remove(cardId, game);
if (card != null) { if (card != null) {
cards.add(card); cards.add(card);
@ -131,7 +130,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().hasCards()) { if (you != null && you.getLibrary().hasCards()) {
if (you.searchLibrary(targetBlack, game)) { if (you.searchLibrary(targetBlack, game)) {
if (!targetBlack.getTargets().isEmpty()) { if (!targetBlack.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetBlack.getTargets()) { for (UUID cardId : targetBlack.getTargets()) {
Card card = you.getLibrary().remove(cardId, game); Card card = you.getLibrary().remove(cardId, game);
if (card != null) { if (card != null) {
cards.add(card); cards.add(card);
@ -143,7 +142,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().hasCards()) { if (you != null && you.getLibrary().hasCards()) {
if (you.searchLibrary(targetRed, game)) { if (you.searchLibrary(targetRed, game)) {
if (!targetRed.getTargets().isEmpty()) { if (!targetRed.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetRed.getTargets()) { for (UUID cardId : targetRed.getTargets()) {
Card card = you.getLibrary().remove(cardId, game); Card card = you.getLibrary().remove(cardId, game);
if (card != null) { if (card != null) {
cards.add(card); cards.add(card);
@ -155,7 +154,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().hasCards()) { if (you != null && you.getLibrary().hasCards()) {
if (you.searchLibrary(targetGreen, game)) { if (you.searchLibrary(targetGreen, game)) {
if (!targetGreen.getTargets().isEmpty()) { if (!targetGreen.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetGreen.getTargets()) { for (UUID cardId : targetGreen.getTargets()) {
Card card = you.getLibrary().remove(cardId, game); Card card = you.getLibrary().remove(cardId, game);
if (card != null) { if (card != null) {
cards.add(card); cards.add(card);

View file

@ -42,7 +42,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -105,9 +105,9 @@ class CrovaxTheCursedEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game); Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game);
int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game);
if (creatures > 0 && controller.chooseUse(outcome, "Sacrifice a creature?", source, game)) { if (creatures > 0 && controller.chooseUse(outcome, "Sacrifice a creature?", source, game)) {
if (new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, "").apply(game, source)) { if (new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURES, 1, "").apply(game, source)) {
if (sourceObject != null) { if (sourceObject != null) {
sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance()); sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance());
game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getName()); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getName());

View file

@ -35,7 +35,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -48,9 +48,9 @@ public class CryptolithRite extends CardImpl {
public CryptolithRite(UUID ownerId, CardSetInfo setInfo) { public CryptolithRite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}");
// Creature you control have "{T}: Add one mana of any color to your mana pool." // Creatures you control have "{T}: Add one mana of any color to your mana pool."
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(
new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creature"), false))); new AnyColorManaAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES, false)));
} }
public CryptolithRite(final CryptolithRite card) { public CryptolithRite(final CryptolithRite card) {

View file

@ -45,7 +45,7 @@ import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -58,8 +58,6 @@ import java.util.UUID;
*/ */
public class CunningBandit extends CardImpl { public class CunningBandit extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public CunningBandit(UUID ownerId, CardSetInfo setInfo) { public CunningBandit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.subtype.add("Human"); this.subtype.add("Human");
@ -71,7 +69,7 @@ public class CunningBandit extends CardImpl {
this.flipCardName = "Azamuki, Treachery Incarnate"; this.flipCardName = "Azamuki, Treachery Incarnate";
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Cunning Bandit. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Cunning Bandit.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Cunning Bandit, you may flip it. // At the beginning of the end step, if there are two or more ki counters on Cunning Bandit, you may flip it.
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -46,7 +46,6 @@ import java.util.UUID;
*/ */
public class CyclopsOfEternalFury extends CardImpl { public class CyclopsOfEternalFury extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures");
public CyclopsOfEternalFury(UUID ownerId, CardSetInfo setInfo) { public CyclopsOfEternalFury(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{4}{R}{R}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{4}{R}{R}");
@ -56,7 +55,7 @@ public class CyclopsOfEternalFury extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Creatures you control have haste. // Creatures you control have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
} }
public CyclopsOfEternalFury(final CyclopsOfEternalFury card) { public CyclopsOfEternalFury(final CyclopsOfEternalFury card) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -39,11 +38,13 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.util.functions.ApplyToPermanent; import mage.util.functions.ApplyToPermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -58,7 +59,7 @@ public class DacksDuplicate extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. // You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone.
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new DacksDuplicateApplyToPermanent()); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new DacksDuplicateApplyToPermanent());
effect.setText("as a copy of any creature on the battlefield except it gains haste and dethrone"); effect.setText("as a copy of any creature on the battlefield except it gains haste and dethrone");
this.addAbility(new EntersBattlefieldAbility(effect, true)); this.addAbility(new EntersBattlefieldAbility(effect, true));
} }

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -52,10 +52,10 @@ public class DanceOfShadows extends CardImpl {
// Creatures you control get +1/+0 and gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.) // Creatures you control get +1/+0 and gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)
Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, new FilterCreaturePermanent()); Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText("Creatures you control get +1/+0"); effect.setText("Creatures you control get +1/+0");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
effect = new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent()); effect = new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText("and gain fear until end of turn"); effect.setText("and gain fear until end of turn");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
} }

View file

@ -52,7 +52,7 @@ public class DauthiJackal extends CardImpl {
public DauthiJackal(UUID ownerId, CardSetInfo setInfo) { public DauthiJackal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
this.subtype.add("Dauthi"); this.subtype.add("Dauthi");
this.subtype.add("Hound"); this.subtype.add("Jackal");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);

View file

@ -39,7 +39,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -63,7 +63,7 @@ public class DawnfeatherEagle extends CardImpl {
Effect effect = new BoostControlledEffect(1, 1, Duration.EndOfTurn); Effect effect = new BoostControlledEffect(1, 1, Duration.EndOfTurn);
effect.setText("creatures you control get +1/+1"); effect.setText("creatures you control get +1/+1");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
effect = new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent()); effect = new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText("and gain vigilance until end of turn"); effect.setText("and gain vigilance until end of turn");
ability.addEffect(effect); ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);

View file

@ -1,16 +1,16 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
@ -20,21 +20,19 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -43,9 +41,10 @@ import java.util.UUID;
public class DayOfJudgment extends CardImpl { public class DayOfJudgment extends CardImpl {
public DayOfJudgment(UUID ownerId, CardSetInfo setInfo) { public DayOfJudgment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}{W}");
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); // Destroy all creatures.
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES));
} }
public DayOfJudgment(final DayOfJudgment card) { public DayOfJudgment(final DayOfJudgment card) {

View file

@ -43,29 +43,28 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public class DeadlyWanderings extends CardImpl { public class DeadlyWanderings extends CardImpl {
public DeadlyWanderings(UUID ownerId, CardSetInfo setInfo) { public DeadlyWanderings(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
// As long as you control exactly one creature, that creature gets +2/+0 and has deathtouch and lifelink. // As long as you control exactly one creature, that creature gets +2/+0 and has deathtouch and lifelink.
ContinuousEffect boostEffect = new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield); ContinuousEffect boostEffect = new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield);
Effect effect = new ConditionalContinuousEffect(boostEffect, new CreatureCountCondition(1, TargetController.YOU), Effect effect = new ConditionalContinuousEffect(boostEffect, new CreatureCountCondition(1, TargetController.YOU),
"As long as you control exactly one creature, that creature gets +2/+0"); "As long as you control exactly one creature, that creature gets +2/+0");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
ContinuousEffect deathtouchEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()); ContinuousEffect deathtouchEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE);
effect = new ConditionalContinuousEffect(deathtouchEffect, new CreatureCountCondition(1, TargetController.YOU), effect = new ConditionalContinuousEffect(deathtouchEffect, new CreatureCountCondition(1, TargetController.YOU),
"and has deathtouch"); "and has deathtouch");
ability.addEffect(effect); ability.addEffect(effect);
ContinuousEffect lifelinkEffect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()); ContinuousEffect lifelinkEffect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE);
effect = new ConditionalContinuousEffect(lifelinkEffect, new CreatureCountCondition(1, TargetController.YOU), effect = new ConditionalContinuousEffect(lifelinkEffect, new CreatureCountCondition(1, TargetController.YOU),
"and lifelink"); "and lifelink");
ability.addEffect(effect); ability.addEffect(effect);

View file

@ -35,6 +35,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -69,7 +70,6 @@ public class DeathFrenzy extends CardImpl {
class DeathFrenzyDelayedTriggeredAbility extends DelayedTriggeredAbility { class DeathFrenzyDelayedTriggeredAbility extends DelayedTriggeredAbility {
protected FilterCreaturePermanent filter = new FilterCreaturePermanent();
public DeathFrenzyDelayedTriggeredAbility() { public DeathFrenzyDelayedTriggeredAbility() {
super(new GainLifeEffect(1), Duration.EndOfTurn, false); super(new GainLifeEffect(1), Duration.EndOfTurn, false);
@ -87,7 +87,7 @@ class DeathFrenzyDelayedTriggeredAbility extends DelayedTriggeredAbility {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event; ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent() && zEvent.getTarget() != null && filter.match(zEvent.getTarget(), sourceId, controllerId, game)) { if (zEvent.isDiesEvent() && zEvent.getTarget() != null && StaticFilters.FILTER_PERMANENT_CREATURES.match(zEvent.getTarget(), sourceId, controllerId, game)) {
return true; return true;
} }
return false; return false;

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken; import mage.game.permanent.PermanentToken;
@ -103,7 +103,7 @@ class DeclarationInStoneEffect extends OneShotEffect {
&& !(targetPermanent instanceof PermanentToken)) { && !(targetPermanent instanceof PermanentToken)) {
nonTokenCount++; nonTokenCount++;
} }
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPermanent.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, targetPermanent.getControllerId(), game)) {
if (!permanent.getId().equals(targetPermanent.getId()) if (!permanent.getId().equals(targetPermanent.getId())
&& permanent.getName().equals(targetPermanent.getName())) { && permanent.getName().equals(targetPermanent.getName())) {
cardsToExile.add(permanent); cardsToExile.add(permanent);

View file

@ -37,7 +37,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -53,12 +53,12 @@ public class Demoralize extends CardImpl {
// All creatures gain menace until end of turn. (They can't be blocked except by two or more creatures.) // All creatures gain menace until end of turn. (They can't be blocked except by two or more creatures.)
this.getSpellAbility().addEffect(new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterCreaturePermanent())); this.getSpellAbility().addEffect(new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES));
// Threshold If seven or more cards are in your graveyard, creatures can't block this turn. // Threshold If seven or more cards are in your graveyard, creatures can't block this turn.
this.getSpellAbility().addEffect( this.getSpellAbility().addEffect(
new ConditionalOneShotEffect( new ConditionalOneShotEffect(
new AddContinuousEffectToGame(new CantBlockAllEffect(new FilterCreaturePermanent(), Duration.EndOfTurn)), new AddContinuousEffectToGame(new CantBlockAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.EndOfTurn)),
new CardsInControllerGraveCondition(7), new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - If seven or more cards are in your graveyard, creatures can't block this turn" "<br/><br/><i>Threshold</i> - If seven or more cards are in your graveyard, creatures can't block this turn"
)); ));

View file

@ -35,7 +35,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -50,7 +50,7 @@ public class DenseFoliage extends CardImpl {
// Creatures can't be the targets of spells. // Creatures can't be the targets of spells.
CantBeTargetedAllEffect cantTargetEffect = new CantBeTargetedAllEffect(new FilterCreaturePermanent("Creatures"), new FilterSpell("spells"), Duration.WhileOnBattlefield); CantBeTargetedAllEffect cantTargetEffect = new CantBeTargetedAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, new FilterSpell("spells"), Duration.WhileOnBattlefield);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, cantTargetEffect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, cantTargetEffect));
} }

View file

@ -35,7 +35,7 @@ import mage.abilities.effects.common.ExileAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.permanent.token.AngelToken; import mage.game.permanent.token.AngelToken;
import java.util.UUID; import java.util.UUID;
@ -50,7 +50,7 @@ public class DescendUponTheSinful extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{W}{W}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{W}{W}");
// Exile all creatures // Exile all creatures
this.getSpellAbility().addEffect(new ExileAllEffect(new FilterCreaturePermanent())); this.getSpellAbility().addEffect(new ExileAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES));
// <i>Delirium</i> &mdash; Create a 4/4 white Angel creature token with flying if there are four or more card types among cards in your graveyard. // <i>Delirium</i> &mdash; Create a 4/4 white Angel creature token with flying if there are four or more card types among cards in your graveyard.
Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new AngelToken()), DeliriumCondition.instance); Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new AngelToken()), DeliriumCondition.instance);

View file

@ -37,8 +37,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TimingRule; import mage.constants.TimingRule;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -105,7 +105,7 @@ class DivineReckoningEffect extends OneShotEffect {
} }
} }
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), source.getSourceId(), game)) {
if (!chosen.contains(permanent)) { if (!chosen.contains(permanent)) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }

View file

@ -33,6 +33,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -89,7 +90,7 @@ class DoOrDieEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (player != null && targetPlayer != null) { if (player != null && targetPlayer != null) {
int count = game.getBattlefield().countAll(new FilterCreaturePermanent(), targetPlayer.getId(), game); int count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURES, targetPlayer.getId(), game);
TargetCreaturePermanent creatures = new TargetCreaturePermanent(0, count, new FilterCreaturePermanent("creatures to put in the first pile"), true); TargetCreaturePermanent creatures = new TargetCreaturePermanent(0, count, new FilterCreaturePermanent("creatures to put in the first pile"), true);
List<Permanent> pile1 = new ArrayList<>(); List<Permanent> pile1 = new ArrayList<>();
creatures.setRequired(false); creatures.setRequired(false);

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
@ -124,7 +124,6 @@ class AddCounterAbility extends TriggeredAbilityImpl {
class BoostCreatureEffectEffect extends ContinuousEffectImpl { class BoostCreatureEffectEffect extends ContinuousEffectImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
public BoostCreatureEffectEffect() { public BoostCreatureEffectEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
@ -146,7 +145,7 @@ class BoostCreatureEffectEffect extends ContinuousEffectImpl {
if (permanent != null) { if (permanent != null) {
String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
if (subtype != null) { if (subtype != null) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game)) {
if (perm.hasSubtype(subtype, game)) { if (perm.hasSubtype(subtype, game)) {
int boost = permanent.getCounters(game).getCount(CounterType.CHARGE); int boost = permanent.getCounters(game).getCount(CounterType.CHARGE);
perm.addPower(boost); perm.addPower(boost);

View file

@ -34,7 +34,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import java.util.UUID; import java.util.UUID;
@ -79,7 +79,6 @@ public class DoranTheSiegeTower extends CardImpl {
class DoranTheSiegeTowerCombatDamageRuleEffect extends ContinuousEffectImpl { class DoranTheSiegeTowerCombatDamageRuleEffect extends ContinuousEffectImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
public DoranTheSiegeTowerCombatDamageRuleEffect() { public DoranTheSiegeTowerCombatDamageRuleEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment); super(Duration.WhileOnBattlefield, Outcome.Detriment);
@ -99,7 +98,7 @@ class DoranTheSiegeTowerCombatDamageRuleEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
// Change the rule // Change the rule
game.getCombat().setUseToughnessForDamage(true); game.getCombat().setUseToughnessForDamage(true);
game.getCombat().addUseToughnessForDamageFilter(filter); game.getCombat().addUseToughnessForDamageFilter(StaticFilters.FILTER_PERMANENT_CREATURES);
return true; return true;
} }

View file

@ -44,7 +44,7 @@ import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -61,11 +61,11 @@ public class DragonThroneOfTarkir extends CardImpl {
// Equipped creature has defender and "{2}, {T}: Other creatures you control gain trample and get +X/+X until end of turn, where X is this creature's power." // Equipped creature has defender and "{2}, {T}: Other creatures you control gain trample and get +X/+X until end of turn, where X is this creature's power."
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DefenderAbility.getInstance(), AttachmentType.EQUIPMENT)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DefenderAbility.getInstance(), AttachmentType.EQUIPMENT));
Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), true); Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, true);
effect.setText("Other creatures you control gain trample"); effect.setText("Other creatures you control gain trample");
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
DynamicValue xValue = new SourcePermanentPowerCount(); DynamicValue xValue = new SourcePermanentPowerCount();
effect = new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), true, true); effect = new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true, true);
effect.setText("and get +X/+X until end of turn, where X is this creature's power"); effect.setText("and get +X/+X until end of turn, where X is this creature's power");
gainedAbility.addEffect(effect); gainedAbility.addEffect(effect);
gainedAbility.addCost(new TapSourceCost()); gainedAbility.addCost(new TapSourceCost());

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
@ -36,7 +35,9 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -52,7 +53,7 @@ public class Dreamcatcher extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever you cast a Spirit or Arcane spell, you may sacrifice Dreamcatcher. If you do, draw a card. // Whenever you cast a Spirit or Arcane spell, you may sacrifice Dreamcatcher. If you do, draw a card.
Ability ability = new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), new FilterSpiritOrArcaneCard(), true, Ability ability = new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, true,
"Whenever you cast a Spirit or Arcane spell, you may sacrifice {this}. If you do, draw a card."); "Whenever you cast a Spirit or Arcane spell, you may sacrifice {this}. If you do, draw a card.");
ability.addEffect(new DrawCardSourceControllerEffect(1)); ability.addEffect(new DrawCardSourceControllerEffect(1));
this.addAbility(ability); this.addAbility(ability);

View file

@ -39,6 +39,7 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate; import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game; import mage.game.Game;
@ -56,8 +57,6 @@ import java.util.UUID;
*/ */
public class DropOfHoney extends CardImpl { public class DropOfHoney extends CardImpl {
static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
public DropOfHoney(UUID ownerId, CardSetInfo setInfo) { public DropOfHoney(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}");
@ -101,7 +100,7 @@ class DropOfHoneyEffect extends OneShotEffect {
int leastPower = Integer.MAX_VALUE; int leastPower = Integer.MAX_VALUE;
boolean multipleExist = false; boolean multipleExist = false;
Permanent permanentToDestroy = null; Permanent permanentToDestroy = null;
for (Permanent permanent : game.getBattlefield().getActivePermanents(DropOfHoney.filter, source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game)) {
if (permanent.getPower().getValue() < leastPower) { if (permanent.getPower().getValue() < leastPower) {
permanentToDestroy = permanent; permanentToDestroy = permanent;
leastPower = permanent.getPower().getValue(); leastPower = permanent.getPower().getValue();
@ -151,7 +150,7 @@ class DropOfHoneyStateTriggeredAbility extends StateTriggeredAbility {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
return game.getBattlefield().count(DropOfHoney.filter, this.getSourceId(), this.getControllerId(), game) == 0; return game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURES, this.getSourceId(), this.getControllerId(), game) == 0;
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -94,7 +95,7 @@ class DuneblastEffect extends OneShotEffect {
if (controller.choose(outcome, target, source.getSourceId(), game)) { if (controller.choose(outcome, target, source.getSourceId(), game)) {
creatureToKeep = game.getPermanent(target.getFirstTarget()); creatureToKeep = game.getPermanent(target.getFirstTarget());
} }
for(Permanent creature: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for(Permanent creature: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), source.getSourceId(), game)) {
if (!Objects.equals(creature, creatureToKeep)) { if (!Objects.equals(creature, creatureToKeep)) {
creature.destroy(source.getSourceId(), game, false); creature.destroy(source.getSourceId(), game, false);
} }

View file

@ -34,6 +34,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
@ -78,7 +79,7 @@ class DwarvenCatapultEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int howMany = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game).size(); int howMany = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getFirstTarget(), game).size();
int amount = source.getManaCostsToPay().getX()/howMany; int amount = source.getManaCostsToPay().getX()/howMany;
DamageAllControlledTargetEffect dmgEffect = new DamageAllControlledTargetEffect(amount, new FilterCreaturePermanent()); DamageAllControlledTargetEffect dmgEffect = new DamageAllControlledTargetEffect(amount, new FilterCreaturePermanent());

View file

@ -36,8 +36,8 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterSpiritOrArcaneCard;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
@ -47,12 +47,10 @@ import java.util.UUID;
* @author Loki * @author Loki
*/ */
public class Earthshaker extends CardImpl { public class Earthshaker extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
private static final FilterCreaturePermanent creatureFilter = new FilterCreaturePermanent("creature without flying"); private static final FilterCreaturePermanent creatureFilter = new FilterCreaturePermanent("creature without flying");
static { static {
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); creatureFilter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
} }
public Earthshaker(UUID ownerId, CardSetInfo setInfo) { public Earthshaker(UUID ownerId, CardSetInfo setInfo) {
@ -62,7 +60,7 @@ public class Earthshaker extends CardImpl {
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Whenever you cast a Spirit or Arcane spell, Earthshaker deals 2 damage to each creature without flying. // Whenever you cast a Spirit or Arcane spell, Earthshaker deals 2 damage to each creature without flying.
this.addAbility(new SpellCastControllerTriggeredAbility(new DamageAllEffect(new StaticValue(2) , creatureFilter), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new DamageAllEffect(new StaticValue(2) , creatureFilter), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public Earthshaker(final Earthshaker card) { public Earthshaker(final Earthshaker card) {

View file

@ -35,8 +35,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandCard; import mage.filter.common.FilterLandCard;
import mage.filter.common.FilterSpiritOrArcaneCard;
import java.util.UUID; import java.util.UUID;
@ -54,7 +54,7 @@ public class ElderPineOfJukai extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order. // Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new SpellCastControllerTriggeredAbility(new RevealLibraryPutIntoHandEffect(3, new FilterLandCard(), Zone.LIBRARY), new FilterSpiritOrArcaneCard(), false)); this.addAbility(new SpellCastControllerTriggeredAbility(new RevealLibraryPutIntoHandEffect(3, new FilterLandCard(), Zone.LIBRARY), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
// Soulshift 2 // Soulshift 2
this.addAbility(new SoulshiftAbility(2)); this.addAbility(new SoulshiftAbility(2));

View file

@ -27,6 +27,8 @@
*/ */
package mage.cards.e; package mage.cards.e;
import java.util.List;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -34,6 +36,7 @@ import mage.abilities.keyword.SplitSecondAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SuperType; import mage.constants.SuperType;
@ -49,9 +52,6 @@ import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author jonubuu * @author jonubuu
@ -65,7 +65,7 @@ public class Extirpate extends CardImpl {
} }
public Extirpate(UUID ownerId, CardSetInfo setInfo) { public Extirpate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// Split second // Split second
this.addAbility(new SplitSecondAbility()); this.addAbility(new SplitSecondAbility());
@ -105,16 +105,17 @@ class ExtirpateEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
Card chosenCard = game.getCard(getTargetPointer().getFirst(game, source)); Card chosenCard = game.getCard(getTargetPointer().getFirst(game, source));
if (chosenCard != null && sourceObject != null && controller != null) { if (chosenCard != null && sourceObject != null && controller != null) {
Player owner = game.getPlayer(chosenCard.getOwnerId()); Player owner = game.getPlayer(chosenCard.getOwnerId());
if (owner == null) { if (owner == null) {
return false; return false;
} }
// Exile all cards with the same name // Exile all cards with the same name
// Building a card filter with the name // Building a card filter with the name
FilterCard filterNamedCard = new FilterCard(); FilterCard filterNamedCard = new FilterCard();
filterNamedCard.add(new NamePredicate(chosenCard.getName())); String nameToSearch = chosenCard.isSplitCard() ? ((SplitCard) chosenCard).getLeftHalfCard().getName() : chosenCard.getName();
filterNamedCard.add(new NamePredicate(nameToSearch));
// The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone. // The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone.
// Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed). // Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed).
@ -133,11 +134,11 @@ class ExtirpateEffect extends OneShotEffect {
for (UUID targetId : targets) { for (UUID targetId : targets) {
Card targetCard = owner.getHand().get(targetId, game); Card targetCard = owner.getHand().get(targetId, game);
if (targetCard != null) { if (targetCard != null) {
controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.HAND, true); controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.HAND, true);
} }
} }
} }
// search cards in Library // search cards in Library
filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the library of " + owner.getName()); filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the library of " + owner.getName());
TargetCardInLibrary targetCardInLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCard); TargetCardInLibrary targetCardInLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCard);
@ -146,7 +147,7 @@ class ExtirpateEffect extends OneShotEffect {
for (UUID targetId : targets) { for (UUID targetId : targets) {
Card targetCard = owner.getLibrary().getCard(targetId, game); Card targetCard = owner.getLibrary().getCard(targetId, game);
if (targetCard != null) { if (targetCard != null) {
controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.LIBRARY, true); controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.LIBRARY, true);
} }
} }
} }
@ -155,5 +156,5 @@ class ExtirpateEffect extends OneShotEffect {
} }
return false; return false;
} }
} }

View file

@ -48,7 +48,7 @@ import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -60,8 +60,6 @@ import java.util.UUID;
*/ */
public class FaithfulSquire extends CardImpl { public class FaithfulSquire extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public FaithfulSquire(UUID ownerId, CardSetInfo setInfo) { public FaithfulSquire(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
this.subtype.add("Human"); this.subtype.add("Human");
@ -73,7 +71,7 @@ public class FaithfulSquire extends CardImpl {
this.flipCardName = "Kaiso, Memory of Loyalty"; this.flipCardName = "Kaiso, Memory of Loyalty";
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Faithful Squire. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Faithful Squire.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Faithful Squire, you may flip it // At the beginning of the end step, if there are two or more ki counters on Faithful Squire, you may flip it
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(

View file

@ -33,7 +33,7 @@ import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -43,8 +43,6 @@ import java.util.UUID;
*/ */
public class FiddleheadKami extends CardImpl { public class FiddleheadKami extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public FiddleheadKami(UUID ownerId, CardSetInfo setInfo) { public FiddleheadKami(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -53,7 +51,7 @@ public class FiddleheadKami extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Whenever you cast a Spirit or Arcane spell, regenerate Fiddlehead Kami. // Whenever you cast a Spirit or Arcane spell, regenerate Fiddlehead Kami.
this.addAbility(new SpellCastControllerTriggeredAbility(new RegenerateSourceEffect(), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new RegenerateSourceEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public FiddleheadKami(final FiddleheadKami card) { public FiddleheadKami(final FiddleheadKami card) {

View file

@ -38,7 +38,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -57,7 +57,7 @@ public class GateHound extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinuousEffect( new ConditionalContinuousEffect(
new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()), new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES),
new EnchantedSourceCondition(), new EnchantedSourceCondition(),
"Creatures you control have vigilance as long as {this} is enchanted"))); "Creatures you control have vigilance as long as {this} is enchanted")));
} }

View file

@ -87,7 +87,6 @@ public class GateToTheAfterlife extends CardImpl {
new GateToTheAfterlifeEffect(), new GenericManaCost(2), new CardsInControllerGraveCondition(6, new FilterCreatureCard())); new GateToTheAfterlifeEffect(), new GenericManaCost(2), new CardsInControllerGraveCondition(6, new FilterCreatureCard()));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -51,6 +51,7 @@ public class GoblinTestPilot extends CardImpl {
public GoblinTestPilot(UUID ownerId, CardSetInfo setInfo) { public GoblinTestPilot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{R}");
this.subtype.add("Goblin"); this.subtype.add("Goblin");
this.subtype.add("Pilot");
this.subtype.add("Wizard"); this.subtype.add("Wizard");
this.power = new MageInt(0); this.power = new MageInt(0);

View file

@ -28,21 +28,21 @@
package mage.cards.g; package mage.cards.g;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import java.util.UUID; import java.util.UUID;
/** /**
* @author Loki * @author Loki
@ -53,7 +53,7 @@ public class GruulWarPlow extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
// Creatures you control have trample. // Creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn. // {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GruulWarPlowToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GruulWarPlowToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}")));

View file

@ -37,7 +37,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -47,15 +47,13 @@ import java.util.UUID;
*/ */
public class GuardianOfSolitude extends CardImpl { public class GuardianOfSolitude extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public GuardianOfSolitude(UUID ownerId, CardSetInfo setInfo) { public GuardianOfSolitude(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
Ability ability = new SpellCastControllerTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -43,11 +42,13 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.HammerOfPurphorosGolemToken; import mage.game.permanent.token.HammerOfPurphorosGolemToken;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -60,7 +61,7 @@ public class HammerOfPurphoros extends CardImpl {
// Creatures you control have haste. // Creatures you control have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// {2}{R}, {tap}, Sacrifice a land: Create a 3/3 colorless Golem enchantment artifact creature token. // {2}{R}, {tap}, Sacrifice a land: Create a 3/3 colorless Golem enchantment artifact creature token.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HammerOfPurphorosGolemToken()), new ManaCostsImpl("{2}{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HammerOfPurphorosGolemToken()), new ManaCostsImpl("{2}{R}"));

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
@ -36,7 +34,10 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -44,8 +45,6 @@ import mage.filter.common.FilterSpiritOrArcaneCard;
*/ */
public class HaruOnna extends CardImpl { public class HaruOnna extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public HaruOnna(UUID ownerId, CardSetInfo setInfo) { public HaruOnna(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -56,7 +55,7 @@ public class HaruOnna extends CardImpl {
// When Haru-Onna enters the battlefield, draw a card. // When Haru-Onna enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
// Whenever you cast a Spirit or Arcane spell, you may return Haru-Onna to its owner's hand. // Whenever you cast a Spirit or Arcane spell, you may return Haru-Onna to its owner's hand.
this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
} }
public HaruOnna(final HaruOnna card) { public HaruOnna(final HaruOnna card) {

View file

@ -1,16 +1,16 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
@ -20,32 +20,31 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.h; package mage.cards.h;
import mage.constants.CardType; import java.util.List;
import mage.constants.Outcome; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.common.FilterBasicLandCard; import mage.filter.common.FilterBasicLandCard;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.List;
import java.util.UUID;
import mage.filter.predicate.mageobject.NamePredicate;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
@ -53,7 +52,7 @@ import mage.filter.predicate.mageobject.NamePredicate;
public class HauntingEchoes extends CardImpl { public class HauntingEchoes extends CardImpl {
public HauntingEchoes(UUID ownerId, CardSetInfo setInfo) { public HauntingEchoes(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new HauntingEchoesEffect()); this.getSpellAbility().addEffect(new HauntingEchoesEffect());
@ -87,18 +86,19 @@ class HauntingEchoesEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (targetPlayer != null) { if (targetPlayer != null) {
for (Card card: targetPlayer.getGraveyard().getCards(game)) { for (Card card : targetPlayer.getGraveyard().getCards(game)) {
if (!filter.match(card, game)) { if (!filter.match(card, game)) {
card.moveToExile(null, "", source.getSourceId(), game); card.moveToExile(null, "", source.getSourceId(), game);
FilterCard filterCard = new FilterCard("cards named " + card.getName()); FilterCard filterCard = new FilterCard("cards named " + card.getName());
filterCard.add(new NamePredicate(card.getName())); String nameToSearch = card.isSplitCard() ? ((SplitCard) card).getLeftHalfCard().getName() : card.getName();
filterCard.add(new NamePredicate(nameToSearch));
int count = targetPlayer.getLibrary().count(filterCard, game); int count = targetPlayer.getLibrary().count(filterCard, game);
TargetCardInLibrary target = new TargetCardInLibrary(count, count, filterCard); TargetCardInLibrary target = new TargetCardInLibrary(count, count, filterCard);
player.searchLibrary(target, game, targetPlayer.getId()); player.searchLibrary(target, game, targetPlayer.getId());
List<UUID> targets = target.getTargets(); List<UUID> targets = target.getTargets();
for(UUID cardId : targets){ for (UUID cardId : targets) {
Card libraryCard = game.getCard(cardId); Card libraryCard = game.getCard(cardId);
if (libraryCard != null) { if (libraryCard != null) {
libraryCard.moveToExile(null, "", source.getSourceId(), game); libraryCard.moveToExile(null, "", source.getSourceId(), game);
@ -117,4 +117,4 @@ class HauntingEchoesEffect extends OneShotEffect {
return new HauntingEchoesEffect(this); return new HauntingEchoesEffect(this);
} }
} }

View file

@ -27,6 +27,7 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.abilities.common.EndOfCombatTriggeredAbility; import mage.abilities.common.EndOfCombatTriggeredAbility;
import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -38,30 +39,23 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.BlockedPredicate; import mage.filter.predicate.permanent.BlockedPredicate;
import mage.filter.predicate.permanent.BlockingPredicate; import mage.filter.predicate.permanent.BlockingPredicate;
import java.util.UUID;
/** /**
* @author dustinroepsch * @author dustinroepsch
*/ */
public class HeatStroke extends CardImpl { public class HeatStroke extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent(); private static final FilterPermanent filter = new FilterCreaturePermanent();
static { static {
filter.add(Predicates.or( filter.add(Predicates.or(new BlockedPredicate(), new BlockingPredicate()));
new BlockedPredicate(), new BlockingPredicate()
));
} }
public HeatStroke(UUID ownerId, CardSetInfo setInfo) { public HeatStroke(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
// At end of combat, destroy each creature that blocked or was blocked this turn. // At end of combat, destroy each creature that blocked or was blocked this turn.
this.addAbility( this.addAbility(new EndOfCombatTriggeredAbility(new DestroyAllEffect(filter)
new EndOfCombatTriggeredAbility( .setText("destroy each creature that blocked or was blocked this turn"), false));
new DestroyAllEffect(filter).setText("destroy each creature that blocked or was blocked this turn."),
false
)
);
} }
public HeatStroke(final HeatStroke card) { public HeatStroke(final HeatStroke card) {
@ -73,4 +67,3 @@ public class HeatStroke extends CardImpl {
return new HeatStroke(this); return new HeatStroke(this);
} }
} }

View file

@ -28,7 +28,6 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -42,11 +41,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -63,7 +64,7 @@ public class HellraiserGoblin extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Creatures you control have haste and attack each combat if able. // Creatures you control have haste and attack each combat if able.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures"))); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES));
Effect effect = new AttacksIfAbleAllEffect(Duration.WhileOnBattlefield); Effect effect = new AttacksIfAbleAllEffect(Duration.WhileOnBattlefield);
effect.setText("and attack each combat if able"); effect.setText("and attack each combat if able");
ability.addEffect(effect); ability.addEffect(effect);

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
@ -46,8 +46,6 @@ import java.util.UUID;
*/ */
public class HikariTwilightGuardian extends CardImpl { public class HikariTwilightGuardian extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public HikariTwilightGuardian(UUID ownerId, CardSetInfo setInfo) { public HikariTwilightGuardian(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -61,7 +59,7 @@ public class HikariTwilightGuardian extends CardImpl {
// Whenever you cast a Spirit or Arcane spell, you may exile Hikari, Twilight Guardian. If you do, return it to the battlefield under its owner's control at the beginning of the next end step. // Whenever you cast a Spirit or Arcane spell, you may exile Hikari, Twilight Guardian. If you do, return it to the battlefield under its owner's control at the beginning of the next end step.
Effect effect = new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true); Effect effect = new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true);
effect.setText("you may exile {this}. If you do, return it to the battlefield under its owner's control at the beginning of the next end step"); effect.setText("you may exile {this}. If you do, return it to the battlefield under its owner's control at the beginning of the next end step");
this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(effect, StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
} }
public HikariTwilightGuardian(final HikariTwilightGuardian card) { public HikariTwilightGuardian(final HikariTwilightGuardian card) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.common.OnEventTriggeredAbility;
@ -47,21 +46,21 @@ import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public class HiredMuscle extends CardImpl { public class HiredMuscle extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public HiredMuscle(UUID ownerId, CardSetInfo setInfo) { public HiredMuscle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Warrior"); this.subtype.add("Warrior");
@ -71,7 +70,7 @@ public class HiredMuscle extends CardImpl {
this.flipCardName = "Scarmaker"; this.flipCardName = "Scarmaker";
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Hired Muscle. // Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Hired Muscle.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Hired Muscle, you may flip it. // At the beginning of the end step, if there are two or more ki counters on Hired Muscle, you may flip it.
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(

View file

@ -28,32 +28,30 @@
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.RegenerateTargetEffect; import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class HorizonSeed extends CardImpl { public class HorizonSeed extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public HorizonSeed(UUID ownerId, CardSetInfo setInfo) { public HorizonSeed(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
Ability ability = new SpellCastControllerTriggeredAbility(new RegenerateTargetEffect(), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new RegenerateTargetEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,12 +27,10 @@
*/ */
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.CantBeRegeneratedTargetEffect; import mage.abilities.effects.common.CantBeRegeneratedTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -41,6 +39,8 @@ import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author MarcoMarin * @author MarcoMarin
@ -49,7 +49,7 @@ public class HurrJackal extends CardImpl {
public HurrJackal(UUID ownerId, CardSetInfo setInfo) { public HurrJackal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
this.subtype.add("Hound"); this.subtype.add("Jackal");
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);

View file

@ -39,7 +39,7 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
@ -66,7 +66,7 @@ public class InfernalKirin extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever you cast a Spirit or Arcane spell, target player reveals his or her hand and discards all cards with that spell's converted mana cost. // Whenever you cast a Spirit or Arcane spell, target player reveals his or her hand and discards all cards with that spell's converted mana cost.
Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new InfernalKirinEffect(), new FilterSpiritOrArcaneCard(), false, true); Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new InfernalKirinEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, false, true);
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);

View file

@ -39,6 +39,7 @@ import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.cards.SplitCard;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.FilterCard; import mage.filter.FilterCard;
@ -56,8 +57,7 @@ import mage.target.common.TargetCardInLibrary;
public class InfernalTutor extends CardImpl { public class InfernalTutor extends CardImpl {
public InfernalTutor(UUID ownerId, CardSetInfo setInfo) { public InfernalTutor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library. // Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library.
this.getSpellAbility().addEffect(new InfernalTutorEffect()); this.getSpellAbility().addEffect(new InfernalTutorEffect());
@ -67,7 +67,7 @@ public class InfernalTutor extends CardImpl {
HellbentCondition.instance, HellbentCondition.instance,
"<br/><br/><i>Hellbent</i> - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library"); "<br/><br/><i>Hellbent</i> - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
} }
public InfernalTutor(final InfernalTutor card) { public InfernalTutor(final InfernalTutor card) {
@ -114,14 +114,15 @@ class InfernalTutorEffect extends OneShotEffect {
} }
FilterCard filterCard; FilterCard filterCard;
if (cardToReveal != null) { if (cardToReveal != null) {
controller.revealCards("from hand :" + sourceObject.getName(), new CardsImpl(cardToReveal), game); controller.revealCards("from hand :" + sourceObject.getName(), new CardsImpl(cardToReveal), game);
filterCard = new FilterCard("card named " + cardToReveal.getName()); String nameToSearch = cardToReveal.isSplitCard() ? ((SplitCard) cardToReveal).getLeftHalfCard().getName() : cardToReveal.getName();
filterCard.add(new NamePredicate(cardToReveal.getName())); filterCard = new FilterCard("card named " + nameToSearch);
filterCard.add(new NamePredicate(nameToSearch));
} else { } else {
filterCard = new FilterCard(); filterCard = new FilterCard();
} }
return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source); return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source);
} }
return true; return true;
} }

View file

@ -28,9 +28,6 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -41,18 +38,19 @@ import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.effects.common.UntapSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol; import mage.constants.ColoredManaSymbol;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class InnocenceKami extends CardImpl { public class InnocenceKami extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public InnocenceKami(UUID ownerId, CardSetInfo setInfo) { public InnocenceKami(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -63,7 +61,7 @@ public class InnocenceKami extends CardImpl {
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public InnocenceKami(final InnocenceKami card) { public InnocenceKami(final InnocenceKami card) {

View file

@ -36,12 +36,10 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.UntapEnchantedEffect; import mage.abilities.effects.common.UntapEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType; import mage.constants.AsThoughEffectType;
import mage.constants.AttachmentType;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
@ -58,7 +56,7 @@ import mage.target.common.TargetCreaturePermanent;
public class InstillEnergy extends CardImpl { public class InstillEnergy extends CardImpl {
public InstillEnergy(UUID ownerId, CardSetInfo setInfo) { public InstillEnergy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.subtype.add("Aura"); this.subtype.add("Aura");
// Enchant creature // Enchant creature
@ -68,9 +66,7 @@ public class InstillEnergy extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature can attack as though it had haste. // Enchanted creature can attack as though it had haste.
Ability asThough = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItHadHasteEnchantedEffect(Duration.WhileOnBattlefield)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItHadHasteEnchantedEffect(Duration.WhileOnBattlefield)));
Ability haste = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(asThough, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted creature can attack as though it had haste."));
this.addAbility(haste);
// {0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn. // {0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn.
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), 1, MyTurnCondition.instance)); this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), 1, MyTurnCondition.instance));
} }
@ -88,7 +84,7 @@ public class InstillEnergy extends CardImpl {
class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl { class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl {
public CanAttackAsThoughItHadHasteEnchantedEffect(Duration duration) { public CanAttackAsThoughItHadHasteEnchantedEffect(Duration duration) {
super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); super(AsThoughEffectType.ATTACK_AS_HASTE, duration, Outcome.Benefit);
staticText = "Enchanted creature can attack as though it had haste"; staticText = "Enchanted creature can attack as though it had haste";
} }

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FearAbility; import mage.abilities.keyword.FearAbility;
@ -37,7 +35,9 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -49,7 +49,7 @@ public class Intimidation extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}{B}");
// Creatures you control have fear. // Creatures you control have fear.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
} }
public Intimidation(final Intimidation card) { public Intimidation(final Intimidation card) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.j; package mage.cards.j;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.CantAttackAloneAbility; import mage.abilities.keyword.CantAttackAloneAbility;
import mage.abilities.keyword.CantBlockAloneAbility; import mage.abilities.keyword.CantBlockAloneAbility;
@ -35,6 +34,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import java.util.UUID;
/** /**
* @author magenoxx_at_gmail.com * @author magenoxx_at_gmail.com
*/ */
@ -42,7 +43,7 @@ public class JackalFamiliar extends CardImpl {
public JackalFamiliar(UUID ownerId, CardSetInfo setInfo) { public JackalFamiliar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
this.subtype.add("Hound"); this.subtype.add("Jackal");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.j; package mage.cards.j;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DealtDamageToSourceTriggeredAbility; import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
@ -40,6 +39,8 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -49,7 +50,7 @@ public class JackalPup extends CardImpl {
public JackalPup(UUID ownerId, CardSetInfo setInfo) { public JackalPup(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
this.subtype.add("Hound"); this.subtype.add("Jackal");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);

View file

@ -28,28 +28,26 @@
package mage.cards.j; package mage.cards.j;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class JadeIdol extends CardImpl { public class JadeIdol extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public JadeIdol(UUID ownerId, CardSetInfo setInfo) { public JadeIdol(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
this.addAbility(new SpellCastControllerTriggeredAbility(new BecomesCreatureSourceEffect(new JadeIdolToken(), "", Duration.EndOfTurn), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new BecomesCreatureSourceEffect(new JadeIdolToken(), "", Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public JadeIdol(final JadeIdol card) { public JadeIdol(final JadeIdol card) {

View file

@ -28,26 +28,24 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.combat.CantBlockTargetEffect; import mage.abilities.effects.common.combat.CantBlockTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class KamiOfFiresRoar extends CardImpl { public class KamiOfFiresRoar extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KamiOfFiresRoar(UUID ownerId, CardSetInfo setInfo) { public KamiOfFiresRoar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -56,7 +54,7 @@ public class KamiOfFiresRoar extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Whenever you cast a Spirit or Arcane spell, target creature can't block this turn. // Whenever you cast a Spirit or Arcane spell, target creature can't block this turn.
Ability ability = new SpellCastControllerTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,17 +27,17 @@
*/ */
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -45,8 +45,6 @@ import mage.filter.common.FilterSpiritOrArcaneCard;
*/ */
public class KamiOfTatteredShoji extends CardImpl { public class KamiOfTatteredShoji extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KamiOfTatteredShoji(UUID ownerId, CardSetInfo setInfo) { public KamiOfTatteredShoji(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -54,7 +52,7 @@ public class KamiOfTatteredShoji extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Whenever you cast a Spirit or Arcane spell, Kami of Tattered Shoji gains flying until end of turn. // Whenever you cast a Spirit or Arcane spell, Kami of Tattered Shoji gains flying until end of turn.
this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public KamiOfTatteredShoji(final KamiOfTatteredShoji card) { public KamiOfTatteredShoji(final KamiOfTatteredShoji card) {

View file

@ -28,31 +28,29 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class KamiOfTheHunt extends CardImpl { public class KamiOfTheHunt extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KamiOfTheHunt(UUID ownerId, CardSetInfo setInfo) { public KamiOfTheHunt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }
public KamiOfTheHunt(final KamiOfTheHunt card) { public KamiOfTheHunt(final KamiOfTheHunt card) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect;
@ -35,7 +34,9 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -43,8 +44,6 @@ import mage.filter.common.FilterSpiritOrArcaneCard;
*/ */
public class KamiOfThePaintedRoad extends CardImpl { public class KamiOfThePaintedRoad extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KamiOfThePaintedRoad(UUID ownerId, CardSetInfo setInfo) { public KamiOfThePaintedRoad(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -53,7 +52,7 @@ public class KamiOfThePaintedRoad extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Whenever you cast a Spirit or Arcane spell, Kami of the Painted Road gains protection from the color of your choice until end of turn. // Whenever you cast a Spirit or Arcane spell, Kami of the Painted Road gains protection from the color of your choice until end of turn.
this.addAbility(new SpellCastControllerTriggeredAbility(new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), filter, false)); this.addAbility(new SpellCastControllerTriggeredAbility(new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false));
} }

View file

@ -28,9 +28,6 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
@ -39,17 +36,18 @@ import mage.abilities.keyword.FearAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author Loki * @author Loki
*/ */
public class KamiOfTheWaningMoon extends CardImpl { public class KamiOfTheWaningMoon extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KamiOfTheWaningMoon(UUID ownerId, CardSetInfo setInfo) { public KamiOfTheWaningMoon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -57,7 +55,7 @@ public class KamiOfTheWaningMoon extends CardImpl {
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
Ability ability = new SpellCastControllerTriggeredAbility(new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,27 +27,26 @@
*/ */
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import java.util.UUID;
/** /**
* *
* @author Loki * @author Loki
*/ */
public class KemuriOnna extends CardImpl { public class KemuriOnna extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KemuriOnna(UUID ownerId, CardSetInfo setInfo) { public KemuriOnna(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -60,7 +59,7 @@ public class KemuriOnna extends CardImpl {
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
// Whenever you cast a Spirit or Arcane spell, you may return Kemuri-Onna to its owner's hand. // Whenever you cast a Spirit or Arcane spell, you may return Kemuri-Onna to its owner's hand.
this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
} }
public KemuriOnna(final KemuriOnna card) { public KemuriOnna(final KemuriOnna card) {

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -37,17 +35,18 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author Loki * @author Loki
*/ */
public class KiriOnna extends CardImpl { public class KiriOnna extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KiriOnna(UUID ownerId, CardSetInfo setInfo) { public KiriOnna(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -60,7 +59,7 @@ public class KiriOnna extends CardImpl {
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
// Whenever you cast a Spirit or Arcane spell, you may return Kiri-Onna to its owner's hand. // Whenever you cast a Spirit or Arcane spell, you may return Kiri-Onna to its owner's hand.
this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), filter, true)); this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
} }
public KiriOnna(final KiriOnna card) { public KiriOnna(final KiriOnna card) {

View file

@ -39,8 +39,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterSpiritOrArcaneCard;
import java.util.UUID; import java.util.UUID;
@ -49,8 +49,6 @@ import java.util.UUID;
*/ */
public class KodamaOfTheSouthTree extends CardImpl { public class KodamaOfTheSouthTree extends CardImpl {
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
public KodamaOfTheSouthTree(UUID ownerId, CardSetInfo setInfo) { public KodamaOfTheSouthTree(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
@ -58,8 +56,8 @@ public class KodamaOfTheSouthTree extends CardImpl {
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
Ability ability = new SpellCastControllerTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), filter, false); Ability ability = new SpellCastControllerTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), true)); ability.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -37,7 +37,7 @@ import mage.constants.CardType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID; import java.util.UUID;
@ -58,7 +58,7 @@ public class KyokiSanitysEclipse extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Whenever you cast a Spirit or Arcane spell, target opponent exiles a card from his or her hand. // Whenever you cast a Spirit or Arcane spell, target opponent exiles a card from his or her hand.
Ability ability = new SpellCastControllerTriggeredAbility(new ExileFromZoneTargetEffect(Zone.HAND, null, "", new FilterCard()), new FilterSpiritOrArcaneCard(), false); Ability ability = new SpellCastControllerTriggeredAbility(new ExileFromZoneTargetEffect(Zone.HAND, null, "", new FilterCard()), StaticFilters.SPIRIT_OR_ARCANE_CARD, false);
ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetOpponent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -27,9 +27,7 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
@ -40,21 +38,19 @@ import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetE
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Outcome; import mage.filter.StaticFilters;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
* *
* @author HCrescent * @author HCrescent
*/ */
public class Lifeline extends CardImpl { public class Lifeline extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature");
public Lifeline(UUID ownerId, CardSetInfo setInfo) { public Lifeline(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
@ -62,8 +58,8 @@ private static final FilterCreaturePermanent filter = new FilterCreaturePermanen
// Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step. // Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step.
Ability ability = new ConditionalTriggeredAbility( Ability ability = new ConditionalTriggeredAbility(
new DiesCreatureTriggeredAbility( Zone.BATTLEFIELD, new LifelineEffect(), false, filter, true), new DiesCreatureTriggeredAbility( Zone.BATTLEFIELD, new LifelineEffect(), false, StaticFilters.FILTER_PERMANENT_CREATURE, true),
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 0, false), new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_PERMANENT_CREATURE, ComparisonType.MORE_THAN, 0, false),
"Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step."); "Whenever a creature dies, if another creature is on the battlefield, return the first card to the battlefield under its owner's control at the beginning of the next end step.");
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -37,14 +35,17 @@ import mage.cards.CardsImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author North * @author North
@ -87,7 +88,7 @@ class LifesFinaleEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game);
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
@ -39,9 +38,11 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -55,7 +56,7 @@ public class LightningVolley extends CardImpl {
// Until end of turn, creatures you control gain "{T}: This creature deals 1 damage to target creature or player." // Until end of turn, creatures you control gain "{T}: This creature deals 1 damage to target creature or player."
Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
grantedAbility.addTarget(new TargetCreatureOrPlayer()); grantedAbility.addTarget(new TargetCreatureOrPlayer());
Effect effect = new GainAbilityControlledEffect(grantedAbility, Duration.EndOfTurn, new FilterCreaturePermanent("Creatures")); Effect effect = new GainAbilityControlledEffect(grantedAbility, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText("Until end of turn, creatures you control gain \"{T}: This creature deals 1 damage to target creature or player.\""); effect.setText("Until end of turn, creatures you control gain \"{T}: This creature deals 1 damage to target creature or player.\"");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
} }

View file

@ -27,14 +27,15 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect; import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.common.FilterSpiritOrArcaneCard; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -50,7 +51,7 @@ public class LoamDweller extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Whenever you cast a Spirit or Arcane spell, you may put a land card from your hand onto the battlefield tapped. // Whenever you cast a Spirit or Arcane spell, you may put a land card from your hand onto the battlefield tapped.
this.addAbility(new SpellCastControllerTriggeredAbility(new PutLandFromHandOntoBattlefieldEffect(true), new FilterSpiritOrArcaneCard(), true)); this.addAbility(new SpellCastControllerTriggeredAbility(new PutLandFromHandOntoBattlefieldEffect(true), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
} }
public LoamDweller(final LoamDweller card) { public LoamDweller(final LoamDweller card) {

View file

@ -27,6 +27,7 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -46,8 +47,6 @@ import mage.target.TargetCard;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -55,7 +54,7 @@ import java.util.UUID;
public class Lobotomy extends CardImpl { public class Lobotomy extends CardImpl {
public Lobotomy(UUID ownerId, CardSetInfo setInfo) { public Lobotomy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}");
// Target player reveals his or her hand, then you choose a card other than a basic land card from it. Search that player's graveyard, hand, and library for all cards with the same name as the chosen card and exile them. Then that player shuffles his or her library. // Target player reveals his or her hand, then you choose a card other than a basic land card from it. Search that player's graveyard, hand, and library for all cards with the same name as the chosen card and exile them. Then that player shuffles his or her library.
this.getSpellAbility().addEffect(new LobotomyEffect()); this.getSpellAbility().addEffect(new LobotomyEffect());
@ -110,12 +109,12 @@ class LobotomyEffect extends OneShotEffect {
// Exile all cards with the same name // Exile all cards with the same name
// Building a card filter with the name // Building a card filter with the name
FilterCard filterNamedCards = new FilterCard(); FilterCard filterNamedCards = new FilterCard();
String nameToSearch = "---";// so no card matches
if (chosenCard != null) { if (chosenCard != null) {
filterNamedCards.add(new NamePredicate(chosenCard.getName())); nameToSearch = chosenCard.isSplitCard() ? ((SplitCard) chosenCard).getLeftHalfCard().getName() : chosenCard.getName();
filterNamedCards.setMessage("cards named " + chosenCard.getName()); filterNamedCards.setMessage("cards named " + chosenCard.getName());
} else {
filterNamedCards.add(new NamePredicate("----")); // so no card matches
} }
filterNamedCards.add(new NamePredicate(nameToSearch));
Cards cardsToExile = new CardsImpl(); Cards cardsToExile = new CardsImpl();
// The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone. // The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone.
// Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed). // Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed).

View file

@ -33,7 +33,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.SpiritWhiteToken; import mage.game.permanent.token.SpiritWhiteToken;
@ -84,7 +84,7 @@ class MarchOfSoulsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> creatures = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), List<Permanent> creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES,
source.getControllerId(), source.getSourceId(), game); source.getControllerId(), source.getSourceId(), game);
HashMap<UUID, Integer> playersWithCreatures = new HashMap<>(); HashMap<UUID, Integer> playersWithCreatures = new HashMap<>();
for(Permanent p : creatures) { for(Permanent p : creatures) {

View file

@ -43,7 +43,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
@ -73,7 +73,7 @@ public class MarchesaTheBlackRose extends CardImpl {
// Other creatures you control have dethrone. // Other creatures you control have dethrone.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(new DethroneAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); new GainAbilityControlledEffect(new DethroneAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES, true)));
// Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step. // Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step.
this.addAbility(new MarchesaTheBlackRoseTriggeredAbility()); this.addAbility(new MarchesaTheBlackRoseTriggeredAbility());

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.m; package mage.cards.m;
import java.util.Iterator;
import java.util.UUID;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.LockedInCondition; import mage.abilities.condition.LockedInCondition;
@ -39,11 +37,14 @@ import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import java.util.Iterator;
import java.util.UUID;
/** /**
* *
* @author North * @author North
@ -105,7 +106,7 @@ class MarshCasualtiesEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
if (this.affectedObjectsSet) { if (this.affectedObjectsSet) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game)) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getFirstTarget(), game)) {
affectedObjectList.add(new MageObjectReference(creature, game)); affectedObjectList.add(new MageObjectReference(creature, game));
} }
} }

View file

@ -27,19 +27,20 @@
*/ */
package mage.cards.m; package mage.cards.m;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.SoldierToken; import mage.game.permanent.token.SoldierToken;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
@ -87,7 +88,7 @@ class MartialCoupEffect extends OneShotEffect {
token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId());
List<UUID> tokens = token.getLastAddedTokenIds(); List<UUID> tokens = token.getLastAddedTokenIds();
if (amount > 4) { if (amount > 4) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game)) {
if (!tokens.contains(permanent.getId())) { if (!tokens.contains(permanent.getId())) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }

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