[NEO] Implemented Takenuma, Abandoned Mire

This commit is contained in:
Evan Kranzler 2022-02-02 21:21:29 -05:00
parent 2517d3bd94
commit d54fdb71b1
2 changed files with 94 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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));