[EOE] Implement Cerebral Download

This commit is contained in:
theelk801 2025-07-17 11:56:42 -04:00
parent fe1166f6e7
commit 7f0dca107d
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,68 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ArtifactYouControlCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.hint.common.ArtifactYouControlHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Controllable;
import mage.game.Game;
import java.util.Optional;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CerebralDownload extends CardImpl {
public CerebralDownload(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}");
// Surveil X, where X is the number of artifacts you control. Then draw three cards.
this.getSpellAbility().addEffect(new CerebralDownloadEffect());
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3).concatBy("Then"));
this.getSpellAbility().addHint(ArtifactYouControlHint.instance);
}
private CerebralDownload(final CerebralDownload card) {
super(card);
}
@Override
public CerebralDownload copy() {
return new CerebralDownload(this);
}
}
class CerebralDownloadEffect extends OneShotEffect {
CerebralDownloadEffect() {
super(Outcome.Benefit);
staticText = "surveil X, where X is the number of artifacts you control";
}
private CerebralDownloadEffect(final CerebralDownloadEffect effect) {
super(effect);
}
@Override
public CerebralDownloadEffect copy() {
return new CerebralDownloadEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return Optional.ofNullable(source)
.map(Controllable::getControllerId)
.map(game::getPlayer)
.filter(player -> player.surveil(
ArtifactYouControlCount.instance.calculate(game, source, this), source, game
))
.isPresent();
}
}

View file

@ -57,6 +57,7 @@ public final class EdgeOfEternities extends ExpansionSet {
cards.add(new SetCardInfo("Breeding Pool", 373, Rarity.RARE, mage.cards.b.BreedingPool.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Broodguard Elite", 175, Rarity.UNCOMMON, mage.cards.b.BroodguardElite.class));
cards.add(new SetCardInfo("Bygone Colossus", 235, Rarity.UNCOMMON, mage.cards.b.BygoneColossus.class));
cards.add(new SetCardInfo("Cerebral Download", 48, Rarity.UNCOMMON, mage.cards.c.CerebralDownload.class));
cards.add(new SetCardInfo("Chorale of the Void", 331, Rarity.RARE, mage.cards.c.ChoraleOfTheVoid.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Chorale of the Void", 91, Rarity.RARE, mage.cards.c.ChoraleOfTheVoid.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Chrome Companion", 236, Rarity.COMMON, mage.cards.c.ChromeCompanion.class));