From c307d6ee3d347e400c8f9d379ab10c2b2a78ae8d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 6 Apr 2021 20:54:28 -0400 Subject: [PATCH] [STX] Implemented Mercurial Transformation --- .../mage/cards/m/MercurialTransformation.java | 83 +++++++++++++++++++ .../mage/sets/StrixhavenSchoolOfMages.java | 1 + 2 files changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MercurialTransformation.java diff --git a/Mage.Sets/src/mage/cards/m/MercurialTransformation.java b/Mage.Sets/src/mage/cards/m/MercurialTransformation.java new file mode 100644 index 00000000000..569fc45200d --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MercurialTransformation.java @@ -0,0 +1,83 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.game.permanent.token.custom.CreatureToken; +import mage.players.Player; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MercurialTransformation extends CardImpl { + + public MercurialTransformation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}"); + + this.subtype.add(SubType.LESSON); + + // Until end of turn, target nonland permanent loses all abilities and becomes your choice of a blue Frog creature with base power and toughness 1/1 or a blue Octopus creature with base power and toughness 4/4. + this.getSpellAbility().addEffect(new MercurialTransformationEffect()); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + } + + private MercurialTransformation(final MercurialTransformation card) { + super(card); + } + + @Override + public MercurialTransformation copy() { + return new MercurialTransformation(this); + } +} + +class MercurialTransformationEffect extends OneShotEffect { + + MercurialTransformationEffect() { + super(Outcome.Benefit); + staticText = "until end of turn, target nonland permanent loses all abilities and " + + "becomes your choice of a blue Frog creature with base power and toughness 1/1 " + + "or a blue Octopus creature with base power and toughness 4/4"; + } + + private MercurialTransformationEffect(final MercurialTransformationEffect effect) { + super(effect); + } + + @Override + public MercurialTransformationEffect copy() { + return new MercurialTransformationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Token token; + if (player.chooseUse( + outcome, "1/1 Frog or 4/4 Octopus?", + null, "Frog", "Octopus", source, game + )) { + token = new CreatureToken(1, 1).withColor("U").withSubType(SubType.FROG); + } else { + token = new CreatureToken(4, 4).withColor("U").withSubType(SubType.OCTOPUS); + } + game.addEffect(new BecomesCreatureTargetEffect( + token, true, false, Duration.EndOfTurn + ), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index a9df4c8ae79..1c76826352a 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -148,6 +148,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Mascot Interception", 110, Rarity.UNCOMMON, mage.cards.m.MascotInterception.class)); cards.add(new SetCardInfo("Master Symmetrist", 138, Rarity.UNCOMMON, mage.cards.m.MasterSymmetrist.class)); cards.add(new SetCardInfo("Mentor's Guidance", 46, Rarity.UNCOMMON, mage.cards.m.MentorsGuidance.class)); + cards.add(new SetCardInfo("Mercurial Transformation", 47, Rarity.UNCOMMON, mage.cards.m.MercurialTransformation.class)); cards.add(new SetCardInfo("Moldering Karok", 206, Rarity.COMMON, mage.cards.m.MolderingKarok.class)); cards.add(new SetCardInfo("Mortality Spear", 207, Rarity.UNCOMMON, mage.cards.m.MortalitySpear.class)); cards.add(new SetCardInfo("Mountain", 372, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));