[C21] Implemented Reinterpret

This commit is contained in:
Evan Kranzler 2021-04-08 17:37:09 -04:00
parent 73df6929e9
commit 16f1ae7b99
2 changed files with 68 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));