Fixed wrong/miss numbers in card rules (see #10067 and prev commit)

This commit is contained in:
Oleg Agafonov 2023-02-25 14:34:26 +04:00
parent 99d1800214
commit 5c30467c48
75 changed files with 105 additions and 88 deletions

View file

@ -15,6 +15,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -34,7 +35,7 @@ public final class AdvancedStitchwing extends CardImpl {
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// {2}{U}, Discard two cards: Return Advanced Stitchwing from your graveyard to the battlefield tapped. // {2}{U}, Discard two cards: Return Advanced Stitchwing from your graveyard to the battlefield tapped.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{2}{U}")); Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{2}{U}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -40,7 +40,7 @@ public final class AlexiZephyrMage extends CardImpl {
effect.setText("Return X target creatures to their owner's hands"); effect.setText("Return X target creatures to their owner's hands");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}{U}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}{U}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURES)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURES));
ability.setTargetAdjuster(XTargetsAdjuster.instance); ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability); this.addAbility(ability);

View file

@ -28,7 +28,7 @@ import mage.target.common.TargetCardInHand;
*/ */
public final class AllosaurusRider extends CardImpl { public final class AllosaurusRider extends CardImpl {
private static final FilterCard filter = new FilterCard("two green cards"); private static final FilterCard filter = new FilterCard("green cards");
static { static {
filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new ColorPredicate(ObjectColor.GREEN));

View file

@ -12,6 +12,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -30,7 +31,7 @@ public final class AnuridBrushhopper extends CardImpl {
// Discard two cards: Exile Anurid Brushhopper. Return it to the battlefield under its owner's control at the beginning of the next end step. // Discard two cards: Exile Anurid Brushhopper. Return it to the battlefield under its owner's control at the beginning of the next end step.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(), new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(),
new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))))); new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS))));
} }
private AnuridBrushhopper(final AnuridBrushhopper card) { private AnuridBrushhopper(final AnuridBrushhopper card) {

View file

@ -12,6 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -31,7 +32,7 @@ public final class AvatarOfDiscord extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// When Avatar of Discord enters the battlefield, sacrifice it unless you discard two cards. // When Avatar of Discord enters the battlefield, sacrifice it unless you discard two cards.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))))); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)))));
} }
private AvatarOfDiscord(final AvatarOfDiscord card) { private AvatarOfDiscord(final AvatarOfDiscord card) {

View file

@ -8,6 +8,7 @@ import mage.cards.Cards;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -128,7 +129,7 @@ class BalancingActDiscardEffect extends OneShotEffect {
if (player == null) { if (player == null) {
continue; continue;
} }
TargetCardInHand target = new TargetCardInHand(minCard, new FilterCard()); TargetCardInHand target = new TargetCardInHand(minCard, StaticFilters.FILTER_CARD);
if (target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), source, game)) { if (target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), source, game)) {
Cards cards = player.getHand().copy(); Cards cards = player.getHand().copy();
cards.removeIf(target.getTargets()::contains); cards.removeIf(target.getTargets()::contains);

View file

@ -71,7 +71,7 @@ class BenthicExplorersCost extends CostImpl {
public BenthicExplorersCost(TargetLandPermanent target) { public BenthicExplorersCost(TargetLandPermanent target) {
this.target = target; this.target = target;
this.text = "Untap " + CardUtil.numberToText(target.getMaxNumberOfTargets(), "") + ' ' + target.getTargetName(); this.text = "Untap " + target.getDescription();
} }
public BenthicExplorersCost(final BenthicExplorersCost cost) { public BenthicExplorersCost(final BenthicExplorersCost cost) {

View file

@ -37,7 +37,7 @@ public final class BetrayalOfFlesh extends CardImpl {
mode.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); mode.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
this.getSpellAbility().getModes().addMode(mode); this.getSpellAbility().getModes().addMode(mode);
// Entwine-Sacrifice three lands. // Entwine-Sacrifice three lands.
this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("three lands"), true)))); this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true))));
} }
private BetrayalOfFlesh(final BetrayalOfFlesh card) { private BetrayalOfFlesh(final BetrayalOfFlesh card) {

View file

@ -9,6 +9,7 @@ import mage.cards.Cards;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -66,7 +67,7 @@ class BreakthroughEffect extends OneShotEffect {
if (amountToKeep == 0) { if (amountToKeep == 0) {
player.discard(player.getHand(), false, source, game); player.discard(player.getHand(), false, source, game);
} else if (amountToKeep < player.getHand().size()) { } else if (amountToKeep < player.getHand().size()) {
TargetCardInHand target = new TargetCardInHand(amountToKeep, new FilterCard()); TargetCardInHand target = new TargetCardInHand(amountToKeep, StaticFilters.FILTER_CARD);
target.setTargetName("cards to keep"); target.setTargetName("cards to keep");
target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), source, game); target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), source, game);
Cards cards = player.getHand().copy(); Cards cards = player.getHand().copy();

View file

@ -8,6 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -20,7 +21,7 @@ public final class CatharticReunion extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}");
// As an additional cost to cast Cathartic Reunion, discard two cards. // As an additional cost to cast Cathartic Reunion, discard two cards.
this.getSpellAbility().addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); this.getSpellAbility().addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
// Draw three cards. // Draw three cards.
getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3));

View file

@ -26,7 +26,7 @@ import mage.target.common.TargetCardInHand;
*/ */
public final class Commandeer extends CardImpl { public final class Commandeer extends CardImpl {
private static final FilterCard filter = new FilterCard("two blue cards"); private static final FilterCard filter = new FilterCard("blue cards");
static { static {
filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(new ColorPredicate(ObjectColor.BLUE));

View file

@ -29,7 +29,7 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public final class ConsecratedByBlood extends CardImpl { public final class ConsecratedByBlood extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("two other creatures"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
static { static {
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);

View file

@ -31,7 +31,7 @@ public final class CosmicLarva extends CardImpl {
// Trample // Trample
this.addAbility(TrampleAbility.getInstance()); this.addAbility(TrampleAbility.getInstance());
// At the beginning of your upkeep, sacrifice Cosmic Larva unless you sacrifice two lands. // At the beginning of your upkeep, sacrifice Cosmic Larva unless you sacrifice two lands.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true))), TargetController.YOU, false)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), true))), TargetController.YOU, false));
} }
private CosmicLarva(final CosmicLarva card) { private CosmicLarva(final CosmicLarva card) {

View file

@ -31,7 +31,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class DarkSupplicant extends CardImpl { public final class DarkSupplicant extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("three Clerics you control"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Clerics you control");
static { static {
filter.add(SubType.CLERIC.getPredicate()); filter.add(SubType.CLERIC.getPredicate());

View file

@ -9,6 +9,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
@ -22,7 +23,7 @@ public final class DemonicCollusion extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}");
// BuybackDiscard two cards. (You may discard two cards in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves.) // BuybackDiscard two cards. (You may discard two cards in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves.)
this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))))); this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS))));
// Search your library for a card and put that card into your hand. Then shuffle your library. // Search your library for a card and put that card into your hand. Then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(),false)); this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(),false));

View file

@ -24,7 +24,7 @@ import java.util.UUID;
*/ */
public final class DespoilerOfSouls extends CardImpl { public final class DespoilerOfSouls extends CardImpl {
private static final FilterCard filter = new FilterCreatureCard("two other creature cards from your graveyard"); private static final FilterCard filter = new FilterCreatureCard("other creature cards from your graveyard");
static { static {
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);

View file

@ -27,7 +27,7 @@ import java.util.UUID;
*/ */
public final class DrivnodCarnageDominus extends CardImpl { public final class DrivnodCarnageDominus extends CardImpl {
private static final FilterCard filter = new FilterCreatureCard("three creature cards from your graveyard"); private static final FilterCard filter = new FilterCreatureCard("creature cards from your graveyard");
public DrivnodCarnageDominus(UUID ownerId, CardSetInfo setInfo) { public DrivnodCarnageDominus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");

View file

@ -24,8 +24,6 @@ import java.util.UUID;
*/ */
public final class FaeOfWishes extends AdventureCard { public final class FaeOfWishes extends AdventureCard {
private static final FilterCard filter = new FilterCard("two cards");
public FaeOfWishes(UUID ownerId, CardSetInfo setInfo) { public FaeOfWishes(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{1}{U}", "Granted", "{3}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{1}{U}", "Granted", "{3}{U}");
@ -41,7 +39,7 @@ public final class FaeOfWishes extends AdventureCard {
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(
new ReturnToHandSourceEffect(true), new ManaCostsImpl<>("{1}{U}") new ReturnToHandSourceEffect(true), new ManaCostsImpl<>("{1}{U}")
); );
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, filter))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
// Granted // Granted

View file

@ -20,7 +20,7 @@ import mage.target.common.TargetAnyTarget;
*/ */
public final class Fireblast extends CardImpl { public final class Fireblast extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Mountains"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountains");
static { static {
filter.add(SubType.MOUNTAIN.getPredicate()); filter.add(SubType.MOUNTAIN.getPredicate());

View file

@ -9,6 +9,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -23,7 +24,7 @@ public final class Forbid extends CardImpl {
// Buyback-Discard two cards. // Buyback-Discard two cards.
this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))))); this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS))));
// Counter target spell. // Counter target spell.
this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addTarget(new TargetSpell());

View file

@ -27,7 +27,7 @@ import mage.target.common.TargetControlledPermanent;
public final class FungalPlots extends CardImpl { public final class FungalPlots extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card from your graveyard"); private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card from your graveyard");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("two Saprolings"); private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("Saprolings");
static { static {
filter2.add(SubType.SAPROLING.getPredicate()); filter2.add(SubType.SAPROLING.getPredicate());

View file

@ -21,7 +21,7 @@ import mage.watchers.common.AttackedThisTurnWatcher;
*/ */
public final class FuryOfTheHorde extends CardImpl { public final class FuryOfTheHorde extends CardImpl {
private static final FilterCard filter = new FilterCard("two red cards"); private static final FilterCard filter = new FilterCard("red cards");
static { static {
filter.add(new ColorPredicate(ObjectColor.RED)); filter.add(new ColorPredicate(ObjectColor.RED));

View file

@ -22,6 +22,7 @@ import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -48,7 +49,7 @@ public final class GeralfsMasterpiece extends CardImpl {
// {3}{U}, Discard three cards: Return Geralf's Masterpiece from your graveyard to the battlefield tapped. // {3}{U}, Discard three cards: Return Geralf's Masterpiece from your graveyard to the battlefield tapped.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{3}{U}")); Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{3}{U}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(3, new FilterCard("three cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(3, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -14,6 +14,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -31,7 +32,7 @@ public final class Ghoulsteed extends CardImpl {
// {2}{B}, Discard two cards: Return Ghouldsteed from your graveyard to the battlefield tapped. // {2}{B}, Discard two cards: Return Ghouldsteed from your graveyard to the battlefield tapped.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{2}{B}")); Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl<>("{2}{B}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -14,6 +14,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -24,8 +25,6 @@ import java.util.UUID;
*/ */
public final class GreelMindRaker extends CardImpl { public final class GreelMindRaker extends CardImpl {
private static final FilterCard filter = new FilterCard("two cards");
public GreelMindRaker(UUID ownerId, CardSetInfo setInfo) { public GreelMindRaker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
@ -40,7 +39,7 @@ public final class GreelMindRaker extends CardImpl {
ManacostVariableValue.REGULAR, true ManacostVariableValue.REGULAR, true
), new ManaCostsImpl<>("{X}{B}")); ), new ManaCostsImpl<>("{X}{B}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, filter))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -16,6 +16,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.permanent.token.SpiritWhiteToken; import mage.game.permanent.token.SpiritWhiteToken;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -36,7 +37,7 @@ public final class HauntedDead extends CardImpl {
// {1}{B}, Discard two cards: Return Haunted Dead from your graveyard to the battlefield tapped. // {1}{B}, Discard two cards: Return Haunted Dead from your graveyard to the battlefield tapped.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true, false), new ManaCostsImpl<>("{1}{B}")); Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true, false), new ManaCostsImpl<>("{1}{B}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -52,14 +52,14 @@ public final class IlluminatedFolio extends CardImpl {
class IlluminatedFolioTarget extends TargetCardInHand { class IlluminatedFolioTarget extends TargetCardInHand {
private static final FilterCard filter = new FilterCard("two cards from your hand that share a color"); private static final FilterCard filter = new FilterCard("cards from your hand that share a color");
static { static {
filter.add(Predicates.not(ColorlessPredicate.instance)); filter.add(Predicates.not(ColorlessPredicate.instance));
} }
public IlluminatedFolioTarget() { public IlluminatedFolioTarget() {
super(2, 2, filter); super(2, filter);
} }
private IlluminatedFolioTarget(final IlluminatedFolioTarget target) { private IlluminatedFolioTarget(final IlluminatedFolioTarget target) {

View file

@ -43,7 +43,7 @@ public final class JeweledSpirit extends CardImpl {
// Sacrifice two lands: Jeweled Spirit gains protection from artifacts or from the color of your choice until end of turn. // Sacrifice two lands: Jeweled Spirit gains protection from artifacts or from the color of your choice until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new JeweledSpiritEffect(), this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new JeweledSpiritEffect(),
new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true)))); new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), true))));
} }
private JeweledSpirit(final JeweledSpirit card) { private JeweledSpirit(final JeweledSpirit card) {

View file

@ -15,6 +15,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
@ -40,7 +41,7 @@ public final class JolraelEmpressOfBeasts extends CardImpl {
// {2}{G}, {tap}, Discard two cards: All lands target player controls become 3/3 creatures until end of turn. They're still lands. // {2}{G}, {tap}, Discard two cards: All lands target player controls become 3/3 creatures until end of turn. They're still lands.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JolraelEmpressOfBeastsEffect(), new ManaCostsImpl<>("{2}{G}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JolraelEmpressOfBeastsEffect(), new ManaCostsImpl<>("{2}{G}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -32,7 +32,7 @@ public final class KeldonArsonist extends CardImpl {
// {1}, Sacrifice two lands: Destroy target land. // {1}, Sacrifice two lands: Destroy target land.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(1)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(1));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true))); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), true)));
TargetLandPermanent target = new TargetLandPermanent(); TargetLandPermanent target = new TargetLandPermanent();
target.setTargetName("land (to destroy)"); target.setTargetName("land (to destroy)");
ability.addTarget(target); ability.addTarget(target);

View file

@ -33,10 +33,9 @@ public final class KrarkClanEngineers extends CardImpl {
// {R}, Sacrifice two artifacts: Destroy target artifact. // {R}, Sacrifice two artifacts: Destroy target artifact.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl<>("{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl<>("{R}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledArtifactPermanent("two artifacts"), true))); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledArtifactPermanent("artifacts"), true)));
ability.addTarget(new TargetArtifactPermanent()); ability.addTarget(new TargetArtifactPermanent());
this.addAbility(ability); this.addAbility(ability);
} }
private KrarkClanEngineers(final KrarkClanEngineers card) { private KrarkClanEngineers(final KrarkClanEngineers card) {

View file

@ -17,6 +17,7 @@ import mage.constants.SubType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
import mage.target.common.TargetAnyTarget; import mage.target.common.TargetAnyTarget;
@ -37,7 +38,7 @@ public final class LatullaKeldonOverseer extends CardImpl {
// {X}{R}, {tap}, Discard two cards: Latulla, Keldon Overseer deals X damage to any target. // {X}{R}, {tap}, Discard two cards: Latulla, Keldon Overseer deals X damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}{R}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, 2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -35,7 +35,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class Leviathan extends CardImpl { public final class Leviathan extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Islands"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands");
static { static {
filter.add(SubType.ISLAND.getPredicate()); filter.add(SubType.ISLAND.getPredicate());
} }
@ -82,7 +82,7 @@ public final class Leviathan extends CardImpl {
class LeviathanCostToAttackBlockEffect extends PayCostToAttackBlockEffectImpl { class LeviathanCostToAttackBlockEffect extends PayCostToAttackBlockEffectImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Islands"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands");
static { static {
filter.add(SubType.ISLAND.getPredicate()); filter.add(SubType.ISLAND.getPredicate());
} }

View file

@ -42,7 +42,7 @@ public final class Lifespinner extends CardImpl {
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)),
new TapSourceCost()); new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledCreaturePermanent(SubType.SPIRIT, "three Spirits"), false))); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledCreaturePermanent(SubType.SPIRIT, "Spirits"), false)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -22,7 +22,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class LotusVale extends CardImpl { public final class LotusVale extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("two untapped lands"); private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("untapped lands");
static { static {
filter.add(TappedPredicate.UNTAPPED); filter.add(TappedPredicate.UNTAPPED);

View file

@ -17,6 +17,7 @@ import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.AnotherPredicate; import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -44,7 +45,7 @@ public final class MagetaTheLion extends CardImpl {
// {2}{W}{W}, {tap}, Discard two cards: Destroy all creatures except for Mageta the Lion. Those creatures can't be regenerated. // {2}{W}{W}, {tap}, Discard two cards: Destroy all creatures except for Mageta the Lion. Those creatures can't be regenerated.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(filter, true), new ManaCostsImpl<>("{2}{W}{W}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(filter, true), new ManaCostsImpl<>("{2}{W}{W}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2,2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,7 +27,7 @@ public final class MagmaBurst extends CardImpl {
// Kicker-Sacrifice two lands. // Kicker-Sacrifice two lands.
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2,
new FilterControlledLandPermanent("two lands"), true)))); new FilterControlledLandPermanent("lands"), true))));
// Magma Burst deals 3 damage to any target. If Magma Burst was kicked, it deals 3 damage to another any target. // Magma Burst deals 3 damage to any target. If Magma Burst was kicked, it deals 3 damage to another any target.
Effect effect = new DamageTargetEffect(3); Effect effect = new DamageTargetEffect(3);

View file

@ -27,7 +27,7 @@ public final class MeteorStorm extends CardImpl {
// {2}{R}{G}, Discard two cards at random: Meteor Storm deals 4 damage to any target. // {2}{R}{G}, Discard two cards at random: Meteor Storm deals 4 damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(4), new ManaCostsImpl<>("{2}{R}{G}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(4), new ManaCostsImpl<>("{2}{R}{G}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards at random")), true)); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("cards at random")), true));
ability.addTarget(new TargetAnyTarget()); ability.addTarget(new TargetAnyTarget());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -19,7 +19,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class MoggAlarm extends CardImpl { public final class MoggAlarm extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Mountains"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountains");
static { static {
filter.add(SubType.MOUNTAIN.getPredicate()); filter.add(SubType.MOUNTAIN.getPredicate());
} }

View file

@ -19,7 +19,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class MoldDemon extends CardImpl { public final class MoldDemon extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("two Swamps"); private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Swamps");
static{ static{
filter.add(SubType.SWAMP.getPredicate()); filter.add(SubType.SWAMP.getPredicate());

View file

@ -22,6 +22,7 @@ import mage.constants.SuperType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -59,7 +60,7 @@ public final class NezahalPrimalTide extends CardImpl {
// Discard three cards: Exile Nezahal. Return it to the battlefield tapped under its owner's control at the beginning of the next end step. // Discard three cards: Exile Nezahal. Return it to the battlefield tapped under its owner's control at the beginning of the next end step.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true), this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true),
new DiscardTargetCost(new TargetCardInHand(3, new FilterCard("three cards"))))); new DiscardTargetCost(new TargetCardInHand(3, StaticFilters.FILTER_CARD_CARDS))));
} }

View file

@ -25,7 +25,7 @@ public final class NightSoil extends CardImpl {
// {1}, Exile two creature cards from a single graveyard: Create a 1/1 green Saproling creature token. // {1}, Exile two creature cards from a single graveyard: Create a 1/1 green Saproling creature token.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new GenericManaCost(1)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new GenericManaCost(1));
ability.addCost(new ExileFromGraveCost(new TargetCardInASingleGraveyard(2, 2, new FilterCreatureCard("two creature cards")))); ability.addCost(new ExileFromGraveCost(new TargetCardInASingleGraveyard(2, 2, new FilterCreatureCard("creature cards"))));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -31,7 +31,7 @@ public final class OrganGrinder extends CardImpl {
// {tap}, Exile three cards from your graveyard: Target player loses 3 life. // {tap}, Exile three cards from your graveyard: Target player loses 3 life.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost());
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCard("three cards from your graveyard")))); ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCard("cards from your graveyard"))));
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -114,7 +114,7 @@ class OrmosArchiveKeeperEffect extends ReplacementEffectImpl {
class OrmosArchiveKeeperTarget extends TargetCardInHand { class OrmosArchiveKeeperTarget extends TargetCardInHand {
private static final FilterCard filter = new FilterCard("three cards with different names"); private static final FilterCard filter = new FilterCard("cards with different names");
OrmosArchiveKeeperTarget() { OrmosArchiveKeeperTarget() {
super(3, filter); super(3, filter);

View file

@ -18,6 +18,7 @@ import mage.constants.SubType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
@ -39,7 +40,7 @@ public final class Phantasmagorian extends CardImpl {
// When you cast Phantasmagorian, any player may discard three cards. If a player does, counter Phantasmagorian. // When you cast Phantasmagorian, any player may discard three cards. If a player does, counter Phantasmagorian.
this.addAbility(new CastSourceTriggeredAbility(new CounterSourceEffect())); this.addAbility(new CastSourceTriggeredAbility(new CounterSourceEffect()));
// Discard three cards: Return Phantasmagorian from your graveyard to your hand. // Discard three cards: Return Phantasmagorian from your graveyard to your hand.
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard("three cards"))))); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new DiscardTargetCost(new TargetCardInHand(3, StaticFilters.FILTER_CARD_CARDS))));
} }
private Phantasmagorian(final Phantasmagorian card) { private Phantasmagorian(final Phantasmagorian card) {

View file

@ -14,6 +14,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate; import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
@ -30,8 +31,6 @@ import java.util.UUID;
*/ */
public final class PlagueReaver extends CardImpl { public final class PlagueReaver extends CardImpl {
private static final FilterCard filter = new FilterCard("two cards");
public PlagueReaver(UUID ownerId, CardSetInfo setInfo) { public PlagueReaver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
@ -46,7 +45,7 @@ public final class PlagueReaver extends CardImpl {
// Discard two cards, Sacrifice Plague Reaver: Choose target opponent. Return Plague Reaver to the battlefield under that player's control at the beginning of their next upkeep. // Discard two cards, Sacrifice Plague Reaver: Choose target opponent. Return Plague Reaver to the battlefield under that player's control at the beginning of their next upkeep.
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(
new PlagueReaverTriggerEffect(), new DiscardTargetCost(new TargetCardInHand(2, filter)) new PlagueReaverTriggerEffect(), new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS))
); );
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
this.addAbility(ability); this.addAbility(ability);

View file

@ -19,7 +19,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class PrimevalForce extends CardImpl { public final class PrimevalForce extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("three Forests"); private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Forests");
static{ static{
filter.add(SubType.FOREST.getPredicate()); filter.add(SubType.FOREST.getPredicate());
} }

View file

@ -66,7 +66,7 @@ class ProwlingPangolinEffect extends OneShotEffect {
if (controller != null) { if (controller != null) {
boolean costPaid = false; boolean costPaid = false;
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledCreaturePermanent("two creatures"), true)); Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledCreaturePermanent("creatures"), true));
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null if (player != null
&& cost.canPay(source, source, playerId, game) && cost.canPay(source, source, playerId, game)

View file

@ -27,7 +27,7 @@ import java.util.UUID;
*/ */
public final class PsychicAllergy extends CardImpl { public final class PsychicAllergy extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Islands"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands");
static { static {
filter.add(SubType.ISLAND.getPredicate()); filter.add(SubType.ISLAND.getPredicate());

View file

@ -19,7 +19,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class Pulverize extends CardImpl { public final class Pulverize extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Mountains"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountains");
static { static {
filter.add(SubType.MOUNTAIN.getPredicate()); filter.add(SubType.MOUNTAIN.getPredicate());
} }

View file

@ -20,7 +20,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class RathiDragon extends CardImpl { public final class RathiDragon extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("two Mountains"); private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Mountains");
static{ static{
filter.add(SubType.MOUNTAIN.getPredicate()); filter.add(SubType.MOUNTAIN.getPredicate());

View file

@ -26,7 +26,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class RuthlessKnave extends CardImpl { public final class RuthlessKnave extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("three Treasures"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Treasures");
static { static {
filter.add(SubType.TREASURE.getPredicate()); filter.add(SubType.TREASURE.getPredicate());

View file

@ -21,7 +21,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class ScorchedRuins extends CardImpl { public final class ScorchedRuins extends CardImpl {
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("two untapped lands"); private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("untapped lands");
static { static {
filter.add(TappedPredicate.UNTAPPED); filter.add(TappedPredicate.UNTAPPED);
} }

View file

@ -29,7 +29,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class SekkiSeasonsGuide extends CardImpl { public final class SekkiSeasonsGuide extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("eight Spirits"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Spirits");
static { static {
filter.add(SubType.SPIRIT.getPredicate()); filter.add(SubType.SPIRIT.getPredicate());

View file

@ -40,7 +40,7 @@ public final class SolarTide extends CardImpl {
this.getSpellAbility().getModes().addMode(mode); this.getSpellAbility().getModes().addMode(mode);
// Entwine-Sacrifice two lands. // Entwine-Sacrifice two lands.
this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true)))); this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), true))));
} }
private SolarTide(final SolarTide card) { private SolarTide(final SolarTide card) {

View file

@ -30,9 +30,9 @@ public final class SoldeviSage extends CardImpl {
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {tap}, Sacrifice two lands: Draw three cards, then discard one of them. // {T}, Sacrifice two lands: Draw three cards, then discard one of them.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardOneOfThemEffect(3), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardOneOfThemEffect(3), new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true))); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), true)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -13,6 +13,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamageEvent; import mage.game.events.DamageEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -41,7 +42,7 @@ public final class SolphimMayhemDominus extends CardImpl {
// {1}{R/P}{R/P}, Discard two cards: Put an indestructible counter on Solphim, Mayhem Dominus. // {1}{R/P}{R/P}, Discard two cards: Put an indestructible counter on Solphim, Mayhem Dominus.
Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.INDESTRUCTIBLE.createInstance()), new ManaCostsImpl<>("{1}{R/P}{R/P}")); Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.INDESTRUCTIBLE.createInstance()), new ManaCostsImpl<>("{1}{R/P}{R/P}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -14,6 +14,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -45,7 +46,7 @@ public final class SoulRansom extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new SoulRansomEffect(), new SoulRansomEffect(),
new DiscardTargetCost( new DiscardTargetCost(
new TargetCardInHand(2, 2, new FilterCard("two cards")) new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)
) )
); );
ability2.setMayActivate(TargetController.OPPONENT); ability2.setMayActivate(TargetController.OPPONENT);

View file

@ -21,7 +21,7 @@ import mage.target.common.TargetAnyTarget;
*/ */
public final class SoulSpike extends CardImpl { public final class SoulSpike extends CardImpl {
private static final FilterCard filter = new FilterCard("two black cards"); private static final FilterCard filter = new FilterCard("black cards");
static { static {
filter.add(new ColorPredicate(ObjectColor.BLACK)); filter.add(new ColorPredicate(ObjectColor.BLACK));

View file

@ -74,7 +74,7 @@ class DiscardTwoNonlandCardsWithTheSameNameCost extends DiscardTargetCost {
class TargetTwoNonLandCardsWithSameNameInHand extends TargetCardInHand { class TargetTwoNonLandCardsWithSameNameInHand extends TargetCardInHand {
public TargetTwoNonLandCardsWithSameNameInHand() { public TargetTwoNonLandCardsWithSameNameInHand() {
super(2, 2, new FilterNonlandCard("two nonland cards with the same name")); super(2, 2, new FilterNonlandCard("nonland cards with the same name"));
} }
public TargetTwoNonLandCardsWithSameNameInHand(final TargetTwoNonLandCardsWithSameNameInHand target) { public TargetTwoNonLandCardsWithSameNameInHand(final TargetTwoNonLandCardsWithSameNameInHand target) {

View file

@ -26,7 +26,7 @@ import mage.target.targetpointer.SecondTargetPointer;
*/ */
public final class SpurnmageAdvocate extends CardImpl { public final class SpurnmageAdvocate extends CardImpl {
private static final FilterCard filter = new FilterCard("two target cards from an opponent's graveyard"); private static final FilterCard filter = new FilterCard("target cards from an opponent's graveyard");
static { static {
filter.add(TargetController.OPPONENT.getOwnerPredicate()); filter.add(TargetController.OPPONENT.getOwnerPredicate());

View file

@ -15,6 +15,7 @@ import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
/** /**
@ -35,7 +36,7 @@ public final class StitchwingSkaab extends CardImpl {
// {1}{U}, Discard two cards: Return Stitchwing Skaab from your graveyard to the battlefield tapped. // {1}{U}, Discard two cards: Return Stitchwing Skaab from your graveyard to the battlefield tapped.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true, false), new ManaCostsImpl<>("{1}{U}")); Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true, false), new ManaCostsImpl<>("{1}{U}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -20,7 +20,7 @@ import mage.target.common.TargetCardInHand;
*/ */
public final class Sunscour extends CardImpl { public final class Sunscour extends CardImpl {
private static final FilterCard filter = new FilterCard("two white cards"); private static final FilterCard filter = new FilterCard("white cards");
static { static {
filter.add(new ColorPredicate(ObjectColor.WHITE)); filter.add(new ColorPredicate(ObjectColor.WHITE));

View file

@ -35,7 +35,7 @@ public final class TorpidMoloch extends CardImpl {
this.addAbility(new SimpleActivatedAbility( this.addAbility(new SimpleActivatedAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn), new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn),
new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("three lands"), true)))); new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true))));
} }
private TorpidMoloch(final TorpidMoloch card) { private TorpidMoloch(final TorpidMoloch card) {

View file

@ -17,7 +17,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author LevelX2 * @author LevelX2
*/ */
public final class TorrentOfStone extends CardImpl { public final class TorrentOfStone extends CardImpl {
private static final FilterControlledLandPermanent filterSacrifice = new FilterControlledLandPermanent("two Mountains"); private static final FilterControlledLandPermanent filterSacrifice = new FilterControlledLandPermanent("Mountains");
static { static {
filterSacrifice.add(SubType.MOUNTAIN.getPredicate()); filterSacrifice.add(SubType.MOUNTAIN.getPredicate());

View file

@ -25,7 +25,7 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public final class VoldarenPariah extends CardImpl { public final class VoldarenPariah extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("three other creatures"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
static { static {
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);

View file

@ -129,7 +129,7 @@ class WormsOfTheEarthDestroyEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && sourcePermanent != null) { if (controller != null && sourcePermanent != null) {
Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), false)); Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false));
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {

View file

@ -10,6 +10,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.permanent.token.ZombieToken; import mage.game.permanent.token.ZombieToken;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -25,7 +26,7 @@ public final class ZombieInfestation extends CardImpl {
// Discard two cards: Create a 2/2 black Zombie creature token. // Discard two cards: Create a 2/2 black Zombie creature token.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CreateTokenEffect(new ZombieToken()), new CreateTokenEffect(new ZombieToken()),
new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); new DiscardTargetCost(new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -30,7 +30,7 @@ public class DiscardTargetCost extends CostImpl {
public DiscardTargetCost(TargetCardInHand target, boolean randomDiscard) { public DiscardTargetCost(TargetCardInHand target, boolean randomDiscard) {
this.addTarget(target); this.addTarget(target);
this.randomDiscard = randomDiscard; this.randomDiscard = randomDiscard;
this.text = "discard " + target.getTargetName(); this.text = "discard " + target.getDescription();
} }
public DiscardTargetCost(DiscardTargetCost cost) { public DiscardTargetCost(DiscardTargetCost cost) {

View file

@ -60,7 +60,7 @@ public class ExileFromGraveCost extends CostImpl {
public ExileFromGraveCost(TargetCardInASingleGraveyard target) { public ExileFromGraveCost(TargetCardInASingleGraveyard target) {
target.setNotTarget(true); target.setNotTarget(true);
this.addTarget(target); this.addTarget(target);
this.text = "exile " + target.getTargetName(); this.text = "exile " + target.getDescription();
} }
public ExileFromGraveCost(TargetCardInYourGraveyard target, boolean setTargetPointer) { public ExileFromGraveCost(TargetCardInYourGraveyard target, boolean setTargetPointer) {

View file

@ -37,7 +37,7 @@ public class ExileFromHandCost extends CostImpl {
*/ */
public ExileFromHandCost(TargetCardInHand target, boolean setXFromCMC) { public ExileFromHandCost(TargetCardInHand target, boolean setXFromCMC) {
this.addTarget(target); this.addTarget(target);
this.text = "exile " + target.getTargetName(); this.text = "exile " + target.getDescription();
this.setXFromCMC = setXFromCMC; this.setXFromCMC = setXFromCMC;
} }

View file

@ -28,7 +28,7 @@ public class ExileTargetCost extends CostImpl {
public ExileTargetCost(TargetControlledPermanent target) { public ExileTargetCost(TargetControlledPermanent target) {
target.setNotTarget(true); target.setNotTarget(true);
this.addTarget(target); this.addTarget(target);
this.text = "exile " + target.getTargetName(); this.text = "exile " + target.getDescription();
} }
public ExileTargetCost(TargetControlledPermanent target, boolean noText) { public ExileTargetCost(TargetControlledPermanent target, boolean noText) {

View file

@ -22,11 +22,7 @@ public class ReturnToHandFromGraveyardCost extends CostImpl {
public ReturnToHandFromGraveyardCost(TargetCardInYourGraveyard target) { public ReturnToHandFromGraveyardCost(TargetCardInYourGraveyard target) {
this.addTarget(target); this.addTarget(target);
if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { this.text = "return " + target.getDescription() + " from graveyard to it's owner's hand";
this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(' ').append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString();
} else {
this.text = new StringBuilder("return ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString();
}
} }
public ReturnToHandFromGraveyardCost(ReturnToHandFromGraveyardCost cost) { public ReturnToHandFromGraveyardCost(ReturnToHandFromGraveyardCost cost) {

View file

@ -27,7 +27,7 @@ public class RevealTargetFromHandCost extends CostImpl {
public RevealTargetFromHandCost(TargetCardInHand target) { public RevealTargetFromHandCost(TargetCardInHand target) {
this.addTarget(target); this.addTarget(target);
this.text = (target.getNumberOfTargets() == 0 ? "you may reveal " : "reveal ") + target.getTargetName(); this.text = (target.getNumberOfTargets() == 0 ? "you may reveal " : "reveal ") + target.getDescription();
this.revealedCards = new ArrayList<>(); this.revealedCards = new ArrayList<>();
} }

View file

@ -88,10 +88,16 @@ public interface Target extends Serializable {
void updateTarget(UUID targetId, Game game); void updateTarget(UUID targetId, Game game);
/**
* @return full description with target name, amount, etc (uses in abilities/rules/cost)
*/
String getDescription(); String getDescription();
String getMessage(); String getMessage();
/**
* @return single target name
*/
String getTargetName(); String getTargetName();
void setTargetName(String name); void setTargetName(String name);