From f097e9763db5351564fc9f017f6eef6239eed091 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Nov 2022 17:59:12 -0500 Subject: [PATCH] [BRC] Implement Glint Raker --- Mage.Sets/src/mage/cards/g/GlintRaker.java | 63 +++++++++++++++++++ .../mage/sets/TheBrothersWarCommander.java | 1 + .../RevealLibraryPickControllerEffect.java | 7 +++ 3 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GlintRaker.java diff --git a/Mage.Sets/src/mage/cards/g/GlintRaker.java b/Mage.Sets/src/mage/cards/g/GlintRaker.java new file mode 100644 index 00000000000..b86899fa2b5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GlintRaker.java @@ -0,0 +1,63 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.HighestManaValueCount; +import mage.abilities.dynamicvalue.common.SavedDamageValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.RevealLibraryPickControllerEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.PutCards; +import mage.constants.SubType; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GlintRaker extends CardImpl { + + private static final DynamicValue xValue = new HighestManaValueCount(StaticFilters.FILTER_PERMANENT_ARTIFACTS); + + public GlintRaker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.DRAKE); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Glint Raker gets +X/+0, where X is the highest mana value among artifacts you control. + this.addAbility(new SimpleStaticAbility(new BoostSourceEffect( + xValue, StaticValue.get(0), Duration.WhileOnBattlefield + ))); + + // Whenever Glint Raker deals combat damage to a player, you may reveal that many cards from the top of your library. Put an artifact card revealed this way into your hand and the rest into your graveyard. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( + new RevealLibraryPickControllerEffect( + SavedDamageValue.MANY, 1, + StaticFilters.FILTER_CARD_ARTIFACT_AN, + PutCards.HAND, PutCards.GRAVEYARD, false + ), true + )); + } + + private GlintRaker(final GlintRaker card) { + super(card); + } + + @Override + public GlintRaker copy() { + return new GlintRaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java index 76ed2de031f..ce651d09cba 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java @@ -73,6 +73,7 @@ public final class TheBrothersWarCommander extends ExpansionSet { cards.add(new SetCardInfo("Fellwar Stone", 141, Rarity.UNCOMMON, mage.cards.f.FellwarStone.class)); cards.add(new SetCardInfo("Filigree Attendant", 85, Rarity.UNCOMMON, mage.cards.f.FiligreeAttendant.class)); cards.add(new SetCardInfo("Geth, Lord of the Vault", 107, Rarity.MYTHIC, mage.cards.g.GethLordOfTheVault.class)); + cards.add(new SetCardInfo("Glint Raker", 7, Rarity.RARE, mage.cards.g.GlintRaker.class)); cards.add(new SetCardInfo("Goldmire Bridge", 186, Rarity.COMMON, mage.cards.g.GoldmireBridge.class)); cards.add(new SetCardInfo("Great Furnace", 187, Rarity.COMMON, mage.cards.g.GreatFurnace.class)); cards.add(new SetCardInfo("Hedron Archive", 142, Rarity.UNCOMMON, mage.cards.h.HedronArchive.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java index 8170f8dfa4b..3c34f018fd5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java @@ -1,5 +1,7 @@ package mage.abilities.effects.common; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.constants.PutCards; import mage.filter.FilterCard; @@ -15,6 +17,11 @@ public class RevealLibraryPickControllerEffect extends LookLibraryAndPickControl public RevealLibraryPickControllerEffect(int numberOfCards, int numberToPick, FilterCard filter, PutCards putPickedCards, PutCards putLookedCards, boolean optional) { + this(StaticValue.get(numberOfCards), numberToPick, filter, putPickedCards, putLookedCards, optional); + } + + public RevealLibraryPickControllerEffect(DynamicValue numberOfCards, int numberToPick, FilterCard filter, + PutCards putPickedCards, PutCards putLookedCards, boolean optional) { super(numberOfCards, numberToPick, filter, putPickedCards, putLookedCards, optional); this.revealCards = true; this.revealPickedCards = false;