From 986a1987084b3bee00a2b9876b40d4cf751ff4a8 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 11 Dec 2025 11:45:24 -0500 Subject: [PATCH] [ECL] Implement High Perfect Morcant --- .../src/mage/cards/h/HighPerfectMorcant.java | 111 ++++++++++++++++++ Mage.Sets/src/mage/sets/LorwynEclipsed.java | 2 + 2 files changed, 113 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/HighPerfectMorcant.java diff --git a/Mage.Sets/src/mage/cards/h/HighPerfectMorcant.java b/Mage.Sets/src/mage/cards/h/HighPerfectMorcant.java new file mode 100644 index 00000000000..d270b5fba24 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HighPerfectMorcant.java @@ -0,0 +1,111 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.ProliferateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HighPerfectMorcant extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.ELF, "Elf"); + private static final FilterControlledPermanent filter2 + = new FilterControlledPermanent(SubType.ELF, "untapped Elves you control"); + + static { + filter2.add(TappedPredicate.UNTAPPED); + } + + public HighPerfectMorcant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever High Perfect Morcant or another Elf you control enters, each opponent blights 1. + this.addAbility(new EntersBattlefieldThisOrAnotherTriggeredAbility( + new HighPerfectMorcantEffect(), filter, false, true + )); + + // Tap three untapped Elves you control: Proliferate. Activate only as a sorcery. + this.addAbility(new ActivateAsSorceryActivatedAbility( + new ProliferateEffect(), new TapTargetCost(3, filter2) + )); + } + + private HighPerfectMorcant(final HighPerfectMorcant card) { + super(card); + } + + @Override + public HighPerfectMorcant copy() { + return new HighPerfectMorcant(this); + } +} + +class HighPerfectMorcantEffect extends OneShotEffect { + + HighPerfectMorcantEffect() { + super(Outcome.Benefit); + staticText = "each opponent blights 1. (They each put a -1/-1 counter on a creature they control.)"; + } + + private HighPerfectMorcantEffect(final HighPerfectMorcantEffect effect) { + super(effect); + } + + @Override + public HighPerfectMorcantEffect copy() { + return new HighPerfectMorcantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + // TODO: this will likely be refactored when we learn more about this mechanic + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent == null || !game.getBattlefield().contains( + StaticFilters.FILTER_CONTROLLED_CREATURE, opponentId, source, game, 1 + )) { + continue; + } + TargetPermanent target = new TargetControlledCreaturePermanent(); + target.withNotTarget(true); + target.withChooseHint("to put a -1/-1 counter on"); + opponent.choose(outcome, target, source, game); + Optional.ofNullable(target) + .map(TargetPermanent::getFirstTarget) + .map(game::getPermanent) + .ifPresent(permanent -> permanent.addCounters( + CounterType.M1M1.createInstance(), opponentId, source, game + )); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index 49e1cf2fd04..4d749f626e3 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -43,6 +43,8 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Hallowed Fountain", "347b", Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Hallowed Fountain", 265, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Hallowed Fountain", 347, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("High Perfect Morcant", 229, Rarity.RARE, mage.cards.h.HighPerfectMorcant.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("High Perfect Morcant", 373, Rarity.RARE, mage.cards.h.HighPerfectMorcant.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Morningtide's Light", 27, Rarity.MYTHIC, mage.cards.m.MorningtidesLight.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Morningtide's Light", 301, Rarity.MYTHIC, mage.cards.m.MorningtidesLight.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mutable Explorer", 186, Rarity.RARE, mage.cards.m.MutableExplorer.class, NON_FULL_USE_VARIOUS));