From 135d7bce27f8941bfbb3750efa9b3a0a10fbd7fe Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Jan 2020 14:34:06 -0500 Subject: [PATCH] Implemented Skola Gravedancer --- .../src/mage/cards/c/CountrysideCrusher.java | 51 +++++++++---------- .../src/mage/cards/s/SkolaGrovedancer.java | 50 ++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 3 files changed, 76 insertions(+), 26 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SkolaGrovedancer.java diff --git a/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java b/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java index 69273c9ae0..2fdb8d5e45 100644 --- a/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java +++ b/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java @@ -1,7 +1,6 @@ package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -9,19 +8,16 @@ import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.*; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.CounterType; -import mage.filter.common.FilterLandCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class CountrysideCrusher extends CardImpl { @@ -35,16 +31,19 @@ public final class CountrysideCrusher extends CardImpl { this.toughness = new MageInt(3); // At the beginning of your upkeep, reveal the top card of your library. If it's a land card, put it into your graveyard and repeat this process. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CountrysideCrusherEffect(), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new CountrysideCrusherEffect(), TargetController.YOU, false + )); + // Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher. this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - false, new FilterLandCard("a land card"), TargetController.YOU + false, StaticFilters.FILTER_CARD_LAND_A, TargetController.YOU )); } - public CountrysideCrusher(final CountrysideCrusher card) { + private CountrysideCrusher(final CountrysideCrusher card) { super(card); } @@ -56,12 +55,12 @@ public final class CountrysideCrusher extends CardImpl { class CountrysideCrusherEffect extends OneShotEffect { - public CountrysideCrusherEffect() { + CountrysideCrusherEffect() { super(Outcome.Discard); this.staticText = "reveal the top card of your library. If it's a land card, put it into your graveyard and repeat this process"; } - public CountrysideCrusherEffect(final CountrysideCrusherEffect effect) { + private CountrysideCrusherEffect(final CountrysideCrusherEffect effect) { super(effect); } @@ -74,19 +73,19 @@ class CountrysideCrusherEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (controller != null && sourcePermanent != null) { - Cards cards = new CardsImpl(); - for (Card card : controller.getLibrary().getCards(game)) { - cards.add(card); - if (card.isLand()) { - controller.moveCards(card, Zone.GRAVEYARD, source, game); - } else { - break; - } - } - controller.revealCards(sourcePermanent.getName(), cards, game); - return true; + if (controller == null || sourcePermanent == null) { + return false; } - return false; + Cards cards = new CardsImpl(); + for (Card card : controller.getLibrary().getCards(game)) { + cards.add(card); + if (card.isLand()) { + controller.moveCards(card, Zone.GRAVEYARD, source, game); + } else { + break; + } + } + controller.revealCards(sourcePermanent.getName(), cards, game); + return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SkolaGrovedancer.java b/Mage.Sets/src/mage/cards/s/SkolaGrovedancer.java new file mode 100644 index 0000000000..3677c1c02f --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkolaGrovedancer.java @@ -0,0 +1,50 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SkolaGrovedancer extends CardImpl { + + public SkolaGrovedancer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.SATYR); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever a land card is put into your graveyard from anywhere, you gain 1 life. + this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility( + new GainLifeEffect(1), false, StaticFilters.FILTER_CARD_LAND_A, TargetController.YOU + )); + + // {2}{G}: Put the top card of your library into your graveyard. + this.addAbility(new SimpleActivatedAbility( + new PutTopCardOfLibraryIntoGraveControllerEffect(1), new ManaCostsImpl("{2}{G}") + )); + } + + private SkolaGrovedancer(final SkolaGrovedancer card) { + super(card); + } + + @Override + public SkolaGrovedancer copy() { + return new SkolaGrovedancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index daf8ca681c..31cbe843f8 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -209,6 +209,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Shimmerwing Chimera", 64, Rarity.UNCOMMON, mage.cards.s.ShimmerwingChimera.class)); cards.add(new SetCardInfo("Shoal Kraken", 65, Rarity.UNCOMMON, mage.cards.s.ShoalKraken.class)); cards.add(new SetCardInfo("Siona, Captain of the Pyleas", 226, Rarity.UNCOMMON, mage.cards.s.SionaCaptainOfThePyleas.class)); + cards.add(new SetCardInfo("Skola Grovedancer", 202, Rarity.COMMON, mage.cards.s.SkolaGrovedancer.class)); cards.add(new SetCardInfo("Skophos Maze-Warden", 153, Rarity.UNCOMMON, mage.cards.s.SkophosMazeWarden.class)); cards.add(new SetCardInfo("Skophos Warleader", 154, Rarity.COMMON, mage.cards.s.SkophosWarleader.class)); cards.add(new SetCardInfo("Slaughter-Priest of Mogis", 227, Rarity.UNCOMMON, mage.cards.s.SlaughterPriestOfMogis.class));