Implemented Stream of Thought

This commit is contained in:
Evan Kranzler 2019-05-19 21:49:16 -04:00
parent 282a0482e3
commit 0638cdee71
3 changed files with 82 additions and 0 deletions

View file

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

View file

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

View file

@ -76,6 +76,7 @@ Prowess|new|
Reach|instance|
Rebound|new|
Renown|number|
Replicate|card, manaString|
Riot|new|
Scavenge|cost|
Shadow|instance|