Implemented Clear the Mind

This commit is contained in:
Evan Kranzler 2019-01-11 23:06:48 -05:00
parent 051875feb5
commit ac39b3fc39
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ClearTheMind extends CardImpl {
public ClearTheMind(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
// Target player shuffles their graveyard into their library.
this.getSpellAbility().addEffect(new ClearTheMindEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
private ClearTheMind(final ClearTheMind card) {
super(card);
}
@Override
public ClearTheMind copy() {
return new ClearTheMind(this);
}
}
class ClearTheMindEffect extends OneShotEffect {
ClearTheMindEffect() {
super(Outcome.Benefit);
staticText = "Target player shuffles their graveyard into their library.";
}
private ClearTheMindEffect(final ClearTheMindEffect effect) {
super(effect);
}
@Override
public ClearTheMindEffect copy() {
return new ClearTheMindEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
player.putCardsOnBottomOfLibrary(
new CardsImpl(player.getGraveyard().getCards(game)),
game, source, false
);
player.shuffleLibrary(source, game);
return true;
}
}

View file

@ -76,6 +76,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Civic Stalwart", 6, Rarity.COMMON, mage.cards.c.CivicStalwart.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("Clear the Mind", 34, Rarity.COMMON, mage.cards.c.ClearTheMind.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("Combine Guildmage", 163, Rarity.UNCOMMON, mage.cards.c.CombineGuildmage.class));