From 7f0dca107da17c0ab6eb3c5bbbac619680fd1bf7 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 17 Jul 2025 11:56:42 -0400 Subject: [PATCH] [EOE] Implement Cerebral Download --- .../src/mage/cards/c/CerebralDownload.java | 68 +++++++++++++++++++ Mage.Sets/src/mage/sets/EdgeOfEternities.java | 1 + 2 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CerebralDownload.java diff --git a/Mage.Sets/src/mage/cards/c/CerebralDownload.java b/Mage.Sets/src/mage/cards/c/CerebralDownload.java new file mode 100644 index 00000000000..d7e427f5e9d --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CerebralDownload.java @@ -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(); + } +} diff --git a/Mage.Sets/src/mage/sets/EdgeOfEternities.java b/Mage.Sets/src/mage/sets/EdgeOfEternities.java index 1b49dfb679f..6b7e9c638ce 100644 --- a/Mage.Sets/src/mage/sets/EdgeOfEternities.java +++ b/Mage.Sets/src/mage/sets/EdgeOfEternities.java @@ -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));