From 9dbfab364e96ae62a9f8bd3ea636f32d550293c9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 3 Jan 2019 13:24:32 -0500 Subject: [PATCH] Implemented Precognitive Perception --- .../mage/cards/p/PrecognitivePerception.java | 68 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PrecognitivePerception.java diff --git a/Mage.Sets/src/mage/cards/p/PrecognitivePerception.java b/Mage.Sets/src/mage/cards/p/PrecognitivePerception.java new file mode 100644 index 0000000000..eea0c0d9c4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PrecognitivePerception.java @@ -0,0 +1,68 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.condition.common.MyMainPhaseCondition; +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.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PrecognitivePerception extends CardImpl { + + public PrecognitivePerception(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); + + // Draw three cards. + // Addendum — If you cast this spell during your main phase, instead scry 3, then draw three cards. + this.getSpellAbility().addEffect(new PrecognitivePerceptionEffect()); + } + + private PrecognitivePerception(final PrecognitivePerception card) { + super(card); + } + + @Override + public PrecognitivePerception copy() { + return new PrecognitivePerception(this); + } +} + +class PrecognitivePerceptionEffect extends OneShotEffect { + + PrecognitivePerceptionEffect() { + super(Outcome.Benefit); + staticText = "Draw three cards.
Addendum — " + + "If you cast this spell during your main phase, " + + "instead scry 3, then draw three cards."; + } + + private PrecognitivePerceptionEffect(final PrecognitivePerceptionEffect effect) { + super(effect); + } + + @Override + public PrecognitivePerceptionEffect copy() { + return new PrecognitivePerceptionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + if (MyMainPhaseCondition.instance.apply(game, source)) { + controller.scry(3, source, game); + } + controller.drawCards(3, game); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index b13d378912..07f39d13ee 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -66,6 +66,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Orzhov Guildgate", 252, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Orzhov Guildgate", 253, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Orzhov Locket", 236, Rarity.COMMON, mage.cards.o.OrzhovLocket.class)); + cards.add(new SetCardInfo("Precognitive Perception", 45, Rarity.RARE, mage.cards.p.PrecognitivePerception.class)); cards.add(new SetCardInfo("Rafter Demon", 196, Rarity.COMMON, mage.cards.r.RafterDemon.class)); cards.add(new SetCardInfo("Rakdos Firewheeler", 197, Rarity.UNCOMMON, mage.cards.r.RakdosFirewheeler.class)); cards.add(new SetCardInfo("Rakdos Guildgate", 255, Rarity.COMMON, mage.cards.r.RakdosGuildgate.class, NON_FULL_USE_VARIOUS));