[TMT] Implement Turtles in Time

This commit is contained in:
theelk801 2026-01-23 13:38:14 -05:00
parent 4c91ca132a
commit 413b8fae27
3 changed files with 97 additions and 16 deletions

View file

@ -61,32 +61,25 @@ class StepBetweenWorldsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
List<Player> players = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
if (!player.chooseUse(
Outcome.Benefit,
"Shuffle your hand and graveyard into your library, then draw seven cards?",
source, game
)) {
continue;
if (player.chooseUse(Outcome.DrawCard, "Shuffle your hand and graveyard into your library and draw seven cards?", source, game)) {
game.informPlayers(player.getLogName() + " chooses to shuffle and draw");
players.add(player);
} else {
game.informPlayers(player.getLogName() + " chooses not to shuffle and draw");
}
players.add(player);
Cards cards = new CardsImpl(player.getHand());
cards.addAll(player.getGraveyard());
player.putCardsOnTopOfLibrary(cards, game, source, false);
player.shuffleLibrary(source, game);
}
for (Player player : players) {
Cards cards = new CardsImpl(player.getHand());
cards.addAll(player.getGraveyard());
player.shuffleCardsToLibrary(cards, game, source);
player.drawCards(7, source, game);
}
return true;
return !players.isEmpty();
}
}

View file

@ -0,0 +1,87 @@
package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TurtlesInTime extends CardImpl {
public TurtlesInTime(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U}{U}");
// Return all creatures to their owners' hands. Each player may shuffle their hand and graveyard into their library, then each player who does draws seven cards.
this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES));
this.getSpellAbility().addEffect(new TurtlesInTimeEffect());
// Exile Turtles in Time.
this.getSpellAbility().addEffect(new ExileSpellEffect().concatBy("<br>"));
}
private TurtlesInTime(final TurtlesInTime card) {
super(card);
}
@Override
public TurtlesInTime copy() {
return new TurtlesInTime(this);
}
}
class TurtlesInTimeEffect extends OneShotEffect {
TurtlesInTimeEffect() {
super(Outcome.Benefit);
staticText = "Each player may shuffle their hand and graveyard into their library, " +
"then each player who does draws seven cards";
}
private TurtlesInTimeEffect(final TurtlesInTimeEffect effect) {
super(effect);
}
@Override
public TurtlesInTimeEffect copy() {
return new TurtlesInTimeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
List<Player> players = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
if (player.chooseUse(Outcome.DrawCard, "Shuffle your hand and graveyard into your library and draw seven cards?", source, game)) {
game.informPlayers(player.getLogName() + " chooses to shuffle and draw");
players.add(player);
} else {
game.informPlayers(player.getLogName() + " chooses not to shuffle and draw");
}
}
for (Player player : players) {
Cards cards = new CardsImpl(player.getHand());
cards.addAll(player.getGraveyard());
player.shuffleCardsToLibrary(cards, game, source);
player.drawCards(7, source, game);
}
return !players.isEmpty();
}
}

View file

@ -94,6 +94,7 @@ public final class TeenageMutantNinjaTurtles extends ExpansionSet {
cards.add(new SetCardInfo("Turncoat Kunoichi", 26, Rarity.RARE, mage.cards.t.TurncoatKunoichi.class));
cards.add(new SetCardInfo("Turtle Power!", 135, Rarity.RARE, mage.cards.t.TurtlePower.class));
cards.add(new SetCardInfo("Turtle Van", 181, Rarity.RARE, mage.cards.t.TurtleVan.class));
cards.add(new SetCardInfo("Turtles in Time", 55, Rarity.MYTHIC, mage.cards.t.TurtlesInTime.class));
cards.add(new SetCardInfo("Weather Maker", 182, Rarity.RARE, mage.cards.w.WeatherMaker.class));
}
}