From c69296b3ea73e81b4dbff682e8b0a18de35edc66 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 22 Jan 2026 12:38:41 -0500 Subject: [PATCH] [TMT] Implement Michelangelo's Technique --- Mage.Sets/src/mage/cards/a/AoTheDawnSky.java | 3 +- .../mage/cards/m/MichelangelosTechnique.java | 128 ++++++++++++++++++ .../mage/sets/TeenageMutantNinjaTurtles.java | 1 + 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/m/MichelangelosTechnique.java diff --git a/Mage.Sets/src/mage/cards/a/AoTheDawnSky.java b/Mage.Sets/src/mage/cards/a/AoTheDawnSky.java index 6c577cd75e5..15798fa4e61 100644 --- a/Mage.Sets/src/mage/cards/a/AoTheDawnSky.java +++ b/Mage.Sets/src/mage/cards/a/AoTheDawnSky.java @@ -115,7 +115,8 @@ class AoTheDawnSkyEffect extends OneShotEffect { class AoTheDawnSkyTarget extends TargetCardInLibrary { - private static final FilterCard filterStatic = new FilterPermanentCard("nonland permanent cards with total mana value 4 or less from your graveyard"); + private static final FilterCard filterStatic = new FilterPermanentCard("nonland permanent cards with total mana value 4 or less"); + static { filterStatic.add(Predicates.not(CardType.LAND.getPredicate())); } diff --git a/Mage.Sets/src/mage/cards/m/MichelangelosTechnique.java b/Mage.Sets/src/mage/cards/m/MichelangelosTechnique.java new file mode 100644 index 00000000000..84f43ebf42d --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MichelangelosTechnique.java @@ -0,0 +1,128 @@ +package mage.cards.m; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SneakAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; +import mage.util.CardUtil; + +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MichelangelosTechnique extends CardImpl { + + public MichelangelosTechnique(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}"); + + // Sneak {3}{G} + this.addAbility(new SneakAbility(this, "{3}{G}")); + + // Look at the top eight cards of your library. Put up to two creature cards with total mana value 6 or less from among them onto the battlefield and the rest on the bottom of your library in a random order. + this.getSpellAbility().addEffect(new MichelangelosTechniqueEffect()); + } + + private MichelangelosTechnique(final MichelangelosTechnique card) { + super(card); + } + + @Override + public MichelangelosTechnique copy() { + return new MichelangelosTechnique(this); + } +} + +class MichelangelosTechniqueEffect extends OneShotEffect { + + MichelangelosTechniqueEffect() { + super(Outcome.Benefit); + staticText = "look at the top eight cards of your library. Put up to two creature cards " + + "with total mana value 6 or less from among them onto the battlefield " + + "and the rest on the bottom of your library in a random order"; + } + + private MichelangelosTechniqueEffect(final MichelangelosTechniqueEffect effect) { + super(effect); + } + + @Override + public MichelangelosTechniqueEffect copy() { + return new MichelangelosTechniqueEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 8)); + TargetCard target = new MichelangelosTechniqueTarget(); + player.choose(outcome, cards, target, source, game); + player.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); + cards.retainZone(Zone.LIBRARY, game); + player.putCardsOnBottomOfLibrary(cards, game, source, false); + return true; + } +} + +class MichelangelosTechniqueTarget extends TargetCardInLibrary { + + private static final FilterCard filterStatic = new FilterCreatureCard("creature cards with total mana value 6 or less"); + + MichelangelosTechniqueTarget() { + super(0, 2, filterStatic); + } + + private MichelangelosTechniqueTarget(final MichelangelosTechniqueTarget target) { + super(target); + } + + @Override + public MichelangelosTechniqueTarget copy() { + return new MichelangelosTechniqueTarget(this); + } + + @Override + public boolean canTarget(UUID playerId, UUID id, Ability source, Game game) { + return super.canTarget(playerId, id, source, game) + && CardUtil.checkCanTargetTotalValueLimit( + this.getTargets(), id, MageObject::getManaValue, 6, game + ); + } + + @Override + public Set possibleTargets(UUID sourceControllerId, Ability source, Game game) { + return CardUtil.checkPossibleTargetsTotalValueLimit( + this.getTargets(), super.possibleTargets(sourceControllerId, source, game), + MageObject::getManaValue, 6, game + ); + } + + @Override + public String getMessage(Game game) { + // shows selected total + int selectedValue = this.getTargets().stream() + .map(game::getObject) + .filter(Objects::nonNull) + .mapToInt(MageObject::getManaValue) + .sum(); + return super.getMessage(game) + " (selected total mana value " + selectedValue + ")"; + } +} diff --git a/Mage.Sets/src/mage/sets/TeenageMutantNinjaTurtles.java b/Mage.Sets/src/mage/sets/TeenageMutantNinjaTurtles.java index 7bff53809f4..a3fc11c8092 100644 --- a/Mage.Sets/src/mage/sets/TeenageMutantNinjaTurtles.java +++ b/Mage.Sets/src/mage/sets/TeenageMutantNinjaTurtles.java @@ -48,6 +48,7 @@ public final class TeenageMutantNinjaTurtles extends ExpansionSet { cards.add(new SetCardInfo("Leonardo, Sewer Samurai", 17, Rarity.MYTHIC, mage.cards.l.LeonardoSewerSamurai.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Leonardo, Sewer Samurai", 301, Rarity.MYTHIC, mage.cards.l.LeonardoSewerSamurai.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Madame Null, Power Broker", 66, Rarity.RARE, mage.cards.m.MadameNullPowerBroker.class)); + cards.add(new SetCardInfo("Michelangelo's Technique", 122, Rarity.RARE, mage.cards.m.MichelangelosTechnique.class)); cards.add(new SetCardInfo("Michelangelo, Improviser", 119, Rarity.MYTHIC, mage.cards.m.MichelangeloImproviser.class)); cards.add(new SetCardInfo("Michelangelo, Weirdness to 11", 121, Rarity.RARE, mage.cards.m.MichelangeloWeirdnessTo11.class)); cards.add(new SetCardInfo("Mikey & Leo, Chaos & Order", 158, Rarity.RARE, mage.cards.m.MikeyAndLeoChaosAndOrder.class));