From 1eea93ab68c4c9a8edbb7852a8fbb35e6b7a7fff Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 21 Aug 2022 20:45:26 -0400 Subject: [PATCH] [DMU] Implemented Soul of Windgrace --- .../src/mage/cards/s/SoulOfWindgrace.java | 108 ++++++++++++++++++ Mage.Sets/src/mage/sets/DominariaUnited.java | 1 + 2 files changed, 109 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SoulOfWindgrace.java diff --git a/Mage.Sets/src/mage/cards/s/SoulOfWindgrace.java b/Mage.Sets/src/mage/cards/s/SoulOfWindgrace.java new file mode 100644 index 0000000000..165f24d7c8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SoulOfWindgrace.java @@ -0,0 +1,108 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SoulOfWindgrace extends CardImpl { + + public SoulOfWindgrace(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.CAT); + this.subtype.add(SubType.AVATAR); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Whenever Soul of Windgrace enters the battlefield or attacks, you may put a land card from a graveyard onto the battlefield tapped under your control. + this.addAbility(new EntersBattlefieldOrAttacksSourceTriggeredAbility(new SoulOfWindgraceEffect())); + + // {G}, Discard a land card: You gain 3 life. + Ability ability = new SimpleActivatedAbility( + new GainLifeEffect(3), new ManaCostsImpl<>("{G}") + ); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_LAND_A))); + this.addAbility(ability); + + // {1}{R}, Discard a land card: Draw a card. + ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{1}{R}") + ); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_LAND_A))); + this.addAbility(ability); + + // {2}{B}, Discard a land card: Soul of Windgrace gains indestructible until end of turn. Tap it. + ability = new SimpleActivatedAbility(new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ), new ManaCostsImpl<>("{2}{B}")); + ability.addEffect(new TapSourceEffect().setText("tap it")); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_LAND_A))); + this.addAbility(ability); + } + + private SoulOfWindgrace(final SoulOfWindgrace card) { + super(card); + } + + @Override + public SoulOfWindgrace copy() { + return new SoulOfWindgrace(this); + } +} + +class SoulOfWindgraceEffect extends OneShotEffect { + + SoulOfWindgraceEffect() { + super(Outcome.PutLandInPlay); + staticText = "you may put a land card from a graveyard onto the battlefield tapped under your control"; + } + + private SoulOfWindgraceEffect(final SoulOfWindgraceEffect effect) { + super(effect); + } + + @Override + public SoulOfWindgraceEffect copy() { + return new SoulOfWindgraceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCardInGraveyard target = new TargetCardInGraveyard( + 0, 1, StaticFilters.FILTER_CARD_LAND_A, true + ); + player.choose(outcome, target, source, game); + Card card = game.getCard(target.getFirstTarget()); + return card != null && player.moveCards( + card, Zone.BATTLEFIELD, source, game, true, false, false, null + ); + } +} diff --git a/Mage.Sets/src/mage/sets/DominariaUnited.java b/Mage.Sets/src/mage/sets/DominariaUnited.java index 106a43dd9d..c108c73bb6 100644 --- a/Mage.Sets/src/mage/sets/DominariaUnited.java +++ b/Mage.Sets/src/mage/sets/DominariaUnited.java @@ -72,6 +72,7 @@ public final class DominariaUnited extends ExpansionSet { cards.add(new SetCardInfo("Shivan Devastator", 143, Rarity.MYTHIC, mage.cards.s.ShivanDevastator.class)); cards.add(new SetCardInfo("Shivan Reef", 255, Rarity.RARE, mage.cards.s.ShivanReef.class)); cards.add(new SetCardInfo("Snarespinner", 179, Rarity.COMMON, mage.cards.s.Snarespinner.class)); + cards.add(new SetCardInfo("Soul of Windgrace", 220, Rarity.MYTHIC, mage.cards.s.SoulOfWindgrace.class)); cards.add(new SetCardInfo("Stall for Time", 34, Rarity.COMMON, mage.cards.s.StallForTime.class)); cards.add(new SetCardInfo("Strength of the Coalition", 180, Rarity.UNCOMMON, mage.cards.s.StrengthOfTheCoalition.class)); cards.add(new SetCardInfo("Sulfurous Springs", 256, Rarity.RARE, mage.cards.s.SulfurousSprings.class));