diff --git a/Mage.Sets/src/mage/cards/s/StreamOfThought.java b/Mage.Sets/src/mage/cards/s/StreamOfThought.java new file mode 100644 index 0000000000..c2772831fd --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StreamOfThought.java @@ -0,0 +1,80 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.keyword.ReplicateAbility; +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 mage.target.TargetCard; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class StreamOfThought extends CardImpl { + + public StreamOfThought(UUID ownerId, CardSetInfo setInfo) { + 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. + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); + this.getSpellAbility().addEffect(new StreamOfThoughtEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Replicate {2}{U}{U} + this.addAbility(new ReplicateAbility(this, "{2}{U}{U}")); + } + + private StreamOfThought(final StreamOfThought card) { + super(card); + } + + @Override + public StreamOfThought copy() { + 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; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index 60f97d6f09..cbc5eabb9b 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -43,6 +43,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Snow-Covered Mountain", 253, Rarity.COMMON, mage.cards.s.SnowCoveredMountain.class)); cards.add(new SetCardInfo("Snow-Covered Plains", 250, Rarity.COMMON, mage.cards.s.SnowCoveredPlains.class)); cards.add(new SetCardInfo("Snow-Covered Swamp", 252, Rarity.COMMON, mage.cards.s.SnowCoveredSwamp.class)); + cards.add(new SetCardInfo("Stream of Thought", 71, Rarity.COMMON, mage.cards.s.StreamOfThought.class)); cards.add(new SetCardInfo("Venomous Changeling", 114, Rarity.COMMON, mage.cards.v.VenomousChangeling.class)); cards.add(new SetCardInfo("Wall of One Thousand Cuts", 36, Rarity.COMMON, mage.cards.w.WallOfOneThousandCuts.class)); cards.add(new SetCardInfo("Wing Shards", 38, Rarity.UNCOMMON, mage.cards.w.WingShards.class)); diff --git a/Utils/keywords.txt b/Utils/keywords.txt index f32a5b3028..c629ddb422 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -76,6 +76,7 @@ Prowess|new| Reach|instance| Rebound|new| Renown|number| +Replicate|card, manaString| Riot|new| Scavenge|cost| Shadow|instance|