Simplify several cards similar to Wand of Vertebrae

This commit is contained in:
Alex Vasile 2022-09-04 20:41:59 -04:00
parent 9c59ec698d
commit e5e76f91f4
6 changed files with 16 additions and 133 deletions

View file

@ -4,6 +4,7 @@ import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetWithReplacementEffect; import mage.abilities.effects.common.CounterTargetWithReplacementEffect;
import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -32,7 +33,7 @@ public final class DeviousCoverUp extends CardImpl {
this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addTarget(new TargetSpell());
// You may shuffle up to four target cards from your graveyard into your library. // You may shuffle up to four target cards from your graveyard into your library.
this.getSpellAbility().addEffect(new DeviousCoverUpEffect().setTargetPointer(new SecondTargetPointer())); this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect(true).setTargetPointer(new SecondTargetPointer()));
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 4)); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 4));
} }
@ -45,39 +46,3 @@ public final class DeviousCoverUp extends CardImpl {
return new DeviousCoverUp(this); return new DeviousCoverUp(this);
} }
} }
class DeviousCoverUpEffect extends OneShotEffect {
public DeviousCoverUpEffect() {
super(Outcome.Benefit);
this.staticText = "You may shuffle up to four target cards "
+ "from your graveyard into your library.";
}
public DeviousCoverUpEffect(final DeviousCoverUpEffect effect) {
super(effect);
}
@Override
public DeviousCoverUpEffect copy() {
return new DeviousCoverUpEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null || !controller.chooseUse(outcome, "Shuffle the targeted cards into your library?", source, game)) {
return false;
}
Cards cards = new CardsImpl();
for (UUID targetId : targetPointer.getTargets(game, source)) {
Card card = game.getCard(targetId);
if (card != null) {
cards.add(card);
}
}
controller.putCardsOnTopOfLibrary(cards, game, source, false);
controller.shuffleLibrary(source, game);
return true;
}
}

View file

@ -9,6 +9,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.MillCardsControllerEffect;
import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
@ -33,7 +34,7 @@ public final class PerpetualTimepiece extends CardImpl {
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new MillCardsControllerEffect(2), new TapSourceCost())); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new MillCardsControllerEffect(2), new TapSourceCost()));
// {2}, Exile Perpetual Timepiece: Shuffle any number of target cards from your graveyard into your library. // {2}, Exile Perpetual Timepiece: Shuffle any number of target cards from your graveyard into your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PerpetualTimepieceShuffleEffect(), new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShuffleIntoLibraryTargetEffect(), new GenericManaCost(2));
ability.addCost(new ExileSourceCost()); ability.addCost(new ExileSourceCost());
ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCard("cards to shuffle into your library"))); ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCard("cards to shuffle into your library")));
this.addAbility(ability); this.addAbility(ability);

View file

@ -3,6 +3,7 @@ package mage.cards.p;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
@ -24,7 +25,7 @@ public final class PipersMelody extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
// Shuffle any number of target creature cards from your graveyard into your library. // Shuffle any number of target creature cards from your graveyard into your library.
this.getSpellAbility().addEffect(new PipersMelodyShuffleEffect()); this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD)); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD));
} }
@ -37,31 +38,3 @@ public final class PipersMelody extends CardImpl {
return new PipersMelody(this); return new PipersMelody(this);
} }
} }
class PipersMelodyShuffleEffect extends OneShotEffect {
PipersMelodyShuffleEffect() {
super(Outcome.Neutral);
this.staticText = "Shuffle any number of target creature cards from your graveyard into your library";
}
PipersMelodyShuffleEffect(final PipersMelodyShuffleEffect effect) {
super(effect);
}
@Override
public PipersMelodyShuffleEffect copy() {
return new PipersMelodyShuffleEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.moveCards(new CardsImpl(this.getTargetPointer().getTargets(game, source)), Zone.LIBRARY, source, game);
controller.shuffleLibrary(source, game);
return true;
}
return false;
}
}

View file

@ -21,8 +21,8 @@ public final class PsychicSpiral extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}");
// Shuffle all cards from your graveyard into your library. Target player puts that many cards from the top of their library into their graveyard. // Shuffle all cards from your graveyard into your library. Target player puts that many cards from the top of their library into their graveyard.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new PsychicSpiralEffect()); this.getSpellAbility().addEffect(new PsychicSpiralEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
} }
private PsychicSpiral(final PsychicSpiral card) { private PsychicSpiral(final PsychicSpiral card) {

View file

@ -3,6 +3,7 @@ package mage.cards.r;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
@ -24,7 +25,7 @@ public final class RenewingTouch extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
// Shuffle any number of target creature cards from your graveyard into your library. // Shuffle any number of target creature cards from your graveyard into your library.
this.getSpellAbility().addEffect(new RenewingTouchEffect()); this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD)); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES_YOUR_GRAVEYARD));
} }
@ -37,31 +38,3 @@ public final class RenewingTouch extends CardImpl {
return new RenewingTouch(this); return new RenewingTouch(this);
} }
} }
class RenewingTouchEffect extends OneShotEffect {
RenewingTouchEffect() {
super(Outcome.Neutral);
this.staticText = "Shuffle any number of target creature cards from your graveyard into your library";
}
RenewingTouchEffect(final RenewingTouchEffect effect) {
super(effect);
}
@Override
public RenewingTouchEffect copy() {
return new RenewingTouchEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.moveCards(new CardsImpl(this.getTargetPointer().getTargets(game, source)), Zone.LIBRARY, source, game);
controller.shuffleLibrary(source, game);
return true;
}
return false;
}
}

View file

@ -3,6 +3,7 @@ package mage.cards.s;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect;
import mage.abilities.keyword.ReplicateAbility; import mage.abilities.keyword.ReplicateAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -15,6 +16,7 @@ import mage.players.Player;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.SecondTargetPointer;
import java.util.UUID; import java.util.UUID;
@ -26,11 +28,14 @@ public final class StreamOfThought extends CardImpl {
public StreamOfThought(UUID ownerId, CardSetInfo setInfo) { public StreamOfThought(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}");
// Target player puts the top four cards of their library into their graveyard. You shuffle up to four cards from your graveyard into your library. // Target player puts the top four cards of their library into their graveyard.
this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4));
this.getSpellAbility().addEffect(new StreamOfThoughtEffect());
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
// You shuffle up to four cards from your graveyard into your library.
this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect().setTargetPointer(new SecondTargetPointer()));
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 4));
// Replicate {2}{U}{U} // Replicate {2}{U}{U}
this.addAbility(new ReplicateAbility("{2}{U}{U}")); this.addAbility(new ReplicateAbility("{2}{U}{U}"));
} }
@ -44,37 +49,3 @@ public final class StreamOfThought extends CardImpl {
return new StreamOfThought(this); return new StreamOfThought(this);
} }
} }
class StreamOfThoughtEffect extends OneShotEffect {
StreamOfThoughtEffect() {
super(Outcome.Benefit);
staticText = "You shuffle up to four cards from your graveyard into your library.";
}
private StreamOfThoughtEffect(final StreamOfThoughtEffect effect) {
super(effect);
}
@Override
public StreamOfThoughtEffect copy() {
return new StreamOfThoughtEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetCard target = new TargetCardInYourGraveyard(0, 4);
target.setNotTarget(true);
if (!player.choose(outcome, player.getGraveyard(), target, game)) {
return false;
}
Cards cards = new CardsImpl(target.getTargets());
player.putCardsOnTopOfLibrary(cards, game, source, false);
player.shuffleLibrary(source, game);
return true;
}
}