diff --git a/Mage.Sets/src/mage/cards/n/NurglesConscription.java b/Mage.Sets/src/mage/cards/n/NurglesConscription.java new file mode 100644 index 0000000000..4b046e8a38 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NurglesConscription.java @@ -0,0 +1,71 @@ +package mage.cards.n; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NurglesConscription extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("creature card from an opponent's graveyard"); + + static { + filter.add(TargetController.OPPONENT.getOwnerPredicate()); + } + + public NurglesConscription(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}"); + + // Put target creature card from an opponent's graveyard onto the battlefield tapped under your control, then exile that player's graveyard. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); + this.getSpellAbility().addEffect(new NurglesConscriptionEffect()); + this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter)); + } + + private NurglesConscription(final NurglesConscription card) { + super(card); + } + + @Override + public NurglesConscription copy() { + return new NurglesConscription(this); + } +} + +class NurglesConscriptionEffect extends OneShotEffect { + + NurglesConscriptionEffect() { + super(Outcome.Benefit); + staticText = ", then exile that player's graveyard"; + } + + private NurglesConscriptionEffect(final NurglesConscriptionEffect effect) { + super(effect); + } + + @Override + public NurglesConscriptionEffect copy() { + return new NurglesConscriptionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getOwnerId(getTargetPointer().getFirst(game, source))); + return player != null && player.moveCards(player.getGraveyard(), Zone.EXILED, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index 4c684e5dbe..5a3fef1dfe 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -177,6 +177,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("New Horizons", 218, Rarity.COMMON, mage.cards.n.NewHorizons.class)); cards.add(new SetCardInfo("Night Scythe", 162, Rarity.UNCOMMON, mage.cards.n.NightScythe.class)); cards.add(new SetCardInfo("Noise Marine", 82, Rarity.UNCOMMON, mage.cards.n.NoiseMarine.class)); + cards.add(new SetCardInfo("Nurgle's Conscription", 44, Rarity.RARE, mage.cards.n.NurglesConscription.class)); cards.add(new SetCardInfo("Nurgle's Rot", 45, Rarity.UNCOMMON, mage.cards.n.NurglesRot.class)); cards.add(new SetCardInfo("Old One Eye", 96, Rarity.RARE, mage.cards.o.OldOneEye.class)); cards.add(new SetCardInfo("Opal Palace", 286, Rarity.COMMON, mage.cards.o.OpalPalace.class));