diff --git a/Mage.Sets/src/mage/cards/d/DemonicBargain.java b/Mage.Sets/src/mage/cards/d/DemonicBargain.java new file mode 100644 index 00000000000..bcce2af2ed9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DemonicBargain.java @@ -0,0 +1,72 @@ +package mage.cards.d; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DemonicBargain extends CardImpl { + + public DemonicBargain(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); + + // Exile the top thirteen cards of your library, then search your library for a card. Put that card into your hand, then shuffle. + this.getSpellAbility().addEffect(new DemonicBargainEffect()); + } + + private DemonicBargain(final DemonicBargain card) { + super(card); + } + + @Override + public DemonicBargain copy() { + return new DemonicBargain(this); + } +} + +class DemonicBargainEffect extends OneShotEffect { + + DemonicBargainEffect() { + super(Outcome.Benefit); + staticText = "exile the top thirteen cards of your library, " + + "then search your library for a card. Put that card into your hand, then shuffle"; + } + + private DemonicBargainEffect(final DemonicBargainEffect effect) { + super(effect); + } + + @Override + public DemonicBargainEffect copy() { + return new DemonicBargainEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.moveCards(player.getLibrary().getTopCards(game, 13), Zone.EXILED, source, game); + TargetCardInLibrary target = new TargetCardInLibrary(); + player.searchLibrary(target, source, game); + Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + player.moveCards(card, Zone.HAND, source, game); + } + player.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index ebeefe8dcd3..5c7e7fe36b7 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -33,6 +33,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Apprentice Sharpshooter", 185, Rarity.COMMON, mage.cards.a.ApprenticeSharpshooter.class)); cards.add(new SetCardInfo("Deathcap Glade", 261, Rarity.RARE, mage.cards.d.DeathcapGlade.class)); + cards.add(new SetCardInfo("Demonic Bargain", 103, Rarity.RARE, mage.cards.d.DemonicBargain.class)); cards.add(new SetCardInfo("Dig Up", 197, Rarity.RARE, mage.cards.d.DigUp.class)); cards.add(new SetCardInfo("Dreamroot Cascade", 262, Rarity.RARE, mage.cards.d.DreamrootCascade.class)); cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class));