[OTJ] Implement Step Between Worlds

This commit is contained in:
Susucre 2024-03-29 20:33:01 +01:00
parent 758df67d74
commit e7ab25e12d
2 changed files with 93 additions and 0 deletions

View file

@ -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<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;
}
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;
}
}

View file

@ -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));