diff --git a/Mage.Sets/src/mage/cards/a/AltarOfBone.java b/Mage.Sets/src/mage/cards/a/AltarOfBone.java index 92fed19760..2b51d51029 100644 --- a/Mage.Sets/src/mage/cards/a/AltarOfBone.java +++ b/Mage.Sets/src/mage/cards/a/AltarOfBone.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; @@ -44,11 +45,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class AltarOfBone extends CardImpl { public AltarOfBone(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{W}"); // As an additional cost to cast Altar of Bone, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true)); } diff --git a/Mage.Sets/src/mage/cards/a/AltarOfDementia.java b/Mage.Sets/src/mage/cards/a/AltarOfDementia.java index c0cd192ae8..44a8dfc255 100644 --- a/Mage.Sets/src/mage/cards/a/AltarOfDementia.java +++ b/Mage.Sets/src/mage/cards/a/AltarOfDementia.java @@ -38,8 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -50,21 +49,15 @@ import mage.target.common.TargetControlledPermanent; * @author jeffwadsworth */ public class AltarOfDementia extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } public AltarOfDementia(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // Sacrifice a creature: Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AltarOfDementiaEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AltarOfDementiaEffect(), new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + } public AltarOfDementia(final AltarOfDementia card) { @@ -78,7 +71,7 @@ public class AltarOfDementia extends CardImpl { } class AltarOfDementiaEffect extends OneShotEffect { - + public AltarOfDementiaEffect() { super(Outcome.Damage); staticText = "Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard"; @@ -93,16 +86,16 @@ class AltarOfDementiaEffect extends OneShotEffect { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { int amount = 0; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); + amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); break; } } if (amount > 0) { player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game); } - return true; + return true; } return false; } @@ -111,4 +104,4 @@ class AltarOfDementiaEffect extends OneShotEffect { public AltarOfDementiaEffect copy() { return new AltarOfDementiaEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/a/AnimalBoneyard.java b/Mage.Sets/src/mage/cards/a/AnimalBoneyard.java index f296f288c6..586fbba00e 100644 --- a/Mage.Sets/src/mage/cards/a/AnimalBoneyard.java +++ b/Mage.Sets/src/mage/cards/a/AnimalBoneyard.java @@ -42,6 +42,7 @@ import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.TargetPermanent; @@ -55,7 +56,7 @@ import mage.target.common.TargetLandPermanent; public class AnimalBoneyard extends CardImpl { public AnimalBoneyard(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.subtype.add(SubType.AURA); // Enchant land @@ -66,7 +67,7 @@ public class AnimalBoneyard extends CardImpl { this.addAbility(ability); // Enchanted land has "{T}, Sacrifice a creature: You gain life equal to that creature's toughness." Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnimalBoneyardEffect(), new TapSourceCost()); - gainedAbility.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + gainedAbility.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted land has \"{T}, Sacrifice a creature: You gain life equal to that creature's toughness.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/a/AshnodsAltar.java b/Mage.Sets/src/mage/cards/a/AshnodsAltar.java index f510471c8e..34f411f48a 100644 --- a/Mage.Sets/src/mage/cards/a/AshnodsAltar.java +++ b/Mage.Sets/src/mage/cards/a/AshnodsAltar.java @@ -35,7 +35,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -45,10 +45,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class AshnodsAltar extends CardImpl { public AshnodsAltar(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Sacrifice a creature: Add {C}{C} to your mana pool. - SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), true)); + SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), cost)); } diff --git a/Mage.Sets/src/mage/cards/a/Attrition.java b/Mage.Sets/src/mage/cards/a/Attrition.java index 3833230b45..f2a50dab60 100644 --- a/Mage.Sets/src/mage/cards/a/Attrition.java +++ b/Mage.Sets/src/mage/cards/a/Attrition.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -56,12 +57,11 @@ public class Attrition extends CardImpl { } public Attrition(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); //{B}, Sacrifice a creature: Destroy target nonblack creature. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BarrageOfExpendables.java b/Mage.Sets/src/mage/cards/b/BarrageOfExpendables.java index 3cc1db9f0c..34c1aa0091 100644 --- a/Mage.Sets/src/mage/cards/b/BarrageOfExpendables.java +++ b/Mage.Sets/src/mage/cards/b/BarrageOfExpendables.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -47,15 +48,14 @@ import mage.target.common.TargetCreatureOrPlayer; public class BarrageOfExpendables extends CardImpl { public BarrageOfExpendables(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}"); // {R}, Sacrifice a creature: Barrage of Expendables deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); - + } public BarrageOfExpendables(final BarrageOfExpendables card) { diff --git a/Mage.Sets/src/mage/cards/b/BirthingPod.java b/Mage.Sets/src/mage/cards/b/BirthingPod.java index cc8bba067d..1b8095c44e 100644 --- a/Mage.Sets/src/mage/cards/b/BirthingPod.java +++ b/Mage.Sets/src/mage/cards/b/BirthingPod.java @@ -43,6 +43,7 @@ import mage.constants.ComparisonType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; @@ -57,13 +58,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class BirthingPod extends CardImpl { public BirthingPod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}{G/P}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}{G/P}"); // {1}{G/P}, {tap}, Sacrifice a creature: Search your library for a creature card with converted mana cost equal to 1 plus the sacrificed creature's converted mana cost, // put that card onto the battlefield, then shuffle your library. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BirthingPodEffect(), new ManaCostsImpl("{1}{G/P}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BlackCarriage.java b/Mage.Sets/src/mage/cards/b/BlackCarriage.java index 1c6908c9af..6022d05991 100644 --- a/Mage.Sets/src/mage/cards/b/BlackCarriage.java +++ b/Mage.Sets/src/mage/cards/b/BlackCarriage.java @@ -42,7 +42,7 @@ import mage.constants.CardType; import mage.constants.PhaseStep; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -65,7 +65,7 @@ public class BlackCarriage extends CardImpl { // Sacrifice a creature: Untap Black Carriage. Activate this ability only during your upkeep. this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new UntapSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))), + new UntapSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), new IsStepCondition(PhaseStep.UPKEEP), "Sacrifice a creature: Untap {this}. Activate this ability only during your upkeep.")); } diff --git a/Mage.Sets/src/mage/cards/b/BlastingStation.java b/Mage.Sets/src/mage/cards/b/BlastingStation.java index 75957e0f8f..84c642e9b2 100644 --- a/Mage.Sets/src/mage/cards/b/BlastingStation.java +++ b/Mage.Sets/src/mage/cards/b/BlastingStation.java @@ -39,6 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -50,11 +51,11 @@ import mage.target.common.TargetCreatureOrPlayer; public class BlastingStation extends CardImpl { public BlastingStation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {tap}, Sacrifice a creature: Blasting Station deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); // Whenever a creature enters the battlefield, you may untap Blasting Station. diff --git a/Mage.Sets/src/mage/cards/b/BlightedShaman.java b/Mage.Sets/src/mage/cards/b/BlightedShaman.java index b25b33d82e..6a886ec22c 100644 --- a/Mage.Sets/src/mage/cards/b/BlightedShaman.java +++ b/Mage.Sets/src/mage/cards/b/BlightedShaman.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,14 +40,13 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author Quercitron @@ -58,9 +58,9 @@ public class BlightedShaman extends CardImpl { static { filterSwamp.add(new SubtypePredicate(SubType.SWAMP)); } - + public BlightedShaman(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.HUMAN, SubType.CLERIC, SubType.SHAMAN); this.power = new MageInt(1); @@ -71,10 +71,10 @@ public class BlightedShaman extends CardImpl { ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filterSwamp))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - + // {tap}, Sacrifice a creature: Target creature gets +2/+2 until end of turn. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodFunnel.java b/Mage.Sets/src/mage/cards/b/BloodFunnel.java index 6118ef717e..2bf389829d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodFunnel.java +++ b/Mage.Sets/src/mage/cards/b/BloodFunnel.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.FilterSpell; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -49,28 +50,28 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author fireshoes */ public class BloodFunnel extends CardImpl { - + private static final FilterCard filter = new FilterCard("Noncreature spells"); private static final FilterSpell filterNoncreature = new FilterSpell("a noncreature spell"); - + static { filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public BloodFunnel(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); // Noncreature spells you cast cost {2} less to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 2))); - + // Whenever you cast a noncreature spell, counter that spell unless you sacrifice a creature. - Effect effect = new CounterUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + Effect effect = new CounterUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); effect.setText("counter that spell unless you sacrifice a creature"); - this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, effect, - filterNoncreature, - false, + filterNoncreature, + false, true)); } @@ -82,4 +83,4 @@ public class BloodFunnel extends CardImpl { public BloodFunnel copy() { return new BloodFunnel(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/b/BloodRites.java b/Mage.Sets/src/mage/cards/b/BloodRites.java index 5ff53b0404..5bc483980d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodRites.java +++ b/Mage.Sets/src/mage/cards/b/BloodRites.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.b; import java.util.UUID; @@ -38,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -45,11 +45,12 @@ import mage.target.common.TargetCreatureOrPlayer; * @author Loki */ public class BloodRites extends CardImpl { + public BloodRites(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{1}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodflowConnoisseur.java b/Mage.Sets/src/mage/cards/b/BloodflowConnoisseur.java index 73d175cacc..a276f54859 100644 --- a/Mage.Sets/src/mage/cards/b/BloodflowConnoisseur.java +++ b/Mage.Sets/src/mage/cards/b/BloodflowConnoisseur.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class BloodflowConnoisseur extends CardImpl { public BloodflowConnoisseur(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(1); @@ -57,7 +58,7 @@ public class BloodflowConnoisseur extends CardImpl { // Sacrifice a creature: Put a +1/+1 counter on Bloodflow Connoisseur. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java b/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java index cb28eea051..353e5985fe 100644 --- a/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java +++ b/Mage.Sets/src/mage/cards/b/BloodshotCyclops.java @@ -39,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -49,7 +50,7 @@ import mage.target.common.TargetCreatureOrPlayer; public class BloodshotCyclops extends CardImpl { public BloodshotCyclops(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}"); this.subtype.add(SubType.CYCLOPS, SubType.GIANT); this.power = new MageInt(4); @@ -60,7 +61,7 @@ public class BloodshotCyclops extends CardImpl { SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodthroneVampire.java b/Mage.Sets/src/mage/cards/b/BloodthroneVampire.java index 85ce17ded8..bd5ccc256d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodthroneVampire.java +++ b/Mage.Sets/src/mage/cards/b/BloodthroneVampire.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * 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.cards.b; import java.util.UUID; @@ -39,6 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,12 +48,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class BloodthroneVampire extends CardImpl { public BloodthroneVampire(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public BloodthroneVampire(final BloodthroneVampire card) { diff --git a/Mage.Sets/src/mage/cards/b/BoneSplinters.java b/Mage.Sets/src/mage/cards/b/BoneSplinters.java index 4ce0bab55f..3570bb5a47 100644 --- a/Mage.Sets/src/mage/cards/b/BoneSplinters.java +++ b/Mage.Sets/src/mage/cards/b/BoneSplinters.java @@ -33,7 +33,7 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -45,10 +45,10 @@ import mage.target.common.TargetCreaturePermanent; public class BoneSplinters extends CardImpl { public BoneSplinters(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); // As an additional cost to cast Bone Splinters, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Destroy target creature. this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)"))); this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature")); diff --git a/Mage.Sets/src/mage/cards/b/BrainGorgers.java b/Mage.Sets/src/mage/cards/b/BrainGorgers.java index 814474978a..3c5fe64156 100644 --- a/Mage.Sets/src/mage/cards/b/BrainGorgers.java +++ b/Mage.Sets/src/mage/cards/b/BrainGorgers.java @@ -41,6 +41,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.stack.Spell; import mage.players.Player; @@ -53,7 +54,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class BrainGorgers extends CardImpl { public BrainGorgers(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(4); this.toughness = new MageInt(2); @@ -95,7 +96,7 @@ class BrainGorgersCounterSourceEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null) { - SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent()); + SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { cost.clearPaid(); Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/b/BrineShaman.java b/Mage.Sets/src/mage/cards/b/BrineShaman.java index 1a36569a76..7187b4e6c1 100644 --- a/Mage.Sets/src/mage/cards/b/BrineShaman.java +++ b/Mage.Sets/src/mage/cards/b/BrineShaman.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -42,14 +43,13 @@ import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterSpell; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author TheElk801 @@ -70,13 +70,15 @@ public class BrineShaman extends CardImpl { this.toughness = new MageInt(1); // {tap}, Sacrifice a creature: Target creature gets +2/+2 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // {1}{U}{U}, Sacrifice a creature: Counter target creature spell. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new ManaCostsImpl("{1}{U}{U}")); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BroodButcher.java b/Mage.Sets/src/mage/cards/b/BroodButcher.java index eacd9c811f..8b3a0f1b3c 100644 --- a/Mage.Sets/src/mage/cards/b/BroodButcher.java +++ b/Mage.Sets/src/mage/cards/b/BroodButcher.java @@ -43,7 +43,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.permanent.token.EldraziScionToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -53,11 +53,9 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class BroodButcher extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature"); public BroodButcher(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); this.subtype.add(SubType.ELDRAZI, SubType.DRONE); this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -70,7 +68,7 @@ public class BroodButcher extends CardImpl { // {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{B}{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BubblingCauldron.java b/Mage.Sets/src/mage/cards/b/BubblingCauldron.java index 59ec77a594..4a523efc66 100644 --- a/Mage.Sets/src/mage/cards/b/BubblingCauldron.java +++ b/Mage.Sets/src/mage/cards/b/BubblingCauldron.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; @@ -52,19 +53,21 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class BubblingCauldron extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature named Festering Newt"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature named Festering Newt"); + static { filter.add(new NamePredicate("Festering Newt")); } + public BubblingCauldron(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // {1}, {T}, Sacrifice a creature: You gain 4 life. Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), new ManaCostsImpl("{1}")); ability1.addCost(new TapSourceCost()); - ability1.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + ability1.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability1); - // {1}, {T}, Sacrifice a creature named Festering Newt: Each opponent loses 4 life. You gain life equal to the life lost this way. + // {1}, {T}, Sacrifice a creature named Festering Newt: Each opponent loses 4 life. You gain life equal to the life lost this way. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BubblingCauldronEffect(), new ManaCostsImpl("{1}")); ability2.addCost(new TapSourceCost()); ability2.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); @@ -95,7 +98,7 @@ class BubblingCauldronEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int damage = 0; - for (UUID opponentId: game.getOpponents(source.getControllerId())) { + for (UUID opponentId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(opponentId); damage += opponent.loseLife(4, game, false); } diff --git a/Mage.Sets/src/mage/cards/b/BurntOffering.java b/Mage.Sets/src/mage/cards/b/BurntOffering.java index 0626baa62c..d9b83c2c5b 100644 --- a/Mage.Sets/src/mage/cards/b/BurntOffering.java +++ b/Mage.Sets/src/mage/cards/b/BurntOffering.java @@ -42,6 +42,7 @@ import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Outcome; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -57,7 +58,7 @@ public class BurntOffering extends CardImpl { super(ownerID, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); //As an additional cost to cast Burnt Offering, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); //Add to your mana pool an amount of {B} and/or {R} equal to the sacrificed creature's converted mana cost. this.getSpellAbility().addEffect(new BurntOfferingEffect()); } diff --git a/Mage.Sets/src/mage/cards/c/CabalPatriarch.java b/Mage.Sets/src/mage/cards/c/CabalPatriarch.java index 2394359f5a..216348901b 100644 --- a/Mage.Sets/src/mage/cards/c/CabalPatriarch.java +++ b/Mage.Sets/src/mage/cards/c/CabalPatriarch.java @@ -42,7 +42,7 @@ import mage.constants.SubType; import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledPermanent; @@ -55,7 +55,7 @@ import mage.target.common.TargetCreaturePermanent; public class CabalPatriarch extends CardImpl { public CabalPatriarch(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); @@ -63,18 +63,18 @@ public class CabalPatriarch extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); - // {2}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. - Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); - TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledCreaturePermanent("a creature")); - ability1.addCost(new SacrificeTargetCost(target)); - ability1.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability1); - + // {2}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); + TargetControlledPermanent target = new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT); + ability1.addCost(new SacrificeTargetCost(target)); + ability1.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability1); + // {2}{B}, Exile a creature card from your graveyard: Target creature gets -2/-2 until end of turn. - Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); - ability2.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card")))); - ability2.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability2); + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); + ability2.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card")))); + ability2.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability2); } public CabalPatriarch(final CabalPatriarch card) { diff --git a/Mage.Sets/src/mage/cards/c/CallForBlood.java b/Mage.Sets/src/mage/cards/c/CallForBlood.java index 7036df8b8b..818e39793a 100644 --- a/Mage.Sets/src/mage/cards/c/CallForBlood.java +++ b/Mage.Sets/src/mage/cards/c/CallForBlood.java @@ -37,9 +37,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,12 +53,11 @@ import mage.target.common.TargetCreaturePermanent; public class CallForBlood extends CardImpl { public CallForBlood(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}"); this.subtype.add(SubType.ARCANE); - // As an additional cost to cast Call for Blood, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Target creature gets -X/-X until end of turn, where X is the sacrificed creature's power. DynamicValue xValue = new CallForBloodDynamicValue(); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)); @@ -76,11 +76,12 @@ public class CallForBlood extends CardImpl { } class CallForBloodDynamicValue implements DynamicValue { + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Card sourceCard = game.getCard(sourceAbility.getSourceId()); if (sourceCard != null) { - for (Object cost: sourceAbility.getCosts()) { + for (Object cost : sourceAbility.getCosts()) { if (cost instanceof SacrificeTargetCost) { Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Zone.BATTLEFIELD); if (p != null) { @@ -106,4 +107,4 @@ class CallForBloodDynamicValue implements DynamicValue { public String toString() { return "-X"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/c/Caregiver.java b/Mage.Sets/src/mage/cards/c/Caregiver.java index 0d14b5be97..8ccac42800 100644 --- a/Mage.Sets/src/mage/cards/c/Caregiver.java +++ b/Mage.Sets/src/mage/cards/c/Caregiver.java @@ -37,10 +37,11 @@ import mage.abilities.effects.common.PreventDamageToTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -51,7 +52,7 @@ import mage.target.common.TargetCreatureOrPlayer; public class Caregiver extends CardImpl { public Caregiver(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); @@ -60,7 +61,7 @@ public class Caregiver extends CardImpl { // {W}, Sacrifice a creature: Prevent the next 1 damage that would be dealt to target creature or player this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new ColoredManaCost(ColoredManaSymbol.W)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CarnageAltar.java b/Mage.Sets/src/mage/cards/c/CarnageAltar.java index 2ab5320a56..56a91a51fe 100644 --- a/Mage.Sets/src/mage/cards/c/CarnageAltar.java +++ b/Mage.Sets/src/mage/cards/c/CarnageAltar.java @@ -36,6 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -45,10 +46,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class CarnageAltar extends CardImpl { public CarnageAltar(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(3)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/Carrion.java b/Mage.Sets/src/mage/cards/c/Carrion.java index 36707992bd..15a835f3ae 100644 --- a/Mage.Sets/src/mage/cards/c/Carrion.java +++ b/Mage.Sets/src/mage/cards/c/Carrion.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.permanent.token.CarrionBlackInsectToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -48,7 +48,7 @@ public class Carrion extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{B}"); // As an additional cost to cast Carrion, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), false))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Put X 0/1 black Insect creature tokens onto the battlefield, where X is the sacrificed creature's power. this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionBlackInsectToken(), new SacrificeCostCreaturesPower())); diff --git a/Mage.Sets/src/mage/cards/c/CarrionFeeder.java b/Mage.Sets/src/mage/cards/c/CarrionFeeder.java index d76daec206..e2ed83634f 100644 --- a/Mage.Sets/src/mage/cards/c/CarrionFeeder.java +++ b/Mage.Sets/src/mage/cards/c/CarrionFeeder.java @@ -39,6 +39,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class CarrionFeeder extends CardImpl { public CarrionFeeder(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(1); @@ -59,7 +60,7 @@ public class CarrionFeeder extends CardImpl { // Sacrifice a creature: Put a +1/+1 counter on Carrion Feeder. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public CarrionFeeder(final CarrionFeeder card) { diff --git a/Mage.Sets/src/mage/cards/c/CateranOverlord.java b/Mage.Sets/src/mage/cards/c/CateranOverlord.java index 79c1725b53..486b59b39a 100644 --- a/Mage.Sets/src/mage/cards/c/CateranOverlord.java +++ b/Mage.Sets/src/mage/cards/c/CateranOverlord.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.c; import java.util.UUID; @@ -43,6 +42,7 @@ import mage.constants.CardType; import mage.constants.ComparisonType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterPermanentCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -59,11 +59,11 @@ public class CateranOverlord extends CardImpl { static { filter.add(new SubtypePredicate(SubType.MERCENARY)); - filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 7)); + filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 7)); } public CateranOverlord(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); this.subtype.add(SubType.HORROR); this.subtype.add(SubType.MERCENARY); @@ -71,7 +71,8 @@ public class CateranOverlord extends CardImpl { this.toughness = new MageInt(5); // Sacrifice a creature: Regenerate Cateran Overlord. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // {6}, {T}: Search your library for a Mercenary permanent card with converted mana cost 6 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()); diff --git a/Mage.Sets/src/mage/cards/c/CollateralDamage.java b/Mage.Sets/src/mage/cards/c/CollateralDamage.java index 351f61d63c..78ad524d54 100644 --- a/Mage.Sets/src/mage/cards/c/CollateralDamage.java +++ b/Mage.Sets/src/mage/cards/c/CollateralDamage.java @@ -33,7 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -44,14 +44,14 @@ import mage.target.common.TargetCreatureOrPlayer; public class CollateralDamage extends CardImpl { public CollateralDamage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}"); // As an additional cost to cast Collateral Damge, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // Collateral Damage deals 3 damage to target creature or player. this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); } public CollateralDamage(final CollateralDamage card) { diff --git a/Mage.Sets/src/mage/cards/c/Contamination.java b/Mage.Sets/src/mage/cards/c/Contamination.java index 165c6a151c..eb38e21c83 100644 --- a/Mage.Sets/src/mage/cards/c/Contamination.java +++ b/Mage.Sets/src/mage/cards/c/Contamination.java @@ -39,7 +39,7 @@ import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -53,10 +53,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Contamination extends CardImpl { public Contamination(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); // At the beginning of your upkeep, sacrifice Contamination unless you sacrifice a creature. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect( + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))), TargetController.YOU, false)); // If a land is tapped for mana, it produces {B} instead of any other type and amount. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContaminationReplacementEffect())); @@ -100,12 +101,11 @@ class ContaminationReplacementEffect extends ReplacementEffectImpl { mana.setToMana(Mana.BlackMana(1)); return false; } - - @Override + + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.TAPPED_FOR_MANA; } - @Override public boolean applies(GameEvent event, Ability source, Game game) { diff --git a/Mage.Sets/src/mage/cards/c/CorpseHarvester.java b/Mage.Sets/src/mage/cards/c/CorpseHarvester.java index 17444dcf11..4634848ace 100644 --- a/Mage.Sets/src/mage/cards/c/CorpseHarvester.java +++ b/Mage.Sets/src/mage/cards/c/CorpseHarvester.java @@ -41,8 +41,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -54,15 +53,9 @@ import mage.target.common.TargetControlledPermanent; * @author jeffwadsworth */ public class CorpseHarvester extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } public CorpseHarvester(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.WIZARD); @@ -72,7 +65,7 @@ public class CorpseHarvester extends CardImpl { // {1}{B}, {tap}, Sacrifice a creature: Search your library for a Zombie card and a Swamp card, reveal them, and put them into your hand. Then shuffle your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CorpseHarvesterEffect(), new ManaCostsImpl("{1}{B}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } @@ -87,7 +80,7 @@ public class CorpseHarvester extends CardImpl { } class CorpseHarvesterEffect extends OneShotEffect { - + CorpseHarvesterEffect() { super(Outcome.DrawCard); staticText = "Search your library for a Zombie card and a Swamp card, reveal them, and put them into your hand. Then shuffle your library"; @@ -128,4 +121,4 @@ class CorpseHarvesterEffect extends OneShotEffect { public CorpseHarvesterEffect copy() { return new CorpseHarvesterEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/c/CorpseTraders.java b/Mage.Sets/src/mage/cards/c/CorpseTraders.java index 182abdc3b5..cd9239b0d9 100644 --- a/Mage.Sets/src/mage/cards/c/CorpseTraders.java +++ b/Mage.Sets/src/mage/cards/c/CorpseTraders.java @@ -39,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetOpponent; @@ -48,7 +49,7 @@ import mage.target.common.TargetOpponent; public class CorpseTraders extends CardImpl { public CorpseTraders(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); @@ -58,7 +59,7 @@ public class CorpseTraders extends CardImpl { // {2}{B}, Sacrifice a creature: Target opponent reveals his or her hand. You choose a card from it. That player discards that card. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardCardYouChooseTargetEffect(), new ManaCostsImpl("{2}{B}")); ability.addTarget(new TargetOpponent()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CorruptedHarvester.java b/Mage.Sets/src/mage/cards/c/CorruptedHarvester.java index 614c47bdab..608d22ee32 100644 --- a/Mage.Sets/src/mage/cards/c/CorruptedHarvester.java +++ b/Mage.Sets/src/mage/cards/c/CorruptedHarvester.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.c; import java.util.UUID; @@ -40,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,18 +48,18 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class CorruptedHarvester extends CardImpl { - public CorruptedHarvester (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}"); + public CorruptedHarvester(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add(SubType.HORROR); this.power = new MageInt(6); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } - public CorruptedHarvester (final CorruptedHarvester card) { + public CorruptedHarvester(final CorruptedHarvester card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/c/CullingDais.java b/Mage.Sets/src/mage/cards/c/CullingDais.java index 59f53f5d9e..7539598728 100644 --- a/Mage.Sets/src/mage/cards/c/CullingDais.java +++ b/Mage.Sets/src/mage/cards/c/CullingDais.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.c; import java.util.UUID; @@ -43,6 +42,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -54,17 +54,17 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class CullingDais extends CardImpl { - public CullingDais (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + public CullingDais(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CullingDaisEffect(), new GenericManaCost(1)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } - public CullingDais (final CullingDais card) { + public CullingDais(final CullingDais card) { super(card); } @@ -76,6 +76,7 @@ public class CullingDais extends CardImpl { } class CullingDaisEffect extends OneShotEffect { + CullingDaisEffect() { super(Outcome.DrawCard); staticText = "Draw a card for each charge counter on {this}"; @@ -102,4 +103,4 @@ class CullingDaisEffect extends OneShotEffect { return new CullingDaisEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/c/CullingTheWeak.java b/Mage.Sets/src/mage/cards/c/CullingTheWeak.java index 4ba307f21c..8daaf333b2 100644 --- a/Mage.Sets/src/mage/cards/c/CullingTheWeak.java +++ b/Mage.Sets/src/mage/cards/c/CullingTheWeak.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -44,12 +44,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class CullingTheWeak extends CardImpl { public CullingTheWeak(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // As an additional cost to cast Culling the Weak, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // Add {B}{B}{B}{B} to your mana pool. this.getSpellAbility().addEffect(new BasicManaEffect(Mana.BlackMana(4))); } diff --git a/Mage.Sets/src/mage/cards/d/DarkPrivilege.java b/Mage.Sets/src/mage/cards/d/DarkPrivilege.java index 94a979fee1..870851fc90 100644 --- a/Mage.Sets/src/mage/cards/d/DarkPrivilege.java +++ b/Mage.Sets/src/mage/cards/d/DarkPrivilege.java @@ -46,7 +46,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -72,7 +72,7 @@ public class DarkPrivilege extends CardImpl { // Sacrifice a creature: Regenerate enchanted creature. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } diff --git a/Mage.Sets/src/mage/cards/d/DarkTriumph.java b/Mage.Sets/src/mage/cards/d/DarkTriumph.java index 35f8785adc..f6db02a354 100644 --- a/Mage.Sets/src/mage/cards/d/DarkTriumph.java +++ b/Mage.Sets/src/mage/cards/d/DarkTriumph.java @@ -37,6 +37,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -58,7 +59,7 @@ public class DarkTriumph extends CardImpl { // If you control a Swamp, you may sacrifice a creature rather than pay Dark Triumph's mana cost. this.addAbility(new AlternativeCostSourceAbility( - new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), new PermanentsOnTheBattlefieldCondition(filterSwamp), null )); diff --git a/Mage.Sets/src/mage/cards/d/DemonmailHauberk.java b/Mage.Sets/src/mage/cards/d/DemonmailHauberk.java index 4ec10651c0..de2283bcbd 100644 --- a/Mage.Sets/src/mage/cards/d/DemonmailHauberk.java +++ b/Mage.Sets/src/mage/cards/d/DemonmailHauberk.java @@ -35,9 +35,10 @@ import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -47,11 +48,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DemonmailHauberk extends CardImpl { public DemonmailHauberk(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); this.subtype.add(SubType.EQUIPMENT); // Equip - Sacrifice a creature. - this.addAbility(new EquipAbility(Outcome.AddAbility, new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new EquipAbility(Outcome.AddAbility, new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // Equipped creature gets +4/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(4, 2))); diff --git a/Mage.Sets/src/mage/cards/d/DevouringStrossus.java b/Mage.Sets/src/mage/cards/d/DevouringStrossus.java index 50f718f5fb..ca59644630 100644 --- a/Mage.Sets/src/mage/cards/d/DevouringStrossus.java +++ b/Mage.Sets/src/mage/cards/d/DevouringStrossus.java @@ -43,6 +43,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.TargetController; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,7 +54,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DevouringStrossus extends CardImpl { public DevouringStrossus(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}"); this.subtype.add(SubType.HORROR); this.power = new MageInt(9); this.toughness = new MageInt(9); @@ -64,11 +65,11 @@ public class DevouringStrossus extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // At the beginning of your upkeep, sacrifice a creature. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterControlledCreaturePermanent("creature"), 1, null), - TargetController.YOU, false); + TargetController.YOU, false); this.addAbility(ability); // Sacrifice a creature: Regenerate Devouring Strossus. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true)))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public DevouringStrossus(final DevouringStrossus card) { diff --git a/Mage.Sets/src/mage/cards/d/DevouringSwarm.java b/Mage.Sets/src/mage/cards/d/DevouringSwarm.java index b563fd2633..d34a22d9d6 100644 --- a/Mage.Sets/src/mage/cards/d/DevouringSwarm.java +++ b/Mage.Sets/src/mage/cards/d/DevouringSwarm.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; import java.util.UUID; @@ -37,9 +36,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,13 +48,14 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DevouringSwarm extends CardImpl { public DevouringSwarm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.INSECT); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public DevouringSwarm(final DevouringSwarm card) { diff --git a/Mage.Sets/src/mage/cards/d/DiabolicIntent.java b/Mage.Sets/src/mage/cards/d/DiabolicIntent.java index a1af2e6f48..6edbafd87e 100644 --- a/Mage.Sets/src/mage/cards/d/DiabolicIntent.java +++ b/Mage.Sets/src/mage/cards/d/DiabolicIntent.java @@ -33,7 +33,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; @@ -44,11 +44,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DiabolicIntent extends CardImpl { public DiabolicIntent(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // As an additional cost to cast Diabolic Intent, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Search your library for a card and put that card into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary())); diff --git a/Mage.Sets/src/mage/cards/d/DiamondValley.java b/Mage.Sets/src/mage/cards/d/DiamondValley.java index a275d513d4..e4a0070d94 100644 --- a/Mage.Sets/src/mage/cards/d/DiamondValley.java +++ b/Mage.Sets/src/mage/cards/d/DiamondValley.java @@ -39,6 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,12 +49,12 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DiamondValley extends CardImpl { public DiamondValley(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); effect.setText("You gain life equal to the sacrificed creature's toughness"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } @@ -65,4 +66,4 @@ public class DiamondValley extends CardImpl { public DiamondValley copy() { return new DiamondValley(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/d/DimirHouseGuard.java b/Mage.Sets/src/mage/cards/d/DimirHouseGuard.java index c83828eba6..5f533f44c5 100644 --- a/Mage.Sets/src/mage/cards/d/DimirHouseGuard.java +++ b/Mage.Sets/src/mage/cards/d/DimirHouseGuard.java @@ -39,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DimirHouseGuard extends CardImpl { public DimirHouseGuard(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.SKELETON); this.power = new MageInt(2); @@ -56,7 +57,8 @@ public class DimirHouseGuard extends CardImpl { this.addAbility(FearAbility.getInstance()); // Sacrifice a creature: Regenerate Dimir House Guard. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // Transmute {1}{B}{B} this.addAbility(new TransmuteAbility("{1}{B}{B}")); } diff --git a/Mage.Sets/src/mage/cards/d/DiscipleOfGriselbrand.java b/Mage.Sets/src/mage/cards/d/DiscipleOfGriselbrand.java index 399b6a265f..e185867551 100644 --- a/Mage.Sets/src/mage/cards/d/DiscipleOfGriselbrand.java +++ b/Mage.Sets/src/mage/cards/d/DiscipleOfGriselbrand.java @@ -38,9 +38,10 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,7 +53,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DiscipleOfGriselbrand extends CardImpl { public DiscipleOfGriselbrand(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); @@ -61,7 +62,7 @@ public class DiscipleOfGriselbrand extends CardImpl { // {1}, Sacrifice a creature: You gain life equal to the sacrificed creature's toughness. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscipleOfGriselbrandEffect(), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DroolingGroodion.java b/Mage.Sets/src/mage/cards/d/DroolingGroodion.java index 0e07818425..502ea64d81 100644 --- a/Mage.Sets/src/mage/cards/d/DroolingGroodion.java +++ b/Mage.Sets/src/mage/cards/d/DroolingGroodion.java @@ -37,7 +37,7 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AnotherTargetPredicate; import mage.game.Game; @@ -52,7 +52,7 @@ import mage.target.common.TargetCreaturePermanent; public class DroolingGroodion extends CardImpl { public DroolingGroodion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(4); @@ -60,7 +60,7 @@ public class DroolingGroodion extends CardImpl { // {2}{B}{G}, Sacrifice a creature: Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DroolingGroodionEffect(), new ManaCostsImpl("{2}{B}{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); TargetCreaturePermanent target = new TargetCreaturePermanent(new FilterCreaturePermanent("creature (first target)")); target.setTargetTag(1); diff --git a/Mage.Sets/src/mage/cards/d/DrossHopper.java b/Mage.Sets/src/mage/cards/d/DrossHopper.java index 43b31f7eb4..3b9078c3ad 100644 --- a/Mage.Sets/src/mage/cards/d/DrossHopper.java +++ b/Mage.Sets/src/mage/cards/d/DrossHopper.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; import java.util.UUID; @@ -37,9 +36,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,8 +48,8 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class DrossHopper extends CardImpl { - public DrossHopper (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + public DrossHopper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.INSECT); this.subtype.add(SubType.HORROR); @@ -57,10 +57,10 @@ public class DrossHopper extends CardImpl { this.toughness = new MageInt(1); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } - public DrossHopper (final DrossHopper card) { + public DrossHopper(final DrossHopper card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/d/DrownedRusalka.java b/Mage.Sets/src/mage/cards/d/DrownedRusalka.java index bd9e2b6303..daeeb95b1a 100644 --- a/Mage.Sets/src/mage/cards/d/DrownedRusalka.java +++ b/Mage.Sets/src/mage/cards/d/DrownedRusalka.java @@ -40,7 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -50,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class DrownedRusalka extends CardImpl { public DrownedRusalka(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); @@ -58,7 +58,7 @@ public class DrownedRusalka extends CardImpl { // {U}, Sacrifice a creature: Discard a card, then draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardControllerEffect(1), new ManaCostsImpl("{U}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addEffect(new DrawCardSourceControllerEffect(1)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/EbonPraetor.java b/Mage.Sets/src/mage/cards/e/EbonPraetor.java index 84561d9c98..1705067ca1 100644 --- a/Mage.Sets/src/mage/cards/e/EbonPraetor.java +++ b/Mage.Sets/src/mage/cards/e/EbonPraetor.java @@ -44,7 +44,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -56,7 +56,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class EbonPraetor extends CardImpl { public EbonPraetor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add(SubType.AVATAR); this.subtype.add(SubType.PRAETOR); this.power = new MageInt(5); @@ -73,7 +73,7 @@ public class EbonPraetor extends CardImpl { // Sacrifice a creature: Remove a -2/-2 counter from Ebon Praetor. If the sacrificed creature was a Thrull, put a +1/+0 counter on Ebon Praetor. Activate this ability only during your upkeep and only once each turn. Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.M2M2.createInstance()), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))), 1, new IsStepCondition(PhaseStep.UPKEEP, true)); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), 1, new IsStepCondition(PhaseStep.UPKEEP, true)); ability.addEffect(new EbonPraetorEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/ElvishSkysweeper.java b/Mage.Sets/src/mage/cards/e/ElvishSkysweeper.java index 5b53518cf1..30fe66bdaa 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishSkysweeper.java +++ b/Mage.Sets/src/mage/cards/e/ElvishSkysweeper.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,12 +54,12 @@ public class ElvishSkysweeper extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); - static { - filter.add(new AbilityPredicate(FlyingAbility.class)); - } + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } - public ElvishSkysweeper(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}"); + public ElvishSkysweeper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.WARRIOR); @@ -67,7 +68,7 @@ public class ElvishSkysweeper extends CardImpl { // {4}{G}, Sacrifice a creature: Destroy target creature with flying. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{4}{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java b/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java index 47cdd018f9..b0800dbbab 100644 --- a/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java +++ b/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java @@ -37,7 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,7 +52,7 @@ public class EvolutionaryLeap extends CardImpl { // {G}, Sacrifice a creature: Reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest on the bottom of your library in a random order. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.LIBRARY), new ManaCostsImpl("{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/EyeOfYawgmoth.java b/Mage.Sets/src/mage/cards/e/EyeOfYawgmoth.java index b597cb6fa6..797b38a33a 100644 --- a/Mage.Sets/src/mage/cards/e/EyeOfYawgmoth.java +++ b/Mage.Sets/src/mage/cards/e/EyeOfYawgmoth.java @@ -44,11 +44,9 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.Target; import mage.target.TargetCard; import mage.target.common.TargetControlledCreaturePermanent; @@ -59,12 +57,12 @@ import mage.target.common.TargetControlledCreaturePermanent; public class EyeOfYawgmoth extends CardImpl { public EyeOfYawgmoth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {3}, {T}, Sacrifice a creature: Reveal a number of cards from the top of your library equal to the sacrificed creature's power. Put one into your hand and exile the rest. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EyeOfYawgmothEffect(), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } @@ -79,21 +77,21 @@ public class EyeOfYawgmoth extends CardImpl { } class EyeOfYawgmothEffect extends OneShotEffect { - + EyeOfYawgmothEffect() { super(Outcome.Benefit); this.staticText = "Reveal a number of cards from the top of your library equal to the sacrificed creature's power. Put one into your hand and exile the rest"; } - + EyeOfYawgmothEffect(final EyeOfYawgmothEffect effect) { super(effect); } - + @Override public EyeOfYawgmothEffect copy() { return new EyeOfYawgmothEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -101,9 +99,9 @@ class EyeOfYawgmothEffect extends OneShotEffect { return false; } int power = 0; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) { - power = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); + power = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); break; } } diff --git a/Mage.Sets/src/mage/cards/f/FalkenrathAristocrat.java b/Mage.Sets/src/mage/cards/f/FalkenrathAristocrat.java index f70466f494..71962fce82 100644 --- a/Mage.Sets/src/mage/cards/f/FalkenrathAristocrat.java +++ b/Mage.Sets/src/mage/cards/f/FalkenrathAristocrat.java @@ -42,6 +42,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,7 +54,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class FalkenrathAristocrat extends CardImpl { public FalkenrathAristocrat(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(4); @@ -65,7 +66,7 @@ public class FalkenrathAristocrat extends CardImpl { // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addEffect(new FalkenrathAristocratEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FalkenrathTorturer.java b/Mage.Sets/src/mage/cards/f/FalkenrathTorturer.java index 7b647e76eb..df58bd1c0a 100644 --- a/Mage.Sets/src/mage/cards/f/FalkenrathTorturer.java +++ b/Mage.Sets/src/mage/cards/f/FalkenrathTorturer.java @@ -27,6 +27,7 @@ */ package mage.cards.f; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,12 +40,11 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author North @@ -52,7 +52,7 @@ import java.util.UUID; public class FalkenrathTorturer extends CardImpl { public FalkenrathTorturer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(2); @@ -62,7 +62,7 @@ public class FalkenrathTorturer extends CardImpl { // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Torturer. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addEffect(new FalkenrathAristocratEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FallenAngel.java b/Mage.Sets/src/mage/cards/f/FallenAngel.java index 531b82f875..7e7b5ade9b 100644 --- a/Mage.Sets/src/mage/cards/f/FallenAngel.java +++ b/Mage.Sets/src/mage/cards/f/FallenAngel.java @@ -36,9 +36,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class FallenAngel extends CardImpl { public FallenAngel(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.ANGEL); this.power = new MageInt(3); @@ -57,7 +58,8 @@ public class FallenAngel extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Sacrifice a creature: Fallen Angel gets +2/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public FallenAngel(final FallenAngel card) { diff --git a/Mage.Sets/src/mage/cards/f/FallenIdeal.java b/Mage.Sets/src/mage/cards/f/FallenIdeal.java index 72c832a08b..d522bc3df5 100644 --- a/Mage.Sets/src/mage/cards/f/FallenIdeal.java +++ b/Mage.Sets/src/mage/cards/f/FallenIdeal.java @@ -43,7 +43,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -55,7 +55,7 @@ import mage.target.common.TargetCreaturePermanent; public class FallenIdeal extends CardImpl { public FallenIdeal(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -64,17 +64,17 @@ public class FallenIdeal extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // Enchanted creature has flying and "Sacrifice a creature: This creature gets +2/+1 until end of turn." Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield); Ability gainedAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(gainedAbility); gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield); effect.setText("Enchanted creature has \"Sacrifice a creature: This creature gets +2/+1 until end of turn.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - + // When Fallen Ideal is put into a graveyard from the battlefield, return Fallen Ideal to its owner's hand. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); } @@ -87,4 +87,4 @@ public class FallenIdeal extends CardImpl { public FallenIdeal copy() { return new FallenIdeal(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/f/FanaticalDevotion.java b/Mage.Sets/src/mage/cards/f/FanaticalDevotion.java index 3874fcdb5a..56ffcb98bc 100644 --- a/Mage.Sets/src/mage/cards/f/FanaticalDevotion.java +++ b/Mage.Sets/src/mage/cards/f/FanaticalDevotion.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -47,12 +47,12 @@ import mage.target.common.TargetCreaturePermanent; public class FanaticalDevotion extends CardImpl { public FanaticalDevotion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // Sacrifice a creature: Regenerate target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FieryBombardment.java b/Mage.Sets/src/mage/cards/f/FieryBombardment.java index 63d29ac716..48dbb4f9d9 100644 --- a/Mage.Sets/src/mage/cards/f/FieryBombardment.java +++ b/Mage.Sets/src/mage/cards/f/FieryBombardment.java @@ -41,6 +41,7 @@ import mage.constants.AbilityWord; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -60,7 +61,7 @@ public class FieryBombardment extends CardImpl { // Chroma - {2}, Sacrifice a creature: Fiery Bombardment deals damage to target creature or player equal to the number of red mana symbols in the sacrificed creature's mana cost. Effect effect = new FieryBombardmentEffect(); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); ability.setAbilityWord(AbilityWord.CHROMA); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FieryConclusion.java b/Mage.Sets/src/mage/cards/f/FieryConclusion.java index d087cd0b95..81fee78a7b 100644 --- a/Mage.Sets/src/mage/cards/f/FieryConclusion.java +++ b/Mage.Sets/src/mage/cards/f/FieryConclusion.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -43,10 +44,10 @@ import mage.target.common.TargetCreaturePermanent; public class FieryConclusion extends CardImpl { public FieryConclusion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); // As an additional cost to cast Fiery Conclusion, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Fiery Conclusion deals 5 damage to target creature. this.getSpellAbility().addEffect(new DamageTargetEffect(5)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/f/FinalStrike.java b/Mage.Sets/src/mage/cards/f/FinalStrike.java index 3a1fdbe7b2..751635fdb7 100644 --- a/Mage.Sets/src/mage/cards/f/FinalStrike.java +++ b/Mage.Sets/src/mage/cards/f/FinalStrike.java @@ -35,7 +35,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetOpponent; @@ -46,11 +46,11 @@ import mage.target.common.TargetOpponent; public class FinalStrike extends CardImpl { public FinalStrike(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); // As an additional cost to cast Final Strike, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // Final Strike deals damage to target opponent equal to the sacrificed creature's power. Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); effect.setText("{this} deals damage to target opponent equal to the sacrificed creature's power"); diff --git a/Mage.Sets/src/mage/cards/f/FleshAllergy.java b/Mage.Sets/src/mage/cards/f/FleshAllergy.java index 823cccd3a7..abd6acdcee 100644 --- a/Mage.Sets/src/mage/cards/f/FleshAllergy.java +++ b/Mage.Sets/src/mage/cards/f/FleshAllergy.java @@ -39,6 +39,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.WatcherScope; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -56,11 +57,11 @@ import mage.watchers.Watcher; public class FleshAllergy extends CardImpl { public FleshAllergy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); // As an additional cost to cast Flesh Allergy, sacrifice a creature. // Destroy target creature. Its controller loses life equal to the number of creatures that died this turn. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new FleshAllergyEffect()); diff --git a/Mage.Sets/src/mage/cards/f/FleshEaterImp.java b/Mage.Sets/src/mage/cards/f/FleshEaterImp.java index 91cc0f9c40..9db3370084 100644 --- a/Mage.Sets/src/mage/cards/f/FleshEaterImp.java +++ b/Mage.Sets/src/mage/cards/f/FleshEaterImp.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.f; import java.util.UUID; @@ -38,9 +37,10 @@ import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,18 +49,19 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class FleshEaterImp extends CardImpl { - public FleshEaterImp (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + public FleshEaterImp(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.IMP); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); this.addAbility(InfectAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } - public FleshEaterImp (final FleshEaterImp card) { + public FleshEaterImp(final FleshEaterImp card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/f/Fling.java b/Mage.Sets/src/mage/cards/f/Fling.java index deea741c1f..60f5457d20 100644 --- a/Mage.Sets/src/mage/cards/f/Fling.java +++ b/Mage.Sets/src/mage/cards/f/Fling.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,7 +20,7 @@ * 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. @@ -35,6 +35,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -49,7 +50,7 @@ public class Fling extends CardImpl { Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); effect.setText("{this} deals damage equal to the sacrificed creature's power to target creature or player"); - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/f/FodderCannon.java b/Mage.Sets/src/mage/cards/f/FodderCannon.java index ac2eb9fbc6..82ddf37829 100644 --- a/Mage.Sets/src/mage/cards/f/FodderCannon.java +++ b/Mage.Sets/src/mage/cards/f/FodderCannon.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -48,15 +49,15 @@ import mage.target.common.TargetCreaturePermanent; public class FodderCannon extends CardImpl { public FodderCannon(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // {4}, {tap}, Sacrifice a creature: Fodder Cannon deals 4 damage to target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(4), new ManaCostsImpl("{4}")); ability.addTarget(new TargetCreaturePermanent()); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); - + } public FodderCannon(final FodderCannon card) { diff --git a/Mage.Sets/src/mage/cards/g/GateToPhyrexia.java b/Mage.Sets/src/mage/cards/g/GateToPhyrexia.java index ec870fce7d..abc3faad42 100644 --- a/Mage.Sets/src/mage/cards/g/GateToPhyrexia.java +++ b/Mage.Sets/src/mage/cards/g/GateToPhyrexia.java @@ -38,7 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.PhaseStep; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetArtifactPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -49,11 +49,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GateToPhyrexia extends CardImpl { public GateToPhyrexia(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); // Sacrifice a creature: Destroy target artifact. Activate this ability only during your upkeep and only once each turn. Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), 1, new IsStepCondition(PhaseStep.UPKEEP, true)); ability.addTarget(new TargetArtifactPermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GhaveGuruOfSpores.java b/Mage.Sets/src/mage/cards/g/GhaveGuruOfSpores.java index bae40f6943..591334eb54 100644 --- a/Mage.Sets/src/mage/cards/g/GhaveGuruOfSpores.java +++ b/Mage.Sets/src/mage/cards/g/GhaveGuruOfSpores.java @@ -45,9 +45,8 @@ import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.SaprolingToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -59,14 +58,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class GhaveGuruOfSpores extends CardImpl { - final static FilterControlledPermanent filter = new FilterControlledPermanent("creature to sacrifice"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public GhaveGuruOfSpores(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{G}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.FUNGUS); this.subtype.add(SubType.SHAMAN); @@ -84,7 +77,7 @@ public class GhaveGuruOfSpores extends CardImpl { // {1}, Sacrifice a creature: Put a +1/+1 counter on target creature. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1)); - ability2.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability2.addCost(new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability2.addTarget(new TargetCreaturePermanent()); this.addAbility(ability2); } diff --git a/Mage.Sets/src/mage/cards/g/GhostCouncilOfOrzhova.java b/Mage.Sets/src/mage/cards/g/GhostCouncilOfOrzhova.java index 3e1e41b733..2ce11f7a11 100644 --- a/Mage.Sets/src/mage/cards/g/GhostCouncilOfOrzhova.java +++ b/Mage.Sets/src/mage/cards/g/GhostCouncilOfOrzhova.java @@ -39,10 +39,11 @@ import mage.abilities.effects.common.ExileReturnBattlefieldOwnerNextEndStepSourc import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -55,7 +56,7 @@ import mage.target.common.TargetOpponent; public class GhostCouncilOfOrzhova extends CardImpl { public GhostCouncilOfOrzhova(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -69,7 +70,7 @@ public class GhostCouncilOfOrzhova extends CardImpl { // {1}, Sacrifice a creature: Exile Ghost Council of Orzhova. Return it to the battlefield under its owner's control at the beginning of the next end step. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GnawingZombie.java b/Mage.Sets/src/mage/cards/g/GnawingZombie.java index 6ec00a3910..7c314c8dcc 100644 --- a/Mage.Sets/src/mage/cards/g/GnawingZombie.java +++ b/Mage.Sets/src/mage/cards/g/GnawingZombie.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -50,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GnawingZombie extends CardImpl { public GnawingZombie(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(1); @@ -60,7 +61,7 @@ public class GnawingZombie extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{1}{B}")); ability.addEffect(new GainLifeEffect(1)); ability.addTarget(new TargetPlayer()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GolgariGuildmage.java b/Mage.Sets/src/mage/cards/g/GolgariGuildmage.java index b6f965c076..a330bdf9c1 100644 --- a/Mage.Sets/src/mage/cards/g/GolgariGuildmage.java +++ b/Mage.Sets/src/mage/cards/g/GolgariGuildmage.java @@ -42,6 +42,7 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.StaticFilters; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -60,7 +61,7 @@ public class GolgariGuildmage extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{4}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{4}{G}")); diff --git a/Mage.Sets/src/mage/cards/g/GolgariRotwurm.java b/Mage.Sets/src/mage/cards/g/GolgariRotwurm.java index 2f0ded16b8..52de8e78f6 100644 --- a/Mage.Sets/src/mage/cards/g/GolgariRotwurm.java +++ b/Mage.Sets/src/mage/cards/g/GolgariRotwurm.java @@ -37,9 +37,10 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -50,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GolgariRotwurm extends CardImpl { public GolgariRotwurm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.WURM); @@ -59,7 +60,7 @@ public class GolgariRotwurm extends CardImpl { // {B}, Sacrifice a creature: Target player loses 1 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ColoredManaCost(ColoredManaSymbol.B)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GreaterGood.java b/Mage.Sets/src/mage/cards/g/GreaterGood.java index c91bade6c7..71a0781d35 100644 --- a/Mage.Sets/src/mage/cards/g/GreaterGood.java +++ b/Mage.Sets/src/mage/cards/g/GreaterGood.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,13 +49,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GreaterGood extends CardImpl { public GreaterGood(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); // Sacrifice a creature: Draw cards equal to the sacrificed creature's power, then discard three cards. Effect effect = new DrawCardSourceControllerEffect(new SacrificeCostCreaturesPower()); effect.setText("Draw cards equal to the sacrificed creature's power"); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); effect = new DiscardControllerEffect(3); effect.setText(", then discard three cards"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/g/GrimBackwoods.java b/Mage.Sets/src/mage/cards/g/GrimBackwoods.java index 3f206cabef..df5932f0ff 100644 --- a/Mage.Sets/src/mage/cards/g/GrimBackwoods.java +++ b/Mage.Sets/src/mage/cards/g/GrimBackwoods.java @@ -39,6 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,14 +49,14 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GrimBackwoods extends CardImpl { public GrimBackwoods(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // {tap}: Add {C} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {2}{B}{G}, {tap}, Sacrifice a creature: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}{B}{G}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GutlessGhoul.java b/Mage.Sets/src/mage/cards/g/GutlessGhoul.java index 122a06b0bd..6cce21a536 100644 --- a/Mage.Sets/src/mage/cards/g/GutlessGhoul.java +++ b/Mage.Sets/src/mage/cards/g/GutlessGhoul.java @@ -40,7 +40,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -50,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GutlessGhoul extends CardImpl { public GutlessGhoul(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.addSuperType(SuperType.SNOW); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(2); @@ -58,7 +58,7 @@ public class GutlessGhoul extends CardImpl { // {1}, Sacrifice a creature: You gain 2 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new ManaCostsImpl("{1}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HellsCaretaker.java b/Mage.Sets/src/mage/cards/h/HellsCaretaker.java index e88ed7a174..6d957dd0f0 100644 --- a/Mage.Sets/src/mage/cards/h/HellsCaretaker.java +++ b/Mage.Sets/src/mage/cards/h/HellsCaretaker.java @@ -42,6 +42,7 @@ import mage.constants.PhaseStep; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.StaticFilters; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledCreaturePermanent; @@ -62,7 +63,7 @@ public class HellsCaretaker extends CardImpl { new ReturnFromGraveyardToBattlefieldTargetEffect(), new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HelmOfPossession.java b/Mage.Sets/src/mage/cards/h/HelmOfPossession.java index a23dd0ca47..1e47145bee 100644 --- a/Mage.Sets/src/mage/cards/h/HelmOfPossession.java +++ b/Mage.Sets/src/mage/cards/h/HelmOfPossession.java @@ -42,6 +42,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,7 +55,7 @@ import mage.target.common.TargetCreaturePermanent; public class HelmOfPossession extends CardImpl { public HelmOfPossession(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // You may choose not to untap Helm of Possession during your untap step. this.addAbility(new SkipUntapOptionalAbility()); @@ -67,7 +68,7 @@ public class HelmOfPossession extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HiddenStockpile.java b/Mage.Sets/src/mage/cards/h/HiddenStockpile.java index 61c7ea73da..218c2309ab 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenStockpile.java +++ b/Mage.Sets/src/mage/cards/h/HiddenStockpile.java @@ -42,7 +42,7 @@ import mage.cards.CardSetInfo; import mage.constants.AbilityWord; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.permanent.token.ServoToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.watchers.common.RevoltWatcher; @@ -65,7 +65,7 @@ public class HiddenStockpile extends CardImpl { // {1}, Sacrifice a creature: Scry 1. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HighMarket.java b/Mage.Sets/src/mage/cards/h/HighMarket.java index ba86c89138..1bd2571512 100644 --- a/Mage.Sets/src/mage/cards/h/HighMarket.java +++ b/Mage.Sets/src/mage/cards/h/HighMarket.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -47,13 +48,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class HighMarket extends CardImpl { public HighMarket(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // {tap}: Add {C} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}, Sacrifice a creature: You gain 1 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/i/IchorExplosion.java b/Mage.Sets/src/mage/cards/i/IchorExplosion.java index a58c4888f4..b77ae88ca0 100644 --- a/Mage.Sets/src/mage/cards/i/IchorExplosion.java +++ b/Mage.Sets/src/mage/cards/i/IchorExplosion.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; import mage.filter.StaticFilters; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,7 +55,7 @@ public class IchorExplosion extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}"); // As an additional cost to cast Ichor Explosion, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // All creatures get -X/-X until end of turn, where X is the sacrificed creature's power. DynamicValue xValue = new IchorExplosionDynamicValue(); this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false, null, true)); diff --git a/Mage.Sets/src/mage/cards/i/IndulgentAristocrat.java b/Mage.Sets/src/mage/cards/i/IndulgentAristocrat.java index 01af997ac0..d17d8de032 100644 --- a/Mage.Sets/src/mage/cards/i/IndulgentAristocrat.java +++ b/Mage.Sets/src/mage/cards/i/IndulgentAristocrat.java @@ -41,7 +41,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -59,7 +59,7 @@ public class IndulgentAristocrat extends CardImpl { } public IndulgentAristocrat(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(1); this.toughness = new MageInt(1); @@ -69,7 +69,7 @@ public class IndulgentAristocrat extends CardImpl { // {2}, Sacrifice a creature: Put a +1/+1 counter on each Vampire you control. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), new GenericManaCost(2)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/i/IndulgentTormentor.java b/Mage.Sets/src/mage/cards/i/IndulgentTormentor.java index 03db8583cc..34bc884333 100644 --- a/Mage.Sets/src/mage/cards/i/IndulgentTormentor.java +++ b/Mage.Sets/src/mage/cards/i/IndulgentTormentor.java @@ -39,9 +39,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.TargetController; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,7 +55,7 @@ import mage.target.common.TargetOpponent; public class IndulgentTormentor extends CardImpl { public IndulgentTormentor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.DEMON); this.power = new MageInt(5); @@ -62,7 +63,7 @@ public class IndulgentTormentor extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // At the beginning of your upkeep, draw a card unless target opponent sacrifices a creature or pays 3 life. Ability ability = new BeginningOfUpkeepTriggeredAbility(new IndulgentTormentorEffect(), TargetController.YOU, false); ability.addTarget(new TargetOpponent()); @@ -80,26 +81,26 @@ public class IndulgentTormentor extends CardImpl { } class IndulgentTormentorEffect extends OneShotEffect { - + IndulgentTormentorEffect() { super(Outcome.DrawCard); this.staticText = "draw a card unless target opponent sacrifices a creature or pays 3 life"; } - + IndulgentTormentorEffect(final IndulgentTormentorEffect effect) { super(effect); } - + @Override public IndulgentTormentorEffect copy() { return new IndulgentTormentorEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(source.getFirstTarget()); if (opponent != null) { - Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent()); + Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); if (cost.canPay(source, source.getSourceId(), opponent.getId(), game) && opponent.chooseUse(outcome, "Sacrifice a creature to prevent the card draw?", source, game)) { if (cost.pay(source, game, source.getSourceId(), opponent.getId(), false, null)) { diff --git a/Mage.Sets/src/mage/cards/i/InfernalPlunge.java b/Mage.Sets/src/mage/cards/i/InfernalPlunge.java index 0529440bcb..fb7fc35d51 100644 --- a/Mage.Sets/src/mage/cards/i/InfernalPlunge.java +++ b/Mage.Sets/src/mage/cards/i/InfernalPlunge.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -43,11 +44,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class InfernalPlunge extends CardImpl { public InfernalPlunge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}"); // As an additional cost to cast Infernal Plunge, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Add {R}{R}{R} to your mana pool. this.getSpellAbility().addEffect(new BasicManaEffect(Mana.RedMana(3))); } diff --git a/Mage.Sets/src/mage/cards/j/JinxedIdol.java b/Mage.Sets/src/mage/cards/j/JinxedIdol.java index f083fc87ae..a2448b980a 100644 --- a/Mage.Sets/src/mage/cards/j/JinxedIdol.java +++ b/Mage.Sets/src/mage/cards/j/JinxedIdol.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * 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.cards.j; import java.util.UUID; @@ -38,6 +37,7 @@ import mage.abilities.effects.common.DamageControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -51,13 +51,14 @@ import mage.target.common.TargetOpponent; public class JinxedIdol extends CardImpl { public JinxedIdol(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); - - // At the beginning of your upkeep, Jinxed Idol deals 2 damage to you. + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // At the beginning of your upkeep, Jinxed Idol deals 2 damage to you. this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DamageControllerEffect(2))); - + // Sacrifice a creature: Target opponent gains control of Jinxed Idol. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedIdolEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedIdolEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/j/JinxedRing.java b/Mage.Sets/src/mage/cards/j/JinxedRing.java index 5dd39696ef..7686a24e82 100644 --- a/Mage.Sets/src/mage/cards/j/JinxedRing.java +++ b/Mage.Sets/src/mage/cards/j/JinxedRing.java @@ -43,6 +43,7 @@ import mage.constants.Outcome; import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.FilterPermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; @@ -55,21 +56,22 @@ import mage.target.common.TargetOpponent; * @author fireshoes */ public class JinxedRing extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("a nontoken permanent"); - + static { filter.add(Predicates.not(new TokenPredicate())); } public JinxedRing(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // Whenever a nontoken permanent is put into your graveyard from the battlefield, Jinxed Ring deals 1 damage to you. this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new DamageControllerEffect(1), false, filter, false, true)); - + // Sacrifice a creature: Target opponent gains control of Jinxed Ring. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedRingEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedRingEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KeldonNecropolis.java b/Mage.Sets/src/mage/cards/k/KeldonNecropolis.java index 0cd12ecc15..7835532a25 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonNecropolis.java +++ b/Mage.Sets/src/mage/cards/k/KeldonNecropolis.java @@ -40,7 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -51,7 +51,7 @@ import mage.target.common.TargetCreatureOrPlayer; public class KeldonNecropolis extends CardImpl { public KeldonNecropolis(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); addSuperType(SuperType.LEGENDARY); // {tap}: Add {C} to your mana pool. @@ -59,7 +59,7 @@ public class KeldonNecropolis extends CardImpl { // {4}{R}, {T}, Sacrifice a creature: Keldon Necropolis deals 2 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl(new ManaCostsImpl("{4}{R}"))); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KrovikanHorror.java b/Mage.Sets/src/mage/cards/k/KrovikanHorror.java index 4b37bb97c6..3f85d49524 100644 --- a/Mage.Sets/src/mage/cards/k/KrovikanHorror.java +++ b/Mage.Sets/src/mage/cards/k/KrovikanHorror.java @@ -38,12 +38,13 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; import mage.cards.Card; -import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.SubType; import mage.constants.TargetController; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -71,7 +72,7 @@ public class KrovikanHorror extends CardImpl { // {1}, Sacrifice a creature: Krovikan Horror deals 1 damage to target creature or player. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/l/LaunchParty.java b/Mage.Sets/src/mage/cards/l/LaunchParty.java index 5f8a5b8e66..b38c16c8ff 100644 --- a/Mage.Sets/src/mage/cards/l/LaunchParty.java +++ b/Mage.Sets/src/mage/cards/l/LaunchParty.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.LoseLifeTargetControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -44,11 +45,10 @@ import mage.target.common.TargetCreaturePermanent; public class LaunchParty extends CardImpl { public LaunchParty(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}"); // As an additional cost to cast Launch Party, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Destroy target creature. Its controller loses 2 life. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); @@ -64,4 +64,4 @@ public class LaunchParty extends CardImpl { public LaunchParty copy() { return new LaunchParty(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/l/LegacyOfTheBeloved.java b/Mage.Sets/src/mage/cards/l/LegacyOfTheBeloved.java index 90b9afba7c..8e0fd5eb5f 100644 --- a/Mage.Sets/src/mage/cards/l/LegacyOfTheBeloved.java +++ b/Mage.Sets/src/mage/cards/l/LegacyOfTheBeloved.java @@ -39,6 +39,7 @@ import mage.constants.CardType; import mage.constants.ComparisonType; import mage.constants.Outcome; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; @@ -54,10 +55,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class LegacyOfTheBeloved extends CardImpl { public LegacyOfTheBeloved(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); // As an additional cost to cast Legacy of the Beloved, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Search you library for up to two creatures cards that each have a lower converted mana cost that sacrificied creature's converted mana cost, reveal them and put them onto the battlefield, then shuffle you library. this.getSpellAbility().addEffect(new LegacyOfTheBelovedEffect()); diff --git a/Mage.Sets/src/mage/cards/l/LifeChisel.java b/Mage.Sets/src/mage/cards/l/LifeChisel.java index e34cf1f455..6fa4203331 100644 --- a/Mage.Sets/src/mage/cards/l/LifeChisel.java +++ b/Mage.Sets/src/mage/cards/l/LifeChisel.java @@ -40,7 +40,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -59,7 +59,7 @@ public class LifeChisel extends CardImpl { Zone.BATTLEFIELD, new LifeChiselEffect(), new SacrificeTargetCost( - new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true) + new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT) ), new IsStepCondition(PhaseStep.UPKEEP), null diff --git a/Mage.Sets/src/mage/cards/l/LifesLegacy.java b/Mage.Sets/src/mage/cards/l/LifesLegacy.java index 154414cdbc..1caf18c8f8 100644 --- a/Mage.Sets/src/mage/cards/l/LifesLegacy.java +++ b/Mage.Sets/src/mage/cards/l/LifesLegacy.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -48,11 +48,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class LifesLegacy extends CardImpl { public LifesLegacy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // As an additional cost to cast Life's Legacy, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Draw cards equal to the sacrificed creature's power. this.getSpellAbility().addEffect(new LifesLegacyEffect()); @@ -86,9 +85,9 @@ class LifesLegacyEffect extends OneShotEffect { return false; } int power = 0; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) { - power = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); + power = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); break; } } diff --git a/Mage.Sets/src/mage/cards/l/LyzoldaTheBloodWitch.java b/Mage.Sets/src/mage/cards/l/LyzoldaTheBloodWitch.java index 91c7e81381..ee32afa6e8 100644 --- a/Mage.Sets/src/mage/cards/l/LyzoldaTheBloodWitch.java +++ b/Mage.Sets/src/mage/cards/l/LyzoldaTheBloodWitch.java @@ -47,6 +47,7 @@ import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; import mage.filter.FilterPermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -61,14 +62,14 @@ public class LyzoldaTheBloodWitch extends CardImpl { private static final FilterPermanent redFilter = new FilterPermanent(); private static final FilterPermanent blackFilter = new FilterPermanent(); - + static { redFilter.add(new ColorPredicate(ObjectColor.RED)); blackFilter.add(new ColorPredicate(ObjectColor.BLACK)); } - + public LyzoldaTheBloodWitch(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); @@ -87,7 +88,7 @@ public class LyzoldaTheBloodWitch extends CardImpl { new SacrificedWasCondition(blackFilter), "Draw a card if the sacrificed creature was black"); ability.addEffect(effect); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } @@ -105,11 +106,11 @@ public class LyzoldaTheBloodWitch extends CardImpl { class SacrificedWasCondition implements Condition { private final FilterPermanent filter; - + public SacrificedWasCondition(final FilterPermanent filter) { this.filter = filter; } - + @Override public boolean apply(Game game, Ability source) { for (Cost cost : source.getCosts()) { @@ -123,5 +124,5 @@ class SacrificedWasCondition implements Condition { } return false; } - + } diff --git a/Mage.Sets/src/mage/cards/m/MalevolentAwakening.java b/Mage.Sets/src/mage/cards/m/MalevolentAwakening.java index 14edbd0c21..5b9b7c5082 100644 --- a/Mage.Sets/src/mage/cards/m/MalevolentAwakening.java +++ b/Mage.Sets/src/mage/cards/m/MalevolentAwakening.java @@ -38,6 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; import mage.filter.FilterCard; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledCreaturePermanent; @@ -47,21 +48,20 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author cbt33 */ public class MalevolentAwakening extends CardImpl { - + private static final FilterCard filter = new FilterCard("creature card from your graveyard"); - - static{ + + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } public MalevolentAwakening(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); // {1}{B}{B}, Sacrifice a creature: Return target creature card from your graveyard to your hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new ManaCostsImpl("{1}{B}{B}")); ability.addTarget(new TargetCardInYourGraveyard(filter)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/Marjhan.java b/Mage.Sets/src/mage/cards/m/Marjhan.java index 09c6170e2f..bb11fa15fd 100644 --- a/Mage.Sets/src/mage/cards/m/Marjhan.java +++ b/Mage.Sets/src/mage/cards/m/Marjhan.java @@ -48,6 +48,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; @@ -68,7 +69,7 @@ public class Marjhan extends CardImpl { } public Marjhan(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); this.subtype.add(SubType.SERPENT); this.power = new MageInt(8); this.toughness = new MageInt(8); @@ -79,7 +80,7 @@ public class Marjhan extends CardImpl { // {U}{U}, Sacrifice a creature: Untap Marjhan. Activate this ability only during your upkeep. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{U}{U}"), new IsStepCondition(PhaseStep.UPKEEP), null); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); // Marjhan can't attack unless defending player controls an Island. diff --git a/Mage.Sets/src/mage/cards/m/MartyredRusalka.java b/Mage.Sets/src/mage/cards/m/MartyredRusalka.java index 7c307ef7fa..e09f9a8f53 100644 --- a/Mage.Sets/src/mage/cards/m/MartyredRusalka.java +++ b/Mage.Sets/src/mage/cards/m/MartyredRusalka.java @@ -37,9 +37,10 @@ import mage.abilities.effects.common.combat.CantAttackTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,17 +51,17 @@ import mage.target.common.TargetCreaturePermanent; public class MartyredRusalka extends CardImpl { public MartyredRusalka(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); this.toughness = new MageInt(1); // {W}, Sacrifice a creature: Target creature can't attack this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantAttackTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - + } public MartyredRusalka(final MartyredRusalka card) { diff --git a/Mage.Sets/src/mage/cards/m/MartyrsCause.java b/Mage.Sets/src/mage/cards/m/MartyrsCause.java index 3170881f59..f838886367 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsCause.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsCause.java @@ -37,7 +37,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -48,11 +48,11 @@ import mage.target.common.TargetCreatureOrPlayer; public class MartyrsCause extends CardImpl { public MartyrsCause(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // Sacrifice a creature: The next time a source of your choice would deal damage to target creature or player this turn, prevent that damage. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventNextDamageFromChosenSourceToTargetEffect(Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventNextDamageFromChosenSourceToTargetEffect(Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MawOfTheObzedat.java b/Mage.Sets/src/mage/cards/m/MawOfTheObzedat.java index eab32a37b7..363a659746 100644 --- a/Mage.Sets/src/mage/cards/m/MawOfTheObzedat.java +++ b/Mage.Sets/src/mage/cards/m/MawOfTheObzedat.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -44,23 +45,24 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author jeffwadsworth */ public class MawOfTheObzedat extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control"); - + static { filter.add(new ControllerPredicate(TargetController.YOU)); } public MawOfTheObzedat(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{B}"); this.subtype.add(SubType.THRULL); this.power = new MageInt(3); this.toughness = new MageInt(3); // Sacrifice a creature: Creatures you control get +1/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); - + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); + } public MawOfTheObzedat(final MawOfTheObzedat card) { diff --git a/Mage.Sets/src/mage/cards/m/Metamorphosis.java b/Mage.Sets/src/mage/cards/m/Metamorphosis.java index b64133d1e0..b919e84843 100644 --- a/Mage.Sets/src/mage/cards/m/Metamorphosis.java +++ b/Mage.Sets/src/mage/cards/m/Metamorphosis.java @@ -40,10 +40,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.target.common.TargetControlledCreaturePermanent; - /** * * @author MarcoMarin @@ -51,10 +51,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Metamorphosis extends CardImpl { public Metamorphosis(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); // As an additional cost to cast Metamorphosis, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addEffect(new MetamorphosisEffect()); // Add X mana of any one color to your mana pool, where X is one plus the sacrificed creature's converted mana cost. Spend this mana only to cast creature spells. } @@ -83,15 +83,15 @@ class MetamorphosisEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int amount = 0; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getConvertedManaCost()+1; + amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getConvertedManaCost() + 1; break; } } if (amount > 0) { - AddConditionalManaOfAnyColorEffect anyMana = new AddConditionalManaOfAnyColorEffect(amount, new MetamorphosisManaBuilder()); - anyMana.apply(game, source); //There probably is a more elegant way of doing this but.. I'm still learning :p + AddConditionalManaOfAnyColorEffect anyMana = new AddConditionalManaOfAnyColorEffect(amount, new MetamorphosisManaBuilder()); + anyMana.apply(game, source); //There probably is a more elegant way of doing this but.. I'm still learning :p } return false; } @@ -104,6 +104,7 @@ class MetamorphosisEffect extends OneShotEffect { } class MetamorphosisManaBuilder extends ConditionalManaBuilder { + @Override public ConditionalMana build(Object... options) { return new CreatureCastConditionalMana(this.mana); @@ -113,4 +114,4 @@ class MetamorphosisManaBuilder extends ConditionalManaBuilder { public String getRule() { return "Spend this mana only to cast creature spells"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/m/MindSlash.java b/Mage.Sets/src/mage/cards/m/MindSlash.java index b424ae952c..bc8b8df742 100644 --- a/Mage.Sets/src/mage/cards/m/MindSlash.java +++ b/Mage.Sets/src/mage/cards/m/MindSlash.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetOpponent; @@ -47,13 +48,12 @@ import mage.target.common.TargetOpponent; public class MindSlash extends CardImpl { public MindSlash(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); // {B}, Sacrifice a creature: Target opponent reveals his or her hand. You choose a card from it. // That player discards that card. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardCardYouChooseTargetEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MindSwords.java b/Mage.Sets/src/mage/cards/m/MindSwords.java index 32f3ab6328..7187bdcff5 100644 --- a/Mage.Sets/src/mage/cards/m/MindSwords.java +++ b/Mage.Sets/src/mage/cards/m/MindSwords.java @@ -44,6 +44,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterCard; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; @@ -69,7 +70,7 @@ public class MindSwords extends CardImpl { // If you control a Swamp, you may sacrifice a creature rather than pay Mind Swords's mana cost. this.addAbility(new AlternativeCostSourceAbility( - new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), new PermanentsOnTheBattlefieldCondition(filterSwamp), null )); diff --git a/Mage.Sets/src/mage/cards/m/MirenTheMoaningWell.java b/Mage.Sets/src/mage/cards/m/MirenTheMoaningWell.java index d51b849b86..72e4b29dc7 100644 --- a/Mage.Sets/src/mage/cards/m/MirenTheMoaningWell.java +++ b/Mage.Sets/src/mage/cards/m/MirenTheMoaningWell.java @@ -42,7 +42,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,7 +54,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class MirenTheMoaningWell extends CardImpl { public MirenTheMoaningWell(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); addSuperType(SuperType.LEGENDARY); // {tap}: Add {C} to your mana pool. @@ -63,7 +63,7 @@ public class MirenTheMoaningWell extends CardImpl { // {3}, {tap}, Sacrifice a creature: You gain life equal to the sacrificed creature's toughness. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirenTheMoaningWellEffect(), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java index f3f391e5bc..a03c1aa8ad 100644 --- a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java +++ b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java @@ -45,6 +45,7 @@ import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -57,7 +58,7 @@ import mage.util.CardUtil; public class MogisGodOfSlaughter extends CardImpl { public MogisGodOfSlaughter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{2}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GOD); @@ -72,7 +73,8 @@ public class MogisGodOfSlaughter extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. - effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, true, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, true, "that player"), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), "Sacrifice a creature? (otherwise you get 2 damage)"); effect.setText("Mogis deals 2 damage to that player unless he or she sacrifices a creature"); Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.OPPONENT, false, true); diff --git a/Mage.Sets/src/mage/cards/m/MomentousFall.java b/Mage.Sets/src/mage/cards/m/MomentousFall.java index a2d3cc5d9d..74433eb6b7 100644 --- a/Mage.Sets/src/mage/cards/m/MomentousFall.java +++ b/Mage.Sets/src/mage/cards/m/MomentousFall.java @@ -36,6 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -47,11 +48,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class MomentousFall extends CardImpl { public MomentousFall(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}{G}"); // As an additional cost to cast Momentous Fall, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // You draw cards equal to the sacrificed creature's power, then you gain life equal to its toughness. this.getSpellAbility().addEffect(new MomentousFallEffect()); @@ -109,4 +109,4 @@ class MomentousFallEffect extends OneShotEffect { public MomentousFallEffect copy() { return new MomentousFallEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/n/NantukoHusk.java b/Mage.Sets/src/mage/cards/n/NantukoHusk.java index 8439fe9045..a6588441f8 100644 --- a/Mage.Sets/src/mage/cards/n/NantukoHusk.java +++ b/Mage.Sets/src/mage/cards/n/NantukoHusk.java @@ -38,7 +38,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,7 +48,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class NantukoHusk extends CardImpl { public NantukoHusk(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.INSECT); @@ -57,7 +57,7 @@ public class NantukoHusk extends CardImpl { // Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public NantukoHusk(final NantukoHusk card) { diff --git a/Mage.Sets/src/mage/cards/n/Necrosavant.java b/Mage.Sets/src/mage/cards/n/Necrosavant.java index fb3a33fb03..c7c4d4b243 100644 --- a/Mage.Sets/src/mage/cards/n/Necrosavant.java +++ b/Mage.Sets/src/mage/cards/n/Necrosavant.java @@ -38,9 +38,10 @@ import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffec import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.PhaseStep; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -50,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Necrosavant extends CardImpl { public Necrosavant(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.GIANT); @@ -58,13 +59,13 @@ public class Necrosavant extends CardImpl { this.toughness = new MageInt(5); // {3}{B}{B}, Sacrifice a creature: Return Necrosavant from your graveyard to the battlefield. Activate this ability only during your upkeep. - Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD, - new ReturnSourceFromGraveyardToBattlefieldEffect(), - new ManaCostsImpl("{3}{B}{B}"), + Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToBattlefieldEffect(), + new ManaCostsImpl("{3}{B}{B}"), new IsStepCondition(PhaseStep.UPKEEP), null ); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/n/NezumiBoneReader.java b/Mage.Sets/src/mage/cards/n/NezumiBoneReader.java index 2413cc41e6..dda7397e9c 100644 --- a/Mage.Sets/src/mage/cards/n/NezumiBoneReader.java +++ b/Mage.Sets/src/mage/cards/n/NezumiBoneReader.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.n; import java.util.UUID; @@ -40,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -49,21 +49,22 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class NezumiBoneReader extends CardImpl { - public NezumiBoneReader (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + public NezumiBoneReader(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.RAT); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(1); this.toughness = new MageInt(1); // {B}, Sacrifice a creature: Target player discards a card. Activate this ability only any time you could cast a sorcery. - Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1),new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new ManaCostsImpl("{B}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } - public NezumiBoneReader (final NezumiBoneReader card) { + public NezumiBoneReader(final NezumiBoneReader card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/n/NimShambler.java b/Mage.Sets/src/mage/cards/n/NimShambler.java index 05db700f85..76d986f8d4 100644 --- a/Mage.Sets/src/mage/cards/n/NimShambler.java +++ b/Mage.Sets/src/mage/cards/n/NimShambler.java @@ -39,9 +39,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -58,13 +59,14 @@ public class NimShambler extends CardImpl { } public NimShambler(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(2); this.toughness = new MageInt(1); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filter), new StaticValue(0), Duration.WhileOnBattlefield))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public NimShambler(final NimShambler card) { diff --git a/Mage.Sets/src/mage/cards/o/OgreMarauder.java b/Mage.Sets/src/mage/cards/o/OgreMarauder.java index b362a36272..aa76539c7f 100644 --- a/Mage.Sets/src/mage/cards/o/OgreMarauder.java +++ b/Mage.Sets/src/mage/cards/o/OgreMarauder.java @@ -40,9 +40,10 @@ import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SubType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,7 +55,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class OgreMarauder extends CardImpl { public OgreMarauder(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.OGRE); this.subtype.add(SubType.WARRIOR); @@ -97,9 +98,9 @@ class OgreMarauderEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); Player defender = game.getPlayer(defendingPlayerId); if (defender != null && sourceObject != null) { - Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent()); - if (cost.canPay(source, source.getSourceId(), defendingPlayerId, game) && - defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent that " + sourceObject.getLogName() + " can't be blocked?", source, game)) { + Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); + if (cost.canPay(source, source.getSourceId(), defendingPlayerId, game) + && defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent that " + sourceObject.getLogName() + " can't be blocked?", source, game)) { if (!cost.pay(source, game, source.getSourceId(), defendingPlayerId, false, null)) { // cost was not payed - so source can't be blocked ContinuousEffect effect = new CantBeBlockedSourceEffect(Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/o/OrcishBloodpainter.java b/Mage.Sets/src/mage/cards/o/OrcishBloodpainter.java index 3a571ffbd7..c6fb4c2b28 100644 --- a/Mage.Sets/src/mage/cards/o/OrcishBloodpainter.java +++ b/Mage.Sets/src/mage/cards/o/OrcishBloodpainter.java @@ -39,7 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -50,7 +50,7 @@ import mage.target.common.TargetCreatureOrPlayer; public class OrcishBloodpainter extends CardImpl { public OrcishBloodpainter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); @@ -58,7 +58,7 @@ public class OrcishBloodpainter extends CardImpl { // {tap}, Sacrifice a creature: Orcish Bloodpainter deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OrochiEggwatcher.java b/Mage.Sets/src/mage/cards/o/OrochiEggwatcher.java index 6d4522b756..a203ac4ac6 100644 --- a/Mage.Sets/src/mage/cards/o/OrochiEggwatcher.java +++ b/Mage.Sets/src/mage/cards/o/OrochiEggwatcher.java @@ -1,5 +1,5 @@ /* - * + * * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -25,9 +25,8 @@ * 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.cards.o; import java.util.UUID; @@ -45,11 +44,12 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ComparisonType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.permanent.token.SnakeToken; import mage.game.permanent.token.Token; @@ -107,9 +107,8 @@ class ShidakoBroodmistress extends Token { Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), new ManaCostsImpl("{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } } - diff --git a/Mage.Sets/src/mage/cards/p/PerilousForays.java b/Mage.Sets/src/mage/cards/p/PerilousForays.java index 1e032d74b0..50f9c22cbe 100644 --- a/Mage.Sets/src/mage/cards/p/PerilousForays.java +++ b/Mage.Sets/src/mage/cards/p/PerilousForays.java @@ -39,6 +39,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterLandCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -50,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author fireshoes */ public class PerilousForays extends CardImpl { - + private static final FilterLandCard filter = new FilterLandCard("land card with a basic land type"); static { @@ -63,13 +64,13 @@ public class PerilousForays extends CardImpl { } public PerilousForays(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); // {1}, Sacrifice a creature: Search your library for a land card with a basic land type and put it onto the battlefield tapped. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true, Outcome.PutLandInPlay), + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true, Outcome.PutLandInPlay), new ManaCostsImpl("{1}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianAltar.java b/Mage.Sets/src/mage/cards/p/PhyrexianAltar.java index ac18164312..08fd264a79 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianAltar.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianAltar.java @@ -33,6 +33,7 @@ import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -42,10 +43,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianAltar extends CardImpl { public PhyrexianAltar(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Sacrifice a creature: Add one mana of any color to your mana pool. - this.addAbility(new AnyColorManaAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new AnyColorManaAbility( + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public PhyrexianAltar(final PhyrexianAltar card) { diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianBroodlings.java b/Mage.Sets/src/mage/cards/p/PhyrexianBroodlings.java index 50b78edeb9..b0779a2afc 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianBroodlings.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianBroodlings.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianBroodlings extends CardImpl { public PhyrexianBroodlings(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.MINION); this.power = new MageInt(2); @@ -57,7 +58,7 @@ public class PhyrexianBroodlings extends CardImpl { // {1}, Sacrifice a creature: Put a +1/+1 counter on Phyrexian Broodlings. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianGhoul.java b/Mage.Sets/src/mage/cards/p/PhyrexianGhoul.java index 8203c93a69..6f48caab97 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianGhoul.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianGhoul.java @@ -35,9 +35,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -47,12 +48,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianGhoul extends CardImpl { public PhyrexianGhoul(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public PhyrexianGhoul(final PhyrexianGhoul card) { diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianPlaguelord.java b/Mage.Sets/src/mage/cards/p/PhyrexianPlaguelord.java index 0a02685170..2cb161bb20 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianPlaguelord.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianPlaguelord.java @@ -38,9 +38,10 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -51,7 +52,7 @@ import mage.target.common.TargetCreaturePermanent; public class PhyrexianPlaguelord extends CardImpl { public PhyrexianPlaguelord(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.CARRIER); this.power = new MageInt(4); @@ -67,7 +68,7 @@ public class PhyrexianPlaguelord extends CardImpl { // Sacrifice a creature: Target creature gets -1/-1 until end of turn. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianSoulgorger.java b/Mage.Sets/src/mage/cards/p/PhyrexianSoulgorger.java index f9949e4777..5bcb2fe753 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianSoulgorger.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianSoulgorger.java @@ -36,7 +36,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -46,14 +46,15 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianSoulgorger extends CardImpl { public PhyrexianSoulgorger(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); addSuperType(SuperType.SNOW); this.subtype.add(SubType.CONSTRUCT); this.power = new MageInt(8); this.toughness = new MageInt(8); // Cumulative upkeep-Sacrifice a creature. - this.addAbility(new CumulativeUpkeepAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); + this.addAbility(new CumulativeUpkeepAbility( + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public PhyrexianSoulgorger(final PhyrexianSoulgorger card) { diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianTower.java b/Mage.Sets/src/mage/cards/p/PhyrexianTower.java index 314c43249f..34a972ba8d 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianTower.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianTower.java @@ -39,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SuperType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianTower extends CardImpl { public PhyrexianTower(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); addSuperType(SuperType.LEGENDARY); // {tap}: Add {C} to your mana pool. @@ -56,7 +57,7 @@ public class PhyrexianTower extends CardImpl { // {tap}, Sacrifice a creature: Add {B}{B} to your mana pool. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana(2), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianVault.java b/Mage.Sets/src/mage/cards/p/PhyrexianVault.java index 05b6a4e66e..2323d206ec 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianVault.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianVault.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -47,10 +48,10 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PhyrexianVault extends CardImpl { public PhyrexianVault(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PlaguedRusalka.java b/Mage.Sets/src/mage/cards/p/PlaguedRusalka.java index 23cc2b1f2d..40a33775a4 100644 --- a/Mage.Sets/src/mage/cards/p/PlaguedRusalka.java +++ b/Mage.Sets/src/mage/cards/p/PlaguedRusalka.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -47,13 +48,13 @@ import mage.target.common.TargetCreaturePermanent; public class PlaguedRusalka extends CardImpl { public PlaguedRusalka(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.B)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PlaguemawBeast.java b/Mage.Sets/src/mage/cards/p/PlaguemawBeast.java index cb67ea3be9..0d337e0c17 100644 --- a/Mage.Sets/src/mage/cards/p/PlaguemawBeast.java +++ b/Mage.Sets/src/mage/cards/p/PlaguemawBeast.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.p; import java.util.UUID; @@ -40,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -48,18 +48,18 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class PlaguemawBeast extends CardImpl { - public PlaguemawBeast (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}"); + public PlaguemawBeast(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(4); this.toughness = new MageInt(3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ProliferateEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } - public PlaguemawBeast (final PlaguemawBeast card) { + public PlaguemawBeast(final PlaguemawBeast card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/p/PrimalGrowth.java b/Mage.Sets/src/mage/cards/p/PrimalGrowth.java index 4d2393857a..158ecafdcc 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalGrowth.java +++ b/Mage.Sets/src/mage/cards/p/PrimalGrowth.java @@ -27,6 +27,7 @@ */ package mage.cards.p; +import java.util.UUID; import mage.abilities.condition.common.KickedCondition; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -36,11 +37,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.StaticFilters; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author fireshoes @@ -48,11 +48,11 @@ import java.util.UUID; public class PrimalGrowth extends CardImpl { public PrimalGrowth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); // Kicker-Sacrifice a creature. - this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); - + this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); + // Search your library for a basic land card, put that card onto the battlefield, then shuffle your library. If Primal Growth was kicked, instead search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_BASIC_LAND_CARD), false, true), diff --git a/Mage.Sets/src/mage/cards/q/QuagmireDruid.java b/Mage.Sets/src/mage/cards/q/QuagmireDruid.java index 05eec0d41c..3dbb34ac37 100644 --- a/Mage.Sets/src/mage/cards/q/QuagmireDruid.java +++ b/Mage.Sets/src/mage/cards/q/QuagmireDruid.java @@ -38,9 +38,10 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetEnchantmentPermanent; @@ -51,17 +52,17 @@ import mage.target.common.TargetEnchantmentPermanent; public class QuagmireDruid extends CardImpl { public QuagmireDruid(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.DRUID); this.power = new MageInt(2); this.toughness = new MageInt(2); - + // {G}, {T}, Sacrifice a creature: Destroy target enchantment. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(false), new ColoredManaCost(ColoredManaSymbol.G)); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetEnchantmentPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java b/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java index d3bb2ae27c..b64a13b146 100644 --- a/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java +++ b/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java @@ -37,9 +37,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class ReaperOfFlightMoonsilver extends CardImpl { public ReaperOfFlightMoonsilver(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.subtype.add(SubType.ANGEL); this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -61,10 +62,10 @@ public class ReaperOfFlightMoonsilver extends CardImpl { // Activate this ability only if there are four or more card types among cards in your graveyard. this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), DeliriumCondition.instance, "Delirium — Sacrifice another creature: Reaper of Flight Moonsilver gets +2/+1 until end of turn. " - + "Activate this ability only if there are four or more card types among cards in your graveyard")); + + "Activate this ability only if there are four or more card types among cards in your graveyard")); } public ReaperOfFlightMoonsilver(final ReaperOfFlightMoonsilver card) { diff --git a/Mage.Sets/src/mage/cards/r/RecklessAbandon.java b/Mage.Sets/src/mage/cards/r/RecklessAbandon.java index 2c7f2433cb..08a1a7b10d 100644 --- a/Mage.Sets/src/mage/cards/r/RecklessAbandon.java +++ b/Mage.Sets/src/mage/cards/r/RecklessAbandon.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -43,10 +44,10 @@ import mage.target.common.TargetCreatureOrPlayer; public class RecklessAbandon extends CardImpl { public RecklessAbandon(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}"); // As an additional cost to cast Reckless Abandon, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Reckless Abandon deals 4 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(4)); diff --git a/Mage.Sets/src/mage/cards/r/RitualOfTheMachine.java b/Mage.Sets/src/mage/cards/r/RitualOfTheMachine.java index 062ec40840..8717c685f2 100644 --- a/Mage.Sets/src/mage/cards/r/RitualOfTheMachine.java +++ b/Mage.Sets/src/mage/cards/r/RitualOfTheMachine.java @@ -35,7 +35,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -57,10 +57,10 @@ public class RitualOfTheMachine extends CardImpl { } public RitualOfTheMachine(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); // As an additional cost to cast Ritual of the Machine, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Gain control of target nonartifact, nonblack creature. this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/r/RuthlessDisposal.java b/Mage.Sets/src/mage/cards/r/RuthlessDisposal.java index cb6b78d995..e7bcb8b3c8 100644 --- a/Mage.Sets/src/mage/cards/r/RuthlessDisposal.java +++ b/Mage.Sets/src/mage/cards/r/RuthlessDisposal.java @@ -38,6 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.filter.FilterCard; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetCardInHand; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -49,11 +50,11 @@ import mage.target.common.TargetCreaturePermanent; public class RuthlessDisposal extends CardImpl { public RuthlessDisposal(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}"); // As an additional cost to cast Ruthless Disposal, discard a card and sacrifice a creature. this.getSpellAbility().addCost(new DiscardTargetCost(new TargetCardInHand(new FilterCard("a card")))); - Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent()); + Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); cost.setText("As an additional cost to cast {this}, sacrifice a creature"); this.getSpellAbility().addCost(cost); diff --git a/Mage.Sets/src/mage/cards/r/RuthlessKnave.java b/Mage.Sets/src/mage/cards/r/RuthlessKnave.java index 96f7b85fda..7e1c736d3d 100644 --- a/Mage.Sets/src/mage/cards/r/RuthlessKnave.java +++ b/Mage.Sets/src/mage/cards/r/RuthlessKnave.java @@ -40,7 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.TreasureToken; @@ -69,7 +69,7 @@ public class RuthlessKnave extends CardImpl { // {2}{B}, Sacrifice a creature: Create two colorless Treasure artifact tokens with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool." Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new TreasureToken(), 2), new ManaCostsImpl("{2}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); // Sacrifice three Treasures: Draw a card. diff --git a/Mage.Sets/src/mage/cards/s/Sacrifice.java b/Mage.Sets/src/mage/cards/s/Sacrifice.java index 4859becf88..a331fead9c 100644 --- a/Mage.Sets/src/mage/cards/s/Sacrifice.java +++ b/Mage.Sets/src/mage/cards/s/Sacrifice.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.DynamicManaEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -44,13 +45,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Sacrifice extends CardImpl { public Sacrifice(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // As an additional cost to cast Sacrifice, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.BlackMana(1), new SacrificeCostConvertedMana("creature"), - "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost")); + "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost")); } public Sacrifice(final Sacrifice card) { diff --git a/Mage.Sets/src/mage/cards/s/SadisticHypnotist.java b/Mage.Sets/src/mage/cards/s/SadisticHypnotist.java index bc458bd6df..65a80e2138 100644 --- a/Mage.Sets/src/mage/cards/s/SadisticHypnotist.java +++ b/Mage.Sets/src/mage/cards/s/SadisticHypnotist.java @@ -38,7 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -50,7 +50,7 @@ import mage.target.common.TargetControlledPermanent; public class SadisticHypnotist extends CardImpl { public SadisticHypnotist(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.MINION); @@ -58,7 +58,7 @@ public class SadisticHypnotist extends CardImpl { this.toughness = new MageInt(2); // Sacrifice a creature: Target player discards two cards. Activate this ability only any time you could cast a sorcery. - TargetControlledPermanent target = new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent("a creature"), true); + TargetControlledPermanent target = new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT); Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(2), new SacrificeTargetCost(target)); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SanguinePraetor.java b/Mage.Sets/src/mage/cards/s/SanguinePraetor.java index 82a84cc0a7..1e5c0d1bee 100644 --- a/Mage.Sets/src/mage/cards/s/SanguinePraetor.java +++ b/Mage.Sets/src/mage/cards/s/SanguinePraetor.java @@ -42,7 +42,7 @@ import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledPermanent; @@ -63,7 +63,7 @@ public class SanguinePraetor extends CardImpl { // {B}, Sacrifice a creature: Destroy each creature with the same converted mana cost as the sacrificed creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SanguinePraetorEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledCreaturePermanent()))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/Scapegoat.java b/Mage.Sets/src/mage/cards/s/Scapegoat.java index 2e1fc84df4..24ab84650b 100644 --- a/Mage.Sets/src/mage/cards/s/Scapegoat.java +++ b/Mage.Sets/src/mage/cards/s/Scapegoat.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -44,11 +45,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Scapegoat extends CardImpl { public Scapegoat(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // As an additional cost to cast Scapegoat, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // Return any number of target creatures you control to their owner's hand. Effect effect = new ReturnToHandTargetEffect(); effect.setText("Return any number of target creatures you control to their owner's hand"); diff --git a/Mage.Sets/src/mage/cards/s/ScarlandThrinax.java b/Mage.Sets/src/mage/cards/s/ScarlandThrinax.java index ebcfd351b7..03d3cc2765 100644 --- a/Mage.Sets/src/mage/cards/s/ScarlandThrinax.java +++ b/Mage.Sets/src/mage/cards/s/ScarlandThrinax.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.s; import java.util.UUID; @@ -41,6 +40,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -50,8 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class ScarlandThrinax extends CardImpl { public ScarlandThrinax(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{R}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{R}{G}"); this.subtype.add(SubType.LIZARD); this.power = new MageInt(2); @@ -59,7 +58,7 @@ public class ScarlandThrinax extends CardImpl { // Sacrifice a creature: Put a +1/+1 counter on Scarland Thrinax. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/ScorchedRusalka.java b/Mage.Sets/src/mage/cards/s/ScorchedRusalka.java index c1854313a1..91e8dad3da 100644 --- a/Mage.Sets/src/mage/cards/s/ScorchedRusalka.java +++ b/Mage.Sets/src/mage/cards/s/ScorchedRusalka.java @@ -37,9 +37,10 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -50,13 +51,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class ScorchedRusalka extends CardImpl { public ScorchedRusalka(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ColoredManaCost(ColoredManaSymbol.R)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/ShattergangBrothers.java b/Mage.Sets/src/mage/cards/s/ShattergangBrothers.java index 7e87dd1667..93f1428076 100644 --- a/Mage.Sets/src/mage/cards/s/ShattergangBrothers.java +++ b/Mage.Sets/src/mage/cards/s/ShattergangBrothers.java @@ -42,8 +42,8 @@ import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledArtifactPermanent; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; @@ -59,7 +59,7 @@ import mage.target.common.TargetControlledPermanent; public class ShattergangBrothers extends CardImpl { public ShattergangBrothers(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{R}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.ARTIFICER); @@ -68,20 +68,19 @@ public class ShattergangBrothers extends CardImpl { this.toughness = new MageInt(3); // {2}{B}, Sacrifice a creature: Each other player sacrifices a creature. - FilterControlledCreaturePermanent filterCreature = new FilterControlledCreaturePermanent("a creature"); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShattergangBrothersEffect(filterCreature), new ManaCostsImpl("{2}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filterCreature, true))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShattergangBrothersEffect(FILTER_CONTROLLED_CREATURE_SHORT_TEXT), new ManaCostsImpl("{2}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); // {2}{R}, Sacrifice an artifact: Each other player sacrifices an artifact. FilterControlledPermanent filter = new FilterControlledArtifactPermanent("an artifact"); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShattergangBrothersEffect(filter), new ManaCostsImpl("{2}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, filter, true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, true))); this.addAbility(ability); // {2}{G}, Sacrifice an enchantment: Each other player sacrifices an enchantment. filter = new FilterControlledPermanent("an enchantment"); filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShattergangBrothersEffect(filter), new ManaCostsImpl("{2}{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, filter, true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, true))); this.addAbility(ability); } @@ -119,14 +118,14 @@ class ShattergangBrothersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for(UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { if (!Objects.equals(playerId, source.getControllerId())) { Player player = game.getPlayer(playerId); if (player != null) { TargetControlledPermanent target = new TargetControlledPermanent(filter); target.setNotTarget(true); - if (target.canChoose(source.getSourceId(), playerId, game) && - player.chooseTarget(outcome, target, source, game)) { + if (target.canChoose(source.getSourceId(), playerId, game) + && player.chooseTarget(outcome, target, source, game)) { Permanent permanent = game.getPermanent(target.getFirstTarget()); if (permanent != null) { permanent.sacrifice(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/s/ShivanHarvest.java b/Mage.Sets/src/mage/cards/s/ShivanHarvest.java index 5cf2d8786f..ce73b12ec1 100644 --- a/Mage.Sets/src/mage/cards/s/ShivanHarvest.java +++ b/Mage.Sets/src/mage/cards/s/ShivanHarvest.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetNonBasicLandPermanent; @@ -45,13 +46,13 @@ import mage.target.common.TargetNonBasicLandPermanent; * @author fireshoes */ public class ShivanHarvest extends CardImpl { - + public ShivanHarvest(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); // {1}{R}, Sacrifice a creature: Destroy target nonbasic land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetNonBasicLandPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SithEvoker.java b/Mage.Sets/src/mage/cards/s/SithEvoker.java index 0afb176e76..f550d53b26 100644 --- a/Mage.Sets/src/mage/cards/s/SithEvoker.java +++ b/Mage.Sets/src/mage/cards/s/SithEvoker.java @@ -47,7 +47,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -69,7 +69,7 @@ public class SithEvoker extends CardImpl { // {T}, {B}, Sacrifice a creature: You gain life equal to that creature's power or toughness. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SithEvokerEffect(), new ManaCostsImpl("{B}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SkeletalKathari.java b/Mage.Sets/src/mage/cards/s/SkeletalKathari.java index d2c8627bad..2b8bb6516e 100644 --- a/Mage.Sets/src/mage/cards/s/SkeletalKathari.java +++ b/Mage.Sets/src/mage/cards/s/SkeletalKathari.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class SkeletalKathari extends CardImpl { public SkeletalKathari(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.BIRD); this.subtype.add(SubType.SKELETON); @@ -58,7 +59,7 @@ public class SkeletalKathari extends CardImpl { this.addAbility(FlyingAbility.getInstance()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SkirsdagCultist.java b/Mage.Sets/src/mage/cards/s/SkirsdagCultist.java index 020a5e6540..84b9e297c2 100644 --- a/Mage.Sets/src/mage/cards/s/SkirsdagCultist.java +++ b/Mage.Sets/src/mage/cards/s/SkirsdagCultist.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -49,7 +50,7 @@ import mage.target.common.TargetCreatureOrPlayer; public class SkirsdagCultist extends CardImpl { public SkirsdagCultist(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SHAMAN); @@ -59,7 +60,7 @@ public class SkirsdagCultist extends CardImpl { // {R}, {T}, Sacrifice a creature: Skirsdag Cultist deals 2 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SkullCatapult.java b/Mage.Sets/src/mage/cards/s/SkullCatapult.java index 6bc31b81cd..d77aa3440c 100644 --- a/Mage.Sets/src/mage/cards/s/SkullCatapult.java +++ b/Mage.Sets/src/mage/cards/s/SkullCatapult.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -48,12 +49,12 @@ import mage.target.common.TargetCreatureOrPlayer; public class SkullCatapult extends CardImpl { public SkullCatapult(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // {1}, {tap}, Sacrifice a creature: Skull Catapult deals 2 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SpawningPit.java b/Mage.Sets/src/mage/cards/s/SpawningPit.java index 223e7635bf..dea54b797a 100644 --- a/Mage.Sets/src/mage/cards/s/SpawningPit.java +++ b/Mage.Sets/src/mage/cards/s/SpawningPit.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; import mage.counters.CounterType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.permanent.token.SpawningPitToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -51,7 +52,8 @@ public class SpawningPit extends CardImpl { public SpawningPit(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SpawningPitToken()), new GenericManaCost(1)); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(2))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SpontaneousCombustion.java b/Mage.Sets/src/mage/cards/s/SpontaneousCombustion.java index ecc9df5a37..577a50bc81 100644 --- a/Mage.Sets/src/mage/cards/s/SpontaneousCombustion.java +++ b/Mage.Sets/src/mage/cards/s/SpontaneousCombustion.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.DamageAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -43,10 +44,9 @@ import mage.target.common.TargetControlledCreaturePermanent; public class SpontaneousCombustion extends CardImpl { public SpontaneousCombustion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{R}"); - - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.getSpellAbility().addEffect(new DamageAllEffect(3, new FilterCreaturePermanent())); } diff --git a/Mage.Sets/src/mage/cards/s/StartFinish.java b/Mage.Sets/src/mage/cards/s/StartFinish.java index 90f937e52c..d832f9504b 100644 --- a/Mage.Sets/src/mage/cards/s/StartFinish.java +++ b/Mage.Sets/src/mage/cards/s/StartFinish.java @@ -38,7 +38,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.SpellAbilityType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.WarriorVigilantToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -63,7 +63,7 @@ public class StartFinish extends SplitCard { // Aftermath // As an additional cost to cast Finish, sacrifice a creature. Destroy target creature. ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true)); - getRightHalfCard().getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + getRightHalfCard().getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)"))); getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature")); } diff --git a/Mage.Sets/src/mage/cards/s/StarvedRusalka.java b/Mage.Sets/src/mage/cards/s/StarvedRusalka.java index b46a3e4609..bf4b576fce 100644 --- a/Mage.Sets/src/mage/cards/s/StarvedRusalka.java +++ b/Mage.Sets/src/mage/cards/s/StarvedRusalka.java @@ -37,9 +37,10 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,13 +50,13 @@ import mage.target.common.TargetControlledCreaturePermanent; public class StarvedRusalka extends CardImpl { public StarvedRusalka(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ColoredManaCost(ColoredManaSymbol.G)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/StrongholdAssassin.java b/Mage.Sets/src/mage/cards/s/StrongholdAssassin.java index d13110dd93..69fe436556 100644 --- a/Mage.Sets/src/mage/cards/s/StrongholdAssassin.java +++ b/Mage.Sets/src/mage/cards/s/StrongholdAssassin.java @@ -40,7 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -55,12 +55,13 @@ import mage.target.common.TargetCreaturePermanent; public class StrongholdAssassin extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + static { filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public StrongholdAssassin(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.ASSASSIN); @@ -69,7 +70,7 @@ public class StrongholdAssassin extends CardImpl { // {tap}, Sacrifice a creature: Destroy target nonblack creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); Target target = new TargetCreaturePermanent(filter); ability.addTarget(target); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/TempleOfAclazotz.java b/Mage.Sets/src/mage/cards/t/TempleOfAclazotz.java index 456e62b94c..c8cca454f4 100644 --- a/Mage.Sets/src/mage/cards/t/TempleOfAclazotz.java +++ b/Mage.Sets/src/mage/cards/t/TempleOfAclazotz.java @@ -41,7 +41,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -63,7 +63,7 @@ public class TempleOfAclazotz extends CardImpl { // {T}, Sacrifice a creature: You gain life equal to the sacrificed creature’s toughness. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TempleOfAclazotzEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TendrilsOfDespair.java b/Mage.Sets/src/mage/cards/t/TendrilsOfDespair.java index 6ede2df29d..180d75bd33 100644 --- a/Mage.Sets/src/mage/cards/t/TendrilsOfDespair.java +++ b/Mage.Sets/src/mage/cards/t/TendrilsOfDespair.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetOpponent; @@ -43,14 +44,14 @@ import mage.target.common.TargetOpponent; public class TendrilsOfDespair extends CardImpl { public TendrilsOfDespair(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); // As an additional cost to cast Tendrils of Despair, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // Target opponent discards two cards. this.getSpellAbility().addTarget(new TargetOpponent()); - this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); + this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); } public TendrilsOfDespair(final TendrilsOfDespair card) { diff --git a/Mage.Sets/src/mage/cards/t/TheloniteDruid.java b/Mage.Sets/src/mage/cards/t/TheloniteDruid.java index cd2aea0a5a..92c4875151 100644 --- a/Mage.Sets/src/mage/cards/t/TheloniteDruid.java +++ b/Mage.Sets/src/mage/cards/t/TheloniteDruid.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; @@ -57,7 +58,7 @@ public class TheloniteDruid extends CardImpl { } public TheloniteDruid(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); this.subtype.add(SubType.DRUID); @@ -71,7 +72,7 @@ public class TheloniteDruid extends CardImpl { effect, new ManaCostsImpl("{1}{G}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/Thermopod.java b/Mage.Sets/src/mage/cards/t/Thermopod.java index f183a4f159..3368cd6a5c 100644 --- a/Mage.Sets/src/mage/cards/t/Thermopod.java +++ b/Mage.Sets/src/mage/cards/t/Thermopod.java @@ -43,7 +43,7 @@ import mage.constants.SubType; import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,7 +53,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Thermopod extends CardImpl { public Thermopod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); addSuperType(SuperType.SNOW); this.subtype.add(SubType.SLUG); this.power = new MageInt(4); @@ -61,10 +61,10 @@ public class Thermopod extends CardImpl { // {S}: Thermopod gains haste until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect( - HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{S}"))); + HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{S}"))); // Sacrifice a creature: Add {R} to your mana pool. - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(1), new SacrificeTargetCost( - new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(1), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public Thermopod(final Thermopod card) { diff --git a/Mage.Sets/src/mage/cards/t/ThoughtpickerWitch.java b/Mage.Sets/src/mage/cards/t/ThoughtpickerWitch.java index 7a0f37f19f..aa8a6e6e4d 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtpickerWitch.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtpickerWitch.java @@ -44,7 +44,7 @@ import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -68,7 +68,7 @@ public class ThoughtpickerWitch extends CardImpl { // {1}, Sacrifice a creature: Look at the top two cards of target opponent's library, then exile one of them. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThoughtpickerWitchEffect(), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TradingPost.java b/Mage.Sets/src/mage/cards/t/TradingPost.java index bbb4ab78c3..602f148177 100644 --- a/Mage.Sets/src/mage/cards/t/TradingPost.java +++ b/Mage.Sets/src/mage/cards/t/TradingPost.java @@ -43,9 +43,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterArtifactCard; import mage.filter.common.FilterControlledArtifactPermanent; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.permanent.token.GoatToken; import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInHand; @@ -76,7 +76,7 @@ public class TradingPost extends CardImpl { Ability ability3 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new GenericManaCost(1)); ability3.addTarget(new TargetCardInGraveyard(new FilterArtifactCard("an artifact card in your graveyard"))); ability3.addCost(new TapSourceCost()); - ability3.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledCreaturePermanent("a creature")))); + ability3.addCost(new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability3); // {1}, {T}, Sacrifice an artifact: Draw a card. diff --git a/Mage.Sets/src/mage/cards/t/TymaretTheMurderKing.java b/Mage.Sets/src/mage/cards/t/TymaretTheMurderKing.java index e2b4986194..89cecce087 100644 --- a/Mage.Sets/src/mage/cards/t/TymaretTheMurderKing.java +++ b/Mage.Sets/src/mage/cards/t/TymaretTheMurderKing.java @@ -42,7 +42,7 @@ import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -68,7 +68,7 @@ public class TymaretTheMurderKing extends CardImpl { this.addAbility(ability); // {1}{B}, Sacrifice a creature: Return Tymaret from your graveyard to your hand. ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{1}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), false))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/u/UndercityInformer.java b/Mage.Sets/src/mage/cards/u/UndercityInformer.java index 64ef22c723..e6f9a0c329 100644 --- a/Mage.Sets/src/mage/cards/u/UndercityInformer.java +++ b/Mage.Sets/src/mage/cards/u/UndercityInformer.java @@ -41,9 +41,10 @@ import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -56,18 +57,17 @@ import mage.target.common.TargetControlledCreaturePermanent; public class UndercityInformer extends CardImpl { public UndercityInformer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); - this.power = new MageInt(2); this.toughness = new MageInt(3); //{1}, Sacrifice a creature: Target player reveals the top card of his or her library until he or she reveals a land card, then puts those cards into his or her graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UndercityInformerEffect(), new ManaCostsImpl("{1}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } @@ -82,7 +82,6 @@ public class UndercityInformer extends CardImpl { } } - class UndercityInformerEffect extends OneShotEffect { public UndercityInformerEffect() { @@ -105,13 +104,13 @@ class UndercityInformerEffect extends OneShotEffect { if (player == null) { return false; } - + Cards cards = new CardsImpl(); - while(player.getLibrary().hasCards()){ + while (player.getLibrary().hasCards()) { Card card = player.getLibrary().removeFromTop(game); if (card != null) { cards.add(card); - if(card.isLand()){ + if (card.isLand()) { break; } } diff --git a/Mage.Sets/src/mage/cards/v/VampiricRites.java b/Mage.Sets/src/mage/cards/v/VampiricRites.java index 105091b898..e56d337b45 100644 --- a/Mage.Sets/src/mage/cards/v/VampiricRites.java +++ b/Mage.Sets/src/mage/cards/v/VampiricRites.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,11 +49,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class VampiricRites extends CardImpl { public VampiricRites(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}"); // {1}{B}, Sacrifice a creature: You gain 1 life and draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl<>("{1}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); Effect effect = new DrawCardSourceControllerEffect(1); effect.setText("and draw a card"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/v/Victimize.java b/Mage.Sets/src/mage/cards/v/Victimize.java index 5ff6e591e1..48c2fa01f6 100644 --- a/Mage.Sets/src/mage/cards/v/Victimize.java +++ b/Mage.Sets/src/mage/cards/v/Victimize.java @@ -37,7 +37,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; @@ -88,7 +88,7 @@ class VictimizeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))); + SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { game.applyEffects(); // To end effects of the sacrificed creature controller.moveCards(new CardsImpl(getTargetPointer().getTargets(game, source)).getCards(game), diff --git a/Mage.Sets/src/mage/cards/v/VisceraSeer.java b/Mage.Sets/src/mage/cards/v/VisceraSeer.java index f765df669a..d1386f2758 100644 --- a/Mage.Sets/src/mage/cards/v/VisceraSeer.java +++ b/Mage.Sets/src/mage/cards/v/VisceraSeer.java @@ -37,6 +37,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,7 +54,8 @@ public class VisceraSeer extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); // Sacrifice a creature: Scry 1. (To scry 1, look at the top card of your library, then you may put that card on the bottom of your library.) - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); } public VisceraSeer(final VisceraSeer card) { diff --git a/Mage.Sets/src/mage/cards/v/VisceridDrone.java b/Mage.Sets/src/mage/cards/v/VisceridDrone.java index be780f4290..2bf56a3205 100644 --- a/Mage.Sets/src/mage/cards/v/VisceridDrone.java +++ b/Mage.Sets/src/mage/cards/v/VisceridDrone.java @@ -35,11 +35,12 @@ import mage.abilities.costs.CompositeCost; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.SubType; import mage.constants.SuperType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; @@ -78,7 +79,7 @@ public class VisceridDrone extends CardImpl { // {tap}, Sacrifice a creature and a Swamp: Destroy target nonartifact creature. It can't be regenerated. Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect(true), new TapSourceCost()); ability.addCost(new CompositeCost( - new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), new SacrificeTargetCost(new TargetControlledPermanent(filter2)), "Sacrifice a creature and a Swamp" )); @@ -88,7 +89,7 @@ public class VisceridDrone extends CardImpl { // {tap}, Sacrifice a creature and a snow Swamp: Destroy target creature. It can't be regenerated. ability = new SimpleActivatedAbility(new DestroyTargetEffect(true), new TapSourceCost()); ability.addCost(new CompositeCost( - new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), new SacrificeTargetCost(new TargetControlledPermanent(filter3)), "Sacrifice a creature and a snow Swamp" )); diff --git a/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java b/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java index ac18d5cf5f..a68eec50bd 100644 --- a/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java +++ b/Mage.Sets/src/mage/cards/v/VishKalBloodArbiter.java @@ -51,7 +51,7 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.counters.Counter; import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -64,7 +64,7 @@ import mage.target.common.TargetCreaturePermanent; public class VishKalBloodArbiter extends CardImpl { public VishKalBloodArbiter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VAMPIRE); @@ -78,7 +78,7 @@ public class VishKalBloodArbiter extends CardImpl { // Sacrifice a creature: Put X +1/+1 counters on Vish Kal, Blood Arbiter, where X is the sacrificed creature's power. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new SacrificeCostCreaturesPower(), true), - new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), false)))); + new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // Remove all +1/+1 counters from Vish Kal: Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way. DynamicValue removedCounters = new SignInversionDynamicValue(new VishKalBloodArbiterDynamicValue()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(removedCounters, removedCounters, Duration.EndOfTurn), new VishKalBloodArbiterCost(CounterType.P1P1.createInstance())); @@ -126,9 +126,7 @@ class VishKalBloodArbiterCost extends CostImpl { this.amount = permanent.getCounters(game).getCount(name); permanent.removeCounters(name, amount, game); this.paid = true; - } - else - { + } else { this.amount = 0; } return paid; @@ -143,12 +141,10 @@ class VishKalBloodArbiterCost extends CostImpl { return amount; } - } class VishKalBloodArbiterDynamicValue implements DynamicValue { - public VishKalBloodArbiterDynamicValue() { } @@ -159,9 +155,9 @@ class VishKalBloodArbiterDynamicValue implements DynamicValue { @Override public int calculate(Game game, Ability source, Effect effect) { int count = 0; - for(Cost cost : source.getCosts()){ - if(cost instanceof VishKalBloodArbiterCost){ - count += ((VishKalBloodArbiterCost)cost).getAmount(); + for (Cost cost : source.getCosts()) { + if (cost instanceof VishKalBloodArbiterCost) { + count += ((VishKalBloodArbiterCost) cost).getAmount(); } } return count; diff --git a/Mage.Sets/src/mage/cards/v/Vivisection.java b/Mage.Sets/src/mage/cards/v/Vivisection.java index 2d1c3d50f2..27ada80979 100644 --- a/Mage.Sets/src/mage/cards/v/Vivisection.java +++ b/Mage.Sets/src/mage/cards/v/Vivisection.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.v; import java.util.UUID; @@ -34,6 +33,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -42,14 +42,14 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class Vivisection extends CardImpl { - public Vivisection (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}"); + public Vivisection(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); } - public Vivisection (final Vivisection card) { + public Vivisection(final Vivisection card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/w/WakeOfVultures.java b/Mage.Sets/src/mage/cards/w/WakeOfVultures.java index e59d24284e..98ef4d9e84 100644 --- a/Mage.Sets/src/mage/cards/w/WakeOfVultures.java +++ b/Mage.Sets/src/mage/cards/w/WakeOfVultures.java @@ -40,6 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class WakeOfVultures extends CardImpl { public WakeOfVultures(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.BIRD); this.power = new MageInt(3); this.toughness = new MageInt(1); @@ -58,7 +59,7 @@ public class WakeOfVultures extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {1}{B}, Sacrifice a creature: Regenerate Wake of Vultures. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/w/WickedReward.java b/Mage.Sets/src/mage/cards/w/WickedReward.java index 9261954c8d..f2dd9c96e2 100644 --- a/Mage.Sets/src/mage/cards/w/WickedReward.java +++ b/Mage.Sets/src/mage/cards/w/WickedReward.java @@ -7,27 +7,28 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; public class WickedReward extends CardImpl { - public WickedReward(UUID cardId, CardSetInfo cardSetInfo){ + public WickedReward(UUID cardId, CardSetInfo cardSetInfo) { super(cardId, cardSetInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); //As an additional cost to cast Wicked Reward, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); //Target creature gets +4/+2 until end of turn. this.getSpellAbility().addEffect(new BoostTargetEffect(4, 2, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } - public WickedReward(WickedReward other){ + public WickedReward(WickedReward other) { super(other); } - public WickedReward copy(){ + public WickedReward copy() { return new WickedReward(this); } } diff --git a/Mage.Sets/src/mage/cards/w/WorthyCause.java b/Mage.Sets/src/mage/cards/w/WorthyCause.java index ba107d1a20..1932f4f527 100644 --- a/Mage.Sets/src/mage/cards/w/WorthyCause.java +++ b/Mage.Sets/src/mage/cards/w/WorthyCause.java @@ -36,6 +36,7 @@ import mage.abilities.keyword.BuybackAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -45,14 +46,14 @@ import mage.target.common.TargetControlledCreaturePermanent; public class WorthyCause extends CardImpl { public WorthyCause(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Buyback {2} this.addAbility(new BuybackAbility("{2}")); - + // As an additional cost to cast Worthy Cause, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + // You gain life equal to the sacrificed creature's toughness. Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness()); effect.setText("You gain life equal to the sacrificed creature's toughness"); diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index a9894b4f59..0cfe31f09a 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -180,6 +180,14 @@ public final class StaticFilters { static { FILTER_CONTROLLED_CREATURE.setLockedFilter(true); } + + // Used for sacrifice targets that don't need the "you control" text + public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_CREATURE_SHORT_TEXT = new FilterControlledCreaturePermanent("a creature"); + + static { + FILTER_CONTROLLED_CREATURE_SHORT_TEXT.setLockedFilter(true); + } + public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_CREATURES = new FilterControlledCreaturePermanent("creatures you control"); static { @@ -219,6 +227,10 @@ public final class StaticFilters { public static final FilterLandPermanent FILTER_LANDS_NONBASIC = FilterLandPermanent.nonbasicLands(); + static { + FILTER_LANDS_NONBASIC.setLockedFilter(true); + } + public static final FilterBasicLandCard FILTER_BASIC_LAND_CARD = new FilterBasicLandCard(); static { diff --git a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java index 9b45cf007d..7f47bab594 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java @@ -37,6 +37,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.command.Emblem; import mage.target.common.TargetControlledCreaturePermanent; @@ -45,7 +46,7 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author spjspj */ public class ObNixilisOfTheBlackOathEmblem extends Emblem { - + // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." public ObNixilisOfTheBlackOathEmblem() { this.setName("Emblem Nixilis"); @@ -53,7 +54,7 @@ public class ObNixilisOfTheBlackOathEmblem extends Emblem { Effect effect = new GainLifeEffect(xValue); effect.setText("You gain X life"); Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); effect = new DrawCardSourceControllerEffect(xValue); effect.setText("and draw X cards, where X is the sacrificed creature's power"); ability.addEffect(effect);