Implemented Thought Collapse

This commit is contained in:
Evan Kranzler 2019-01-11 23:31:24 -05:00
parent ca11af6ab0
commit 339475c398
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,66 @@
package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetSpell;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ThoughtCollapse extends CardImpl {
public ThoughtCollapse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
// Counter target spell. Its controller puts the top three cards of their library into their graveyard.
this.getSpellAbility().addEffect(new ThoughtCollapseEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
private ThoughtCollapse(final ThoughtCollapse card) {
super(card);
}
@Override
public ThoughtCollapse copy() {
return new ThoughtCollapse(this);
}
}
class ThoughtCollapseEffect extends OneShotEffect {
ThoughtCollapseEffect() {
super(Outcome.Benefit);
staticText = "Counter target spell. Its controller puts " +
"the top three cards of their library into their graveyard.";
}
private ThoughtCollapseEffect(final ThoughtCollapseEffect effect) {
super(effect);
}
@Override
public ThoughtCollapseEffect copy() {
return new ThoughtCollapseEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getControllerId(source.getFirstTarget()));
if (player == null) {
return false;
}
player.moveCards(player.getLibrary().getTopCards(game, 3), Zone.GRAVEYARD, source, game);
return new CounterTargetEffect().apply(game, source);
}
}

View file

@ -275,6 +275,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class));
cards.add(new SetCardInfo("Theater of Horrors", 213, Rarity.RARE, mage.cards.t.TheaterOfHorrors.class));
cards.add(new SetCardInfo("Thirsting Shade", 87, Rarity.COMMON, mage.cards.t.ThirstingShade.class));
cards.add(new SetCardInfo("Thought Collapse", 57, Rarity.COMMON, mage.cards.t.ThoughtCollapse.class));
cards.add(new SetCardInfo("Thrash // Threat", 229, Rarity.RARE, mage.cards.t.ThrashThreat.class));
cards.add(new SetCardInfo("Titanic Brawl", 146, Rarity.COMMON, mage.cards.t.TitanicBrawl.class));
cards.add(new SetCardInfo("Tithe Taker", 27, Rarity.RARE, mage.cards.t.TitheTaker.class));