diff --git a/Mage.Sets/src/mage/cards/m/MindleechGhoul.java b/Mage.Sets/src/mage/cards/m/MindleechGhoul.java new file mode 100644 index 0000000000..5116b311c0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MindleechGhoul.java @@ -0,0 +1,86 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ExploitCreatureTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.ExploitAbility; +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.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MindleechGhoul extends CardImpl { + + public MindleechGhoul(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Exploit + this.addAbility(new ExploitAbility()); + + // When Mindleech Ghoul exploits a creature, each opponent exiles a card from their hand. + this.addAbility(new ExploitCreatureTriggeredAbility(new MindleechGhoulEffect())); + } + + private MindleechGhoul(final MindleechGhoul card) { + super(card); + } + + @Override + public MindleechGhoul copy() { + return new MindleechGhoul(this); + } +} + +class MindleechGhoulEffect extends OneShotEffect { + + MindleechGhoulEffect() { + super(Outcome.Benefit); + staticText = "each opponent exiles a card from their hand"; + } + + private MindleechGhoulEffect(final MindleechGhoulEffect effect) { + super(effect); + } + + @Override + public MindleechGhoulEffect copy() { + return new MindleechGhoulEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + Cards cards = new CardsImpl(); + for (UUID playerId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(playerId); + if (opponent == null || opponent.getHand().isEmpty()) { + continue; + } + TargetCard target = new TargetCardInHand(); + opponent.choose(Outcome.Discard, opponent.getHand(), target, game); + cards.add(game.getCard(target.getFirstTarget())); + } + return controller.moveCards(cards, Zone.EXILED, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index ca01841f70..a41c632ba5 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -48,6 +48,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Gryff Rider", 15, Rarity.COMMON, mage.cards.g.GryffRider.class)); cards.add(new SetCardInfo("Island", 270, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Massive Might", 208, Rarity.COMMON, mage.cards.m.MassiveMight.class)); + cards.add(new SetCardInfo("Mindleech Ghoul", 122, Rarity.COMMON, mage.cards.m.MindleechGhoul.class)); cards.add(new SetCardInfo("Mountain", 274, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Overcharged Amalgam", 71, Rarity.RARE, mage.cards.o.OverchargedAmalgam.class)); cards.add(new SetCardInfo("Path of Peril", 124, Rarity.RARE, mage.cards.p.PathOfPeril.class));