diff --git a/Mage.Sets/src/mage/cards/s/StepBetweenWorlds.java b/Mage.Sets/src/mage/cards/s/StepBetweenWorlds.java new file mode 100644 index 00000000000..4710a898b45 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StepBetweenWorlds.java @@ -0,0 +1,92 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.keyword.PlotAbility; +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.game.Game; +import mage.players.Player; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @author Susucr + */ +public final class StepBetweenWorlds extends CardImpl { + + public StepBetweenWorlds(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + + // Each player may shuffle their hand and graveyard into their library. Each player who does draws seven cards. Exile Step Between Worlds. + this.getSpellAbility().addEffect(new StepBetweenWorldsEffect()); + this.getSpellAbility().addEffect(new ExileSourceEffect()); + + // Plot {4}{U}{U} + this.addAbility(new PlotAbility("{4}{U}{U}")); + } + + private StepBetweenWorlds(final StepBetweenWorlds card) { + super(card); + } + + @Override + public StepBetweenWorlds copy() { + return new StepBetweenWorlds(this); + } +} + +class StepBetweenWorldsEffect extends OneShotEffect { + + StepBetweenWorldsEffect() { + super(Outcome.DrawCard); + this.staticText = "Each player may shuffle their hand and graveyard into their library. Each player who does draws seven cards"; + } + + private StepBetweenWorldsEffect(final StepBetweenWorldsEffect effect) { + super(effect); + } + + @Override + public StepBetweenWorldsEffect copy() { + return new StepBetweenWorldsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + List 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; + } + 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) { + player.drawCards(7, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index 15c5338b4f4..718d2adde76 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -111,6 +111,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Slickshot Vault-Buster", 68, Rarity.COMMON, mage.cards.s.SlickshotVaultBuster.class)); cards.add(new SetCardInfo("Soured Springs", 264, Rarity.COMMON, mage.cards.s.SouredSprings.class)); cards.add(new SetCardInfo("Spirebluff Canal", 270, Rarity.RARE, mage.cards.s.SpirebluffCanal.class)); + cards.add(new SetCardInfo("Step Between Worlds", 70, Rarity.RARE, mage.cards.s.StepBetweenWorlds.class)); cards.add(new SetCardInfo("Stingerback Terror", 147, Rarity.RARE, mage.cards.s.StingerbackTerror.class)); cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Terror of the Peaks", 149, Rarity.MYTHIC, mage.cards.t.TerrorOfThePeaks.class));