From ed1746a049c76e88f527ee3200da578c2d740e49 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 3 May 2023 08:16:57 -0400 Subject: [PATCH] [MAT] Implement Undercity Upheaval --- .../src/mage/cards/u/UndercityUpheaval.java | 52 +++++++++++++++++++ .../sets/MarchOfTheMachineTheAftermath.java | 1 + 2 files changed, 53 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/u/UndercityUpheaval.java diff --git a/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java b/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java new file mode 100644 index 0000000000..e0e5046277 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UndercityUpheaval.java @@ -0,0 +1,52 @@ +package mage.cards.u; + +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.counter.DistributeCountersEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.target.common.TargetCreaturePermanentAmount; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class UndercityUpheaval extends CardImpl { + + private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); + private static final Hint hint = new ValueHint("Creatures in your graveyard", xValue); + + public UndercityUpheaval(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + + // Undergrowth -- Distribute X +1/+1 counters among any number of target creatures you control, where X is the number of creature cards in your graveyard as you cast this spell. Creatures you control gain vigilance until end of turn. + this.getSpellAbility().addEffect(new DistributeCountersEffect(CounterType.P1P1, 1, "") + .setText("distribute X +1/+1 counters among any number of target creatures you control, " + + "where X is the number of creature cards in your graveyard as you cast this spell")); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + VigilanceAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES + )); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue)); + this.getSpellAbility().setAbilityWord(AbilityWord.UNDERGROWTH); + this.getSpellAbility().addHint(hint); + } + + private UndercityUpheaval(final UndercityUpheaval card) { + super(card); + } + + @Override + public UndercityUpheaval copy() { + return new UndercityUpheaval(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java index e660cf571c..f20a6f2dd4 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java @@ -37,5 +37,6 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet { cards.add(new SetCardInfo("Spark Rupture", 5, Rarity.RARE, mage.cards.s.SparkRupture.class)); cards.add(new SetCardInfo("The Kenriths' Royal Funeral", 34, Rarity.RARE, mage.cards.t.TheKenrithsRoyalFuneral.class)); cards.add(new SetCardInfo("Training Grounds", 9, Rarity.RARE, mage.cards.t.TrainingGrounds.class)); + cards.add(new SetCardInfo("Undercity Upheaval", 25, Rarity.UNCOMMON, mage.cards.u.UndercityUpheaval.class)); } }