From 2c6859c60a9069c93389699c7200e1e0481f2482 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 14 Jun 2020 10:32:59 -0400 Subject: [PATCH] Implemented Frantic Inventory --- .../src/mage/cards/f/FranticInventory.java | 44 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2021.java | 1 + 2 files changed, 45 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FranticInventory.java diff --git a/Mage.Sets/src/mage/cards/f/FranticInventory.java b/Mage.Sets/src/mage/cards/f/FranticInventory.java new file mode 100644 index 0000000000..7ab40c6030 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FranticInventory.java @@ -0,0 +1,44 @@ +package mage.cards.f; + +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FranticInventory extends CardImpl { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(new NamePredicate("Frantic Inventory")); + } + + private static final DynamicValue xValue = new CardsInControllerGraveyardCount(filter); + + public FranticInventory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Draw a card, then draw cards equal to the number of cards named Frantic Inventory in your graveyard. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(xValue) + .setText(", then draw cards equal to the number of cards named Frantic Inventory in your graveyard")); + } + + private FranticInventory(final FranticInventory card) { + super(card); + } + + @Override + public FranticInventory copy() { + return new FranticInventory(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index 5c08b29540..3f6db8c387 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -74,6 +74,7 @@ public final class CoreSet2021 extends ExpansionSet { cards.add(new SetCardInfo("Fierce Empath", 181, Rarity.UNCOMMON, mage.cards.f.FierceEmpath.class)); cards.add(new SetCardInfo("Fiery Emancipation", 143, Rarity.MYTHIC, mage.cards.f.FieryEmancipation.class)); cards.add(new SetCardInfo("Finishing Blow", 99, Rarity.COMMON, mage.cards.f.FinishingBlow.class)); + cards.add(new SetCardInfo("Frantic Inventory", 50, Rarity.COMMON, mage.cards.f.FranticInventory.class)); cards.add(new SetCardInfo("Fungal Rebirth", 182, Rarity.UNCOMMON, mage.cards.f.FungalRebirth.class)); cards.add(new SetCardInfo("Furious Rise", 144, Rarity.UNCOMMON, mage.cards.f.FuriousRise.class)); cards.add(new SetCardInfo("Gadrak, the Crown-Scourge", 146, Rarity.RARE, mage.cards.g.GadrakTheCrownScourge.class));