[ECL] Implement End-Blaze Epiphany

This commit is contained in:
theelk801 2026-01-17 09:30:45 -05:00
parent 3f5a5edcae
commit fd1e142a4e
3 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,79 @@
package mage.cards.e;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.delayed.WhenTargetDiesDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.Optional;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class EndBlazeEpiphany extends CardImpl {
public EndBlazeEpiphany(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}");
// End-Blaze Epiphany deals X damage to target creature. When that creature dies this turn, exile a number of cards from the top of your library equal to its power, then choose a card exiled this way. Until the end of your next turn, you may play that card.
this.getSpellAbility().addEffect(new DamageTargetEffect(GetXValue.instance));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(
new WhenTargetDiesDelayedTriggeredAbility(new ExileTopXMayPlayUntilEffect(
EndBlazeEpiphanyValue.instance, true, Duration.UntilEndOfYourNextTurn
).setText("exile a number of cards from the top of your library equal to its power, " +
"then choose a card exiled this way. Until the end of your next turn, you may play that card"))
));
}
private EndBlazeEpiphany(final EndBlazeEpiphany card) {
super(card);
}
@Override
public EndBlazeEpiphany copy() {
return new EndBlazeEpiphany(this);
}
}
enum EndBlazeEpiphanyValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
return Optional
.ofNullable((Permanent) effect.getValue("creatureDied"))
.map(MageObject::getPower)
.map(MageInt::getValue)
.orElse(0);
}
@Override
public EndBlazeEpiphanyValue copy() {
return this;
}
@Override
public String getMessage() {
return "";
}
@Override
public String toString() {
return "1";
}
}

View file

@ -144,6 +144,8 @@ public final class LorwynEclipsed extends ExpansionSet {
cards.add(new SetCardInfo("Emptiness", 222, Rarity.MYTHIC, mage.cards.e.Emptiness.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Emptiness", 294, Rarity.MYTHIC, mage.cards.e.Emptiness.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Encumbered Reejerey", 14, Rarity.UNCOMMON, mage.cards.e.EncumberedReejerey.class));
cards.add(new SetCardInfo("End-Blaze Epiphany", 134, Rarity.RARE, mage.cards.e.EndBlazeEpiphany.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("End-Blaze Epiphany", 364, Rarity.RARE, mage.cards.e.EndBlazeEpiphany.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Enraged Flamecaster", 135, Rarity.COMMON, mage.cards.e.EnragedFlamecaster.class));
cards.add(new SetCardInfo("Evershrike's Gift", 15, Rarity.UNCOMMON, mage.cards.e.EvershrikesGift.class));
cards.add(new SetCardInfo("Evolving Wilds", 264, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));

View file

@ -87,6 +87,7 @@ public class WhenTargetDiesDelayedTriggeredAbility extends DelayedTriggeredAbili
getEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
break;
}
getEffects().setValue("creatureDied", zEvent.getTarget());
return true;
}
}