From c7b26132448ec4027f13f265f83951c60b041c69 Mon Sep 17 00:00:00 2001 From: Muz Ali Date: Sun, 5 Apr 2026 12:16:30 -0500 Subject: [PATCH 1/2] [SOS] Implement Mana Sculpt --- Mage.Sets/src/mage/cards/m/ManaSculpt.java | 95 +++++++++++++++++++ .../src/mage/sets/SecretsOfStrixhaven.java | 2 + 2 files changed, 97 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/ManaSculpt.java diff --git a/Mage.Sets/src/mage/cards/m/ManaSculpt.java b/Mage.Sets/src/mage/cards/m/ManaSculpt.java new file mode 100644 index 000000000000..9038c00d88bb --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/ManaSculpt.java @@ -0,0 +1,95 @@ +package mage.cards.m; + +import java.util.UUID; + +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.target.TargetSpell; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author muz + */ +public final class ManaSculpt extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.WIZARD); + private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter); + private static final Hint hint = new ConditionHint(condition, "You control a Wizard"); + + public ManaSculpt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + + // Counter target spell. If you control a Wizard, add an amount of {C} equal to the amount of mana spent to cast that spell at the beginning of your next main phase. + this.getSpellAbility().addEffect(new ManaSculptEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addHint(hint); + } + + private ManaSculpt(final ManaSculpt card) { + super(card); + } + + @Override + public ManaSculpt copy() { + return new ManaSculpt(this); + } +} + +class ManaSculptEffect extends OneShotEffect { + + ManaSculptEffect() { + super(Outcome.Benefit); + this.staticText = "counter target spell. If you control a Wizard, add an amount of {C} equal to the amount of mana spent to cast that spell at the beginning of your next main phase"; + } + + private ManaSculptEffect(final ManaSculptEffect effect) { + super(effect); + } + + @Override + public ManaSculptEffect copy() { + return new ManaSculptEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); + if (spell != null) { + game.getStack().counter(source.getFirstTarget(), source, game); + + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { + if (permanent.hasSubtype(SubType.WIZARD, game)) { + int cmc = spell.getManaValue(); + Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.ColorlessMana(cmc), "your"); + effect.setTargetPointer(new FixedTarget(source.getControllerId())); + AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility + = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); + game.addDelayedTriggeredAbility(delayedAbility, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/SecretsOfStrixhaven.java b/Mage.Sets/src/mage/sets/SecretsOfStrixhaven.java index 9d9ad287b39a..dbc7821718c3 100644 --- a/Mage.Sets/src/mage/sets/SecretsOfStrixhaven.java +++ b/Mage.Sets/src/mage/sets/SecretsOfStrixhaven.java @@ -151,6 +151,8 @@ private SecretsOfStrixhaven() { cards.add(new SetCardInfo("Maelstrom Artisan", 122, Rarity.RARE, mage.cards.m.MaelstromArtisan.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Maelstrom Artisan", 334, Rarity.RARE, mage.cards.m.MaelstromArtisan.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mage Tower Referee", 249, Rarity.COMMON, mage.cards.m.MageTowerReferee.class)); + cards.add(new SetCardInfo("Mana Sculpt", 319, Rarity.RARE, mage.cards.m.ManaSculpt.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mana Sculpt", 57, Rarity.RARE, mage.cards.m.ManaSculpt.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Masterful Flourish", 89, Rarity.COMMON, mage.cards.m.MasterfulFlourish.class)); cards.add(new SetCardInfo("Mathemagics", 320, Rarity.MYTHIC, mage.cards.m.Mathemagics.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mathemagics", 58, Rarity.MYTHIC, mage.cards.m.Mathemagics.class, NON_FULL_USE_VARIOUS)); From 3b5b9ca53706271a010edf6664513645aa64c493 Mon Sep 17 00:00:00 2001 From: Muz Ali Date: Sat, 11 Apr 2026 11:28:48 -0500 Subject: [PATCH 2/2] PR comments --- Mage.Sets/src/mage/cards/m/ManaSculpt.java | 56 +++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/ManaSculpt.java b/Mage.Sets/src/mage/cards/m/ManaSculpt.java index 9038c00d88bb..333d36473aaf 100644 --- a/Mage.Sets/src/mage/cards/m/ManaSculpt.java +++ b/Mage.Sets/src/mage/cards/m/ManaSculpt.java @@ -22,7 +22,6 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.target.TargetSpell; import mage.target.targetpointer.FixedTarget; @@ -54,42 +53,41 @@ private ManaSculpt(final ManaSculpt card) { public ManaSculpt copy() { return new ManaSculpt(this); } -} -class ManaSculptEffect extends OneShotEffect { + private static final class ManaSculptEffect extends OneShotEffect { - ManaSculptEffect() { - super(Outcome.Benefit); - this.staticText = "counter target spell. If you control a Wizard, add an amount of {C} equal to the amount of mana spent to cast that spell at the beginning of your next main phase"; - } + ManaSculptEffect() { + super(Outcome.Benefit); + this.staticText = "counter target spell. If you control a Wizard, add an amount of {C} equal to the amount of mana spent to cast that spell at the beginning of your next main phase"; + } - private ManaSculptEffect(final ManaSculptEffect effect) { - super(effect); - } + private ManaSculptEffect(final ManaSculptEffect effect) { + super(effect); + } - @Override - public ManaSculptEffect copy() { - return new ManaSculptEffect(this); - } + @Override + public ManaSculptEffect copy() { + return new ManaSculptEffect(this); + } - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); - if (spell != null) { - game.getStack().counter(source.getFirstTarget(), source, game); + @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); - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.hasSubtype(SubType.WIZARD, game)) { - int cmc = spell.getManaValue(); - Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.ColorlessMana(cmc), "your"); - effect.setTargetPointer(new FixedTarget(source.getControllerId())); - AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility - = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); - game.addDelayedTriggeredAbility(delayedAbility, source); - } + if (game.getBattlefield().contains(filter, source.getControllerId(), source, game, 1)) { + int cmc = spell.getManaValue(); + Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.ColorlessMana(cmc), "your"); + effect.setTargetPointer(new FixedTarget(source.getControllerId())); + AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility + = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); + game.addDelayedTriggeredAbility(delayedAbility, source); } return true; } - return false; } }