From 195717576b60362f6d53b1f525ecd474a61ca2a9 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 29 Apr 2025 12:50:35 -0400 Subject: [PATCH] [M3C] Implement Tempt with Mayhem --- .../src/mage/cards/t/TemptWithMayhem.java | 80 +++++++++++++++++++ .../mage/sets/ModernHorizons3Commander.java | 2 + 2 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TemptWithMayhem.java diff --git a/Mage.Sets/src/mage/cards/t/TemptWithMayhem.java b/Mage.Sets/src/mage/cards/t/TemptWithMayhem.java new file mode 100644 index 00000000000..f8a6e528c62 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TemptWithMayhem.java @@ -0,0 +1,80 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TemptWithMayhem extends CardImpl { + + public TemptWithMayhem(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); + + // Tempting offer -- Choose target instant or sorcery spell. Each opponent may copy that spell and may choose new targets for the copy they control. You copy that spell once plus an additional time for each opponent who copied the spell this way. You may choose new targets for the copies you control. + this.getSpellAbility().addEffect(new TemptWithMayhemEffect()); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY)); + this.getSpellAbility().setAbilityWord(AbilityWord.TEMPTING_OFFER); + } + + private TemptWithMayhem(final TemptWithMayhem card) { + super(card); + } + + @Override + public TemptWithMayhem copy() { + return new TemptWithMayhem(this); + } +} + +class TemptWithMayhemEffect extends OneShotEffect { + + TemptWithMayhemEffect() { + super(Outcome.Benefit); + staticText = "choose target instant or sorcery spell. Each opponent may copy that spell " + + "and may choose new targets for the copy they control. You copy that spell once " + + "plus an additional time for each opponent who copied the spell this way. " + + "You may choose new targets for the copies you control"; + } + + private TemptWithMayhemEffect(final TemptWithMayhemEffect effect) { + super(effect); + } + + @Override + public TemptWithMayhemEffect copy() { + return new TemptWithMayhemEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpell(getTargetPointer().getFirst(game, source)); + if (spell == null) { + return false; + } + int count = 0; + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null && opponent.chooseUse( + Outcome.Copy, "Copy " + spell.getIdName() + '?', source, game + )) { + spell.createCopyOnStack(game, source, opponentId, true); + count++; + } + } + spell.createCopyOnStack(game, source, source.getControllerId(), true, count + 1); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java b/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java index 702ea8e563a..cd96edc428d 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java @@ -248,6 +248,7 @@ public final class ModernHorizons3Commander extends ExpansionSet { cards.add(new SetCardInfo("Shivan Reef", 375, Rarity.RARE, mage.cards.s.ShivanReef.class)); cards.add(new SetCardInfo("Shrine of the Forsaken Gods", 376, Rarity.RARE, mage.cards.s.ShrineOfTheForsakenGods.class)); cards.add(new SetCardInfo("Siege-Gang Lieutenant", 61, Rarity.RARE, mage.cards.s.SiegeGangLieutenant.class)); + cards.add(new SetCardInfo("Tempt with Mayhem", 62, Rarity.RARE, mage.cards.t.TemptWithMayhem.class)); cards.add(new SetCardInfo("Ulalek, Fused Atrocity", 4, Rarity.MYTHIC, mage.cards.u.UlalekFusedAtrocity.class)); cards.add(new SetCardInfo("Sifter of Skulls", 203, Rarity.RARE, mage.cards.s.SifterOfSkulls.class)); cards.add(new SetCardInfo("Silverquill Lecturer", 44, Rarity.RARE, mage.cards.s.SilverquillLecturer.class)); @@ -294,6 +295,7 @@ public final class ModernHorizons3Commander extends ExpansionSet { cards.add(new SetCardInfo("Temple of Mystery", 390, Rarity.RARE, mage.cards.t.TempleOfMystery.class)); cards.add(new SetCardInfo("Temple of Silence", 391, Rarity.RARE, mage.cards.t.TempleOfSilence.class)); cards.add(new SetCardInfo("Temple of Triumph", 392, Rarity.RARE, mage.cards.t.TempleOfTriumph.class)); + cards.add(new SetCardInfo("Tempt with Mayhem", 62, Rarity.RARE, mage.cards.t.TemptWithMayhem.class)); cards.add(new SetCardInfo("Tendo Ice Bridge", 393, Rarity.RARE, mage.cards.t.TendoIceBridge.class)); cards.add(new SetCardInfo("Terastodon", 249, Rarity.RARE, mage.cards.t.Terastodon.class)); cards.add(new SetCardInfo("Terminate", 274, Rarity.COMMON, mage.cards.t.Terminate.class));