diff --git a/Mage.Sets/src/mage/cards/n/Necrogoyf.java b/Mage.Sets/src/mage/cards/n/Necrogoyf.java new file mode 100644 index 0000000000..7201dab97d --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/Necrogoyf.java @@ -0,0 +1,56 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Necrogoyf extends CardImpl { + + private static final DynamicValue xValue = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURES); + + public Necrogoyf(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add(SubType.LHURGOYF); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Necrogoyf's power is equal to the number of creature cards in all graveyards. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame) + )); + + // At the beginning of each player's upkeep, that player discards a card. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + Zone.BATTLEFIELD, new DiscardTargetEffect(1), + TargetController.EACH_PLAYER, false, true + )); + + // Madness {1}{B}{B} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl<>("{1}{B}{B}"))); + } + + private Necrogoyf(final Necrogoyf card) { + super(card); + } + + @Override + public Necrogoyf copy() { + return new Necrogoyf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index 2e98314928..7f2d74a057 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -185,6 +185,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 487, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Myr Scrapling", 230, Rarity.COMMON, mage.cards.m.MyrScrapling.class)); cards.add(new SetCardInfo("Mystic Redaction", 53, Rarity.UNCOMMON, mage.cards.m.MysticRedaction.class)); + cards.add(new SetCardInfo("Necrogoyf", 93, Rarity.RARE, mage.cards.n.Necrogoyf.class)); cards.add(new SetCardInfo("Necromancer's Familiar", 94, Rarity.UNCOMMON, mage.cards.n.NecromancersFamiliar.class)); cards.add(new SetCardInfo("Nested Shambler", 95, Rarity.COMMON, mage.cards.n.NestedShambler.class)); cards.add(new SetCardInfo("Nettlecyst", 231, Rarity.RARE, mage.cards.n.Nettlecyst.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java index 72cd99216c..4976affce1 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java @@ -1,23 +1,24 @@ package mage.abilities.dynamicvalue.common; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.filter.FilterCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** - * * @author North */ public class CardsInAllGraveyardsCount implements DynamicValue { - private FilterCard filter; + private final FilterCard filter; public CardsInAllGraveyardsCount() { - this(new FilterCard()); + this(StaticFilters.FILTER_CARD); } public CardsInAllGraveyardsCount(FilterCard filter) {