[ECL] Implement Dream Harvest

This commit is contained in:
theelk801 2026-01-12 18:41:01 -05:00
parent 2fc1c8de5f
commit e5c6643708
2 changed files with 80 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));