From e5c66437089d0a198f2182a7a98a4328b4b80ea9 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 12 Jan 2026 18:41:01 -0500 Subject: [PATCH] [ECL] Implement Dream Harvest --- Mage.Sets/src/mage/cards/d/DreamHarvest.java | 78 ++++++++++++++++++++ Mage.Sets/src/mage/sets/LorwynEclipsed.java | 2 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DreamHarvest.java diff --git a/Mage.Sets/src/mage/cards/d/DreamHarvest.java b/Mage.Sets/src/mage/cards/d/DreamHarvest.java new file mode 100644 index 00000000000..b320a36614d --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DreamHarvest.java @@ -0,0 +1,78 @@ +package mage.cards.d; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect; +import mage.cards.*; +import mage.constants.*; +import mage.game.Game; +import mage.players.Player; +import mage.target.targetpointer.FixedTargets; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DreamHarvest extends CardImpl { + + public DreamHarvest(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U/B}{U/B}"); + + // Each opponent exiles cards from the top of their library until they have exiled cards with total mana value 5 or greater this way. Until end of turn, you may cast cards exiled this way without paying their mana costs. + this.getSpellAbility().addEffect(new DreamHarvestEffect()); + } + + private DreamHarvest(final DreamHarvest card) { + super(card); + } + + @Override + public DreamHarvest copy() { + return new DreamHarvest(this); + } +} + +class DreamHarvestEffect extends OneShotEffect { + + DreamHarvestEffect() { + super(Outcome.Benefit); + staticText = "each opponent exiles cards from the top of their library until they have exiled cards " + + "with total mana value 5 or greater this way. Until end of turn, " + + "you may cast cards exiled this way without paying their mana costs"; + } + + private DreamHarvestEffect(final DreamHarvestEffect effect) { + super(effect); + } + + @Override + public DreamHarvestEffect copy() { + return new DreamHarvestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Cards exiled = new CardsImpl(); + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(opponentId); + if (player == null) { + continue; + } + Cards cards = new CardsImpl(); + for (Card card : player.getLibrary().getCards(game)) { + player.moveCards(card, Zone.EXILED, source, game); + cards.add(card); + if (cards.getCards(game).stream().mapToInt(MageObject::getManaValue).sum() >= 5) { + break; + } + } + exiled.addAll(cards); + } + game.addEffect(new PlayFromNotOwnHandZoneTargetEffect( + Zone.EXILED, TargetController.YOU, Duration.EndOfTurn, true, true + ).setTargetPointer(new FixedTargets(exiled, game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index fbbbba037cf..93d3359ce5a 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -108,6 +108,8 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Doran, Besieged by Time", 215, Rarity.RARE, mage.cards.d.DoranBesiegedByTime.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Doran, Besieged by Time", 334, Rarity.RARE, mage.cards.d.DoranBesiegedByTime.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Dose of Dawnglow", 100, Rarity.UNCOMMON, mage.cards.d.DoseOfDawnglow.class)); + cards.add(new SetCardInfo("Dream Harvest", 216, Rarity.RARE, mage.cards.d.DreamHarvest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Dream Harvest", 371, Rarity.RARE, mage.cards.d.DreamHarvest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Dream Seizer", 101, Rarity.COMMON, mage.cards.d.DreamSeizer.class)); cards.add(new SetCardInfo("Dundoolin Weaver", 175, Rarity.UNCOMMON, mage.cards.d.DundoolinWeaver.class)); cards.add(new SetCardInfo("Eclipsed Boggart", 217, Rarity.UNCOMMON, mage.cards.e.EclipsedBoggart.class, NON_FULL_USE_VARIOUS));