diff --git a/Mage.Sets/src/mage/cards/r/Reinterpret.java b/Mage.Sets/src/mage/cards/r/Reinterpret.java new file mode 100644 index 00000000000..b5a54f80b25 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/Reinterpret.java @@ -0,0 +1,67 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Reinterpret extends CardImpl { + + public Reinterpret(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{R}"); + + // Counter target spell. You may cast a spell with an equal or lesser mana value from your hand without paying its mana cost. + this.getSpellAbility().addEffect(new ReinterpretEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + private Reinterpret(final Reinterpret card) { + super(card); + } + + @Override + public Reinterpret copy() { + return new Reinterpret(this); + } +} + +class ReinterpretEffect extends OneShotEffect { + + ReinterpretEffect() { + super(Outcome.Benefit); + staticText = "counter target spell. You may cast a spell with an " + + "equal or lesser mana value from your hand without paying its mana cost"; + } + + private ReinterpretEffect(final ReinterpretEffect effect) { + super(effect); + } + + @Override + public ReinterpretEffect copy() { + return new ReinterpretEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpell(source.getFirstTarget()); + if (spell == null) { + return false; + } + int manaValue = spell.getConvertedManaCost(); + spell.counter(source, game); + new CastWithoutPayingManaCostEffect(manaValue).apply(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2021Edition.java b/Mage.Sets/src/mage/sets/Commander2021Edition.java index df9bda7d204..ebb1dc7371c 100644 --- a/Mage.Sets/src/mage/sets/Commander2021Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2021Edition.java @@ -68,6 +68,7 @@ public final class Commander2021Edition extends ExpansionSet { cards.add(new SetCardInfo("Pia Nalaar", 177, Rarity.RARE, mage.cards.p.PiaNalaar.class)); cards.add(new SetCardInfo("Pilgrim's Eye", 257, Rarity.COMMON, mage.cards.p.PilgrimsEye.class)); cards.add(new SetCardInfo("Quicksmith Genius", 178, Rarity.UNCOMMON, mage.cards.q.QuicksmithGenius.class)); + cards.add(new SetCardInfo("Reinterpret", 73, Rarity.RARE, mage.cards.r.Reinterpret.class)); cards.add(new SetCardInfo("Replication Technique", 31, Rarity.RARE, mage.cards.r.ReplicationTechnique.class)); cards.add(new SetCardInfo("Return to Dust", 100, Rarity.UNCOMMON, mage.cards.r.ReturnToDust.class)); cards.add(new SetCardInfo("Rout", 101, Rarity.RARE, mage.cards.r.Rout.class));