From f18c50a85752c810f538e722789189861527fb2a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 3 Apr 2024 09:56:35 -0400 Subject: [PATCH] [BIG] Implement Molten Duplication --- .../src/mage/cards/m/MoltenDuplication.java | 73 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBigScore.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MoltenDuplication.java diff --git a/Mage.Sets/src/mage/cards/m/MoltenDuplication.java b/Mage.Sets/src/mage/cards/m/MoltenDuplication.java new file mode 100644 index 00000000000..b2025ac58e4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MoltenDuplication.java @@ -0,0 +1,73 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTargets; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MoltenDuplication extends CardImpl { + + public MoltenDuplication(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); + + // Create a token that's a copy of target artifact or creature you control, except it's an artifact in addition to its other types. It gains haste until end of turn. Sacrifice it at the beginning of the next end step. + this.getSpellAbility().addEffect(new MoltenDuplicationEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE)); + } + + private MoltenDuplication(final MoltenDuplication card) { + super(card); + } + + @Override + public MoltenDuplication copy() { + return new MoltenDuplication(this); + } +} + +class MoltenDuplicationEffect extends OneShotEffect { + + MoltenDuplicationEffect() { + super(Outcome.Benefit); + staticText = "create a token that's a copy of target artifact or creature you control, " + + "except it's an artifact in addition to its other types. " + + "It gains haste until end of turn. Sacrifice it at the beginning of the next end step"; + } + + private MoltenDuplicationEffect(final MoltenDuplicationEffect effect) { + super(effect); + } + + @Override + public MoltenDuplicationEffect copy() { + return new MoltenDuplicationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + null, CardType.ARTIFACT, false + ); + effect.apply(game, source); + game.addEffect(new GainAbilityTargetEffect( + HasteAbility.getInstance(), Duration.EndOfTurn + ).setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game)), source); + effect.sacrificeTokensCreatedAtNextEndStep(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBigScore.java b/Mage.Sets/src/mage/sets/TheBigScore.java index e9f9c2d27a4..538d33cdb9e 100644 --- a/Mage.Sets/src/mage/sets/TheBigScore.java +++ b/Mage.Sets/src/mage/sets/TheBigScore.java @@ -28,6 +28,7 @@ public final class TheBigScore extends ExpansionSet { cards.add(new SetCardInfo("Loot, the Key to Everything", 21, Rarity.MYTHIC, mage.cards.l.LootTheKeyToEverything.class)); cards.add(new SetCardInfo("Lost Jitte", 53, Rarity.MYTHIC, mage.cards.l.LostJitte.class)); cards.add(new SetCardInfo("Lotus Ring", 24, Rarity.MYTHIC, mage.cards.l.LotusRing.class)); + cards.add(new SetCardInfo("Molten Duplication", 14, Rarity.MYTHIC, mage.cards.m.MoltenDuplication.class)); cards.add(new SetCardInfo("Oltec Matterweaver", 3, Rarity.MYTHIC, mage.cards.o.OltecMatterweaver.class)); cards.add(new SetCardInfo("Pest Control", 22, Rarity.MYTHIC, mage.cards.p.PestControl.class)); cards.add(new SetCardInfo("Rest in Peace", 4, Rarity.MYTHIC, mage.cards.r.RestInPeace.class));