From a4a995f615803c1b9aa2b8a0cb885bee1dead868 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 2 Jun 2023 09:02:51 -0400 Subject: [PATCH] [LTR] Implement There and Back Again --- .../src/mage/cards/t/ThereAndBackAgain.java | 71 +++++++++++++++++++ .../mage/cards/w/WarOfTheLastAlliance.java | 2 + .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + .../token/KaroxBladewingDragonToken.java | 2 +- .../mage/game/permanent/token/SmaugToken.java | 41 +++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/t/ThereAndBackAgain.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/SmaugToken.java diff --git a/Mage.Sets/src/mage/cards/t/ThereAndBackAgain.java b/Mage.Sets/src/mage/cards/t/ThereAndBackAgain.java new file mode 100644 index 0000000000..1fbd7ea5d8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThereAndBackAgain.java @@ -0,0 +1,71 @@ +package mage.cards.t; + +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.Effects; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.effects.keyword.TheRingTemptsYouEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.filter.FilterCard; +import mage.game.permanent.token.SmaugToken; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ThereAndBackAgain extends CardImpl { + + private static final FilterCard filter = new FilterCard("Mountain card"); + + static { + filter.add(SubType.MOUNTAIN.getPredicate()); + } + + public ThereAndBackAgain(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); + + 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 -- Up to one target creature can't block for as long as you control There and Back Again. The Ring tempts you. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_I, + new Effects( + new CantBlockTargetEffect(Duration.WhileControlled), new TheRingTemptsYouEffect() + ), new TargetCreaturePermanent(0, 1) + ); + + // II -- Search your library for a Mountain card, put it onto the battlefield, then shuffle. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_II, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)) + ); + + // III -- Create Smaug, a legendary 6/6 red Dragon creature token with flying, haste, and "When this creature dies, create fourteen Treasure tokens." + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, new CreateTokenEffect(new SmaugToken()) + ); + + this.addAbility(sagaAbility); + } + + private ThereAndBackAgain(final ThereAndBackAgain card) { + super(card); + } + + @Override + public ThereAndBackAgain copy() { + return new ThereAndBackAgain(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WarOfTheLastAlliance.java b/Mage.Sets/src/mage/cards/w/WarOfTheLastAlliance.java index 8622151951..a688ae7154 100644 --- a/Mage.Sets/src/mage/cards/w/WarOfTheLastAlliance.java +++ b/Mage.Sets/src/mage/cards/w/WarOfTheLastAlliance.java @@ -48,6 +48,8 @@ public final class WarOfTheLastAlliance extends CardImpl { StaticFilters.FILTER_PERMANENT_CREATURES ), new TheRingTemptsYouEffect() ); + + this.addAbility(sagaAbility); } private WarOfTheLastAlliance(final WarOfTheLastAlliance card) { diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 7b344f53dd..cca3321b46 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -87,6 +87,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("The Bath Song", 40, Rarity.UNCOMMON, mage.cards.t.TheBathSong.class)); cards.add(new SetCardInfo("The One Ring", 246, Rarity.MYTHIC, mage.cards.t.TheOneRing.class)); cards.add(new SetCardInfo("The Shire", 260, Rarity.RARE, mage.cards.t.TheShire.class)); + cards.add(new SetCardInfo("There and Back Again", 151, Rarity.RARE, mage.cards.t.ThereAndBackAgain.class)); cards.add(new SetCardInfo("Tom Bombadil", 234, Rarity.MYTHIC, mage.cards.t.TomBombadil.class)); cards.add(new SetCardInfo("Trailblazer's Boots", 398, Rarity.RARE, mage.cards.t.TrailblazersBoots.class)); cards.add(new SetCardInfo("War of the Last Alliance", 36, Rarity.RARE, mage.cards.w.WarOfTheLastAlliance.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java b/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java index 2ccc9ca07b..1c34c67842 100644 --- a/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java @@ -13,7 +13,7 @@ import mage.constants.SuperType; public final class KaroxBladewingDragonToken extends TokenImpl { public KaroxBladewingDragonToken() { - super("Karox Bladewing Token", "legendary 4/4 red Dragon creature token with flying"); + super("Karox Bladewing", "Karox Bladewing, a legendary 4/4 red Dragon creature token with flying"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.supertype.add(SuperType.LEGENDARY); diff --git a/Mage/src/main/java/mage/game/permanent/token/SmaugToken.java b/Mage/src/main/java/mage/game/permanent/token/SmaugToken.java new file mode 100644 index 0000000000..17463fa322 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/SmaugToken.java @@ -0,0 +1,41 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.common.DiesSourceTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; + +/** + * @author TheElk801 + */ +public final class SmaugToken extends TokenImpl { + + public SmaugToken() { + super("Smaug", "Smaug, a legendary 6/6 red Dragon creature token with flying, haste, and \"When this creature dies, create fourteen Treasure tokens.\""); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + this.supertype.add(SuperType.LEGENDARY); + this.cardType.add(CardType.CREATURE); + this.subtype.add(SubType.DRAGON); + this.color.setRed(true); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new DiesSourceTriggeredAbility( + new CreateTokenEffect(new FoodToken(), 14) + ).setTriggerPhrase("When this creature dies, ")); + } + + public SmaugToken(final SmaugToken token) { + super(token); + } + + @Override + public SmaugToken copy() { + return new SmaugToken(this); + } +}