[M3C] Implement Tempt with Mayhem

This commit is contained in:
theelk801 2025-04-29 12:50:35 -04:00
parent 8115de2bac
commit 195717576b
2 changed files with 82 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));