From 4cf9568953fc6e08cd947970580d66c3b581d323 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 9 Jan 2026 21:19:37 -0500 Subject: [PATCH] [ECL] Implement Prismatic Undercurrents --- .../mage/cards/p/PrismaticUndercurrents.java | 88 +++++++++++++++++++ Mage.Sets/src/mage/sets/LorwynEclipsed.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PrismaticUndercurrents.java diff --git a/Mage.Sets/src/mage/cards/p/PrismaticUndercurrents.java b/Mage.Sets/src/mage/cards/p/PrismaticUndercurrents.java new file mode 100644 index 00000000000..60a3523045e --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PrismaticUndercurrents.java @@ -0,0 +1,88 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.ColorsAmongControlledPermanentsCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PrismaticUndercurrents extends CardImpl { + + public PrismaticUndercurrents(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); + + // Vivid -- When this enchantment enters, search your library for up to X basic land cards, where X is the number of colors among permanents you control. Reveal those cards, put them into your hand, then shuffle. + this.addAbility(new EntersBattlefieldTriggeredAbility(new PrismaticUndercurrentsEffect()) + .setAbilityWord(AbilityWord.VIVID) + .addHint(ColorsAmongControlledPermanentsCount.ALL_PERMANENTS.getHint())); + + // You may play an additional land on each of your turns. + this.addAbility(new SimpleStaticAbility( + new PlayAdditionalLandsControllerEffect(1, Duration.WhileOnBattlefield) + )); + } + + private PrismaticUndercurrents(final PrismaticUndercurrents card) { + super(card); + } + + @Override + public PrismaticUndercurrents copy() { + return new PrismaticUndercurrents(this); + } +} + +class PrismaticUndercurrentsEffect extends OneShotEffect { + + PrismaticUndercurrentsEffect() { + super(Outcome.Benefit); + staticText = "search your library for up to X basic land cards, where X is the number of colors " + + "among permanents you control. Reveal those cards, put them into your hand, then shuffle"; + } + + private PrismaticUndercurrentsEffect(final PrismaticUndercurrentsEffect effect) { + super(effect); + } + + @Override + public PrismaticUndercurrentsEffect copy() { + return new PrismaticUndercurrentsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCardInLibrary target = new TargetCardInLibrary( + 0, + ColorsAmongControlledPermanentsCount + .ALL_PERMANENTS + .calculate(game, source, this), + StaticFilters.FILTER_CARD_BASIC_LANDS + ); + player.searchLibrary(target, source, game); + Cards cards = new CardsImpl(target.getTargets()); + cards.retainZone(Zone.LIBRARY, game); + player.revealCards(source, cards, game); + player.moveCards(cards, Zone.HAND, source, game); + player.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index 8dce90bd03c..9b27e999686 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -231,6 +231,7 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Plains", 274, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Plains", 279, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Prideful Feastling", 238, Rarity.COMMON, mage.cards.p.PridefulFeastling.class)); + cards.add(new SetCardInfo("Prismatic Undercurrents", 189, Rarity.UNCOMMON, mage.cards.p.PrismaticUndercurrents.class)); cards.add(new SetCardInfo("Protective Response", 29, Rarity.UNCOMMON, mage.cards.p.ProtectiveResponse.class)); cards.add(new SetCardInfo("Puca's Eye", 259, Rarity.UNCOMMON, mage.cards.p.PucasEye.class)); cards.add(new SetCardInfo("Reckless Ransacking", 152, Rarity.COMMON, mage.cards.r.RecklessRansacking.class));