mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
[TDM] Implement Perennation
This commit is contained in:
parent
cf970ec019
commit
9285b7e78a
6 changed files with 67 additions and 22 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
36
Mage.Sets/src/mage/cards/p/Perennation.java
Normal file
36
Mage.Sets/src/mage/cards/p/Perennation.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
this.counters.addCounter(counter);
|
for (Counter counter : counters) {
|
||||||
this.counterText = makeText(counter, additional);
|
this.counters.addCounter(counter);
|
||||||
|
}
|
||||||
|
this.counterText = makeText(additional, counters);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(final ReturnFromGraveyardToBattlefieldWithCounterTargetEffect effect) {
|
protected ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(final ReturnFromGraveyardToBattlefieldWithCounterTargetEffect effect) {
|
||||||
|
|
@ -47,22 +51,26 @@ 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<>();
|
||||||
if (counter.getCount() == 1) {
|
for (Counter counter : counters) {
|
||||||
if (additional) {
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("an additional ").append(counter.getName());
|
if (counter.getCount() == 1) {
|
||||||
|
if (additional) {
|
||||||
|
sb.append("an additional ").append(counter.getName());
|
||||||
|
} else {
|
||||||
|
sb.append(CardUtil.addArticle(counter.getName()));
|
||||||
|
}
|
||||||
|
sb.append(" counter");
|
||||||
} else {
|
} else {
|
||||||
sb.append(CardUtil.addArticle(counter.getName()));
|
sb.append(CardUtil.numberToText(counter.getCount()));
|
||||||
|
sb.append(additional ? " additional " : " ");
|
||||||
|
sb.append(counter.getName());
|
||||||
|
sb.append(" counters");
|
||||||
}
|
}
|
||||||
sb.append(" counter");
|
strings.add(sb.toString());
|
||||||
} else {
|
|
||||||
sb.append(CardUtil.numberToText(counter.getCount()));
|
|
||||||
sb.append(additional ? " additional " : " ");
|
|
||||||
sb.append(counter.getName());
|
|
||||||
sb.append(" counters");
|
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return " with " + CardUtil.concatWithAnd(strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue