From 38b6f476e35e252388bdc4af3416befe82eee517 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 2 Jan 2019 12:04:45 -0500 Subject: [PATCH] Implemented Sphinx of Foresight --- .../src/mage/cards/s/SphinxOfForesight.java | 85 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SphinxOfForesight.java diff --git a/Mage.Sets/src/mage/cards/s/SphinxOfForesight.java b/Mage.Sets/src/mage/cards/s/SphinxOfForesight.java new file mode 100644 index 00000000000..a3aac1877c6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SphinxOfForesight.java @@ -0,0 +1,85 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.ChancellorAbility; +import mage.abilities.effects.keyword.ScryEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SphinxOfForesight extends CardImpl { + + public SphinxOfForesight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + + this.subtype.add(SubType.SPHINX); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // You may reveal this card from your opening hand. If you do, scry 3 at the beginning of your first upkeep. + Ability ability = new ChancellorAbility( + new SphinxOfForesightDelayedTriggeredAbility(), + "scry 3 at the beginning of your first upkeep." + ); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, scry 1. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + Zone.BATTLEFIELD, new ScryEffect(1), + TargetController.YOU, false + )); + } + + private SphinxOfForesight(final SphinxOfForesight card) { + super(card); + } + + @Override + public SphinxOfForesight copy() { + return new SphinxOfForesight(this); + } +} + +class SphinxOfForesightDelayedTriggeredAbility extends DelayedTriggeredAbility { + + SphinxOfForesightDelayedTriggeredAbility() { + super(new ScryEffect(3)); + } + + private SphinxOfForesightDelayedTriggeredAbility(SphinxOfForesightDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return game.getActivePlayerId().equals(this.controllerId); + } + + @Override + public SphinxOfForesightDelayedTriggeredAbility copy() { + return new SphinxOfForesightDelayedTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index 90709c9ac5d..3de72bb88b3 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("Simic Guildgate", 257, Rarity.COMMON, mage.cards.s.SimicGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Simic Guildgate", 258, Rarity.COMMON, mage.cards.s.SimicGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Simic Locket", 240, Rarity.COMMON, mage.cards.s.SimicLocket.class)); + cards.add(new SetCardInfo("Sphinx of Foresight", 55, Rarity.RARE, mage.cards.s.SphinxOfForesight.class)); cards.add(new SetCardInfo("Sphinx's Insight", 209, Rarity.COMMON, mage.cards.s.SphinxsInsight.class)); cards.add(new SetCardInfo("Stomping Ground", 259, Rarity.RARE, mage.cards.s.StompingGround.class)); cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class));