From f18337557c94f1d4f80cffea8c580753109d9015 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 13 Nov 2012 17:00:34 +0100 Subject: [PATCH] Added FilterControlledLandPermanent and revised affected cards. --- .../sets/alarareborn/FieldmistBorderpost.java | 13 +++-- .../sets/alarareborn/FirewildBorderpost.java | 11 +++- .../sets/alarareborn/MistveinBorderpost.java | 11 +++- .../sets/alarareborn/VeinfireBorderpost.java | 11 +++- .../sets/alarareborn/WildfieldBorderpost.java | 11 +++- .../mage/sets/antiquities/SageOfLatNam.java | 4 +- .../mage/sets/apocalypse/GoblinTrenches.java | 15 ++--- .../mage/sets/apocalypse/OvergrownEstate.java | 16 ++--- .../AkkiBlizzardHerder.java | 9 +-- .../sets/betrayersofkamigawa/AkkiRaider.java | 9 +-- .../betrayersofkamigawa/Floodbringer.java | 14 ++--- .../championsofkamigawa/AkkiAvalanchers.java | 18 +++--- .../championsofkamigawa/BudokaGardener.java | 36 +++++++----- .../championsofkamigawa/FeastOfWorms.java | 16 ++--- .../championsofkamigawa/Frostwielder.java | 19 ++---- .../championsofkamigawa/JoyousRespite.java | 10 ++-- .../KumanoMasterYamabushi.java | 9 --- .../championsofkamigawa/KumanosPupils.java | 8 +-- .../MelokuTheCloudedMirror.java | 16 +++-- .../SoratamiCloudskater.java | 17 +++--- .../SoratamiMirrorGuard.java | 7 +-- .../SoratamiMirrorMage.java | 17 +++--- .../SoratamiRainshaper.java | 14 ++--- .../championsofkamigawa/SoratamiSavant.java | 13 ++--- .../championsofkamigawa/SoratamiSeer.java | 16 ++--- .../championsofkamigawa/StrengthOfCedars.java | 18 +++--- .../mage/sets/conflux/GoblinRazerunners.java | 16 ++--- .../sets/conflux/KnightOfTheReliquary.java | 7 ++- .../mage/sets/darksteel/ArcaneSpyglass.java | 13 ++--- .../src/mage/sets/darksteel/Tanglewalker.java | 4 +- .../mage/sets/dissension/AzoriusChancery.java | 12 ++-- .../mage/sets/dissension/RakdosCarnarium.java | 12 ++-- .../sets/dissension/SimicGrowthChamber.java | 12 ++-- .../sets/eventide/NoggleBridgebreaker.java | 11 ++-- .../src/mage/sets/fifthedition/Karma.java | 8 +-- .../sets/guildpact/DuneBroodNephilim.java | 10 ++-- .../mage/sets/guildpact/GruulGuildmage.java | 11 ++-- .../mage/sets/guildpact/IzzetBoilerworks.java | 17 +++--- .../mage/sets/guildpact/OrzhovBasilica.java | 18 +++--- .../mage/sets/magic2010/YawningFissure.java | 10 +--- .../mage/sets/magic2011/DestructiveForce.java | 16 ++--- .../mage/sets/magic2012/BountifulHarvest.java | 11 ++-- .../sets/magic2012/GarrukPrimalHunter.java | 17 +++--- .../src/mage/sets/magic2012/Smallpox.java | 22 +++---- .../sets/mercadianmasques/RishadanPort.java | 10 +--- .../mage/sets/morningtide/ShardVolley.java | 12 ++-- .../mage/sets/planechase/BorosGarrison.java | 20 ++++--- .../src/mage/sets/planechase/GruulTurf.java | 8 +-- .../sets/planechase2012/DimirAqueduct.java | 2 +- .../planechase2012/SelesnyaSanctuary.java | 2 +- .../src/mage/sets/prophecy/AgentOfShauku.java | 10 +--- .../src/mage/sets/prophecy/BogGlider.java | 19 +++--- .../mage/sets/prophecy/CoastalHornclaw.java | 10 +--- .../mage/sets/prophecy/HazyHomunculus.java | 4 +- .../src/mage/sets/ravnika/DimirAqueduct.java | 15 ++--- .../src/mage/sets/ravnika/GolgariRotFarm.java | 13 ++--- .../mage/sets/ravnika/SelesnyaSanctuary.java | 13 ++--- .../mage/sets/riseoftheeldrazi/Deprive.java | 11 ++-- .../saviorsofkamigawa/OboroBreezecaller.java | 16 +++-- .../sets/seventhedition/SeismicAssault.java | 8 +-- .../mage/sets/shadowmoor/ElsewhereFlask.java | 10 ++-- .../src/mage/sets/tempest/ReflectingPool.java | 14 ++--- .../mage/sets/tenth/MolimoMaroSorcerer.java | 12 ++-- .../mage/sets/urzaslegacy/CropRotation.java | 9 +-- .../src/mage/sets/urzassaga/RainOfSalt.java | 10 ++-- .../src/mage/sets/urzassaga/Wildfire.java | 8 +-- .../sets/worldwake/AvengerOfZendikar.java | 15 ++--- .../src/mage/sets/worldwake/VaporSnare.java | 16 ++--- Mage.Sets/src/mage/sets/zendikar/Harrow.java | 6 +- .../src/mage/sets/zendikar/KhalniGem.java | 9 +-- .../src/mage/sets/zendikar/MagmaRift.java | 12 ++-- .../mage/sets/zendikar/RuinousMinotaur.java | 8 +-- .../src/mage/sets/zendikar/ScytheTiger.java | 11 ++-- .../common/FilterControlledLandPermanent.java | 58 +++++++++++++++++++ 74 files changed, 441 insertions(+), 515 deletions(-) create mode 100644 Mage/src/mage/filter/common/FilterControlledLandPermanent.java diff --git a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java index f595c1f62a..02b5c27989 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -50,14 +50,13 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class FieldmistBorderpost extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); - + + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Fieldmist Borderpost's mana cost"; static { filter.add(new SupertypePredicate("Basic")); - filter.add(new CardTypePredicate(CardType.LAND)); } public FieldmistBorderpost (UUID ownerId) { @@ -65,9 +64,15 @@ public class FieldmistBorderpost extends CardImpl { this.expansionSetCode = "ARB"; this.color.setWhite(true); this.color.setBlue(true); + + // You may pay {1} and return a basic land you control to its owner's hand rather than pay Fieldmist Borderpost's mana cost. Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); + + // Fieldmist Borderpost enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // Tap: Add {W} or {U} to your mana pool. this.addAbility(new WhiteManaAbility()); this.addAbility(new BlueManaAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java index 05c37150f2..5d71276e09 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -50,14 +50,13 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class FirewildBorderpost extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Firewild Borderpost's mana cost"; static { filter.add(new SupertypePredicate("Basic")); - filter.add(new CardTypePredicate(CardType.LAND)); } public FirewildBorderpost (UUID ownerId) { @@ -65,9 +64,15 @@ public class FirewildBorderpost extends CardImpl { this.expansionSetCode = "ARB"; this.color.setRed(true); this.color.setGreen(true); + + // You may pay {1} and return a basic land you control to its owner's hand rather than pay Firewild Borderpost's mana cost. Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); + + // Veinfire Firewild enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // Tap: Add {R} or {G} to your mana pool. this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java index 79653ccadf..2d23913e63 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -50,14 +50,13 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class MistveinBorderpost extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpos's mana cost"; static { filter.add(new SupertypePredicate("Basic")); - filter.add(new CardTypePredicate(CardType.LAND)); } public MistveinBorderpost (UUID ownerId) { @@ -65,9 +64,15 @@ public class MistveinBorderpost extends CardImpl { this.expansionSetCode = "ARB"; this.color.setBlue(true); this.color.setBlack(true); + + // You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpost's mana cost. Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); + + // Mistvein Borderpost enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // Tap: Add {U} or {B} to your mana pool. this.addAbility(new BlueManaAbility()); this.addAbility(new BlackManaAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java index bd4971d26b..0e1e2d1f9a 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -50,14 +50,13 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class VeinfireBorderpost extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Veinfire Borderpost's mana cost"; static { filter.add(new SupertypePredicate("Basic")); - filter.add(new CardTypePredicate(CardType.LAND)); } public VeinfireBorderpost (UUID ownerId) { @@ -65,9 +64,15 @@ public class VeinfireBorderpost extends CardImpl { this.expansionSetCode = "ARB"; this.color.setBlack(true); this.color.setRed(true); + + // You may pay {1} and return a basic land you control to its owner's hand rather than pay Veinfire Borderpost's mana cost. Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); + + // Veinfire Borderpost enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // Tap: Add {B} or {R} to your mana pool. this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java index 7714f2d634..2877d254d4 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -50,14 +50,13 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class WildfieldBorderpost extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Wildfield Borderpost's mana cost"; static { filter.add(new SupertypePredicate("Basic")); - filter.add(new CardTypePredicate(CardType.LAND)); } public WildfieldBorderpost (UUID ownerId) { @@ -65,9 +64,15 @@ public class WildfieldBorderpost extends CardImpl { this.expansionSetCode = "ARB"; this.color.setGreen(true); this.color.setWhite(true); + + // You may pay {1} and return a basic land you control to its owner's hand rather than pay Wildfield Borderpost's mana cost. Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION); this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost)); + + // Wildfield Borderpost enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // {T}: Add {G} or {W} to your mana pool. this.addAbility(new GreenManaAbility()); this.addAbility(new WhiteManaAbility()); } diff --git a/Mage.Sets/src/mage/sets/antiquities/SageOfLatNam.java b/Mage.Sets/src/mage/sets/antiquities/SageOfLatNam.java index de3612d871..c5d085f707 100644 --- a/Mage.Sets/src/mage/sets/antiquities/SageOfLatNam.java +++ b/Mage.Sets/src/mage/sets/antiquities/SageOfLatNam.java @@ -48,7 +48,7 @@ import mage.target.common.TargetControlledPermanent; */ public class SageOfLatNam extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Artifact"); static { @@ -65,7 +65,7 @@ public class SageOfLatNam extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - // {tap}, Sacrifice an artifact: Draw a card. + // {T}, Sacrifice an artifact: Draw a card. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java b/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java index 0bc3585426..fc8f101baf 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java +++ b/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java @@ -28,10 +28,9 @@ package mage.sets.apocalypse; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,8 +38,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -50,18 +49,16 @@ import mage.target.common.TargetControlledPermanent; */ public class GoblinTrenches extends CardImpl { - final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public GoblinTrenches(UUID ownerId) { super(ownerId, 104, "Goblin Trenches", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{W}"); this.expansionSetCode = "APC"; this.color.setRed(true); this.color.setWhite(true); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new GoblinTrenchesToken(), 2), new GenericManaCost(2)); + + // {2}, Sacrifice a land: Put two 1/1 red and white Goblin Soldier creature tokens onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GoblinTrenchesToken(), 2), new GenericManaCost(2)); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java b/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java index e4299af27c..c736f80975 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java +++ b/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java @@ -28,16 +28,15 @@ package mage.sets.apocalypse; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -45,12 +44,7 @@ import mage.target.common.TargetControlledPermanent; */ public class OvergrownEstate extends CardImpl { - - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public OvergrownEstate(UUID ownerId) { super(ownerId, 113, "Overgrown Estate", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{G}{W}"); @@ -58,7 +52,9 @@ public class OvergrownEstate extends CardImpl { this.color.setGreen(true); this.color.setBlack(true); this.color.setWhite(true); - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(3), new SacrificeTargetCost(new TargetControlledPermanent(filter)))); + + // Sacrifice a land: You gain 3 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } public OvergrownEstate(final OvergrownEstate card) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java index e01a4ca32a..3a6a351ad4 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java @@ -28,15 +28,14 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,10 +43,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class AkkiBlizzardHerder extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public AkkiBlizzardHerder(UUID ownerId) { super(ownerId, 91, "Akki Blizzard-Herder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); @@ -57,6 +53,7 @@ public class AkkiBlizzardHerder extends CardImpl { this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); + // When Akki Blizzard-Herder dies, each player sacrifices a land. this.addAbility(new DiesTriggeredAbility(new SacrificeAllEffect(filter))); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiRaider.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiRaider.java index 90f489d0f3..648e98024a 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiRaider.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiRaider.java @@ -29,7 +29,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; import mage.Constants; - import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; @@ -39,8 +38,6 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -52,11 +49,6 @@ import mage.game.permanent.Permanent; */ public class AkkiRaider extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - public AkkiRaider(UUID ownerId) { super(ownerId, 92, "Akki Raider", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "BOK"; @@ -65,6 +57,7 @@ public class AkkiRaider extends CardImpl { this.color.setRed(true); this.power = new MageInt(2); this.toughness = new MageInt(1); + // Whenever a land is put into a graveyard from the battlefield, Akki Raider gets +1/+0 until end of turn. this.addAbility(new AkkiRaiderTriggeredAbility(new BoostSourceEffect(1,0,Duration.EndOfTurn))); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java index f302e3251d..3092ae8123 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java @@ -28,10 +28,9 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -51,11 +50,7 @@ import mage.target.common.TargetLandPermanent; */ public class Floodbringer extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land (return to hand)"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land you control (return to hand)"); public Floodbringer(UUID ownerId) { super(ownerId, 34, "Floodbringer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -66,8 +61,9 @@ public class Floodbringer extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); + // {2}, Return a land you control to its owner's hand: Tap target land. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(2)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(2)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java index 8b46a5e69a..18389d46e3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java @@ -29,18 +29,17 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.ActivateOncePerTurnActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -48,11 +47,7 @@ import mage.target.common.TargetControlledPermanent; */ public class AkkiAvalanchers extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public AkkiAvalanchers(UUID ownerId) { super(ownerId, 151, "Akki Avalanchers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); @@ -62,8 +57,9 @@ public class AkkiAvalanchers extends CardImpl { this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new ActivateOncePerTurnActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter))); - this.addAbility(ability); + + // Sacrifice a land: Akki Avalanchers gets +2/+0 until end of turn. Activate this ability only once each turn. + this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } public AkkiAvalanchers(final AkkiAvalanchers card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java index 7aff14b150..44fafff82c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java @@ -27,9 +27,12 @@ */ package mage.sets.championsofkamigawa; -import mage.Constants; +import java.util.UUID; import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -38,6 +41,7 @@ import mage.abilities.condition.common.FlippedCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyTokenEffect; @@ -45,20 +49,20 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.common.TargetCardInHand; -import java.util.UUID; /** * @author Loki */ public class BudokaGardener extends CardImpl { + public BudokaGardener(UUID ownerId) { super(ownerId, 202, "Budoka Gardener", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.expansionSetCode = "CHK"; @@ -68,10 +72,12 @@ public class BudokaGardener extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); this.flipCard = true; - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BudokaGardenerEffect(), new TapSourceCost()); + + // {T}: You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip Budoka Gardener. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BudokaGardenerEffect(), new TapSourceCost()); ability.addTarget(new TargetCardInHand(new FilterLandCard())); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new DokaiWeaverofLife()), FlippedCondition.getInstance(), ""))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new DokaiWeaverofLife()), FlippedCondition.getInstance(), ""))); } public BudokaGardener(final BudokaGardener card) { @@ -86,8 +92,9 @@ public class BudokaGardener extends CardImpl { } class BudokaGardenerEffect extends OneShotEffect { + BudokaGardenerEffect() { - super(Constants.Outcome.PutLandInPlay); + super(Outcome.PutLandInPlay); staticText = "You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip {this}"; } @@ -99,7 +106,7 @@ class BudokaGardenerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Card c = game.getCard(targetPointer.getFirst(game, source)); if (c != null) { - c.moveToZone(Constants.Zone.BATTLEFIELD, source.getSourceId(), game, false); + c.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); } if (game.getBattlefield().count(DokaiWeaverofLifeToken.filterLands, source.getControllerId(), game) >= 10) { Permanent p = game.getPermanent(source.getSourceId()); @@ -118,6 +125,7 @@ class BudokaGardenerEffect extends OneShotEffect { } class DokaiWeaverofLife extends Token { + DokaiWeaverofLife() { super("Dokai, Weaver of Life", ""); supertype.add("Legendary"); @@ -127,18 +135,17 @@ class DokaiWeaverofLife extends Token { subtype.add("Monk"); power = new MageInt(3); toughness = new MageInt(3); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new DokaiWeaverofLifeToken()), new ManaCostsImpl("{4}{G}{G}")); + + // {4}{G}{G}, {T}: Put an X/X green Elemental creature token onto the battlefield, where X is the number of lands you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DokaiWeaverofLifeToken()), new ManaCostsImpl("{4}{G}{G}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); } } class DokaiWeaverofLifeToken extends Token { - final static FilterControlledPermanent filterLands = new FilterControlledPermanent("lands"); - - static { - filterLands.add(new CardTypePredicate(CardType.LAND)); - } + + final static FilterControlledPermanent filterLands = new FilterControlledLandPermanent("lands you control"); DokaiWeaverofLifeToken() { super("Elemental", "a X/X green Elemental creature token onto the battlefield, where X is the number of lands you control"); @@ -147,7 +154,8 @@ class DokaiWeaverofLifeToken extends Token { subtype.add("Elemental"); power = new MageInt(0); toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filterLands), new PermanentsOnBattlefieldCount(filterLands), Constants.Duration.WhileOnBattlefield))); + DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filterLands); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(controlledLands, controlledLands, Duration.WhileOnBattlefield))); } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java index 76714689b3..a75efc1b0b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java @@ -37,8 +37,8 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -52,12 +52,6 @@ import mage.target.common.TargetLandPermanent; */ public class FeastOfWorms extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent(); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - - public FeastOfWorms (UUID ownerId) { super(ownerId, 216, "Feast of Worms", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); this.expansionSetCode = "CHK"; @@ -101,10 +95,8 @@ class FeastOfWormsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); Player targetPlayer = game.getPlayer(permanent.getControllerId()); - if (targetPlayer != null && permanent != null - && (permanent.getSupertype().get(0).toString().equals("Legendary"))) { - FilterControlledPermanent filter = new FilterControlledPermanent("land to sacrifice"); - filter.add(new CardTypePredicate(CardType.LAND)); + if (targetPlayer != null && permanent != null && (permanent.getSupertype().get(0).toString().equals("Legendary"))) { + FilterPermanent filter = new FilterLandPermanent("land to sacrifice"); filter.add(new ControllerIdPredicate(targetPlayer.getId())); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java index b1c6c0bbfb..e7dbf2a5de 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java @@ -29,7 +29,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Outcome; @@ -43,8 +42,6 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -58,12 +55,6 @@ import mage.watchers.common.DamagedByWatcher; */ public class Frostwielder extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - public Frostwielder(UUID ownerId) { super(ownerId, 167, "Frostwielder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.expansionSetCode = "CHK"; @@ -128,11 +119,11 @@ class FrostwielderEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { - DamagedByWatcher watcher = - (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); - if (watcher != null) - return watcher.damagedCreatures.contains(event.getTargetId()); - } + DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); + if (watcher != null) { + return watcher.damagedCreatures.contains(event.getTargetId()); + } + } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java index 988b9ad0b6..5e5d6575c9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,17 +43,15 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class JoyousRespite extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent(); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public JoyousRespite (UUID ownerId) { super(ownerId, 216, "Joyous Respite", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); this.color.setGreen(true); + + // You gain 1 life for each land you control. this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java index adae10259d..fcbf006fa8 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java @@ -31,7 +31,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Outcome; @@ -45,8 +44,6 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -62,12 +59,6 @@ import mage.watchers.common.DamagedByWatcher; */ public class KumanoMasterYamabushi extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - public KumanoMasterYamabushi(UUID ownerId) { super(ownerId, 176, "Kumano, Master Yamabushi", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java index 8a90e23780..b0dcffb9c3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java @@ -39,8 +39,8 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -55,12 +55,6 @@ import mage.watchers.common.DamagedByWatcher; */ public class KumanosPupils extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - public KumanosPupils(UUID ownerId) { super(ownerId, 177, "Kumano's Pupils", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); this.expansionSetCode = "CHK"; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java index bded380684..b17a280eed 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java @@ -29,10 +29,9 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -41,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -51,11 +50,7 @@ import mage.target.common.TargetControlledPermanent; */ public class MelokuTheCloudedMirror extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public MelokuTheCloudedMirror(UUID ownerId) { super(ownerId, 74, "Meloku the Clouded Mirror", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); @@ -66,8 +61,11 @@ public class MelokuTheCloudedMirror extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new MelokuTheCloudedMirrorToken(), 1), new GenericManaCost(1)); + + // {1}, Return a land you control to its owner's hand: Put a 1/1 blue Illusion creature token with flying onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new MelokuTheCloudedMirrorToken(), 1), new GenericManaCost(1)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java index 5431075d84..c6a55d2ed1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java @@ -29,10 +29,9 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -41,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,11 +49,7 @@ import mage.target.common.TargetControlledPermanent; */ public class SoratamiCloudskater extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public SoratamiCloudskater(UUID ownerId) { super(ownerId, 86, "Soratami Cloudskater", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -64,8 +59,12 @@ public class SoratamiCloudskater extends CardImpl { this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); + + //Flying this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new GenericManaCost(2)); + + // {2}, Return a land you control to its owner's hand: Draw a card, then discard a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new GenericManaCost(2)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java index 50ee45dcb2..8357d2e3f2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java @@ -29,7 +29,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; @@ -42,9 +41,9 @@ import mage.abilities.effects.common.UnblockableTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.Filter; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.PowerPredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,11 +53,10 @@ import mage.target.common.TargetCreaturePermanent; */ public class SoratamiMirrorGuard extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); private final static FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature with power 2 or less"); static { - filter.add(new CardTypePredicate(CardType.LAND)); filterCreature.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); } @@ -73,6 +71,7 @@ public class SoratamiMirrorGuard extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // {2}, Return a land you control to its owner's hand: Target creature with power 2 or less is unblockable this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UnblockableTargetEffect(), new GenericManaCost(2)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java index 5c4ca44112..c8e4ad3437 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java @@ -29,10 +29,9 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -41,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -51,11 +50,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class SoratamiMirrorMage extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("lands you control"); public SoratamiMirrorMage(UUID ownerId) { super(ownerId, 88, "Soratami Mirror-Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); @@ -65,8 +60,12 @@ public class SoratamiMirrorMage extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(1); + + // Flying this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3)); + + // {3}, Return three lands you control to their owner's hand: Return target creature to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(3, 3, filter, false))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java index 6f5840ed7e..8be50469b3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java @@ -29,7 +29,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -42,8 +41,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -52,11 +51,7 @@ import mage.target.common.TargetControlledPermanent; */ public class SoratamiRainshaper extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public SoratamiRainshaper(UUID ownerId) { super(ownerId, 89, "Soratami Rainshaper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); @@ -66,7 +61,11 @@ public class SoratamiRainshaper extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(1); + + // Flying this.addAbility(FlyingAbility.getInstance()); + + // {3}, Return a land you control to its owner's hand: Target creature you control gains shroud until end of turn. (It can't be the target of spells or abilities.) Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(ShroudAbility.getInstance(), Constants.Duration.EndOfTurn), new GenericManaCost(3)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetControlledCreaturePermanent()); @@ -81,5 +80,4 @@ public class SoratamiRainshaper extends CardImpl { public SoratamiRainshaper copy() { return new SoratamiRainshaper(this); } - } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java index ff452ba9da..c4926dc017 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java @@ -29,7 +29,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -41,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -51,11 +50,7 @@ import mage.target.common.TargetControlledPermanent; */ public class SoratamiSavant extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public SoratamiSavant(UUID ownerId) { super(ownerId, 90, "Soratami Savant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); @@ -65,7 +60,11 @@ public class SoratamiSavant extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); + + // Flying this.addAbility(FlyingAbility.getInstance()); + + // {3}, Return a land you control to its owner's hand: Counter target spell unless its controller pays {3}. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(3)), new GenericManaCost(3)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java index 78a2dce4ad..a5d3548b71 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java @@ -29,10 +29,10 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -42,8 +42,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledPermanent; @@ -53,11 +53,7 @@ import mage.target.common.TargetControlledPermanent; */ public class SoratamiSeer extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("lands you control"); public SoratamiSeer(UUID ownerId) { super(ownerId, 91, "Soratami Seer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); @@ -67,8 +63,12 @@ public class SoratamiSeer extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(3); + + // Flying this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SoratamiSeerEffect(), new GenericManaCost(4)); + + // {4}, Return two lands you control to their owner's hand: Discard all the cards in your hand, then draw that many cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoratamiSeerEffect(), new GenericManaCost(4)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(2, 2, filter, false))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java index 4bca368ba0..5568042f49 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java @@ -29,15 +29,15 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,19 +45,17 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki */ public class StrengthOfCedars extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land your control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("lands you control"); public StrengthOfCedars (UUID ownerId) { super(ownerId, 245, "Strength of Cedars", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); this.color.setGreen(true); - this.getSpellAbility().addEffect(new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), - new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfTurn, true)); + + // Target creature gets +X/+X until end of turn, where X is the number of lands you control. + DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filter); + this.getSpellAbility().addEffect(new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java index d7d34e9236..cfcaac92d2 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java @@ -29,10 +29,9 @@ package mage.sets.conflux; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; @@ -44,8 +43,8 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; @@ -54,11 +53,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class GoblinRazerunners extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public GoblinRazerunners (UUID ownerId) { super(ownerId, 64, "Goblin Razerunners", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); @@ -68,9 +64,13 @@ public class GoblinRazerunners extends CardImpl { this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(4); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R}")); + + // {1}{R}, Sacrifice a land: Put a +1/+1 counter on Goblin Razerunners. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R}")); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); + + // At the beginning of your end step, you may have Goblin Razerunners deal damage equal to the number of +1/+1 counters on it to target player. ability = new BeginningOfYourEndStepTriggeredAbility(new DamageTargetEffect(new CountersCount(CounterType.P1P1)), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java index 06f488a2f6..c393853d32 100644 --- a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java +++ b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java @@ -44,10 +44,10 @@ import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -58,10 +58,9 @@ import mage.target.common.TargetControlledPermanent; */ public class KnightOfTheReliquary extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest or Plains"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("Forest or Plains"); static { - filter.add(new CardTypePredicate(CardType.LAND)); filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains"))); } @@ -76,9 +75,11 @@ public class KnightOfTheReliquary extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); + // Knight of the Reliquary gets +1/+1 for each land card in your graveyard. CardsInControllerGraveyardCount value = new CardsInControllerGraveyardCount(new FilterLandCard()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(value, value, Duration.WhileOnBattlefield))); + // {T}, Sacrifice a Forest or Plains: Search your library for a land card, put it onto the battlefield, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); Costs costs = new CostsImpl(); costs.add(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java b/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java index 436f6a13f0..f7278151fe 100644 --- a/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java +++ b/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java @@ -29,7 +29,6 @@ package mage.sets.darksteel; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -43,8 +42,8 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -53,20 +52,20 @@ import mage.target.common.TargetControlledPermanent; */ public class ArcaneSpyglass extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public ArcaneSpyglass (UUID ownerId) { super(ownerId, 93, "Arcane Spyglass", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "DST"; + + // {2}, {T} , Sacrifice a land: Draw a card and put a charge counter on Arcane Spyglass. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance())); this.addAbility(ability); + + // Remove three charge counters from Arcane Spyglass: Draw a card. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3)))); } diff --git a/Mage.Sets/src/mage/sets/darksteel/Tanglewalker.java b/Mage.Sets/src/mage/sets/darksteel/Tanglewalker.java index 82171e6965..2ef7fa00ec 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Tanglewalker.java +++ b/Mage.Sets/src/mage/sets/darksteel/Tanglewalker.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.UnblockableAllEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; /** @@ -49,11 +50,10 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class Tanglewalker extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterLandPermanent(); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); - filter.add(new CardTypePredicate(CardType.LAND)); } public Tanglewalker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java b/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java index e0516a836a..89f36bc1f0 100644 --- a/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java +++ b/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java @@ -28,10 +28,9 @@ package mage.sets.dissension; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -50,11 +49,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class AzoriusChancery extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public AzoriusChancery(UUID ownerId) { super(ownerId, 170, "Azorius Chancery", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); @@ -69,7 +65,7 @@ public class AzoriusChancery extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {W}{U} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 0, 1, 1, 0, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 1, 1, 0, 0, 0), new TapSourceCost())); } public AzoriusChancery(final AzoriusChancery card) { diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java b/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java index 28523838b2..a7de5fec14 100644 --- a/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java +++ b/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java @@ -28,10 +28,9 @@ package mage.sets.dissension; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -49,11 +48,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class RakdosCarnarium extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public RakdosCarnarium(UUID ownerId) { super(ownerId, 178, "Rakdos Carnarium", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); @@ -68,7 +64,7 @@ public class RakdosCarnarium extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {B}{R} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(1, 0, 0, 0, 1, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 0, 1, 0, 0), new TapSourceCost())); } public RakdosCarnarium(final RakdosCarnarium card) { diff --git a/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java b/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java index 2e1605f3c9..176978c433 100644 --- a/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java +++ b/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java @@ -28,10 +28,9 @@ package mage.sets.dissension; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -50,11 +49,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class SimicGrowthChamber extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public SimicGrowthChamber(UUID ownerId) { super(ownerId, 180, "Simic Growth Chamber", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); @@ -69,7 +65,7 @@ public class SimicGrowthChamber extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {G}{U} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 1, 1, 0, 0, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 1, 0, 0, 0, 0), new TapSourceCost())); } public SimicGrowthChamber(final SimicGrowthChamber card) { diff --git a/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java b/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java index fedc5ca294..d455268440 100644 --- a/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java +++ b/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java @@ -28,7 +28,6 @@ package mage.sets.eventide; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; @@ -36,8 +35,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -45,11 +44,7 @@ import mage.target.common.TargetControlledPermanent; */ public class NoggleBridgebreaker extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public NoggleBridgebreaker(UUID ownerId) { super(ownerId, 107, "Noggle Bridgebreaker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U/R}{U/R}"); @@ -60,6 +55,8 @@ public class NoggleBridgebreaker extends CardImpl { this.color.setBlue(true); this.power = new MageInt(4); this.toughness = new MageInt(3); + + // When Noggle Bridgebreaker enters the battlefield, return a land you control to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); ability.addTarget(new TargetControlledPermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/fifthedition/Karma.java b/Mage.Sets/src/mage/sets/fifthedition/Karma.java index 931dd1e16e..67d6d5616c 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Karma.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Karma.java @@ -28,19 +28,16 @@ package mage.sets.fifthedition; import java.util.UUID; -import javax.smartcardio.CardTerminal; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -75,9 +72,8 @@ public class Karma extends CardImpl { class KarmaDamageTargetEffect extends OneShotEffect{ - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Swamps"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("Swamps"); static{ - filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SubtypePredicate("Swamp")); } diff --git a/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java b/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java index 377987d118..1acb1b9ab8 100644 --- a/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java +++ b/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java @@ -35,8 +35,8 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; /** @@ -44,11 +44,7 @@ import mage.game.permanent.token.Token; */ public class DuneBroodNephilim extends CardImpl { - final static FilterControlledPermanent filterLands = new FilterControlledPermanent("land you control"); - - static { - filterLands.add(new CardTypePredicate(CardType.LAND)); - } + final static FilterControlledPermanent filterLands = new FilterControlledLandPermanent(); public DuneBroodNephilim(UUID ownerId) { super(ownerId, 110, "Dune-Brood Nephilim", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{R}{G}{W}"); @@ -60,6 +56,8 @@ public class DuneBroodNephilim extends CardImpl { this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(3); + + // Whenever Dune-Brood Nephilim deals combat damage to a player, put a 1/1 colorless Sand creature token onto the battlefield for each land you control. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new CreateTokenEffect(new DuneBroodNephilimToken(), new PermanentsOnBattlefieldCount(filterLands)), false)); } diff --git a/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java b/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java index 12bede32e5..f8d8bb176f 100644 --- a/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java +++ b/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,11 +50,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class GruulGuildmage extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public GruulGuildmage(UUID ownerId) { super(ownerId, 144, "Gruul Guildmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R/G}{R/G}"); @@ -65,10 +61,13 @@ public class GruulGuildmage extends CardImpl { this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); + + // {3}{R}, Sacrifice a land: Gruul Guildmage deals 2 damage to target player. Ability firstAbility = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{R}")); firstAbility.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); firstAbility.addTarget(new TargetPlayer(1)); this.addAbility(firstAbility); + // {3}{G}: Target creature gets +2/+2 until end of turn. Ability secondAbility = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Constants.Duration.EndOfTurn), new ManaCostsImpl("{3}{G}")); secondAbility.addTarget(new TargetCreaturePermanent()); this.addAbility(secondAbility); diff --git a/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java b/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java index 0c4593527e..b1584cfd99 100644 --- a/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java +++ b/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java @@ -28,9 +28,9 @@ package mage.sets.guildpact; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -49,22 +49,23 @@ import mage.target.common.TargetControlledPermanent; */ public class IzzetBoilerworks extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(Constants.CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public IzzetBoilerworks(UUID ownerId) { super(ownerId, 159, "Izzet Boilerworks", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "GPT"; + + // Izzet Boilerworks enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Izzet Boilerworks enters the battlefield, return a land you control to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); Target target = new TargetControlledPermanent(filter); target.setRequired(true); ability.addTarget(target); this.addAbility(ability); - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(1, 0, 1, 0, 0, 0, 0), new TapSourceCost())); + // {T}: Add {U}{R} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 1, 0, 0, 0, 0), new TapSourceCost())); } public IzzetBoilerworks(final IzzetBoilerworks card) { diff --git a/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java b/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java index 05a378dfc7..31749b3d83 100644 --- a/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java +++ b/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java @@ -28,9 +28,9 @@ package mage.sets.guildpact; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -50,22 +50,24 @@ import mage.target.common.TargetControlledPermanent; */ public class OrzhovBasilica extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(Constants.CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public OrzhovBasilica(UUID ownerId) { super(ownerId, 161, "Orzhov Basilica", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "GPT"; + + // Orzhov Basilica enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Orzhov Basilica enters the battlefield, return a land you control to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); Target target = new TargetControlledPermanent(filter); target.setRequired(true); ability.addTarget(target); this.addAbility(ability); - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 0, 0, 1, 1, 0, 0), new TapSourceCost())); + + // {T}: Add {W}{B} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 1, 1, 0, 0), new TapSourceCost())); } public OrzhovBasilica(final OrzhovBasilica card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java index 56178dd2e3..1c7994992c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java +++ b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java @@ -32,13 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; -import mage.Constants.TargetController; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -73,6 +71,8 @@ public class YawningFissure extends CardImpl { class YawningFissureEffect extends OneShotEffect { + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); + public YawningFissureEffect() { super(Outcome.Sacrifice); this.staticText = "Each opponent sacrifices a land"; @@ -89,10 +89,6 @@ class YawningFissureEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - filter.add(new CardTypePredicate(CardType.LAND)); - filter.add(new ControllerPredicate(TargetController.YOU)); - Set opponents = game.getOpponents(source.getControllerId()); for (UUID opponentId : opponents) { Player player = game.getPlayer(opponentId); diff --git a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java index 474ef51097..961530eb19 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java +++ b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java @@ -34,9 +34,10 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,18 +45,19 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class DestructiveForce extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); + private static final FilterControlledPermanent filterLand = new FilterControlledLandPermanent(); + private static final FilterPermanent filterCreature = new FilterCreaturePermanent(); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } public DestructiveForce(UUID ownerId) { super(ownerId, 133, "Destructive Force", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); this.expansionSetCode = "M11"; this.color.setRed(true); - this.getSpellAbility().addEffect(new SacrificeAllEffect(5, filter)); - this.getSpellAbility().addEffect(new DamageAllEffect(5, new FilterCreaturePermanent())); + + // Each player sacrifices five lands. + this.getSpellAbility().addEffect(new SacrificeAllEffect(5, filterLand)); + // Destructive Force deals 5 damage to each creature. + this.getSpellAbility().addEffect(new DamageAllEffect(5, filterCreature)); } public DestructiveForce(final DestructiveForce card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java b/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java index 618fbc9ffa..3a928937e6 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java +++ b/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java @@ -29,30 +29,27 @@ package mage.sets.magic2012; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki */ public class BountifulHarvest extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public BountifulHarvest(UUID ownerId) { super(ownerId, 166, "Bountiful Harvest", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); this.expansionSetCode = "M12"; this.color.setGreen(true); + + // You gain 1 life for each land you control. this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); } diff --git a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java index d1646687a3..d28b30894e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java +++ b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.BeastToken; @@ -56,21 +56,24 @@ import mage.players.Player; * @author Loki */ public class GarrukPrimalHunter extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land your control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - + + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public GarrukPrimalHunter (UUID ownerId) { super(ownerId, 174, "Garruk, Primal Hunter", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}{G}"); this.expansionSetCode = "M12"; this.subtype.add("Garruk"); this.color.setGreen(true); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + + // +1: Put a 3/3 green Beast creature token onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), 1)); + + // -3: Draw cards equal to the greatest power among creatures you control. this.addAbility(new LoyaltyAbility(new GarrukPrimalHunterEffect(), -3)); + + // -6: Put a 6/6 green Wurm creature token onto the battlefield for each land you control. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new WurmToken(), new PermanentsOnBattlefieldCount(filter)), -6)); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java index 731039ed39..0cf9d1f47a 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java +++ b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java @@ -28,16 +28,15 @@ package mage.sets.magic2012; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -72,18 +71,11 @@ public class Smallpox extends CardImpl { class SmallpoxEffect extends OneShotEffect { - private static final FilterPermanent filterCreature = new FilterPermanent("a creature you control"); - private static final FilterPermanent filterLand = new FilterPermanent("a land you control"); - - static { - filterCreature.add(new CardTypePredicate(CardType.CREATURE)); - filterCreature.add(new ControllerPredicate(Constants.TargetController.YOU)); - filterLand.add(new CardTypePredicate(CardType.LAND)); - filterLand.add(new ControllerPredicate(Constants.TargetController.YOU)); - } + private static final FilterPermanent filterCreature = new FilterControlledCreaturePermanent(); + private static final FilterPermanent filterLand = new FilterControlledLandPermanent(); SmallpoxEffect() { - super(Constants.Outcome.DestroyPermanent); + super(Outcome.DestroyPermanent); staticText = "Each player loses 1 life, discards a card, sacrifices a creature, then sacrifices a land"; } @@ -134,7 +126,7 @@ class SmallpoxEffect extends OneShotEffect { Target target = new TargetControlledPermanent(1, 1, filter, false); if (target.canChoose(player.getId(), game)) { while (!target.isChosen() && target.canChoose(player.getId(), game)) { - player.choose(Constants.Outcome.Sacrifice, target, source.getSourceId(), game); + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); } for ( int idx = 0; idx < target.getTargets().size(); idx++) { diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/RishadanPort.java b/Mage.Sets/src/mage/sets/mercadianmasques/RishadanPort.java index 4c163abbf3..46124fe21b 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/RishadanPort.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/RishadanPort.java @@ -38,8 +38,6 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetLandPermanent; /** @@ -48,14 +46,8 @@ import mage.target.common.TargetLandPermanent; */ public class RishadanPort extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("Tap Target Land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - public RishadanPort(UUID ownerId) { - super(ownerId, 324, "Rishadan Port", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + super(ownerId, 324, "Rishadan Port", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "MMQ"; // {tap}: Add {1} to your mana pool. diff --git a/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java b/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java index 79ae27345d..16934ba404 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java +++ b/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -44,17 +44,17 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class ShardVolley extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public ShardVolley(UUID ownerId) { super(ownerId, 103, "Shard Volley", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "MOR"; this.color.setRed(true); + + // As an additional cost to cast Shard Volley, sacrifice a land. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + + // Shard Volley deals 3 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java b/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java index 1002b2eb33..66ab74ae4b 100644 --- a/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java +++ b/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java @@ -28,10 +28,9 @@ package mage.sets.planechase; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,33 +39,36 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; + /** * * @author Loki */ public class BorosGarrison extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public BorosGarrison(UUID ownerId) { super(ownerId, 131, "Boros Garrison", Rarity.COMMON, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "HOP"; + + // Boros Garrison enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Boros Garrison enters the battlefield, return a land you control to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); Target target = new TargetControlledPermanent(filter); target.setRequired(true); ability.addTarget(target); this.addAbility(ability); - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(1, 0, 0, 1, 0, 0, 0), new TapSourceCost())); + + // {T}: Add {R}{W} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 1, 0, 0, 0), new TapSourceCost())); } public BorosGarrison(final BorosGarrison card) { diff --git a/Mage.Sets/src/mage/sets/planechase/GruulTurf.java b/Mage.Sets/src/mage/sets/planechase/GruulTurf.java index b1a2e92b7b..3fb0f24979 100644 --- a/Mage.Sets/src/mage/sets/planechase/GruulTurf.java +++ b/Mage.Sets/src/mage/sets/planechase/GruulTurf.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -49,11 +49,7 @@ import mage.target.common.TargetControlledPermanent; */ public class GruulTurf extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(Constants.CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public GruulTurf(UUID ownerId) { super(ownerId, 134, "Gruul Turf", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); diff --git a/Mage.Sets/src/mage/sets/planechase2012/DimirAqueduct.java b/Mage.Sets/src/mage/sets/planechase2012/DimirAqueduct.java index 909069a3c6..824f6c1660 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/DimirAqueduct.java +++ b/Mage.Sets/src/mage/sets/planechase2012/DimirAqueduct.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author * @author LevelX2 + * @author LevelX2 */ public class DimirAqueduct extends mage.sets.ravnika.DimirAqueduct { diff --git a/Mage.Sets/src/mage/sets/planechase2012/SelesnyaSanctuary.java b/Mage.Sets/src/mage/sets/planechase2012/SelesnyaSanctuary.java index 087840a1c0..5d7b9427e9 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/SelesnyaSanctuary.java +++ b/Mage.Sets/src/mage/sets/planechase2012/SelesnyaSanctuary.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author * @author LevelX2 + * @author LevelX2 */ public class SelesnyaSanctuary extends mage.sets.ravnika.SelesnyaSanctuary { diff --git a/Mage.Sets/src/mage/sets/prophecy/AgentOfShauku.java b/Mage.Sets/src/mage/sets/prophecy/AgentOfShauku.java index 989cdc41cf..6482b3c493 100644 --- a/Mage.Sets/src/mage/sets/prophecy/AgentOfShauku.java +++ b/Mage.Sets/src/mage/sets/prophecy/AgentOfShauku.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,13 +50,9 @@ import mage.target.common.TargetCreaturePermanent; */ public class AgentOfShauku extends CardImpl { - final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); + final static FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - - public AgentOfShauku(UUID ownerId) { + public AgentOfShauku(UUID ownerId) { super(ownerId, 55, "Agent of Shauku", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.expansionSetCode = "PCY"; this.subtype.add("Human"); diff --git a/Mage.Sets/src/mage/sets/prophecy/BogGlider.java b/Mage.Sets/src/mage/sets/prophecy/BogGlider.java index d96ba1bf3c..151ab5cf27 100644 --- a/Mage.Sets/src/mage/sets/prophecy/BogGlider.java +++ b/Mage.Sets/src/mage/sets/prophecy/BogGlider.java @@ -40,9 +40,9 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.Filter.ComparisonType; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreatureCard; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -54,16 +54,15 @@ import mage.target.common.TargetControlledPermanent; */ public class BogGlider extends CardImpl { - final static FilterControlledPermanent landFilter = new FilterControlledPermanent("a land"); + final static FilterControlledPermanent landFilter = new FilterControlledLandPermanent("a land"); private static final FilterCreatureCard filter = new FilterCreatureCard("Mercenary permanent card with converted mana cost 2 or less"); - static { - landFilter.add(new CardTypePredicate(CardType.LAND)); + static { filter.add(new SubtypePredicate("Mercenary")); - filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, 3)); + filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, 3)); } - public BogGlider(UUID ownerId) { + public BogGlider(UUID ownerId) { super(ownerId, 58, "Bog Glider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.expansionSetCode = "PCY"; this.subtype.add("Human"); @@ -72,11 +71,13 @@ public class BogGlider extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // Flying this.addAbility(FlyingAbility.getInstance()); - // {T}, Sacrifice a land: Search your library for a Mercenary permanent card with converted mana cost 2 or less and put it onto the battlefield. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new TapSourceCost()); + + // {T}, Sacrifice a land: Search your library for a Mercenary permanent card with converted mana cost 2 or less and put it onto the battlefield. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(landFilter))); - this.addAbility(ability); + this.addAbility(ability); } public BogGlider(final BogGlider card) { diff --git a/Mage.Sets/src/mage/sets/prophecy/CoastalHornclaw.java b/Mage.Sets/src/mage/sets/prophecy/CoastalHornclaw.java index 2b4e5b91bd..1b0c27f29e 100644 --- a/Mage.Sets/src/mage/sets/prophecy/CoastalHornclaw.java +++ b/Mage.Sets/src/mage/sets/prophecy/CoastalHornclaw.java @@ -37,8 +37,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -48,13 +48,7 @@ import mage.target.common.TargetControlledPermanent; public class CoastalHornclaw extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - - static - { - filter.add(new CardTypePredicate(CardType.LAND)); - } - + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); public CoastalHornclaw(UUID ownerId) { super(ownerId, 31, "Coastal Hornclaw", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); diff --git a/Mage.Sets/src/mage/sets/prophecy/HazyHomunculus.java b/Mage.Sets/src/mage/sets/prophecy/HazyHomunculus.java index 770ea673c1..98df3a821b 100644 --- a/Mage.Sets/src/mage/sets/prophecy/HazyHomunculus.java +++ b/Mage.Sets/src/mage/sets/prophecy/HazyHomunculus.java @@ -39,6 +39,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.UnblockableSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.TappedPredicate; @@ -49,11 +50,10 @@ import mage.filter.predicate.permanent.TappedPredicate; */ public class HazyHomunculus extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterLandPermanent(); static { filter.add(Predicates.not(new TappedPredicate())); - filter.add(new CardTypePredicate(CardType.LAND)); } public HazyHomunculus(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java b/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java index fa4a338ea4..1a609f1de7 100644 --- a/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java +++ b/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java @@ -28,10 +28,9 @@ package mage.sets.ravnika; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -49,12 +48,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class DimirAqueduct extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } - + + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public DimirAqueduct(UUID ownerId) { super(ownerId, 276, "Dimir Aqueduct", Rarity.COMMON, new CardType[]{CardType.LAND}, null); @@ -69,7 +64,7 @@ public class DimirAqueduct extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {U}{B} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 0, 1, 0, 1, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 1, 0, 1, 0, 0), new TapSourceCost())); } public DimirAqueduct(final DimirAqueduct card) { diff --git a/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java b/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java index 6d1e8bb2ea..141b870094 100644 --- a/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java +++ b/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java @@ -26,12 +26,10 @@ * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.ravnika; - import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +38,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -50,11 +48,8 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class GolgariRotFarm extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public GolgariRotFarm(UUID ownerId) { super(ownerId, 278, "Golgari Rot Farm", Rarity.COMMON, new CardType[]{CardType.LAND}, null); @@ -69,7 +64,7 @@ public class GolgariRotFarm extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {B}{G} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 1, 0, 0, 1, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 0, 1, 0, 0), new TapSourceCost())); } public GolgariRotFarm(final GolgariRotFarm card) { diff --git a/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java b/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java index 705c097140..fcc759acaa 100644 --- a/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java +++ b/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java @@ -28,10 +28,9 @@ package mage.sets.ravnika; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -50,11 +49,9 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class SelesnyaSanctuary extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); + public SelesnyaSanctuary(UUID ownerId) { super(ownerId, 281, "Selesnya Sanctuary", Rarity.COMMON, new CardType[]{CardType.LAND}, null); @@ -69,7 +66,7 @@ public class SelesnyaSanctuary extends CardImpl { ability.addTarget(target); this.addAbility(ability); // {tap}: Add {G}{W} to your mana pool. - this.addAbility(new SimpleManaAbility(Constants.Zone.BATTLEFIELD, new Mana(0, 1, 0, 1, 0, 0, 0), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 1, 0, 0, 0), new TapSourceCost())); } public SelesnyaSanctuary(final SelesnyaSanctuary card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java index 6892b16b2a..bf288e9316 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.ReturnToHandTargetCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -45,17 +45,16 @@ import mage.target.common.TargetControlledPermanent; */ public class Deprive extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public Deprive(UUID ownerId) { super(ownerId, 59, "Deprive", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); this.expansionSetCode = "ROE"; this.color.setBlue(true); + // As an additional cost to cast Deprive, return a land you control to its owner's hand. this.getSpellAbility().addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); + + // Counter target spell. this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new CounterTargetEffect()); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java index e27f8210f7..433e38ef17 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java @@ -28,10 +28,9 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -40,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -51,11 +50,7 @@ import mage.target.common.TargetLandPermanent; */ public class OboroBreezecaller extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); public OboroBreezecaller(UUID ownerId) { super(ownerId, 48, "Oboro Breezecaller", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -65,9 +60,12 @@ public class OboroBreezecaller extends CardImpl { this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); + + // Flying this.addAbility(FlyingAbility.getInstance()); + // {2}, Return a land you control to its owner's hand: Untap target land. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new UntapTargetEffect(), new GenericManaCost(2)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new GenericManaCost(2)); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/seventhedition/SeismicAssault.java b/Mage.Sets/src/mage/sets/seventhedition/SeismicAssault.java index 3fdabd79a0..938ce7ec21 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/SeismicAssault.java +++ b/Mage.Sets/src/mage/sets/seventhedition/SeismicAssault.java @@ -37,7 +37,7 @@ import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterLandCard; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCreatureOrPlayer; @@ -47,11 +47,7 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class SeismicAssault extends CardImpl { - private static final FilterCard filter = new FilterCard("land card"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterCard filter = new FilterLandCard(); public SeismicAssault(UUID ownerId) { super(ownerId, 216, "Seismic Assault", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}{R}{R}"); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java b/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java index d42d5c2e4f..538e585037 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java @@ -42,9 +42,8 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.mana.*; import mage.cards.CardImpl; import mage.choices.ChoiceImpl; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -115,6 +114,8 @@ class ElsewhereFlaskEffect extends OneShotEffect { class ElsewhereFlaskContinuousEffect extends ContinuousEffectImpl { + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); + public ElsewhereFlaskContinuousEffect() { super(Constants.Duration.EndOfTurn, Constants.Outcome.Neutral); } @@ -130,9 +131,6 @@ class ElsewhereFlaskContinuousEffect extends ContinuousEffectImpl { super(ownerId, 328, "Reflecting Pool", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "TMP"; - // {tap}: Add to your mana pool one mana of any type that a land you control could produce. + // {T}: Add to your mana pool one mana of any type that a land you control could produce. this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ReflectingPoolEffect(), new TapSourceCost())); } @@ -77,6 +74,8 @@ public class ReflectingPool extends CardImpl { class ReflectingPoolEffect extends ManaEffect { + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); + public ReflectingPoolEffect() { super(); staticText = "Add to your mana pool one mana of any type that a land you control could produce"; @@ -88,9 +87,6 @@ class ReflectingPoolEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { - FilterPermanent filter = new FilterPermanent(); - filter.add(new CardTypePredicate(CardType.LAND)); - filter.add(new ControllerPredicate(TargetController.YOU)); List lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); for (Permanent land : lands) { Abilities mana = land.getAbilities().getManaAbilities(Constants.Zone.BATTLEFIELD); diff --git a/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java b/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java index 9a6f6a9fde..b43e18147c 100644 --- a/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java +++ b/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java @@ -28,7 +28,6 @@ package mage.sets.tenth; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -38,8 +37,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -47,11 +46,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class MolimoMaroSorcerer extends CardImpl { - private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent("lands you control"); public MolimoMaroSorcerer(UUID ownerId) { super(ownerId, 280, "Molimo, Maro-Sorcerer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); @@ -61,7 +56,10 @@ public class MolimoMaroSorcerer extends CardImpl { this.color.setGreen(true); this.power = new MageInt(0); this.toughness = new MageInt(0); + + // Trample this.addAbility(TrampleAbility.getInstance()); + // Molimo, Maro-Sorcerer's power and toughness are each equal to the number of lands you control. this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Constants.Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/CropRotation.java b/Mage.Sets/src/mage/sets/urzaslegacy/CropRotation.java index 60af412933..19c98068f2 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/CropRotation.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/CropRotation.java @@ -34,9 +34,9 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -46,11 +46,7 @@ import mage.target.common.TargetControlledPermanent; */ public class CropRotation extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land."); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public CropRotation(UUID ownerId) { super(ownerId, 98, "Crop Rotation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); @@ -60,6 +56,7 @@ public class CropRotation extends CardImpl { // As an additional cost to cast Crop Rotation, sacrifice a land. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + // Search your library for a land card and put that card onto the battlefield. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterLandCard()), false, Outcome.PutLandInPlay)); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java b/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java index b0797bd645..539d8c6629 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java +++ b/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java @@ -34,7 +34,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterLandPermanent; import mage.target.TargetPermanent; /** @@ -43,16 +43,14 @@ import mage.target.TargetPermanent; */ public class RainOfSalt extends CardImpl { - private final static FilterPermanent filter = new FilterPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private final static FilterPermanent filter = new FilterLandPermanent(); public RainOfSalt(UUID ownerId) { super(ownerId, 206, "Rain of Salt", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); this.expansionSetCode = "USG"; this.color.setRed(true); + + // Destroy two target lands. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(2, filter)); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java b/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java index 0f4c117bbd..1b4a0cf19d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java @@ -33,9 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,11 +43,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class Wildfire extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("land"); public Wildfire(UUID ownerId) { super(ownerId, 228, "Wildfire", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); diff --git a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java index 6dd3430ce9..2a8760bc16 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java +++ b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java @@ -29,7 +29,6 @@ package mage.sets.worldwake; import java.util.UUID; - import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; @@ -40,8 +39,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.cards.CardImpl; import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.PlantToken; @@ -50,14 +50,12 @@ import mage.game.permanent.token.PlantToken; * @author Loki, nantuko, North */ public class AvengerOfZendikar extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Plant creature you control"); - private static final FilterControlledPermanent filterLand = new FilterControlledPermanent("land you control"); + + private static final FilterControlledPermanent filter = new FilterControlledCreaturePermanent("Plant creature you control"); + private static final FilterControlledPermanent filterLand = new FilterControlledLandPermanent(); static { - filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Plant")); - - filterLand.add(new CardTypePredicate(CardType.LAND)); } public AvengerOfZendikar (UUID ownerId) { @@ -69,7 +67,10 @@ public class AvengerOfZendikar extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); + // When Avenger of Zendikar enters the battlefield, put a 0/1 green Plant creature token onto the battlefield for each land you control. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PlantToken(), new PermanentsOnBattlefieldCount(filterLand)), false)); + + // Landfall - Whenever a land enters the battlefield under your control, you may put a +1/+1 counter on each Plant creature you control. this.addAbility(new LandfallAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), true)); } diff --git a/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java b/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java index 68a92256ac..59c78d3e48 100644 --- a/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java +++ b/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java @@ -41,7 +41,6 @@ import mage.abilities.effects.common.continious.ControlEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -62,16 +61,16 @@ public class VaporSnare extends CardImpl { this.color.setBlue(true); // Enchant creature - // You control enchanted creature. - // At the beginning of your upkeep, sacrifice Vapor Snare unless you return a land you control to its owner's hand. - TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // You control enchanted creature. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ControlEnchantedEffect())); - + + // At the beginning of your upkeep, sacrifice Vapor Snare unless you return a land you control to its owner's hand. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new VaporSnareEffect(), Constants.TargetController.YOU, false)); } @@ -87,14 +86,9 @@ public class VaporSnare extends CardImpl { class VaporSnareEffect extends OneShotEffect { - private static final FilterControlledPermanent filter; + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); private static final String effectText = "sacrifice {this} unless you return a land you control to its owner's hand"; - static { - filter = new FilterControlledPermanent("land"); - filter.add(new CardTypePredicate(CardType.LAND)); - } - VaporSnareEffect( ) { super(Constants.Outcome.Sacrifice); staticText = effectText; diff --git a/Mage.Sets/src/mage/sets/zendikar/Harrow.java b/Mage.Sets/src/mage/sets/zendikar/Harrow.java index 9b90e0c2a3..c8ec60546f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Harrow.java +++ b/Mage.Sets/src/mage/sets/zendikar/Harrow.java @@ -36,6 +36,7 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; @@ -47,7 +48,7 @@ import mage.target.common.TargetControlledPermanent; */ public class Harrow extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land."); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); static{ filter.add(new CardTypePredicate(CardType.LAND)); @@ -58,7 +59,10 @@ public class Harrow extends CardImpl { this.expansionSetCode = "ZEN"; this.color.setGreen(true); + // As an additional cost to cast Harrow, sacrifice a land. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + + // Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); } diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java index 62013a77bd..d7540a280b 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.AddManaOfAnyColorEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; @@ -54,12 +54,7 @@ import mage.target.common.TargetControlledPermanent; */ public class KhalniGem extends CardImpl { - private static final FilterControlledPermanent filter; - - static { - filter = new FilterControlledPermanent("land you control"); - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public KhalniGem (UUID ownerId) { super(ownerId, 205, "Khalni Gem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); diff --git a/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java b/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java index f856683e9f..aee1ad77dc 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java +++ b/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -44,19 +44,17 @@ import mage.target.common.TargetCreaturePermanent; */ public class MagmaRift extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public MagmaRift(UUID ownerId) { super(ownerId, 136, "Magma Rift", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "ZEN"; - this.color.setRed(true); + // As an additional cost to cast Magma Rift, sacrifice a land. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + + // Magma Rift deals 5 damage to target creature. this.getSpellAbility().addEffect(new DamageTargetEffect(5)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java index 0fbcdce2f1..883774d9be 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java +++ b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java @@ -35,8 +35,8 @@ import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.common.TargetControlledPermanent; @@ -73,11 +73,7 @@ public class RuinousMinotaur extends CardImpl { class RuinousMinotaurTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); public RuinousMinotaurTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeTargetEffect(), true); diff --git a/Mage.Sets/src/mage/sets/zendikar/ScytheTiger.java b/Mage.Sets/src/mage/sets/zendikar/ScytheTiger.java index 89071e9747..3a64adcd44 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ScytheTiger.java +++ b/Mage.Sets/src/mage/sets/zendikar/ScytheTiger.java @@ -36,8 +36,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -46,6 +46,8 @@ import mage.target.common.TargetControlledPermanent; */ public class ScytheTiger extends CardImpl { + private final static FilterControlledPermanent filter = new FilterControlledLandPermanent(); + public ScytheTiger(UUID ownerId) { super(ownerId, 183, "Scythe Tiger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); this.expansionSetCode = "ZEN"; @@ -55,11 +57,10 @@ public class ScytheTiger extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(2); + // Shroud (This creature can't be the target of spells or abilities.) this.addAbility(ShroudAbility.getInstance()); - // When Scythe Tiger enters the battlefield, sacrifice it unless you - // sacrifice a land. - FilterControlledPermanent filter = new FilterControlledPermanent("a land"); - filter.add(new CardTypePredicate(CardType.LAND)); + + // When Scythe Tiger enters the battlefield, sacrifice it unless you sacrifice a land. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))))); } diff --git a/Mage/src/mage/filter/common/FilterControlledLandPermanent.java b/Mage/src/mage/filter/common/FilterControlledLandPermanent.java new file mode 100644 index 0000000000..075f049db4 --- /dev/null +++ b/Mage/src/mage/filter/common/FilterControlledLandPermanent.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.filter.common; + +import mage.Constants.CardType; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author LevelX2 + */ +public class FilterControlledLandPermanent extends FilterControlledPermanent { + + public FilterControlledLandPermanent() { + this("land you control"); + } + + public FilterControlledLandPermanent(String name) { + super(name); + this.add(new CardTypePredicate(CardType.LAND)); + } + + public FilterControlledLandPermanent(final FilterControlledLandPermanent filter) { + super(filter); + } + + @Override + public FilterControlledLandPermanent copy() { + return new FilterControlledLandPermanent(this); + } + +}