diff --git a/Mage.Sets/src/mage/cards/a/ArtifactWard.java b/Mage.Sets/src/mage/cards/a/ArtifactWard.java index 0d4db6e3d9d..5c59207e7bb 100644 --- a/Mage.Sets/src/mage/cards/a/ArtifactWard.java +++ b/Mage.Sets/src/mage/cards/a/ArtifactWard.java @@ -29,7 +29,6 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; @@ -49,10 +48,9 @@ import mage.target.common.TargetCreaturePermanent; * @author MarcoMarin */ public class ArtifactWard extends CardImpl { - private static final FilterArtifactCard filter = new FilterArtifactCard("artifacts"); - + public ArtifactWard(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.subtype.add("Aura"); // Enchant creature @@ -60,13 +58,12 @@ public class ArtifactWard extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Protect)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // Enchanted creature can't be blocked by artifact creatures. // Prevent all damage that would be dealt to enchanted creature by artifact sources. // Enchanted creature can't be the target of abilities from artifact sources. - ProtectionAbility gainedAbility = new ProtectionAbility(filter); - - Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAttachedEffect(new ProtectionAbility(new FilterArtifactCard("artifacts")), AttachmentType.AURA))); } public ArtifactWard(final ArtifactWard card) { diff --git a/Mage.Sets/src/mage/cards/c/ChromescaleDrake.java b/Mage.Sets/src/mage/cards/c/ChromescaleDrake.java index d8ec9a7b4f4..64f35a70755 100644 --- a/Mage.Sets/src/mage/cards/c/ChromescaleDrake.java +++ b/Mage.Sets/src/mage/cards/c/ChromescaleDrake.java @@ -29,22 +29,15 @@ package mage.cards.c; import java.util.UUID; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; import mage.abilities.keyword.AffinityForArtifactsAbility; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; -import mage.game.Game; -import mage.players.Player; +import mage.filter.common.FilterArtifactCard; /** * @@ -53,19 +46,19 @@ import mage.players.Player; public class ChromescaleDrake extends CardImpl { public ChromescaleDrake(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{U}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}"); this.subtype.add("Drake"); this.power = new MageInt(3); this.toughness = new MageInt(4); // Affinity for artifacts this.addAbility(new AffinityForArtifactsAbility()); - + // Flying this.addAbility(FlyingAbility.getInstance()); - + // When Chromescale Drake enters the battlefield, reveal the top three cards of your library. Put all artifact cards revealed this way into your hand and the rest into your graveyard. - this.addAbility(new EntersBattlefieldTriggeredAbility(new ChromescaleDrakeEffect())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new RevealLibraryPutIntoHandEffect(3, new FilterArtifactCard("artifact cards"), Zone.GRAVEYARD))); } public ChromescaleDrake(final ChromescaleDrake card) { @@ -77,45 +70,3 @@ public class ChromescaleDrake extends CardImpl { return new ChromescaleDrake(this); } } - -class ChromescaleDrakeEffect extends OneShotEffect { - - public ChromescaleDrakeEffect() { - super(Outcome.Benefit); - staticText = "Reveal the top three cards of your library. Put all artifacts cards revealed this way into your hand and the rest into your graveyard"; - } - - public ChromescaleDrakeEffect(final ChromescaleDrakeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (controller == null || sourceObject == null) { - return false; - } - - Cards cards = new CardsImpl(); - Cards cardsToHand = new CardsImpl(); - cards.addAll(controller.getLibrary().getTopCards(game, 3)); - if (!cards.isEmpty()) { - controller.revealCards(sourceObject.getName(), cards, game); - for (Card card: cards.getCards(game)) { - if (card.getCardType().contains(CardType.ARTIFACT)) { - cardsToHand.add(card); - cards.remove(card); - } - } - controller.moveCards(cardsToHand, Zone.HAND, source, game); - controller.moveCards(cards, Zone.GRAVEYARD, source, game); - } - return true; - } - - @Override - public ChromescaleDrakeEffect copy() { - return new ChromescaleDrakeEffect(this); - } -} diff --git a/Mage.Sets/src/mage/cards/c/CreepingCorrosion.java b/Mage.Sets/src/mage/cards/c/CreepingCorrosion.java index 8d57214b7eb..ba20fbb7e24 100644 --- a/Mage.Sets/src/mage/cards/c/CreepingCorrosion.java +++ b/Mage.Sets/src/mage/cards/c/CreepingCorrosion.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.c; import java.util.UUID; @@ -42,9 +41,10 @@ import mage.filter.common.FilterArtifactPermanent; public class CreepingCorrosion extends CardImpl { public CreepingCorrosion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent())); + // Destroy all artifacts. + this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent("artifacts"))); } public CreepingCorrosion(final CreepingCorrosion card) { diff --git a/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java b/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java index c0f5cfac38f..f118961dcbc 100644 --- a/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; import java.util.UUID; @@ -39,33 +38,32 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledArtifactPermanent; /** * * @author Loki */ public class DarksteelJuggernaut extends CardImpl { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control"); - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - - public DarksteelJuggernaut (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}"); + public DarksteelJuggernaut(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); this.subtype.add("Juggernaut"); this.power = new MageInt(0); this.toughness = new MageInt(0); - SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); - this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); + // Indestructible this.addAbility(IndestructibleAbility.getInstance()); + + // Darksteel Juggernaut’s power and toughness are each equal to the number of artifacts you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, + new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame))); + + // Darksteel Juggernaut attacks each turn if able. this.addAbility(new AttacksEachTurnStaticAbility()); } - public DarksteelJuggernaut (final DarksteelJuggernaut card) { + public DarksteelJuggernaut(final DarksteelJuggernaut card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/e/EdgeOfAutumn.java b/Mage.Sets/src/mage/cards/e/EdgeOfAutumn.java index ff448f296e6..c8aafa73baa 100644 --- a/Mage.Sets/src/mage/cards/e/EdgeOfAutumn.java +++ b/Mage.Sets/src/mage/cards/e/EdgeOfAutumn.java @@ -28,7 +28,6 @@ package mage.cards.e; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -50,19 +49,17 @@ import mage.target.common.TargetControlledPermanent; public class EdgeOfAutumn extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); - private static final FilterBasicLandCard basiclandfilter = new FilterBasicLandCard(); public EdgeOfAutumn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // If you control four or fewer lands, search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(basiclandfilter), true), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 5), "If you control four or fewer lands, search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.")); // Cycling-Sacrifice a land. - Ability cycling = new CyclingAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter))); - this.addAbility(cycling); + this.addAbility(new CyclingAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } public EdgeOfAutumn(final EdgeOfAutumn card) { diff --git a/Mage.Sets/src/mage/cards/e/ExplosiveVegetation.java b/Mage.Sets/src/mage/cards/e/ExplosiveVegetation.java index ca154d62eed..96d9fcb4807 100644 --- a/Mage.Sets/src/mage/cards/e/ExplosiveVegetation.java +++ b/Mage.Sets/src/mage/cards/e/ExplosiveVegetation.java @@ -41,12 +41,11 @@ import mage.target.common.TargetCardInLibrary; */ public class ExplosiveVegetation extends CardImpl { - private static final FilterBasicLandCard filter = new FilterBasicLandCard(); - public ExplosiveVegetation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); - this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, filter), true)); + // Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, new FilterBasicLandCard("basic land cards")), true)); } public ExplosiveVegetation(final ExplosiveVegetation card) { diff --git a/Mage.Sets/src/mage/cards/f/FrontierGuide.java b/Mage.Sets/src/mage/cards/f/FrontierGuide.java index 78b6eeeaaed..7a80bb99dd1 100644 --- a/Mage.Sets/src/mage/cards/f/FrontierGuide.java +++ b/Mage.Sets/src/mage/cards/f/FrontierGuide.java @@ -46,18 +46,17 @@ import mage.target.common.TargetCardInLibrary; */ public class FrontierGuide extends CardImpl { - private static final FilterBasicLandCard filter = new FilterBasicLandCard(); - public FrontierGuide(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add("Elf"); this.subtype.add("Scout"); this.power = new MageInt(1); this.toughness = new MageInt(1); + //{3}{G}, {T}: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true), new ManaCostsImpl("{3}{G}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java index a5bd26e902c..50615d70931 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java +++ b/Mage.Sets/src/mage/cards/g/GarrukCallerOfBeasts.java @@ -69,7 +69,7 @@ public class GarrukCallerOfBeasts extends CardImpl { this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Reveal the top 5 cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard(), Zone.LIBRARY), 1)); + this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("creature cards"), Zone.LIBRARY), 1)); // -3: You may put a green creature card from your hand onto the battlefield. this.addAbility(new LoyaltyAbility(new PutPermanentOnBattlefieldEffect(filterGreenCreature), -3)); diff --git a/Mage.Sets/src/mage/cards/g/GraveRobbers.java b/Mage.Sets/src/mage/cards/g/GraveRobbers.java index 6b481d13a9b..57933c75986 100644 --- a/Mage.Sets/src/mage/cards/g/GraveRobbers.java +++ b/Mage.Sets/src/mage/cards/g/GraveRobbers.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCardInGraveyard; public class GraveRobbers extends CardImpl { public GraveRobbers(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("Rogue"); this.power = new MageInt(1); @@ -58,7 +58,7 @@ public class GraveRobbers extends CardImpl { // {B}, {tap}: Exile target artifact card from a graveyard. You gain 2 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{B}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCardInGraveyard(new FilterArtifactCard())); + ability.addTarget(new TargetCardInGraveyard(new FilterArtifactCard("artifact card from your graveyard"))); ability.addEffect(new GainLifeEffect(2)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KuldothaForgemaster.java b/Mage.Sets/src/mage/cards/k/KuldothaForgemaster.java index 0309e51fa8c..65d6984aaaf 100644 --- a/Mage.Sets/src/mage/cards/k/KuldothaForgemaster.java +++ b/Mage.Sets/src/mage/cards/k/KuldothaForgemaster.java @@ -48,11 +48,8 @@ import mage.target.common.TargetControlledPermanent; */ public class KuldothaForgemaster extends CardImpl { - private static final FilterArtifactCard filterArtifactCard = new FilterArtifactCard(); - private static final FilterControlledArtifactPermanent filterArtifactPermanent = new FilterControlledArtifactPermanent("three artifacts you control"); - public KuldothaForgemaster(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); this.subtype.add("Construct"); this.power = new MageInt(3); @@ -60,9 +57,9 @@ public class KuldothaForgemaster extends CardImpl { // {T}, Sacrifice three artifacts: Search your library for an artifact card and put it onto the battlefield. Then shuffle your library. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterArtifactCard)), + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterArtifactCard())), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, filterArtifactPermanent, false))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent("three artifacts you control"), false))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/l/LumengridSentinel.java b/Mage.Sets/src/mage/cards/l/LumengridSentinel.java index 687d7e96668..7dae06a3ddf 100644 --- a/Mage.Sets/src/mage/cards/l/LumengridSentinel.java +++ b/Mage.Sets/src/mage/cards/l/LumengridSentinel.java @@ -36,11 +36,8 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.TargetPermanent; /** @@ -48,14 +45,9 @@ import mage.target.TargetPermanent; * @author fireshoes */ public class LumengridSentinel extends CardImpl { - - private static final FilterPermanent filter = new FilterArtifactPermanent("an artifact"); - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } public LumengridSentinel(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.subtype.add("Human"); this.subtype.add("Wizard"); this.power = new MageInt(1); @@ -63,9 +55,9 @@ public class LumengridSentinel extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Whenever an artifact enters the battlefield under your control, you may tap target permanent. - Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect(), filter, true); + Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new FilterControlledArtifactPermanent("an artifact"), true); ability.addTarget(new TargetPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/Mulch.java b/Mage.Sets/src/mage/cards/m/Mulch.java index e488ee7fbe1..e09da43dca1 100644 --- a/Mage.Sets/src/mage/cards/m/Mulch.java +++ b/Mage.Sets/src/mage/cards/m/Mulch.java @@ -45,7 +45,7 @@ public class Mulch extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // Reveal the top four cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. - this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(4, new FilterLandCard(), Zone.GRAVEYARD)); + this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(4, new FilterLandCard("land cards"), Zone.GRAVEYARD)); } public Mulch(final Mulch card) { diff --git a/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java b/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java index e6ab8e70ac1..61e5cdb019f 100644 --- a/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java +++ b/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java @@ -42,7 +42,6 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterArtifactCard; import mage.game.Game; import mage.players.Player; @@ -53,13 +52,14 @@ import mage.players.Player; public class NeurokFamiliar extends CardImpl { public NeurokFamiliar(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("Bird"); this.power = new MageInt(1); this.toughness = new MageInt(1); // Flying this.addAbility(FlyingAbility.getInstance()); + // When Neurok Familiar enters the battlefield, reveal the top card of your library. If it's an artifact card, put it into your hand. Otherwise, put it into your graveyard. this.addAbility(new EntersBattlefieldTriggeredAbility(new NeurokFamiliarEffect())); } @@ -76,8 +76,6 @@ public class NeurokFamiliar extends CardImpl { class NeurokFamiliarEffect extends OneShotEffect { - private static final FilterArtifactCard filterPutInHand = new FilterArtifactCard("artifact card to put in hand"); - public NeurokFamiliarEffect() { super(Outcome.DrawCard); this.staticText = "Reveal the top card of your library. If it's an artifact card, put it into your hand. Otherwise, put it into your graveyard."; diff --git a/Mage.Sets/src/mage/cards/o/OxiddaScrapmelter.java b/Mage.Sets/src/mage/cards/o/OxiddaScrapmelter.java index 42814c8842a..fd62ac9a125 100644 --- a/Mage.Sets/src/mage/cards/o/OxiddaScrapmelter.java +++ b/Mage.Sets/src/mage/cards/o/OxiddaScrapmelter.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.o; import mage.constants.CardType; @@ -45,21 +44,21 @@ import mage.filter.common.FilterArtifactPermanent; * @author Loki, North */ public class OxiddaScrapmelter extends CardImpl { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact"); - public OxiddaScrapmelter (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); + public OxiddaScrapmelter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.subtype.add("Beast"); this.power = new MageInt(3); this.toughness = new MageInt(3); + // When Oxidda Scrapmelter enters the battlefield, destroy target artifact. Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); - ability.addTarget(new TargetPermanent(filter)); + ability.addTarget(new TargetPermanent(new FilterArtifactPermanent())); this.addAbility(ability); } - public OxiddaScrapmelter (final OxiddaScrapmelter card) { + public OxiddaScrapmelter(final OxiddaScrapmelter card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/q/QuicksmithGenius.java b/Mage.Sets/src/mage/cards/q/QuicksmithGenius.java index 699e889bfee..dd94a0e0afb 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksmithGenius.java +++ b/Mage.Sets/src/mage/cards/q/QuicksmithGenius.java @@ -36,11 +36,8 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledArtifactPermanent; /** * @@ -48,14 +45,8 @@ import mage.filter.predicate.permanent.ControllerPredicate; */ public class QuicksmithGenius extends CardImpl { - private static final FilterPermanent filter = new FilterArtifactPermanent("an artifact"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - public QuicksmithGenius(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.subtype.add("Human"); this.subtype.add("Artificer"); this.power = new MageInt(3); @@ -63,7 +54,7 @@ public class QuicksmithGenius extends CardImpl { // Whenever an artifact enters the battlefield under your control, you may discard a card. If you do, draw a card. this.addAbility(new EntersBattlefieldAllTriggeredAbility( - Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new DiscardCardCost()), filter, true)); + Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new DiscardCardCost()), new FilterControlledArtifactPermanent("an artifact"), true, null, true)); } public QuicksmithGenius(final QuicksmithGenius card) { diff --git a/Mage.Sets/src/mage/cards/q/QuicksmithRebel.java b/Mage.Sets/src/mage/cards/q/QuicksmithRebel.java index e75e24e1a87..4368886e967 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksmithRebel.java +++ b/Mage.Sets/src/mage/cards/q/QuicksmithRebel.java @@ -41,10 +41,8 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -54,12 +52,6 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class QuicksmithRebel extends CardImpl { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - public QuicksmithRebel(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); @@ -76,7 +68,7 @@ public class QuicksmithRebel extends CardImpl { new SourceOnBattlefieldControlUnchangedCondition(), "target artifact you control gains \"{T}: This artifact deals 2 damage to target creature or player\" for as long as you control {this}"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); - ability.addTarget(new TargetPermanent(filter)); + ability.addTarget(new TargetPermanent(new FilterControlledArtifactPermanent())); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/q/QuicksmithSpy.java b/Mage.Sets/src/mage/cards/q/QuicksmithSpy.java index 9dec163dd13..b32cd993015 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksmithSpy.java +++ b/Mage.Sets/src/mage/cards/q/QuicksmithSpy.java @@ -37,16 +37,12 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; -import mage.target.Target; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.TargetPermanent; /** @@ -55,12 +51,6 @@ import mage.target.TargetPermanent; */ public class QuicksmithSpy extends CardImpl { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - public QuicksmithSpy(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); @@ -76,7 +66,7 @@ public class QuicksmithSpy extends CardImpl { new SourceOnBattlefieldControlUnchangedCondition(), "target artifact you control gains \"{T}: Draw a card\" for as long as you control {this}"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); - ability.addTarget(new TargetPermanent(filter)); + ability.addTarget(new TargetPermanent(new FilterControlledArtifactPermanent())); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SalvageSlasher.java b/Mage.Sets/src/mage/cards/s/SalvageSlasher.java index 6d691405d84..63aad93ea1f 100644 --- a/Mage.Sets/src/mage/cards/s/SalvageSlasher.java +++ b/Mage.Sets/src/mage/cards/s/SalvageSlasher.java @@ -55,7 +55,7 @@ public class SalvageSlasher extends CardImpl { this.toughness = new MageInt(1); // Salvage Slasher gets +1/+0 for each artifact card in your graveyard. - BoostSourceEffect effect = new BoostSourceEffect(new CardsInControllerGraveyardCount(new FilterArtifactCard("artifact card")), + BoostSourceEffect effect = new BoostSourceEffect(new CardsInControllerGraveyardCount(new FilterArtifactCard()), new StaticValue(0), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/s/SalvageTitan.java b/Mage.Sets/src/mage/cards/s/SalvageTitan.java index acf879a3b8d..8ff401cd3ef 100644 --- a/Mage.Sets/src/mage/cards/s/SalvageTitan.java +++ b/Mage.Sets/src/mage/cards/s/SalvageTitan.java @@ -51,23 +51,18 @@ import mage.target.common.TargetControlledPermanent; */ public class SalvageTitan extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("three artifacts"); - static{ - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public SalvageTitan(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add("Golem"); this.power = new MageInt(6); this.toughness = new MageInt(4); // You may sacrifice three artifacts rather than pay Salvage Titan's mana cost. - this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent(), true)))); + this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent("three artifacts"), true)))); // Exile three artifact cards from your graveyard: Return Salvage Titan from your graveyard to your hand. - this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(3, new FilterArtifactCard())))); + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(3, new FilterArtifactCard("artifact cards"))))); } public SalvageTitan(final SalvageTitan card) { diff --git a/Mage.Sets/src/mage/cards/s/ScrapyardSalvo.java b/Mage.Sets/src/mage/cards/s/ScrapyardSalvo.java index 6182065c6f4..99216ead910 100644 --- a/Mage.Sets/src/mage/cards/s/ScrapyardSalvo.java +++ b/Mage.Sets/src/mage/cards/s/ScrapyardSalvo.java @@ -42,14 +42,11 @@ import mage.target.TargetPlayer; */ public class ScrapyardSalvo extends CardImpl { - private static final FilterArtifactCard filter = new FilterArtifactCard("artifact cards"); - public ScrapyardSalvo(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(new CardsInControllerGraveyardCount(filter))); + this.getSpellAbility().addEffect(new DamageTargetEffect(new CardsInControllerGraveyardCount(new FilterArtifactCard()))); } public ScrapyardSalvo(final ScrapyardSalvo card) { diff --git a/Mage.Sets/src/mage/cards/s/ShimmerMyr.java b/Mage.Sets/src/mage/cards/s/ShimmerMyr.java index efb2cc0692c..910276e6618 100644 --- a/Mage.Sets/src/mage/cards/s/ShimmerMyr.java +++ b/Mage.Sets/src/mage/cards/s/ShimmerMyr.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.s; import java.util.UUID; @@ -46,22 +45,20 @@ import mage.filter.common.FilterArtifactCard; */ public class ShimmerMyr extends CardImpl { - private static final FilterArtifactCard filter = new FilterArtifactCard("artifact cards"); - - public ShimmerMyr (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); + public ShimmerMyr(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.subtype.add("Myr"); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // Flash this.addAbility(FlashAbility.getInstance()); - + // You may cast artifact cards as though they had flash. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashAllEffect(Duration.WhileOnBattlefield, filter, false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashAllEffect(Duration.WhileOnBattlefield, new FilterArtifactCard("artifact cards"), false))); } - public ShimmerMyr (final ShimmerMyr card) { + public ShimmerMyr(final ShimmerMyr card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java b/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java index bbe00c398d5..c25baaa0997 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretTheSchemer.java @@ -51,12 +51,10 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterArtifactPermanent; import mage.filter.common.FilterControlledArtifactPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.command.Emblem; import mage.game.permanent.token.Token; -import mage.target.common.TargetArtifactPermanent; +import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; /** @@ -64,8 +62,6 @@ import mage.target.common.TargetCreaturePermanent; */ public class TezzeretTheSchemer extends CardImpl { - final static FilterControlledArtifactPermanent filter = new FilterControlledArtifactPermanent("artifacts you control"); - public TezzeretTheSchemer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}"); this.subtype.add("Tezzeret"); @@ -77,7 +73,7 @@ public class TezzeretTheSchemer extends CardImpl { this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new EtheriumCellToken()), 1)); // -2: Target creature gets +X/-X until end of turn, where X is the number of artifacts you control. - DynamicValue count = new PermanentsOnBattlefieldCount(filter); + DynamicValue count = new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")); Effect effect = new BoostTargetEffect(count, new SignInversionDynamicValue(count), Duration.EndOfTurn); effect.setText("Target creature gets +X/-X until end of turn, where X is the number of artifacts you control"); Ability ability = new LoyaltyAbility(effect, -2); @@ -100,12 +96,6 @@ public class TezzeretTheSchemer extends CardImpl { class TezzeretTheSchemerEmblem extends Emblem { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - public TezzeretTheSchemerEmblem() { this.setName("Emblem Tezzeret"); @@ -115,8 +105,7 @@ class TezzeretTheSchemerEmblem extends Emblem { effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability.addEffect(effect); - ability.addTarget(new TargetArtifactPermanent(filter)); - + ability.addTarget(new TargetPermanent(new FilterControlledArtifactPermanent())); this.getAbilities().add(ability); } } diff --git a/Mage.Sets/src/mage/cards/t/TidalCourier.java b/Mage.Sets/src/mage/cards/t/TidalCourier.java index 36ac0dd5f91..5deed7bce74 100644 --- a/Mage.Sets/src/mage/cards/t/TidalCourier.java +++ b/Mage.Sets/src/mage/cards/t/TidalCourier.java @@ -39,7 +39,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.EnvoyEffect; +import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -56,16 +56,16 @@ public class TidalCourier extends CardImpl { } public TidalCourier(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add("Merfolk"); this.power = new MageInt(1); this.toughness = new MageInt(2); // When Tidal Courier enters the battlefield, reveal the top four cards of your library. Put all Merfolk cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new RevealLibraryPutIntoHandEffect(4, filter, Zone.LIBRARY))); // {3}{U}: Tidal Courier gains flying until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), - Duration.EndOfTurn), new ManaCostsImpl("{3}{U}"))); + Duration.EndOfTurn), new ManaCostsImpl("{3}{U}"))); } public TidalCourier(final TidalCourier card) { diff --git a/Mage.Sets/src/mage/cards/t/Tinker.java b/Mage.Sets/src/mage/cards/t/Tinker.java index 9fa2b0a4a52..853254ef9f5 100644 --- a/Mage.Sets/src/mage/cards/t/Tinker.java +++ b/Mage.Sets/src/mage/cards/t/Tinker.java @@ -34,8 +34,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.filter.common.FilterArtifactCard; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -45,21 +44,14 @@ import mage.target.common.TargetControlledPermanent; */ public class Tinker extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Tinker(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}"); // As an additional cost to cast Tinker, sacrifice an artifact. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); + // Search your library for an artifact card and put that card onto the battlefield. Then shuffle your library. - TargetCardInLibrary target = new TargetCardInLibrary(new FilterArtifactCard()); - this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target)); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterArtifactCard("an artifact card")))); } public Tinker(final Tinker card) { diff --git a/Mage/src/main/java/mage/filter/common/FilterArtifactCard.java b/Mage/src/main/java/mage/filter/common/FilterArtifactCard.java index 6974d29811b..8bc513c69a5 100644 --- a/Mage/src/main/java/mage/filter/common/FilterArtifactCard.java +++ b/Mage/src/main/java/mage/filter/common/FilterArtifactCard.java @@ -39,7 +39,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; public class FilterArtifactCard extends FilterCard { public FilterArtifactCard() { - this("artifact"); + this("artifact card"); } public FilterArtifactCard(String name) {