From d54fdb71b1ccd4275474084c38b79968571b1557 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 2 Feb 2022 21:21:29 -0500 Subject: [PATCH] [NEO] Implemented Takenuma, Abandoned Mire --- .../mage/cards/t/TakenumaAbandonedMire.java | 93 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 94 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TakenumaAbandonedMire.java diff --git a/Mage.Sets/src/mage/cards/t/TakenumaAbandonedMire.java b/Mage.Sets/src/mage/cards/t/TakenumaAbandonedMire.java new file mode 100644 index 0000000000..027398fc15 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TakenumaAbandonedMire.java @@ -0,0 +1,93 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.costs.costadjusters.LegendaryCreatureCostAdjuster; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.ChannelAbility; +import mage.abilities.mana.BlackManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TakenumaAbandonedMire extends CardImpl { + + public TakenumaAbandonedMire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.addSuperType(SuperType.LEGENDARY); + + // {T}: Add {B}. + this.addAbility(new BlackManaAbility()); + + // Channel — {3}{B}, Discard Takenuma, Abandoned Mire: Mill three cards, then return a creature or planeswalker card from your graveyard to your hand. This ability costs {1} less to activate for each legendary creature you control. + Ability ability = new ChannelAbility("{3}{B}", new TakenumaAbandonedMireEffect()); + ability.setCostAdjuster(LegendaryCreatureCostAdjuster.instance); + this.addAbility(ability); + } + + private TakenumaAbandonedMire(final TakenumaAbandonedMire card) { + super(card); + } + + @Override + public TakenumaAbandonedMire copy() { + return new TakenumaAbandonedMire(this); + } +} + +class TakenumaAbandonedMireEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("creature or planeswalker card"); + + static { + filter.add(Predicates.or( + CardType.CREATURE.getPredicate(), + CardType.PLANESWALKER.getPredicate() + )); + } + + TakenumaAbandonedMireEffect() { + super(Outcome.Benefit); + staticText = "mill three cards, then return a creature or planeswalker card from your graveyard to your hand. " + + "This ability costs {1} less to activate for each legendary creature you control"; + } + + private TakenumaAbandonedMireEffect(final TakenumaAbandonedMireEffect effect) { + super(effect); + } + + @Override + public TakenumaAbandonedMireEffect copy() { + return new TakenumaAbandonedMireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.millCards(3, source, game); + if (player.getGraveyard().count(filter, game) < 1) { + return true; + } + TargetCard target = new TargetCardInGraveyard(filter); + target.setNotTarget(true); + player.choose(outcome, player.getGraveyard(), target, game); + return player.moveCards(game.getCard(target.getFirstTarget()), Zone.HAND, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 2ae9a11b44..dd55e30839 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -123,6 +123,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Sunblade Samurai", 39, Rarity.COMMON, mage.cards.s.SunbladeSamurai.class)); cards.add(new SetCardInfo("Surgehacker Mech", 260, Rarity.RARE, mage.cards.s.SurgehackerMech.class)); cards.add(new SetCardInfo("Swamp", 287, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Takenuma, Abandoned Mire", 278, Rarity.RARE, mage.cards.t.TakenumaAbandonedMire.class)); cards.add(new SetCardInfo("Tempered in Solitude", 165, Rarity.UNCOMMON, mage.cards.t.TemperedInSolitude.class)); cards.add(new SetCardInfo("The Fall of Lord Konda", 12, Rarity.UNCOMMON, mage.cards.t.TheFallOfLordKonda.class)); cards.add(new SetCardInfo("The Modern Age", 66, Rarity.COMMON, mage.cards.t.TheModernAge.class));