From b27f2f04c110a29646fdd3bf8e277a3221be190e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 30 Apr 2021 07:01:18 -0400 Subject: [PATCH] [STX] fixed Magma Opus not tapping permanents (fixes #7787) --- Mage.Sets/src/mage/cards/m/MagmaOpus.java | 39 ++--------------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/MagmaOpus.java b/Mage.Sets/src/mage/cards/m/MagmaOpus.java index 61a85f3d2c..e442a26918 100644 --- a/Mage.Sets/src/mage/cards/m/MagmaOpus.java +++ b/Mage.Sets/src/mage/cards/m/MagmaOpus.java @@ -4,22 +4,20 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DamageMultiEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.PrismariToken; import mage.game.permanent.token.TreasureToken; import mage.target.TargetPermanent; import mage.target.common.TargetAnyTargetAmount; +import mage.target.targetpointer.SecondTargetPointer; import java.util.UUID; @@ -34,7 +32,7 @@ public final class MagmaOpus extends CardImpl { // Magma Opus deals 4 damage divided as you choose among any number of targets. Tap two target permanents. Create a 4/4 blue and red Elemental creature token. Draw two cards. this.getSpellAbility().addEffect(new DamageMultiEffect(4)); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4).withChooseHint("damage")); - this.getSpellAbility().addEffect(new MagmaOpusTapEffect()); + this.getSpellAbility().addEffect(new TapTargetEffect().setTargetPointer(new SecondTargetPointer()).setText("two target permanents")); this.getSpellAbility().addTarget(new TargetPermanent(2, StaticFilters.FILTER_PERMANENTS).withChooseHint("tap")); this.getSpellAbility().addEffect(new CreateTokenEffect(new PrismariToken())); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("Draw two cards")); @@ -56,34 +54,3 @@ public final class MagmaOpus extends CardImpl { return new MagmaOpus(this); } } - -class MagmaOpusTapEffect extends OneShotEffect { - - MagmaOpusTapEffect() { - super(Outcome.Benefit); - staticText = "Tap two target permanents."; - } - - private MagmaOpusTapEffect(final MagmaOpusTapEffect effect) { - super(effect); - } - - @Override - public MagmaOpusTapEffect copy() { - return new MagmaOpusTapEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - if (!source.getTargets().get(1).getTargets().contains(targetId)) { - continue; - } - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - permanent.tap(source, game); - } - } - return true; - } -}