From 661e86915ac0728abd0beff8769a3eab981294ca Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Nov 2022 11:09:07 -0400 Subject: [PATCH] [BRO] Implement Titania's Command --- .../src/mage/cards/t/TitaniasCommand.java | 95 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 96 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TitaniasCommand.java diff --git a/Mage.Sets/src/mage/cards/t/TitaniasCommand.java b/Mage.Sets/src/mage/cards/t/TitaniasCommand.java new file mode 100644 index 00000000000..f9c7f631f52 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TitaniasCommand.java @@ -0,0 +1,95 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.BearToken; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TitaniasCommand extends CardImpl { + + public TitaniasCommand(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); + + // Choose two -- + // * Exile target player's graveyard. You gain 1 life for each card exiled this way. + this.getSpellAbility().addEffect(new TitaniasCommandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // * Search your library for up to two land cards, put them onto the battlefield tapped, then shuffle. + this.getSpellAbility().addMode(new Mode(new SearchLibraryPutInPlayEffect( + new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_LANDS), true + ))); + + // * Create two 2/2 green Bear creature tokens. + this.getSpellAbility().addMode(new Mode(new CreateTokenEffect(new BearToken(), 2))); + + // * Put two +1/+1 counters on each creature you control. + this.getSpellAbility().addMode(new Mode(new AddCountersAllEffect( + CounterType.P1P1.createInstance(2), StaticFilters.FILTER_CONTROLLED_CREATURE + ))); + } + + private TitaniasCommand(final TitaniasCommand card) { + super(card); + } + + @Override + public TitaniasCommand copy() { + return new TitaniasCommand(this); + } +} + +class TitaniasCommandEffect extends OneShotEffect { + + TitaniasCommandEffect() { + super(Outcome.Benefit); + staticText = "exile target player's graveyard. You gain 1 life for each card exiled this way"; + } + + private TitaniasCommandEffect(final TitaniasCommandEffect effect) { + super(effect); + } + + @Override + public TitaniasCommandEffect copy() { + return new TitaniasCommandEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (controller == null || player == null) { + return false; + } + Cards cards = new CardsImpl(player.getGraveyard()); + if (cards.isEmpty()) { + return false; + } + controller.moveCards(cards, Zone.EXILED, source, game); + cards.retainZone(Zone.EXILED, game); + player.gainLife(cards.size(), game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index ed2a06dad1b..46a6d51e188 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -225,6 +225,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Thran Spider", 254, Rarity.RARE, mage.cards.t.ThranSpider.class)); cards.add(new SetCardInfo("Thran Vigil", 114, Rarity.UNCOMMON, mage.cards.t.ThranVigil.class)); cards.add(new SetCardInfo("Thraxodemon", 115, Rarity.COMMON, mage.cards.t.Thraxodemon.class)); + cards.add(new SetCardInfo("Titania's Command", 194, Rarity.RARE, mage.cards.t.TitaniasCommand.class)); cards.add(new SetCardInfo("Titania, Gaea Incarnate", "256b", Rarity.MYTHIC, mage.cards.t.TitaniaGaeaIncarnate.class)); cards.add(new SetCardInfo("Titania, Voice of Gaea", 193, Rarity.MYTHIC, mage.cards.t.TitaniaVoiceOfGaea.class)); cards.add(new SetCardInfo("Tocasia's Dig Site", 266, Rarity.COMMON, mage.cards.t.TocasiasDigSite.class));