From b2bc60efcbd2012b97fdc667b927f5928434c890 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 5 Aug 2019 16:53:21 -0400 Subject: [PATCH] Implemented Grismold, the Dreadsower --- .../mage/cards/g/GrismoldTheDreadsower.java | 94 +++++++++++++++++++ .../src/mage/sets/Commander2019Edition.java | 1 + .../permanent/token/GrismoldPlantToken.java | 38 ++++++++ 3 files changed, 133 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GrismoldTheDreadsower.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/GrismoldPlantToken.java diff --git a/Mage.Sets/src/mage/cards/g/GrismoldTheDreadsower.java b/Mage.Sets/src/mage/cards/g/GrismoldTheDreadsower.java new file mode 100644 index 00000000000..e5d86bdfa57 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GrismoldTheDreadsower.java @@ -0,0 +1,94 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.permanent.token.GrismoldPlantToken; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GrismoldTheDreadsower extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("a creature token"); + + static { + filter.add(TokenPredicate.instance); + } + + public GrismoldTheDreadsower(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.TROLL); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // At the beginning of your end step, each player creates a 1/1 green Plant creature token. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new GrismoldTheDreadsowerEffect(), TargetController.YOU, false + )); + + // Whenever a creature token dies, put a +1/+1 counter on Grismold, the Dreadsower. + this.addAbility(new DiesCreatureTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter + )); + } + + private GrismoldTheDreadsower(final GrismoldTheDreadsower card) { + super(card); + } + + @Override + public GrismoldTheDreadsower copy() { + return new GrismoldTheDreadsower(this); + } +} + +class GrismoldTheDreadsowerEffect extends OneShotEffect { + + GrismoldTheDreadsowerEffect() { + super(Outcome.Benefit); + staticText = "each player creates a 1/1 green Plant creature token"; + } + + private GrismoldTheDreadsowerEffect(final GrismoldTheDreadsowerEffect effect) { + super(effect); + } + + @Override + public GrismoldTheDreadsowerEffect copy() { + return new GrismoldTheDreadsowerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.getState().getPlayersInRange(source.getControllerId(), game).stream().forEach(playerId -> { + Effect effect = new CreateTokenTargetEffect(new GrismoldPlantToken(), 1); + effect.setTargetPointer(new FixedTarget(playerId, game)); + effect.apply(game, source); + }); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2019Edition.java b/Mage.Sets/src/mage/sets/Commander2019Edition.java index f5819aed8ab..01e871d3602 100644 --- a/Mage.Sets/src/mage/sets/Commander2019Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2019Edition.java @@ -29,6 +29,7 @@ public final class Commander2019Edition extends ExpansionSet { cards.add(new SetCardInfo("Gerrard, Weatherlight Hero", 41, Rarity.RARE, mage.cards.g.GerrardWeatherlightHero.class)); cards.add(new SetCardInfo("Ghired's Belligerence", 25, Rarity.RARE, mage.cards.g.GhiredsBelligerence.class)); cards.add(new SetCardInfo("Ghired, Conclave Exile", 42, Rarity.MYTHIC, mage.cards.g.GhiredConclaveExile.class)); + cards.add(new SetCardInfo("Grismold, the Dreadsower", 44, Rarity.RARE, mage.cards.g.GrismoldTheDreadsower.class)); cards.add(new SetCardInfo("Ixidron", 87, Rarity.RARE, mage.cards.i.Ixidron.class)); cards.add(new SetCardInfo("Kadena's Silencer", 8, Rarity.RARE, mage.cards.k.KadenasSilencer.class)); cards.add(new SetCardInfo("Kadena, Slinking Sorcerer", 45, Rarity.MYTHIC, mage.cards.k.KadenaSlinkingSorcerer.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/GrismoldPlantToken.java b/Mage/src/main/java/mage/game/permanent/token/GrismoldPlantToken.java new file mode 100644 index 00000000000..51ffa57bbd9 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/GrismoldPlantToken.java @@ -0,0 +1,38 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public final class GrismoldPlantToken extends TokenImpl { + + static final private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("C19")); + } + + public GrismoldPlantToken() { + super("Plant", "1/1 green Plant creature"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add(SubType.PLANT); + power = new MageInt(1); + toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; + } + + public GrismoldPlantToken(final GrismoldPlantToken token) { + super(token); + } + + public GrismoldPlantToken copy() { + return new GrismoldPlantToken(this); + } +} + \ No newline at end of file