diff --git a/Mage.Sets/src/mage/cards/r/ReleaseToMemory.java b/Mage.Sets/src/mage/cards/r/ReleaseToMemory.java new file mode 100644 index 0000000000..c323affd7a --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/ReleaseToMemory.java @@ -0,0 +1,71 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.SpiritToken; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ReleaseToMemory extends CardImpl { + + public ReleaseToMemory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}"); + + // Exile target opponent's graveyard. For each creature card exiled this way, create a 1/1 colorless Spirit creature token. + this.getSpellAbility().addEffect(new ReleaseToMemoryEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + private ReleaseToMemory(final ReleaseToMemory card) { + super(card); + } + + @Override + public ReleaseToMemory copy() { + return new ReleaseToMemory(this); + } +} + +class ReleaseToMemoryEffect extends OneShotEffect { + + ReleaseToMemoryEffect() { + super(Outcome.Benefit); + staticText = "exile target opponent's graveyard. For each creature " + + "card exiled this way, create a 1/1 colorless Spirit creature token"; + } + + private ReleaseToMemoryEffect(final ReleaseToMemoryEffect effect) { + super(effect); + } + + @Override + public ReleaseToMemoryEffect copy() { + return new ReleaseToMemoryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player == null) { + return false; + } + int creatures = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); + player.moveCards(player.getGraveyard(), Zone.EXILED, source, game); + if (creatures > 0) { + new SpiritToken().putOntoBattlefield(creatures, game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/NeonDynastyCommander.java b/Mage.Sets/src/mage/sets/NeonDynastyCommander.java index 5f1e3fa254..40ee615a79 100644 --- a/Mage.Sets/src/mage/sets/NeonDynastyCommander.java +++ b/Mage.Sets/src/mage/sets/NeonDynastyCommander.java @@ -25,6 +25,7 @@ public final class NeonDynastyCommander extends ExpansionSet { cards.add(new SetCardInfo("Myojin of Roaring Blades", 36, Rarity.RARE, mage.cards.m.MyojinOfRoaringBlades.class)); cards.add(new SetCardInfo("Myojin of Towering Might", 38, Rarity.RARE, mage.cards.m.MyojinOfToweringMight.class)); cards.add(new SetCardInfo("Organic Extinction", 8, Rarity.RARE, mage.cards.o.OrganicExtinction.class)); + cards.add(new SetCardInfo("Release to Memory", 9, Rarity.RARE, mage.cards.r.ReleaseToMemory.class)); cards.add(new SetCardInfo("Shorikai, Genesis Engine", 4, Rarity.MYTHIC, mage.cards.s.ShorikaiGenesisEngine.class)); cards.add(new SetCardInfo("Universal Surveillance", 17, Rarity.RARE, mage.cards.u.UniversalSurveillance.class)); cards.add(new SetCardInfo("Yoshimaru, Ever Faithful", 32, Rarity.MYTHIC, mage.cards.y.YoshimaruEverFaithful.class));