diff --git a/Mage.Sets/src/mage/cards/b/Breakthrough.java b/Mage.Sets/src/mage/cards/b/Breakthrough.java index 132a19e4f89..e69df78e1a5 100644 --- a/Mage.Sets/src/mage/cards/b/Breakthrough.java +++ b/Mage.Sets/src/mage/cards/b/Breakthrough.java @@ -8,7 +8,6 @@ import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterCard; import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -67,8 +66,7 @@ class BreakthroughEffect extends OneShotEffect { if (amountToKeep == 0) { player.discard(player.getHand(), false, source, game); } else if (amountToKeep < player.getHand().size()) { - TargetCardInHand target = new TargetCardInHand(amountToKeep, StaticFilters.FILTER_CARD); - target.setTargetName("cards to keep"); + TargetCardInHand target = new TargetCardInHand(amountToKeep, StaticFilters.FILTER_CARD).withChooseHint("to keep"); target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), source, game); Cards cards = player.getHand().copy(); cards.removeIf(target.getTargets()::contains); diff --git a/Mage.Sets/src/mage/cards/c/ChimneyImp.java b/Mage.Sets/src/mage/cards/c/ChimneyImp.java index 3a6120a6957..eda7dabec7c 100644 --- a/Mage.Sets/src/mage/cards/c/ChimneyImp.java +++ b/Mage.Sets/src/mage/cards/c/ChimneyImp.java @@ -72,9 +72,7 @@ class ChimneyImpEffect extends OneShotEffect { Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (targetOpponent != null) { if (!targetOpponent.getHand().isEmpty()) { - TargetCardInHand target = new TargetCardInHand(); - target.withNotTarget(true); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); targetOpponent.choose(Outcome.Detriment, target, source, game); Card card = targetOpponent.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/c/ChitteringRats.java b/Mage.Sets/src/mage/cards/c/ChitteringRats.java index 408c5e57893..adbb8058039 100644 --- a/Mage.Sets/src/mage/cards/c/ChitteringRats.java +++ b/Mage.Sets/src/mage/cards/c/ChitteringRats.java @@ -69,9 +69,7 @@ class ChitteringRatsEffect extends OneShotEffect { Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (targetOpponent != null) { if (!targetOpponent.getHand().isEmpty()) { - TargetCardInHand target = new TargetCardInHand(); - target.withNotTarget(true); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); targetOpponent.choose(Outcome.Detriment, target, source, game); Card card = targetOpponent.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/g/GoForTheThroat.java b/Mage.Sets/src/mage/cards/g/GoForTheThroat.java index 9692a148c1f..1f145b3380d 100644 --- a/Mage.Sets/src/mage/cards/g/GoForTheThroat.java +++ b/Mage.Sets/src/mage/cards/g/GoForTheThroat.java @@ -1,23 +1,22 @@ - package mage.cards.g; -import java.util.UUID; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** * * @author Loki */ public final class GoForTheThroat extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact creature"); static { filter.add(Predicates.not(CardType.ARTIFACT.getPredicate())); @@ -26,10 +25,8 @@ public final class GoForTheThroat extends CardImpl { public GoForTheThroat(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}"); - - Target target = new TargetCreaturePermanent(filter); - target.setTargetName("nonartifact creature"); - this.getSpellAbility().addTarget(target); + // Destroy target nonartifact creature. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); } diff --git a/Mage.Sets/src/mage/cards/k/KeldonArsonist.java b/Mage.Sets/src/mage/cards/k/KeldonArsonist.java index ac07a4e856d..04cf99ff74c 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonArsonist.java +++ b/Mage.Sets/src/mage/cards/k/KeldonArsonist.java @@ -1,7 +1,6 @@ package mage.cards.k; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -14,10 +13,10 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterControlledLandPermanent; -import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author fireshoes @@ -34,9 +33,7 @@ public final class KeldonArsonist extends CardImpl { // {1}, Sacrifice two lands: Destroy target land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(1)); ability.addCost(new SacrificeTargetCost(2, StaticFilters.FILTER_LANDS)); - TargetLandPermanent target = new TargetLandPermanent(); - target.setTargetName("land (to destroy)"); - ability.addTarget(target); + ability.addTarget(new TargetLandPermanent().withChooseHint("to destroy")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PryingQuestions.java b/Mage.Sets/src/mage/cards/p/PryingQuestions.java index 1cb045fb42d..607257f960a 100644 --- a/Mage.Sets/src/mage/cards/p/PryingQuestions.java +++ b/Mage.Sets/src/mage/cards/p/PryingQuestions.java @@ -61,9 +61,7 @@ class PryingQuestionsEffect extends OneShotEffect { Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (targetOpponent != null) { if (!targetOpponent.getHand().isEmpty()) { - TargetCardInHand target = new TargetCardInHand(); - target.withNotTarget(true); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); targetOpponent.choose(Outcome.Detriment, target, source, game); Card card = targetOpponent.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/s/SadisticAugermage.java b/Mage.Sets/src/mage/cards/s/SadisticAugermage.java index 8cf75596a64..8f691b92303 100644 --- a/Mage.Sets/src/mage/cards/s/SadisticAugermage.java +++ b/Mage.Sets/src/mage/cards/s/SadisticAugermage.java @@ -69,8 +69,7 @@ class WidespreadPanicEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { if (!player.getHand().isEmpty()) { - TargetCardInHand target = new TargetCardInHand(); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); player.choose(Outcome.Detriment, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/t/TaintedSpecter.java b/Mage.Sets/src/mage/cards/t/TaintedSpecter.java index d60cec880d8..f270bfb86cf 100644 --- a/Mage.Sets/src/mage/cards/t/TaintedSpecter.java +++ b/Mage.Sets/src/mage/cards/t/TaintedSpecter.java @@ -92,8 +92,7 @@ class TaintedSpecterEffect extends OneShotEffect { } } else { // Put a card from your hand on top of your library - TargetCardInHand target = new TargetCardInHand(); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); targetPlayer.choose(Outcome.Detriment, target, source, game); Card card = targetPlayer.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/w/WidespreadPanic.java b/Mage.Sets/src/mage/cards/w/WidespreadPanic.java index 8df94b282b9..81cc765672a 100644 --- a/Mage.Sets/src/mage/cards/w/WidespreadPanic.java +++ b/Mage.Sets/src/mage/cards/w/WidespreadPanic.java @@ -96,9 +96,7 @@ class WidespreadPanicEffect extends OneShotEffect { Player shuffler = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (shuffler != null) { if (!shuffler.getHand().isEmpty()) { - TargetCardInHand target = new TargetCardInHand(); - target.withNotTarget(true); - target.setTargetName("a card from your hand to put on top of your library"); + TargetCardInHand target = new TargetCardInHand().withChooseHint("to put on top of your library"); shuffler.choose(Outcome.Detriment, target, source, game); Card card = shuffler.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage/src/main/java/mage/target/Target.java b/Mage/src/main/java/mage/target/Target.java index 4bb7cb1ff60..00b2bea559a 100644 --- a/Mage/src/main/java/mage/target/Target.java +++ b/Mage/src/main/java/mage/target/Target.java @@ -108,6 +108,10 @@ public interface Target extends Serializable { */ String getTargetName(); + /** + * Overwrites the name automatically generated from the filter text. + * If you want to add additional info for usability, use `withChooseHint` instead. + */ Target setTargetName(String name); String getTargetedName(Game game); @@ -172,6 +176,10 @@ public interface Target extends Serializable { // used for cards like Spellskite void setTargetAmount(UUID targetId, int amount, Game game); + /** + * Adds a clarification during target selection (in parentheses). + * Useful for abilities that have multiple targets and different effects. + */ Target withChooseHint(String chooseHint); String getChooseHint();