diff --git a/Mage.Sets/src/mage/cards/g/GlacialDragonhunt.java b/Mage.Sets/src/mage/cards/g/GlacialDragonhunt.java new file mode 100644 index 00000000000..44400ac5cc3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GlacialDragonhunt.java @@ -0,0 +1,77 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.HarmonizeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GlacialDragonhunt extends CardImpl { + + public GlacialDragonhunt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{R}"); + + // Draw a card, then you may discard a card. When you discard a nonland card this way, Glacial Dragonhunt deals 3 damage to target creature. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect(new GlacialDragonhuntEffect()); + + // Harmonize {4}{U}{R} + this.addAbility(new HarmonizeAbility(this, "{4}{U}{R}")); + } + + private GlacialDragonhunt(final GlacialDragonhunt card) { + super(card); + } + + @Override + public GlacialDragonhunt copy() { + return new GlacialDragonhunt(this); + } +} + +class GlacialDragonhuntEffect extends OneShotEffect { + + GlacialDragonhuntEffect() { + super(Outcome.Benefit); + staticText = ", then you may discard a card. When you discard a nonland card this way, " + + "{this} deals 3 damage to target creature"; + } + + private GlacialDragonhuntEffect(final GlacialDragonhuntEffect effect) { + super(effect); + } + + @Override + public GlacialDragonhuntEffect copy() { + return new GlacialDragonhuntEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null || player.getHand().isEmpty() + || player + .discard(0, 1, true, source, game) + .count(StaticFilters.FILTER_CARD_NON_LAND, game) < 1) { + return false; + } + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(3), false); + ability.addTarget(new TargetCreaturePermanent()); + game.fireReflexiveTriggeredAbility(ability, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java index 7985e1fbb03..7b52940ccea 100644 --- a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java +++ b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java @@ -69,6 +69,7 @@ public final class TarkirDragonstorm extends ExpansionSet { cards.add(new SetCardInfo("Fortress Kin-Guard", 12, Rarity.COMMON, mage.cards.f.FortressKinGuard.class)); cards.add(new SetCardInfo("Fresh Start", 46, Rarity.UNCOMMON, mage.cards.f.FreshStart.class)); cards.add(new SetCardInfo("Frontier Bivouac", 256, Rarity.UNCOMMON, mage.cards.f.FrontierBivouac.class)); + cards.add(new SetCardInfo("Glacial Dragonhunt", 188, Rarity.UNCOMMON, mage.cards.g.GlacialDragonhunt.class)); cards.add(new SetCardInfo("Heritage Reclamation", 145, Rarity.COMMON, mage.cards.h.HeritageReclamation.class)); cards.add(new SetCardInfo("Inevitable Defeat", 194, Rarity.RARE, mage.cards.i.InevitableDefeat.class)); cards.add(new SetCardInfo("Island", 279, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));