[ECC] Implement Eventide's Shadow

This commit is contained in:
theelk801 2026-01-20 10:35:45 -05:00
parent ee1a280410
commit b5d751cb51
3 changed files with 98 additions and 2 deletions

View file

@ -0,0 +1,87 @@
package mage.cards.e;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.RemoveUpToAmountCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class EventidesShadow extends CardImpl {
public EventidesShadow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
// Remove any number of counters from among permanents on the battlefield. You draw cards and lose life equal to the number of counters removed this way.
this.getSpellAbility().addEffect(new EventidesShadowEffect());
}
private EventidesShadow(final EventidesShadow card) {
super(card);
}
@Override
public EventidesShadow copy() {
return new EventidesShadow(this);
}
}
class EventidesShadowEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("permanents");
static {
filter.add(CounterAnyPredicate.instance);
}
EventidesShadowEffect() {
super(Outcome.Benefit);
staticText = "remove any number of counters from among permanents on the battlefield. " +
"You draw cards and lose life equal to the number of counters removed this way";
}
private EventidesShadowEffect(final EventidesShadowEffect effect) {
super(effect);
}
@Override
public EventidesShadowEffect copy() {
return new EventidesShadowEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetPermanent target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
target.withChooseHint("to remove counters from");
player.choose(outcome, target, source, game);
int total = 0;
for (UUID targetId : target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
total += RemoveUpToAmountCountersEffect.doRemoval(Integer.MAX_VALUE, targetId, player, game, source);
}
if (total < 1) {
return false;
}
game.processAction();
player.drawCards(total, source, game);
game.processAction();
player.loseLife(total, game, source, false);
return true;
}
}

View file

@ -64,6 +64,8 @@ public final class LorwynEclipsedCommander extends ExpansionSet {
cards.add(new SetCardInfo("Elemental Spectacle", 15, Rarity.RARE, mage.cards.e.ElementalSpectacle.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Elemental Spectacle", 35, Rarity.RARE, mage.cards.e.ElementalSpectacle.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Endurance", 51, Rarity.MYTHIC, mage.cards.e.Endurance.class));
cards.add(new SetCardInfo("Eventide's Shadow", 28, Rarity.RARE, mage.cards.e.EventidesShadow.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Eventide's Shadow", 8, Rarity.RARE, mage.cards.e.EventidesShadow.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Everlasting Torment", 121, Rarity.RARE, mage.cards.e.EverlastingTorment.class));
cards.add(new SetCardInfo("Evolution Sage", 105, Rarity.UNCOMMON, mage.cards.e.EvolutionSage.class));
cards.add(new SetCardInfo("Exotic Orchard", 148, Rarity.RARE, mage.cards.e.ExoticOrchard.class));

View file

@ -64,6 +64,13 @@ public class RemoveUpToAmountCountersEffect extends OneShotEffect {
return 0;
}
private static String getIdName(Permanent permanent, Player player) {
if (permanent != null) {
return permanent.getIdName();
}
return player.getName();
}
public static int doRemoval(int amount, UUID targetId, Player controller, Game game, Ability source) {
Permanent permanent = game.getPermanent(targetId);
Player player = game.getPlayer(targetId);
@ -75,8 +82,8 @@ public class RemoveUpToAmountCountersEffect extends OneShotEffect {
return 0;
}
List<Integer> counterList = controller.getMultiAmount(
Outcome.UnboostCreature, toChoose, 0, 0,
amount, MultiAmountType.REMOVE_COUNTERS, game
Outcome.UnboostCreature, toChoose, 0, 0, amount,
new MultiAmountType("Choose counters", "Remove counters (from " + getIdName(permanent, player) + ')'), game
);
int total = 0;
for (int i = 0; i < toChoose.size(); i++) {