diff --git a/Mage.Sets/src/mage/cards/r/RediscoverTheWay.java b/Mage.Sets/src/mage/cards/r/RediscoverTheWay.java new file mode 100644 index 00000000000..efab4b20360 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RediscoverTheWay.java @@ -0,0 +1,86 @@ +package mage.cards.r; + +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RediscoverTheWay extends CardImpl { + + public RediscoverTheWay(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}{W}"); + + this.subtype.add(SubType.SAGA); + + // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I, II -- Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II, + new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY) + ); + + // III -- Whenever you cast a noncreature spell this turn, target creature you control gains double strike until end of turn. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, + new CreateDelayedTriggeredAbilityEffect(new RediscoverTheWayTriggeredAbility()) + ); + this.addAbility(sagaAbility); + } + + private RediscoverTheWay(final RediscoverTheWay card) { + super(card); + } + + @Override + public RediscoverTheWay copy() { + return new RediscoverTheWay(this); + } +} + +class RediscoverTheWayTriggeredAbility extends DelayedTriggeredAbility { + + RediscoverTheWayTriggeredAbility() { + super(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance()), Duration.EndOfTurn, false, false); + this.addTarget(new TargetControlledCreaturePermanent()); + this.setTriggerPhrase("Whenever you cast a noncreature spell this turn, "); + } + + private RediscoverTheWayTriggeredAbility(final RediscoverTheWayTriggeredAbility ability) { + super(ability); + } + + @Override + public RediscoverTheWayTriggeredAbility copy() { + return new RediscoverTheWayTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (!isControlledBy(event.getPlayerId())) { + return false; + } + Spell spell = game.getSpell(event.getTargetId()); + return spell != null && !spell.isCreature(game); + } +} diff --git a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java index 0f212b98028..3c5f8ded306 100644 --- a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java +++ b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java @@ -149,6 +149,7 @@ public final class TarkirDragonstorm extends ExpansionSet { cards.add(new SetCardInfo("Rakshasa's Bargain", 214, Rarity.UNCOMMON, mage.cards.r.RakshasasBargain.class)); cards.add(new SetCardInfo("Rally the Monastery", 19, Rarity.UNCOMMON, mage.cards.r.RallyTheMonastery.class)); cards.add(new SetCardInfo("Rebellious Strike", 20, Rarity.COMMON, mage.cards.r.RebelliousStrike.class)); + cards.add(new SetCardInfo("Rediscover the Way", 215, Rarity.RARE, mage.cards.r.RediscoverTheWay.class)); cards.add(new SetCardInfo("Reigning Victor", 216, Rarity.COMMON, mage.cards.r.ReigningVictor.class)); cards.add(new SetCardInfo("Reputable Merchant", 217, Rarity.COMMON, mage.cards.r.ReputableMerchant.class)); cards.add(new SetCardInfo("Rescue Leopard", 116, Rarity.COMMON, mage.cards.r.RescueLeopard.class));