From c025349791684f9254a9731fa25754c54942643f Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 14 Apr 2023 21:09:22 -0400 Subject: [PATCH] [MOM] Implement Vorinclex --- .../src/mage/cards/t/TheGrandEvolution.java | 111 ++++++++++++++++++ Mage.Sets/src/mage/cards/v/Vorinclex.java | 71 +++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 2 + .../counter/DistributeCountersEffect.java | 8 +- 4 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/TheGrandEvolution.java create mode 100644 Mage.Sets/src/mage/cards/v/Vorinclex.java diff --git a/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java b/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java new file mode 100644 index 00000000000..817d0f32c50 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheGrandEvolution.java @@ -0,0 +1,111 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.common.SagaAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSourceAndReturnFaceUpEffect; +import mage.abilities.effects.common.FightTargetSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.counter.DistributeCountersEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPermanent; +import mage.target.common.TargetPermanentAmount; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheGrandEvolution extends CardImpl { + + public TheGrandEvolution(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, ""); + + this.subtype.add(SubType.SAGA); + this.color.setGreen(true); + this.nightCard = true; + + // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) + SagaAbility sagaAbility = new SagaAbility(this, false); + + // I -- Mill ten cards. Put up to two creature cards from among the milled cards onto the battlefield. + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, new TheGrandEvolutionEffect()); + + // II -- Distribute seven +1/+1 counters among any number of target creatures you control. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II, + new DistributeCountersEffect( + CounterType.P1P1, 7, + "any number of target creatures you control" + ), new TargetPermanentAmount(7, StaticFilters.FILTER_CONTROLLED_CREATURES) + ); + + // III -- Until end of turn, creatures you control gain "{1}: This creature fights target creature you don't control." Exile The Grand Evolution, then return it to the battlefield. + Ability ability = new SimpleActivatedAbility( + new FightTargetSourceEffect() + .setText("this creature fights target creature you don't control"), + new GenericManaCost(1) + ); + ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, + new GainAbilityControlledEffect( + ability, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE + ).setText("Until end of turn, creatures you control gain " + + "\"{1}: This creature fights target creature you don't control.\""), + new ExileSourceAndReturnFaceUpEffect() + ); + this.addAbility(sagaAbility); + } + + private TheGrandEvolution(final TheGrandEvolution card) { + super(card); + } + + @Override + public TheGrandEvolution copy() { + return new TheGrandEvolution(this); + } +} + +class TheGrandEvolutionEffect extends OneShotEffect { + + TheGrandEvolutionEffect() { + super(Outcome.Benefit); + staticText = "mill ten cards. Put up to two creature cards from among the milled cards onto the battlefield"; + } + + private TheGrandEvolutionEffect(final TheGrandEvolutionEffect effect) { + super(effect); + } + + @Override + public TheGrandEvolutionEffect copy() { + return new TheGrandEvolutionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = player.millCards(10, source, game); + TargetCard target = new TargetCard(0, 2, Zone.ALL, StaticFilters.FILTER_CARD_CREATURE); + target.setNotTarget(true); + player.choose(Outcome.PutCreatureInPlay, cards, target, game); + player.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/v/Vorinclex.java b/Mage.Sets/src/mage/cards/v/Vorinclex.java new file mode 100644 index 00000000000..07243fdd4b8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/Vorinclex.java @@ -0,0 +1,71 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileAndReturnSourceEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.PutCards; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Vorinclex extends CardImpl { + + private static final FilterCard filter = new FilterCard("Forest cards"); + + static { + filter.add(SubType.FOREST.getPredicate()); + } + + public Vorinclex(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.PRAETOR); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + this.secondSideCardClazz = mage.cards.t.TheGrandEvolution.class; + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // When Vorinclex enters the battlefield, search your library for up to two Forest cards, reveal them, put them into your hand, then shuffle. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect( + new TargetCardInLibrary(0, 2, filter), true, true + ))); + + // {6}{G}{G}: Exile Vorinclex, then return it to the battlefield transformed under its owner's control. Activate only as a sorcery. + this.addAbility(new TransformAbility()); + this.addAbility(new ActivateAsSorceryActivatedAbility( + new ExileAndReturnSourceEffect(PutCards.BATTLEFIELD_TRANSFORMED), + new ManaCostsImpl<>("{6}{G}{G}") + )); + } + + private Vorinclex(final Vorinclex card) { + super(card); + } + + @Override + public Vorinclex copy() { + return new Vorinclex(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 49409d60710..a5bc4755216 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -296,6 +296,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Tenured Oilcaster", 126, Rarity.COMMON, mage.cards.t.TenuredOilcaster.class)); cards.add(new SetCardInfo("The Argent Etchings", 12, Rarity.MYTHIC, mage.cards.t.TheArgentEtchings.class)); cards.add(new SetCardInfo("The Broken Sky", 241, Rarity.RARE, mage.cards.t.TheBrokenSky.class)); + cards.add(new SetCardInfo("The Grand Evolution", 213, Rarity.MYTHIC, mage.cards.t.TheGrandEvolution.class)); cards.add(new SetCardInfo("The Great Synthesis", 65, Rarity.MYTHIC, mage.cards.t.TheGreatSynthesis.class)); cards.add(new SetCardInfo("The True Scriptures", 125, Rarity.MYTHIC, mage.cards.t.TheTrueScriptures.class)); cards.add(new SetCardInfo("Thornwood Falls", 274, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class)); @@ -317,6 +318,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Vertex Paladin", 242, Rarity.UNCOMMON, mage.cards.v.VertexPaladin.class)); cards.add(new SetCardInfo("Volcanic Spite", 170, Rarity.COMMON, mage.cards.v.VolcanicSpite.class)); cards.add(new SetCardInfo("Voldaren Thrillseeker", 171, Rarity.RARE, mage.cards.v.VoldarenThrillseeker.class)); + cards.add(new SetCardInfo("Vorinclex", 213, Rarity.MYTHIC, mage.cards.v.Vorinclex.class)); cards.add(new SetCardInfo("War Historian", 214, Rarity.COMMON, mage.cards.w.WarHistorian.class)); cards.add(new SetCardInfo("War-Trained Slasher", 172, Rarity.COMMON, mage.cards.w.WarTrainedSlasher.class)); cards.add(new SetCardInfo("Wary Thespian", 215, Rarity.COMMON, mage.cards.w.WaryThespian.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java index 0825bc9b7fd..1f46112a2f1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java @@ -1,7 +1,6 @@ package mage.abilities.effects.common.counter; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.Mode; @@ -14,8 +13,9 @@ import mage.game.permanent.Permanent; import mage.target.Target; import mage.util.CardUtil; +import java.util.UUID; + /** - * * @author LoneFox */ public class DistributeCountersEffect extends OneShotEffect { @@ -25,6 +25,10 @@ public class DistributeCountersEffect extends OneShotEffect { private final boolean removeAtEndOfTurn; private final String targetDescription; + public DistributeCountersEffect(CounterType counterType, int amount, String targetDescription) { + this(counterType, amount, false, targetDescription); + } + public DistributeCountersEffect(CounterType counterType, int amount, boolean removeAtEndOfTurn, String targetDescription) { super(Outcome.BoostCreature); this.counterType = counterType;