1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 09:11:05 -09:00

[STX] Implemented Reduce to Memory

This commit is contained in:
Evan Kranzler 2021-03-30 09:06:47 -04:00
parent f224629c4f
commit b128a38f56
2 changed files with 72 additions and 0 deletions

View file

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

View file

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