From cdfe3d1d2d1a76135e23f8d71c18dc02ea54e1b1 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 30 Oct 2021 10:11:46 -0500 Subject: [PATCH] [VOW] Implemented Dormant Grove --- Mage.Sets/src/mage/cards/d/DormantGrove.java | 76 +++++++++++++++++++ .../src/mage/cards/g/GnarledGrovestrider.java | 50 ++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 2 + 3 files changed, 128 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DormantGrove.java create mode 100644 Mage.Sets/src/mage/cards/g/GnarledGrovestrider.java diff --git a/Mage.Sets/src/mage/cards/d/DormantGrove.java b/Mage.Sets/src/mage/cards/d/DormantGrove.java new file mode 100644 index 0000000000..1bb4d62b25 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DormantGrove.java @@ -0,0 +1,76 @@ +package mage.cards.d; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class DormantGrove extends CardImpl { + + public DormantGrove(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); + + this.transformable = true; + this.secondSideCardClazz = mage.cards.g.GnarledGrovestrider.class; + + // At the beginning of combat on your turn, put a +1/+1 counter on target creature you control. + // Then if that creature has toughness 6 or greater, transform Dormant Grove. + this.addAbility(new TransformAbility()); + + Ability ability = new BeginningOfCombatTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + TargetController.YOU, false + ); + ability.addEffect(new ConditionalOneShotEffect( + new TransformSourceEffect(true, true), + DormatGroveCondition.instance, + "Then if that creature has toughness 6 or greater, transform {this}" + )); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + private DormantGrove(final DormantGrove card) { + super(card); + } + + @Override + public DormantGrove copy() { + return new DormantGrove(this); + } +} + +enum DormatGroveCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + return permanent.getToughness().getValue() >= 6; + } + return false; + } + + @Override + public String toString() { + return "that creature has toughness 6 or greater"; + } +} diff --git a/Mage.Sets/src/mage/cards/g/GnarledGrovestrider.java b/Mage.Sets/src/mage/cards/g/GnarledGrovestrider.java new file mode 100644 index 0000000000..ad4fced764 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GnarledGrovestrider.java @@ -0,0 +1,50 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * + * @author weirddan455 + */ +public class GnarledGrovestrider extends CardImpl { + + public GnarledGrovestrider(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + this.subtype.add(SubType.TREEFOLK); + this.color.setGreen(true); + + // Back half of Dormant Grove + this.nightCard = true; + + this.power = new MageInt(3); + this.toughness = new MageInt(6); + + this.addAbility(VigilanceAbility.getInstance()); + + // Other creatures you control have vigilance. + this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( + VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, + StaticFilters.FILTER_PERMANENT_CREATURES, true + ))); + } + + private GnarledGrovestrider(final GnarledGrovestrider card) { + super(card); + } + + @Override + public GnarledGrovestrider copy() { + return new GnarledGrovestrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 202c0f83ed..e5f6622cf0 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -42,11 +42,13 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Dig Up", 197, Rarity.RARE, mage.cards.d.DigUp.class)); cards.add(new SetCardInfo("Dire-Strain Anarchist", 181, Rarity.MYTHIC, mage.cards.d.DireStrainAnarchist.class)); cards.add(new SetCardInfo("Dominating Vampire", 154, Rarity.RARE, mage.cards.d.DominatingVampire.class)); + cards.add(new SetCardInfo("Dormant Grove", 198, Rarity.UNCOMMON, mage.cards.d.DormantGrove.class)); cards.add(new SetCardInfo("Dreamroot Cascade", 262, Rarity.RARE, mage.cards.d.DreamrootCascade.class)); cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Geistlight Snare", 60, Rarity.UNCOMMON, mage.cards.g.GeistlightSnare.class)); cards.add(new SetCardInfo("Gluttonous Guest", 114, Rarity.COMMON, mage.cards.g.GluttonousGuest.class)); + cards.add(new SetCardInfo("Gnarled Grovestrider", 198, Rarity.UNCOMMON, mage.cards.g.GnarledGrovestrider.class)); cards.add(new SetCardInfo("Grolnok, the Omnivore", 238, Rarity.RARE, mage.cards.g.GrolnokTheOmnivore.class)); cards.add(new SetCardInfo("Gryff Rider", 15, Rarity.COMMON, mage.cards.g.GryffRider.class)); cards.add(new SetCardInfo("Halana and Alena, Partners", 239, Rarity.RARE, mage.cards.h.HalanaAndAlenaPartners.class));