[TDM] Implement Perennation

This commit is contained in:
theelk801 2025-04-10 18:26:13 -04:00
parent cf970ec019
commit 9285b7e78a
6 changed files with 67 additions and 22 deletions

View file

@ -32,7 +32,7 @@ public final class GracefulRestoration extends CardImpl {
// Choose one // Choose one
// Return target creature card from your graveyard to the battlefield with an additional +1/+1 counter on it. // Return target creature card from your graveyard to the battlefield with an additional +1/+1 counter on it.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(CounterType.P1P1.createInstance(), true)); this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(true, CounterType.P1P1.createInstance()));
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
// Return up to two target creature cards with power 2 or less from your graveyard to the battlefield. // Return up to two target creature cards with power 2 or less from your graveyard to the battlefield.

View file

@ -0,0 +1,36 @@
package mage.cards.p;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldWithCounterTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Perennation extends CardImpl {
public Perennation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{B}{G}");
// Return target permanent card from your graveyard to the battlefield with a hexproof counter and an indestructible counter on it.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(
CounterType.HEXPROOF.createInstance(), CounterType.INDESTRUCTIBLE.createInstance()
));
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_PERMANENT));
}
private Perennation(final Perennation card) {
super(card);
}
@Override
public Perennation copy() {
return new Perennation(this);
}
}

View file

@ -43,7 +43,7 @@ public final class RakdosJoinsUp extends CardImpl {
// When Rakdos Joins Up enters the battlefield, return target creature card from your graveyard to the battlefield with two additional +1/+1 counters on it. // When Rakdos Joins Up enters the battlefield, return target creature card from your graveyard to the battlefield with two additional +1/+1 counters on it.
Ability ability = new EntersBattlefieldTriggeredAbility( Ability ability = new EntersBattlefieldTriggeredAbility(
new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(CounterType.P1P1.createInstance(2), true) new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(true, CounterType.P1P1.createInstance(2))
); );
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
this.addAbility(ability); this.addAbility(ability);

View file

@ -61,7 +61,7 @@ public final class TheRevelationsOfEzio extends CardImpl {
sagaAbility.addChapterEffect( sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_III, SagaChapter.CHAPTER_III, this, SagaChapter.CHAPTER_III, SagaChapter.CHAPTER_III,
ability -> { ability -> {
ability.addEffect(new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(CounterType.P1P1.createInstance(), true)); ability.addEffect(new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(true, CounterType.P1P1.createInstance()));
ability.addTarget(new TargetCardInYourGraveyard(assassinFilter)); ability.addTarget(new TargetCardInYourGraveyard(assassinFilter));
} }
); );

View file

@ -181,6 +181,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
cards.add(new SetCardInfo("Opulent Palace", 264, Rarity.UNCOMMON, mage.cards.o.OpulentPalace.class)); cards.add(new SetCardInfo("Opulent Palace", 264, Rarity.UNCOMMON, mage.cards.o.OpulentPalace.class));
cards.add(new SetCardInfo("Osseous Exhale", 17, Rarity.COMMON, mage.cards.o.OsseousExhale.class)); cards.add(new SetCardInfo("Osseous Exhale", 17, Rarity.COMMON, mage.cards.o.OsseousExhale.class));
cards.add(new SetCardInfo("Overwhelming Surge", 115, Rarity.UNCOMMON, mage.cards.o.OverwhelmingSurge.class)); cards.add(new SetCardInfo("Overwhelming Surge", 115, Rarity.UNCOMMON, mage.cards.o.OverwhelmingSurge.class));
cards.add(new SetCardInfo("Perennation", 212, Rarity.MYTHIC, mage.cards.p.Perennation.class));
cards.add(new SetCardInfo("Piercing Exhale", 151, Rarity.COMMON, mage.cards.p.PiercingExhale.class)); cards.add(new SetCardInfo("Piercing Exhale", 151, Rarity.COMMON, mage.cards.p.PiercingExhale.class));
cards.add(new SetCardInfo("Plains", 277, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Plains", 277, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Poised Practitioner", 18, Rarity.COMMON, mage.cards.p.PoisedPractitioner.class)); cards.add(new SetCardInfo("Poised Practitioner", 18, Rarity.COMMON, mage.cards.p.PoisedPractitioner.class));

View file

@ -7,6 +7,8 @@ import mage.counters.Counters;
import mage.game.Game; import mage.game.Game;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
@ -17,15 +19,17 @@ public class ReturnFromGraveyardToBattlefieldWithCounterTargetEffect extends Ret
private final Counters counters; private final Counters counters;
private final String counterText; private final String counterText;
public ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(Counter counter) { public ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(Counter... counters) {
this(counter, false); this(false, counters);
} }
public ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(Counter counter, boolean additional) { public ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(boolean additional, Counter... counters) {
super(false); super(false);
this.counters = new Counters(); this.counters = new Counters();
for (Counter counter : counters) {
this.counters.addCounter(counter); this.counters.addCounter(counter);
this.counterText = makeText(counter, additional); }
this.counterText = makeText(additional, counters);
} }
protected ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(final ReturnFromGraveyardToBattlefieldWithCounterTargetEffect effect) { protected ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(final ReturnFromGraveyardToBattlefieldWithCounterTargetEffect effect) {
@ -47,8 +51,10 @@ public class ReturnFromGraveyardToBattlefieldWithCounterTargetEffect extends Ret
return super.apply(game, source); return super.apply(game, source);
} }
private String makeText(Counter counter, boolean additional) { private static String makeText(boolean additional, Counter... counters) {
StringBuilder sb = new StringBuilder(" with "); List<String> strings = new ArrayList<>();
for (Counter counter : counters) {
StringBuilder sb = new StringBuilder();
if (counter.getCount() == 1) { if (counter.getCount() == 1) {
if (additional) { if (additional) {
sb.append("an additional ").append(counter.getName()); sb.append("an additional ").append(counter.getName());
@ -62,7 +68,9 @@ public class ReturnFromGraveyardToBattlefieldWithCounterTargetEffect extends Ret
sb.append(counter.getName()); sb.append(counter.getName());
sb.append(" counters"); sb.append(" counters");
} }
return sb.toString(); strings.add(sb.toString());
}
return " with " + CardUtil.concatWithAnd(strings);
} }
@Override @Override