diff --git a/Mage.Sets/src/mage/cards/f/FieryEncore.java b/Mage.Sets/src/mage/cards/f/FieryEncore.java new file mode 100644 index 00000000000..027345cbc38 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FieryEncore.java @@ -0,0 +1,80 @@ +package mage.cards.f; + +import mage.abilities.Ability; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.StormAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlaneswalker; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FieryEncore extends CardImpl { + + public FieryEncore(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}"); + + // Discard a card, then draw a card. When you discard a nonland card this way, Fiery Encore deals damage equal to that card's mana value to target creature or planeswalker. + this.getSpellAbility().addEffect(new FieryEncoreEffect()); + + // Storm + this.addAbility(new StormAbility()); + } + + private FieryEncore(final FieryEncore card) { + super(card); + } + + @Override + public FieryEncore copy() { + return new FieryEncore(this); + } +} + +class FieryEncoreEffect extends OneShotEffect { + + FieryEncoreEffect() { + super(Outcome.Benefit); + staticText = "discard a card, then draw a card. When you discard a nonland card this way, " + + "{this} deals damage equal to that card's mana value to target creature or planeswalker"; + } + + private FieryEncoreEffect(final FieryEncoreEffect effect) { + super(effect); + } + + @Override + public FieryEncoreEffect copy() { + return new FieryEncoreEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Card card = player.discardOne(false, false, source, game); + player.drawCards(1, source, game); + if (card == null || card.isLand()) { + return true; + } + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new DamageTargetEffect(card.getConvertedManaCost()), false, "when you discard a nonland " + + "card this way, {this} deals damage equal to that card's mana value to target creature or planeswalker" + ); + ability.addTarget(new TargetCreatureOrPlaneswalker()); + game.fireReflexiveTriggeredAbility(ability, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2021Edition.java b/Mage.Sets/src/mage/sets/Commander2021Edition.java index c5611233ee7..b160af00abb 100644 --- a/Mage.Sets/src/mage/sets/Commander2021Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2021Edition.java @@ -45,6 +45,7 @@ public final class Commander2021Edition extends ExpansionSet { cards.add(new SetCardInfo("Excavation Technique", 16, Rarity.RARE, mage.cards.e.ExcavationTechnique.class)); cards.add(new SetCardInfo("Faithless Looting", 168, Rarity.COMMON, mage.cards.f.FaithlessLooting.class)); cards.add(new SetCardInfo("Feldon of the Third Path", 169, Rarity.MYTHIC, mage.cards.f.FeldonOfTheThirdPath.class)); + cards.add(new SetCardInfo("Fiery Encore", 51, Rarity.RARE, mage.cards.f.FieryEncore.class)); cards.add(new SetCardInfo("Great Furnace", 292, Rarity.COMMON, mage.cards.g.GreatFurnace.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));