From 116767e2343e6e7f57f9aa2840beaa77cbd75862 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:05:13 +0100 Subject: [PATCH] [WHO] Implement Sibylline Soothsayer --- .../src/mage/cards/s/SibyllineSoothsayer.java | 103 ++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 1 + 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SibyllineSoothsayer.java diff --git a/Mage.Sets/src/mage/cards/s/SibyllineSoothsayer.java b/Mage.Sets/src/mage/cards/s/SibyllineSoothsayer.java new file mode 100644 index 00000000000..64b31875f49 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SibyllineSoothsayer.java @@ -0,0 +1,103 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainSuspendEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Library; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class SibyllineSoothsayer extends CardImpl { + + public SibyllineSoothsayer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.subtype.add(SubType.HUMAN, SubType.WARLOCK); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Temporal Foresight — When Sibylline Soothsayer enters the battlefield, reveal cards from the top of your library until you reveal a nonland card with mana value 3 or greater. + // Exile that card with three time counters on it. If it doesn't have suspend, it gains suspend. Put the rest of the revealed cards on the bottom of your library in a random order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SibyllineSoothsayerEffect()).withFlavorWord("Temporal Foresight")); + } + + private SibyllineSoothsayer(final SibyllineSoothsayer card) { + super(card); + } + + @Override + public SibyllineSoothsayer copy() { + return new SibyllineSoothsayer(this); + } +} + +class SibyllineSoothsayerEffect extends OneShotEffect { + + SibyllineSoothsayerEffect() { + super(Outcome.Benefit); + staticText = "reveal cards from the top of your library until you reveal a nonland card with mana value 3 or greater. Exile that card with three time " + + "counters on it. If it doesn't have suspend, it gains suspend. Put the rest of the revealed cards on the bottom of your library in a random order."; + } + + private SibyllineSoothsayerEffect(final SibyllineSoothsayerEffect effect) { + super(effect); + } + + @Override + public SibyllineSoothsayerEffect copy() { + return new SibyllineSoothsayerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Library library = player.getLibrary(); + if (!library.hasCards()) { + return true; + } + Cards cards = new CardsImpl(); + Card toSuspend = null; + for (Card card : library.getCards(game)) { + cards.add(card); + if (!card.isLand(game) && card.getManaValue() >= 3) { + toSuspend = card; + break; + } + } + + player.revealCards(source, cards, game); + if (toSuspend != null) { + boolean hasSuspend = toSuspend.getAbilities(game).containsClass(SuspendAbility.class); + UUID exileId = SuspendAbility.getSuspendExileId(player.getId(), game); + if (player.moveCardToExileWithInfo(toSuspend, exileId, "Suspended cards of " + player.getName(), source, game, Zone.LIBRARY, true)) { + toSuspend.addCounters(CounterType.TIME.createInstance(3), source.getControllerId(), source, game); + if (!hasSuspend) { + game.addEffect(new GainSuspendEffect(new MageObjectReference(toSuspend, game)), source); + } + game.informPlayers(player.getLogName() + " suspends 3 - " + toSuspend.getName()); + } + } + cards.remove(toSuspend); + if (!cards.isEmpty()) { + player.putCardsOnBottomOfLibrary(cards, game, source, false); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index 2aae3c5aa3b..c01322d9321 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -165,6 +165,7 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Shadowblood Ridge", 303, Rarity.RARE, mage.cards.s.ShadowbloodRidge.class)); cards.add(new SetCardInfo("Sheltered Thicket", 304, Rarity.RARE, mage.cards.s.ShelteredThicket.class)); cards.add(new SetCardInfo("Shipwreck Marsh", 305, Rarity.RARE, mage.cards.s.ShipwreckMarsh.class)); + cards.add(new SetCardInfo("Sibylline Soothsayer", 95, Rarity.UNCOMMON, mage.cards.s.SibyllineSoothsayer.class)); cards.add(new SetCardInfo("Sisterhood of Karn", 109, Rarity.RARE, mage.cards.s.SisterhoodOfKarn.class)); cards.add(new SetCardInfo("Skycloud Expanse", 306, Rarity.RARE, mage.cards.s.SkycloudExpanse.class)); cards.add(new SetCardInfo("Smoldering Marsh", 307, Rarity.RARE, mage.cards.s.SmolderingMarsh.class));