diff --git a/Mage.Sets/src/mage/cards/e/EldritchPact.java b/Mage.Sets/src/mage/cards/e/EldritchPact.java new file mode 100644 index 0000000000..cfd51b639f --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EldritchPact.java @@ -0,0 +1,68 @@ +package mage.cards.e; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class EldritchPact extends CardImpl { + + public EldritchPact(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{B}"); + + // Target player draws X cards and loses X life, where X is the number of cards in their graveyard. + this.getSpellAbility().addEffect(new EldritchPactEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + private EldritchPact(final EldritchPact card) { + super(card); + } + + @Override + public EldritchPact copy() { + return new EldritchPact(this); + } +} + +class EldritchPactEffect extends OneShotEffect { + + EldritchPactEffect() { + super(Outcome.Benefit); + staticText = "target player draws X cards and loses X life, where X is the number of cards in their graveyard"; + } + + private EldritchPactEffect(final EldritchPactEffect effect) { + super(effect); + } + + @Override + public EldritchPactEffect copy() { + return new EldritchPactEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int count = player.getGraveyard().size(); + if (count < 1) { + return false; + } + player.drawCards(count, source, game); + player.loseLife(count, game, source, false); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 3a64500815..8b86cfa77e 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -73,6 +73,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Dungeoneer's Pack", 312, Rarity.UNCOMMON, mage.cards.d.DungeoneersPack.class)); cards.add(new SetCardInfo("Earthquake Dragon", 228, Rarity.RARE, mage.cards.e.EarthquakeDragon.class)); cards.add(new SetCardInfo("Elder Brain", 125, Rarity.RARE, mage.cards.e.ElderBrain.class)); + cards.add(new SetCardInfo("Eldritch Pact", 126, Rarity.RARE, mage.cards.e.EldritchPact.class)); cards.add(new SetCardInfo("Ellyn Harbreeze, Busybody", 16, Rarity.UNCOMMON, mage.cards.e.EllynHarbreezeBusybody.class)); cards.add(new SetCardInfo("Elminster", 274, Rarity.MYTHIC, mage.cards.e.Elminster.class)); cards.add(new SetCardInfo("Elminster's Simulacrum", 68, Rarity.MYTHIC, mage.cards.e.ElminstersSimulacrum.class));