From 35bec7102c5211bbe9648ebe7a7bc0fd199b48bd Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:10:56 -0500 Subject: [PATCH] [PIP] Implement Electrosiphon (#11964) --- Mage.Sets/src/mage/cards/e/Electrosiphon.java | 66 +++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 4 ++ 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/Electrosiphon.java diff --git a/Mage.Sets/src/mage/cards/e/Electrosiphon.java b/Mage.Sets/src/mage/cards/e/Electrosiphon.java new file mode 100644 index 00000000000..a9cb0184deb --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/Electrosiphon.java @@ -0,0 +1,66 @@ +package mage.cards.e; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +/** + * @author Cguy7777 + */ +public final class Electrosiphon extends CardImpl { + + public Electrosiphon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}{R}"); + + // Counter target spell. You get an amount of {E} equal to its mana value. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new ElectrosiphonEffect()); + } + + private Electrosiphon(final Electrosiphon card) { + super(card); + } + + @Override + public Electrosiphon copy() { + return new Electrosiphon(this); + } +} + +class ElectrosiphonEffect extends OneShotEffect { + + ElectrosiphonEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target spell. You get an amount of {E} (energy counters) equal to its mana value"; + } + + private ElectrosiphonEffect(final ElectrosiphonEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); + if (spell == null) { + return false; + } + + game.getStack().counter(spell.getId(), source, game); + new GetEnergyCountersControllerEffect(spell.getManaValue()).apply(game, source); + return true; + } + + @Override + public ElectrosiphonEffect copy() { + return new ElectrosiphonEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 11b770c4ea6..6ec045d8a60 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -89,6 +89,10 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Dr. Madison Li", 3, Rarity.MYTHIC, mage.cards.d.DrMadisonLi.class)); cards.add(new SetCardInfo("Dragonskull Summit", 261, Rarity.RARE, mage.cards.d.DragonskullSummit.class)); cards.add(new SetCardInfo("Drowned Catacomb", 262, Rarity.RARE, mage.cards.d.DrownedCatacomb.class)); + cards.add(new SetCardInfo("Electrosiphon", 104, Rarity.RARE, mage.cards.e.Electrosiphon.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Electrosiphon", 414, Rarity.RARE, mage.cards.e.Electrosiphon.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Electrosiphon", 632, Rarity.RARE, mage.cards.e.Electrosiphon.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Electrosiphon", 942, Rarity.RARE, mage.cards.e.Electrosiphon.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Entrapment Maneuver", 160, Rarity.RARE, mage.cards.e.EntrapmentManeuver.class)); cards.add(new SetCardInfo("Everflowing Chalice", 230, Rarity.UNCOMMON, mage.cards.e.EverflowingChalice.class)); cards.add(new SetCardInfo("Evolving Wilds", 263, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));