[C21] Implemented Fiery Encore

This commit is contained in:
Evan Kranzler 2021-04-08 08:30:19 -04:00
parent 77d22b9960
commit 748228a16c
2 changed files with 81 additions and 0 deletions

View file

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

View file

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