From 34cd9f7824eb279dc8724f94d7fa885102d1ed62 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 3 Feb 2022 20:57:59 -0500 Subject: [PATCH] [NEO] Implemented Moonsnare Prototype --- .../src/mage/cards/m/MoonsnarePrototype.java | 91 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MoonsnarePrototype.java diff --git a/Mage.Sets/src/mage/cards/m/MoonsnarePrototype.java b/Mage.Sets/src/mage/cards/m/MoonsnarePrototype.java new file mode 100644 index 0000000000..741687662a --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MoonsnarePrototype.java @@ -0,0 +1,91 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.keyword.ChannelAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MoonsnarePrototype extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledPermanent("untapped artifact or creature you control"); + + static { + filter.add(TappedPredicate.UNTAPPED); + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate() + )); + } + + public MoonsnarePrototype(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{U}"); + + // {T}, Tap an untapped artifact or creature you control: Add {C}. + Ability ability = new ColorlessManaAbility(); + ability.addCost(new TapTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + + // Channel — {4}{U}, Discard Moonsnare Prototype: The owner of target nonland permanent puts it on the top or bottom of their library. + ability = new ChannelAbility("{4}{U}", new MoonsnarePrototypeEffect()); + ability.addTarget(new TargetNonlandPermanent()); + this.addAbility(ability); + } + + private MoonsnarePrototype(final MoonsnarePrototype card) { + super(card); + } + + @Override + public MoonsnarePrototype copy() { + return new MoonsnarePrototype(this); + } +} + +class MoonsnarePrototypeEffect extends OneShotEffect { + + MoonsnarePrototypeEffect() { + super(Outcome.Benefit); + staticText = "the owner of target nonland permanent puts it on the top or bottom of their library"; + } + + private MoonsnarePrototypeEffect(final MoonsnarePrototypeEffect effect) { + super(effect); + } + + @Override + public MoonsnarePrototypeEffect copy() { + return new MoonsnarePrototypeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getOwnerId(source.getFirstTarget())); + if (player == null) { + return false; + } + if (player.chooseUse(Outcome.Detriment, "Put the targeted object on the top or bottom of your library?", + "", "Top", "Bottom", source, game)) { + return new PutOnLibraryTargetEffect(true).apply(game, source); + } + return new PutOnLibraryTargetEffect(false).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 07b4dc890c..962d861472 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -104,6 +104,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Michiko's Reign of Truth", 29, Rarity.UNCOMMON, mage.cards.m.MichikosReignOfTruth.class)); cards.add(new SetCardInfo("Mobilizer Mech", 65, Rarity.UNCOMMON, mage.cards.m.MobilizerMech.class)); cards.add(new SetCardInfo("Moon-Circuit Hacker", 67, Rarity.COMMON, mage.cards.m.MoonCircuitHacker.class)); + cards.add(new SetCardInfo("Moonsnare Prototype", 69, Rarity.COMMON, mage.cards.m.MoonsnarePrototype.class)); cards.add(new SetCardInfo("Mountain", 289, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Nameless Conqueror", 162, Rarity.COMMON, mage.cards.n.NamelessConqueror.class)); cards.add(new SetCardInfo("Naomi, Pillar of Order", 229, Rarity.UNCOMMON, mage.cards.n.NaomiPillarOfOrder.class));