Implemented Clear the Stage

This commit is contained in:
Evan Kranzler 2019-01-12 11:30:19 -05:00
parent 2c58801991
commit ee7ea4e8fe
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ClearTheStage extends CardImpl {
private static final FilterCard filter = new FilterCreatureCard("creature card from your graveyard");
public ClearTheStage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}");
// Target creature gets -3/-3 until end of turn. If you control a creature with power 4 or greater, you may return up to one target creature card from your graveyard to your hand.
this.getSpellAbility().addEffect(new ClearTheStageEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 1, filter));
}
private ClearTheStage(final ClearTheStage card) {
super(card);
}
@Override
public ClearTheStage copy() {
return new ClearTheStage(this);
}
}
class ClearTheStageEffect extends OneShotEffect {
ClearTheStageEffect() {
super(Outcome.Benefit);
staticText = "Target creature gets -3/-3 until end of turn. If you control a creature with power 4 or greater, " +
"you may return up to one target creature card from your graveyard to your hand.";
}
private ClearTheStageEffect(final ClearTheStageEffect effect) {
super(effect);
}
@Override
public ClearTheStageEffect copy() {
return new ClearTheStageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new BoostTargetEffect(-3, -3), source);
if (!FerociousCondition.instance.apply(game, source)) {
return true;
}
Player player = game.getPlayer(source.getSourceId());
if (player == null || !player.chooseUse(Outcome.Benefit, "Return a creature card from your graveyard to your hand?", source, game)) {
return false;
}
Card card = game.getCard(source.getTargets().get(1).getFirstTarget());
if (card == null) {
return false;
}
return player.moveCards(card, Zone.HAND, source, game);
}
}

View file

@ -77,6 +77,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Clamor Shaman", 96, Rarity.UNCOMMON, mage.cards.c.ClamorShaman.class)); cards.add(new SetCardInfo("Clamor Shaman", 96, Rarity.UNCOMMON, mage.cards.c.ClamorShaman.class));
cards.add(new SetCardInfo("Clan Guildmage", 162, Rarity.UNCOMMON, mage.cards.c.ClanGuildmage.class)); cards.add(new SetCardInfo("Clan Guildmage", 162, Rarity.UNCOMMON, mage.cards.c.ClanGuildmage.class));
cards.add(new SetCardInfo("Clear the Mind", 34, Rarity.COMMON, mage.cards.c.ClearTheMind.class)); cards.add(new SetCardInfo("Clear the Mind", 34, Rarity.COMMON, mage.cards.c.ClearTheMind.class));
cards.add(new SetCardInfo("Clear the Stage", 68, Rarity.UNCOMMON, mage.cards.c.ClearTheStage.class));
cards.add(new SetCardInfo("Code of Constraint", 35, Rarity.UNCOMMON, mage.cards.c.CodeOfConstraint.class)); cards.add(new SetCardInfo("Code of Constraint", 35, Rarity.UNCOMMON, mage.cards.c.CodeOfConstraint.class));
cards.add(new SetCardInfo("Collision // Colossus", 223, Rarity.UNCOMMON, mage.cards.c.CollisionColossus.class)); cards.add(new SetCardInfo("Collision // Colossus", 223, Rarity.UNCOMMON, mage.cards.c.CollisionColossus.class));
cards.add(new SetCardInfo("Combine Guildmage", 163, Rarity.UNCOMMON, mage.cards.c.CombineGuildmage.class)); cards.add(new SetCardInfo("Combine Guildmage", 163, Rarity.UNCOMMON, mage.cards.c.CombineGuildmage.class));