diff --git a/Mage.Sets/src/mage/cards/h/HuntedNightmare.java b/Mage.Sets/src/mage/cards/h/HuntedNightmare.java new file mode 100644 index 0000000000..22c2ffb871 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HuntedNightmare.java @@ -0,0 +1,85 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HuntedNightmare extends CardImpl { + + public HuntedNightmare(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + + this.subtype.add(SubType.NIGHTMARE); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Menace + this.addAbility(new MenaceAbility()); + + // When Hunted Nightmare enters the battlefield, target opponent puts a deathtouch counter on a creature they control. + Ability ability = new EntersBattlefieldTriggeredAbility(new HuntedNightmareEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + private HuntedNightmare(final HuntedNightmare card) { + super(card); + } + + @Override + public HuntedNightmare copy() { + return new HuntedNightmare(this); + } +} + +class HuntedNightmareEffect extends OneShotEffect { + + HuntedNightmareEffect() { + super(Outcome.Benefit); + staticText = "target opponent puts a deathtouch counter on a creature they control"; + } + + private HuntedNightmareEffect(final HuntedNightmareEffect effect) { + super(effect); + } + + @Override + public HuntedNightmareEffect copy() { + return new HuntedNightmareEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player == null || game.getBattlefield().countAll( + StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game + ) == 0) { + return false; + } + Target target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); + player.choose(outcome, target, source.getSourceId(), game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + return permanent != null && permanent.addCounters(CounterType.DEATHTOUCH.createInstance(), source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 718f562c2b..edcf4f62c0 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -166,6 +166,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Helica Glider", 15, Rarity.COMMON, mage.cards.h.HelicaGlider.class)); cards.add(new SetCardInfo("Honey Mammoth", 158, Rarity.COMMON, mage.cards.h.HoneyMammoth.class)); cards.add(new SetCardInfo("Hornbash Mentor", 159, Rarity.UNCOMMON, mage.cards.h.HornbashMentor.class)); + cards.add(new SetCardInfo("Hunted Nightmare", 92, Rarity.RARE, mage.cards.h.HuntedNightmare.class)); cards.add(new SetCardInfo("Huntmaster Liger", 16, Rarity.UNCOMMON, mage.cards.h.HuntmasterLiger.class)); cards.add(new SetCardInfo("Imposing Vantasaur", 17, Rarity.COMMON, mage.cards.i.ImposingVantasaur.class)); cards.add(new SetCardInfo("Indatha Crystal", 235, Rarity.UNCOMMON, mage.cards.i.IndathaCrystal.class));