From e30959bbbea8fea5d608b551670c5722bb18865b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 9 Apr 2020 22:23:24 -0400 Subject: [PATCH] Implemented Fire Prophecy --- Mage.Sets/src/mage/cards/f/FireProphecy.java | 80 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + 2 files changed, 81 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FireProphecy.java diff --git a/Mage.Sets/src/mage/cards/f/FireProphecy.java b/Mage.Sets/src/mage/cards/f/FireProphecy.java new file mode 100644 index 0000000000..61ab33e688 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FireProphecy.java @@ -0,0 +1,80 @@ +package mage.cards.f; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +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.TargetCard; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FireProphecy extends CardImpl { + + public FireProphecy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Fire Prophecy deals 3 damage to target creature. You may put a card from your hand on the bottom of your library. If you do, draw a card. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new FireProphecyEffect()); + } + + private FireProphecy(final FireProphecy card) { + super(card); + } + + @Override + public FireProphecy copy() { + return new FireProphecy(this); + } +} + +class FireProphecyEffect extends OneShotEffect { + + FireProphecyEffect() { + super(Outcome.Benefit); + staticText = "You may put a card from your hand on the bottom of your library. If you do, draw a card."; + } + + private FireProphecyEffect(final FireProphecyEffect effect) { + super(effect); + } + + @Override + public FireProphecyEffect copy() { + return new FireProphecyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null + || player.getHand().isEmpty() + || !player.chooseUse( + outcome, "Put a card from your hand " + + "on the bottom of your library?", source, game + )) { + return false; + } + TargetCard target = new TargetCardInHand(); + player.choose(outcome, player.getHand(), target, game); + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + return false; + } + player.getLibrary().putOnBottom(card, game); + player.drawCards(1, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 9bfeb68028..3a1c1d519e 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -106,6 +106,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Fertilid", 152, Rarity.COMMON, mage.cards.f.Fertilid.class)); cards.add(new SetCardInfo("Fiend Artisan", 220, Rarity.MYTHIC, mage.cards.f.FiendArtisan.class)); cards.add(new SetCardInfo("Fight as One", 12, Rarity.UNCOMMON, mage.cards.f.FightAsOne.class)); + cards.add(new SetCardInfo("Fire Prophecy", 116, Rarity.COMMON, mage.cards.f.FireProphecy.class)); cards.add(new SetCardInfo("Flame Spill", 117, Rarity.UNCOMMON, mage.cards.f.FlameSpill.class)); cards.add(new SetCardInfo("Flourishing Fox", 13, Rarity.UNCOMMON, mage.cards.f.FlourishingFox.class)); cards.add(new SetCardInfo("Footfall Crater", 118, Rarity.UNCOMMON, mage.cards.f.FootfallCrater.class));