[C21] Implemented Healing Technique

This commit is contained in:
Evan Kranzler 2021-04-10 10:38:25 -04:00
parent d76853ed8b
commit 0b6b8d09d1
2 changed files with 77 additions and 0 deletions

View file

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

View file

@ -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("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("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("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("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 Igniter", 171, Rarity.RARE, mage.cards.h.HellkiteIgniter.class));
cards.add(new SetCardInfo("Hellkite Tyrant", 172, Rarity.MYTHIC, mage.cards.h.HellkiteTyrant.class)); cards.add(new SetCardInfo("Hellkite Tyrant", 172, Rarity.MYTHIC, mage.cards.h.HellkiteTyrant.class));