[TDM] Implement Rediscover the Way

This commit is contained in:
theelk801 2025-03-31 14:12:04 -04:00
parent 588b0f390f
commit 4d1f154b13
2 changed files with 87 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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));