diff --git a/Mage.Sets/src/mage/cards/r/ReduceToMemory.java b/Mage.Sets/src/mage/cards/r/ReduceToMemory.java new file mode 100644 index 00000000000..0640bbbbfbb --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/ReduceToMemory.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.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.LoreholdToken; +import mage.players.Player; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ReduceToMemory extends CardImpl { + + public ReduceToMemory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}"); + + this.subtype.add(SubType.LESSON); + + // Exile target nonland permanent. Its controller creates a 3/2 red and white spirit creature token. + this.getSpellAbility().addEffect(new ReduceToMemoryEffect()); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + } + + private ReduceToMemory(final ReduceToMemory card) { + super(card); + } + + @Override + public ReduceToMemory copy() { + return new ReduceToMemory(this); + } +} + +class ReduceToMemoryEffect extends OneShotEffect { + + ReduceToMemoryEffect() { + super(Outcome.Benefit); + staticText = "exile target nonland permanent. Its controller creates a 3/2 red and white spirit creature token"; + } + + private ReduceToMemoryEffect(final ReduceToMemoryEffect effect) { + super(effect); + } + + @Override + public ReduceToMemoryEffect copy() { + return new ReduceToMemoryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + Player player = game.getPlayer(permanent.getControllerId()); + player.moveCards(permanent, Zone.EXILED, source, game); + new LoreholdToken().putOntoBattlefield(1, game, source, player.getId()); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index fc3ea9fbea1..3a65d57b631 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -77,6 +77,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Quandrix Command", 217, Rarity.RARE, mage.cards.q.QuandrixCommand.class)); cards.add(new SetCardInfo("Quintorius, Field Historian", 220, Rarity.UNCOMMON, mage.cards.q.QuintoriusFieldHistorian.class)); cards.add(new SetCardInfo("Reconstruct History", 222, Rarity.UNCOMMON, mage.cards.r.ReconstructHistory.class)); + cards.add(new SetCardInfo("Reduce to Memory", 25, Rarity.UNCOMMON, mage.cards.r.ReduceToMemory.class)); cards.add(new SetCardInfo("Relic Sloth", 223, Rarity.COMMON, mage.cards.r.RelicSloth.class)); cards.add(new SetCardInfo("Returned Pastcaller", 224, Rarity.UNCOMMON, mage.cards.r.ReturnedPastcaller.class)); cards.add(new SetCardInfo("Rip Apart", 381, Rarity.UNCOMMON, mage.cards.r.RipApart.class));