[NEC] Implemented Release to Memory

This commit is contained in:
Evan Kranzler 2022-02-07 18:16:28 -05:00
parent ac9a6b576e
commit f1e3f1dbb2
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.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;
}
}

View file

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