From 0b6b8d09d1f8a890d343bd1508aa12b9119b28db Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 10 Apr 2021 10:38:25 -0400 Subject: [PATCH] [C21] Implemented Healing Technique --- .../src/mage/cards/h/HealingTechnique.java | 76 +++++++++++++++++++ .../src/mage/sets/Commander2021Edition.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/HealingTechnique.java diff --git a/Mage.Sets/src/mage/cards/h/HealingTechnique.java b/Mage.Sets/src/mage/cards/h/HealingTechnique.java new file mode 100644 index 0000000000..f155729ac3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HealingTechnique.java @@ -0,0 +1,76 @@ +package mage.cards.h; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.keyword.DemonstrateAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HealingTechnique extends CardImpl { + + public HealingTechnique(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + + // Demonstrate + this.addAbility(new DemonstrateAbility()); + + // Return target card from your graveyard to your hand. You gain life equal to that card's mana value. Exile Healing Technique. + this.getSpellAbility().addEffect(new HealingTechniqueEffect()); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); + } + + private HealingTechnique(final HealingTechnique card) { + super(card); + } + + @Override + public HealingTechnique copy() { + return new HealingTechnique(this); + } +} + +class HealingTechniqueEffect extends OneShotEffect { + + HealingTechniqueEffect() { + super(Outcome.Benefit); + staticText = "return target card from your graveyard to your hand. " + + "You gain life equal to that card's mana value"; + } + + private HealingTechniqueEffect(final HealingTechniqueEffect effect) { + super(effect); + } + + @Override + public HealingTechniqueEffect copy() { + return new HealingTechniqueEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = game.getCard(source.getFirstTarget()); + if (player == null || card == null) { + return false; + } + int manaValue = card.getConvertedManaCost(); + player.moveCards(card, Zone.HAND, source, game); + player.gainLife(manaValue, game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2021Edition.java b/Mage.Sets/src/mage/sets/Commander2021Edition.java index b32dd14216..e38dbb5e50 100644 --- a/Mage.Sets/src/mage/sets/Commander2021Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2021Edition.java @@ -98,6 +98,7 @@ public final class Commander2021Edition extends ExpansionSet { cards.add(new SetCardInfo("Gideon, Champion of Justice", 93, Rarity.MYTHIC, mage.cards.g.GideonChampionOfJustice.class)); cards.add(new SetCardInfo("Great Furnace", 292, Rarity.COMMON, mage.cards.g.GreatFurnace.class)); cards.add(new SetCardInfo("Guardian Augmenter", 62, Rarity.RARE, mage.cards.g.GuardianAugmenter.class)); + cards.add(new SetCardInfo("Healing Technique", 63, Rarity.RARE, mage.cards.h.HealingTechnique.class)); cards.add(new SetCardInfo("Hedron Archive", 244, Rarity.UNCOMMON, mage.cards.h.HedronArchive.class)); cards.add(new SetCardInfo("Hellkite Igniter", 171, Rarity.RARE, mage.cards.h.HellkiteIgniter.class)); cards.add(new SetCardInfo("Hellkite Tyrant", 172, Rarity.MYTHIC, mage.cards.h.HellkiteTyrant.class));