diff --git a/Mage.Sets/src/mage/cards/p/PlayWithFire.java b/Mage.Sets/src/mage/cards/p/PlayWithFire.java new file mode 100644 index 0000000000..481c849c06 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PlayWithFire.java @@ -0,0 +1,71 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetAnyTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PlayWithFire extends CardImpl { + + public PlayWithFire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}"); + + // Play with Fire deals 2 damage to any target. If a player is dealt damage this way, scry 1. + this.getSpellAbility().addEffect(new PlayWithFireEffect()); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + } + + private PlayWithFire(final PlayWithFire card) { + super(card); + } + + @Override + public PlayWithFire copy() { + return new PlayWithFire(this); + } +} + +class PlayWithFireEffect extends OneShotEffect { + + PlayWithFireEffect() { + super(Outcome.Benefit); + staticText = "{this} deals 2 damage to any target. If a player is dealt damage this way, scry 1"; + } + + private PlayWithFireEffect(final PlayWithFireEffect effect) { + super(effect); + } + + @Override + public PlayWithFireEffect copy() { + return new PlayWithFireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + return permanent.damage(2, source.getSourceId(), source, game) > 0; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (player == null || player.damage(2, source.getSourceId(), source, game) < 1) { + return false; + } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.scry(1, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 91657bc341..86abdcfcd8 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -34,6 +34,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Join the Dance", 229, Rarity.UNCOMMON, mage.cards.j.JoinTheDance.class)); cards.add(new SetCardInfo("Mountain", 274, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Play with Fire", 154, Rarity.UNCOMMON, mage.cards.p.PlayWithFire.class)); cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); } }