diff --git a/Mage.Sets/src/mage/cards/p/PromiseOfTomorrow.java b/Mage.Sets/src/mage/cards/p/PromiseOfTomorrow.java new file mode 100644 index 00000000000..d6064ff0922 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PromiseOfTomorrow.java @@ -0,0 +1,60 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PromiseOfTomorrow extends CardImpl { + + private static final Condition condition = new PermanentsOnTheBattlefieldCondition( + StaticFilters.FILTER_CONTROLLED_CREATURE, + ComparisonType.EQUAL_TO, 0, true + ); + + public PromiseOfTomorrow(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + + // Whenever a creature you control dies, exile it. + this.addAbility(new DiesCreatureTriggeredAbility( + new ExileTargetForSourceEffect(), false, + StaticFilters.FILTER_CONTROLLED_A_CREATURE, true + )); + + // At the beginning of each end step, if you control no creatures, sacrifice Promise of Tomorrow and return all cards exiled with it to the battlefield under your control. + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new BeginningOfEndStepTriggeredAbility( + new SacrificeSourceEffect(), TargetController.ANY, false + ), condition, "At the beginning of each end step, if you control no creatures, " + + "sacrifice {this} and return all cards exiled with it to the battlefield under your control." + ); + ability.addEffect(new ReturnFromExileForSourceEffect(Zone.EXILED)); + this.addAbility(ability); + } + + private PromiseOfTomorrow(final PromiseOfTomorrow card) { + super(card); + } + + @Override + public PromiseOfTomorrow copy() { + return new PromiseOfTomorrow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 8d57cd25923..37ba014c5c3 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -184,6 +184,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Prava of the Steel Legion", 38, Rarity.UNCOMMON, mage.cards.p.PravaOfTheSteelLegion.class)); cards.add(new SetCardInfo("Preordain", 84, Rarity.COMMON, mage.cards.p.Preordain.class)); cards.add(new SetCardInfo("Profane Transfusion", 145, Rarity.MYTHIC, mage.cards.p.ProfaneTransfusion.class)); + cards.add(new SetCardInfo("Promise of Tomorrow", 39, Rarity.RARE, mage.cards.p.PromiseOfTomorrow.class)); cards.add(new SetCardInfo("Prophetic Prism", 334, Rarity.COMMON, mage.cards.p.PropheticPrism.class)); cards.add(new SetCardInfo("Prossh, Skyraider of Kher", 530, Rarity.MYTHIC, mage.cards.p.ProsshSkyraiderOfKher.class)); cards.add(new SetCardInfo("Prying Eyes", 86, Rarity.COMMON, mage.cards.p.PryingEyes.class));