From e61c7c22d318c96e9c838d054466fa9d47cee75a Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 19 Apr 2020 22:49:59 +0400 Subject: [PATCH] [IKO] Heartless Act - fixed wrong ability and missing text; --- Mage.Sets/src/mage/cards/h/HeartlessAct.java | 38 ++++---------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/Mage.Sets/src/mage/cards/h/HeartlessAct.java b/Mage.Sets/src/mage/cards/h/HeartlessAct.java index f5d4f24495..3e6504137f 100644 --- a/Mage.Sets/src/mage/cards/h/HeartlessAct.java +++ b/Mage.Sets/src/mage/cards/h/HeartlessAct.java @@ -10,7 +10,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.CounterAnyPredicate; @@ -27,11 +26,11 @@ import java.util.UUID; */ public final class HeartlessAct extends CardImpl { - private static final FilterPermanent filter + private static final FilterCreaturePermanent filterWithoutCounters = new FilterCreaturePermanent("creature with no counters on it"); static { - filter.add(Predicates.not(CounterAnyPredicate.instance)); + filterWithoutCounters.add(Predicates.not(CounterAnyPredicate.instance)); } public HeartlessAct(UUID ownerId, CardSetInfo setInfo) { @@ -40,7 +39,7 @@ public final class HeartlessAct extends CardImpl { // Choose one — // • Destroy target creature with no counters on it. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addTarget(new TargetPermanent(filterWithoutCounters)); // • Remove up to three counters from target creature. Mode mode = new Mode(new HeartlessActEffect()); @@ -61,8 +60,8 @@ public final class HeartlessAct extends CardImpl { class HeartlessActEffect extends OneShotEffect { HeartlessActEffect() { - super(Outcome.Benefit); - staticText = ""; + super(Outcome.AIDontUseIt); + staticText = "Remove up to three counters from target creature"; } private HeartlessActEffect(final HeartlessActEffect effect) { @@ -87,7 +86,7 @@ class HeartlessActEffect extends OneShotEffect { String[] counterNames = permanent.getCounters(game).keySet().toArray(new String[0]); for (String counterName : counterNames) { if (controller.chooseUse(Outcome.Neutral, "Do you want to remove " + counterName + " counters?", source, game)) { - if (permanent.getCounters(game).get(counterName).getCount() == 1 || toRemove == 1) { + if (permanent.getCounters(game).get(counterName).getCount() == 1 || (toRemove - removed == 1)) { permanent.removeCounters(counterName, 1, game); removed++; } else { @@ -105,31 +104,6 @@ class HeartlessActEffect extends OneShotEffect { game.addEffect(new BoostSourceEffect(removed, 0, Duration.EndOfTurn), source); return true; } - Player player = game.getPlayer(source.getFirstTarget()); - if (player == null) { - return false; - } - int toRemove = 3; - int removed = 0; - String[] counterNames = player.getCounters().keySet().toArray(new String[0]); - for (String counterName : counterNames) { - if (controller.chooseUse(Outcome.Neutral, "Do you want to remove " + counterName + " counters?", source, game)) { - if (player.getCounters().get(counterName).getCount() == 1 || toRemove == 1) { - player.removeCounters(counterName, 1, source, game); - removed++; - } else { - int amount = controller.getAmount(1, Math.min(player.getCounters().get(counterName).getCount(), toRemove - removed), "How many?", game); - if (amount > 0) { - removed += amount; - player.removeCounters(counterName, amount, source, game); - } - } - } - if (removed >= toRemove) { - break; - } - } - game.addEffect(new BoostSourceEffect(removed, 0, Duration.EndOfTurn), source); return true; } } \ No newline at end of file