Implemented Sevinne's Reclamation

This commit is contained in:
Evan Kranzler 2019-08-02 14:07:15 -04:00
parent b376e1c2de
commit 4ee1a4e0cc
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SevinnesReclamation extends CardImpl {
private static final FilterCard filter
= new FilterPermanentCard("permanent card with converted mana cost 3 or less from your graveyard");
static {
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4));
}
public SevinnesReclamation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}");
// Return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield. If this spell was cast from a graveyard, you may copy this spell and may choose a new target for the copy.
this.getSpellAbility().addEffect(new SevinnesReclamationEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
// Flashback {4}{W}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{W}"), TimingRule.SORCERY));
}
private SevinnesReclamation(final SevinnesReclamation card) {
super(card);
}
@Override
public SevinnesReclamation copy() {
return new SevinnesReclamation(this);
}
}
class SevinnesReclamationEffect extends OneShotEffect {
private static final Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
SevinnesReclamationEffect() {
super(Outcome.Benefit);
staticText = "Return target permanent card with converted mana cost 3 or less " +
"from your graveyard to the battlefield. If this spell was cast from a graveyard, " +
"you may copy this spell and may choose a new target for the copy.";
}
private SevinnesReclamationEffect(final SevinnesReclamationEffect effect) {
super(effect);
}
@Override
public SevinnesReclamationEffect copy() {
return new SevinnesReclamationEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = (Spell) game.getStack().getStackObject(source.getSourceId());
Player player = game.getPlayer(source.getControllerId());
if (spell == null || player == null) {
return false;
}
effect.apply(game, source);
if (spell.getFromZone() == Zone.GRAVEYARD
&& player.chooseUse(outcome, "Copy this spell?", source, game)) {
spell.createCopyOnStack(game, source, source.getControllerId(), true);
}
return true;
}
}

View file

@ -25,5 +25,6 @@ public final class Commander2019Edition extends ExpansionSet {
cards.add(new SetCardInfo("Kadena's Silencer", 8, Rarity.RARE, mage.cards.k.KadenasSilencer.class)); cards.add(new SetCardInfo("Kadena's Silencer", 8, Rarity.RARE, mage.cards.k.KadenasSilencer.class));
cards.add(new SetCardInfo("Kadena, Slinking Sorcerer", 45, Rarity.MYTHIC, mage.cards.k.KadenaSlinkingSorcerer.class)); cards.add(new SetCardInfo("Kadena, Slinking Sorcerer", 45, Rarity.MYTHIC, mage.cards.k.KadenaSlinkingSorcerer.class));
cards.add(new SetCardInfo("Seedborn Muse", 179, Rarity.RARE, mage.cards.s.SeedbornMuse.class)); cards.add(new SetCardInfo("Seedborn Muse", 179, Rarity.RARE, mage.cards.s.SeedbornMuse.class));
cards.add(new SetCardInfo("Sevinne's Reclamation", 5, Rarity.RARE, mage.cards.s.SevinnesReclamation.class));
} }
} }