From b4f81efef8e14d86d77bdfaf0730921d96006e34 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Wed, 3 Nov 2021 16:10:34 -0500 Subject: [PATCH] [VOW] Implemented Manaform Hellkite --- .../src/mage/cards/m/ManaformHellkite.java | 81 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + .../permanent/token/DragonIllusionToken.java | 36 +++++++++ 3 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/ManaformHellkite.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/DragonIllusionToken.java diff --git a/Mage.Sets/src/mage/cards/m/ManaformHellkite.java b/Mage.Sets/src/mage/cards/m/ManaformHellkite.java new file mode 100644 index 00000000000..7df9d3d3e8b --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/ManaformHellkite.java @@ -0,0 +1,81 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.DragonIllusionToken; +import mage.game.stack.Spell; +import mage.watchers.common.ManaPaidSourceWatcher; + +/** + * + * @author weirddan455 + */ +public final class ManaformHellkite extends CardImpl { + + public ManaformHellkite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you cast a noncreature spell, create an X/X red Dragon Illusion creature token with flying and haste, where X is the amount of mana spent to cast that spell. + // Exile that token at the beginning of the next end step. + this.addAbility(new SpellCastControllerTriggeredAbility(new ManaformHellkitEffect(), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false, true)); + } + + private ManaformHellkite(final ManaformHellkite card) { + super(card); + } + + @Override + public ManaformHellkite copy() { + return new ManaformHellkite(this); + } +} + +class ManaformHellkitEffect extends OneShotEffect { + + public ManaformHellkitEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "create an X/X red Dragon Illusion creature token with flying and haste, where X is the amount of mana spent to cast that spell. " + + "Exile that token at the beginning of the next end step"; + } + + private ManaformHellkitEffect(final ManaformHellkitEffect effect) { + super(effect); + } + + @Override + public ManaformHellkitEffect copy() { + return new ManaformHellkitEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = (Spell) getValue("spellCast"); + if (spell != null) { + CreateTokenEffect effect = new CreateTokenEffect(new DragonIllusionToken(ManaPaidSourceWatcher.getTotalPaid(spell.getId(), game))); + if (effect.apply(game, source)) { + effect.exileTokensCreatedAtNextEndStep(game, source); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 96da14c0702..3939c0aeadf 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -94,6 +94,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Lantern Bearer", 66, Rarity.COMMON, mage.cards.l.LanternBearer.class)); cards.add(new SetCardInfo("Lanterns' Lift", 66, Rarity.COMMON, mage.cards.l.LanternsLift.class)); cards.add(new SetCardInfo("Lunar Rejection", 67, Rarity.UNCOMMON, mage.cards.l.LunarRejection.class)); + cards.add(new SetCardInfo("Manaform Hellkite", 170, Rarity.MYTHIC, mage.cards.m.ManaformHellkite.class)); cards.add(new SetCardInfo("Markov Purifier", 241, Rarity.UNCOMMON, mage.cards.m.MarkovPurifier.class)); cards.add(new SetCardInfo("Massive Might", 208, Rarity.COMMON, mage.cards.m.MassiveMight.class)); cards.add(new SetCardInfo("Mindleech Ghoul", 122, Rarity.COMMON, mage.cards.m.MindleechGhoul.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/DragonIllusionToken.java b/Mage/src/main/java/mage/game/permanent/token/DragonIllusionToken.java new file mode 100644 index 00000000000..bb40a3cc252 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/DragonIllusionToken.java @@ -0,0 +1,36 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * + * @author weirddan455 + */ +public class DragonIllusionToken extends TokenImpl { + + public DragonIllusionToken(int xValue) { + super("Dragon Illusion", "X/X red Dragon Illusion creature token with flying and haste"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add(SubType.DRAGON); + subtype.add(SubType.ILLUSION); + power = new MageInt(xValue); + toughness = new MageInt(xValue); + + addAbility(FlyingAbility.getInstance()); + addAbility(HasteAbility.getInstance()); + } + + private DragonIllusionToken(final DragonIllusionToken token) { + super(token); + } + + @Override + public DragonIllusionToken copy() { + return new DragonIllusionToken(this); + } +}