From ec17073175788cd999a520400adf9bcf568e0682 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Tue, 12 Apr 2022 11:35:37 -0500 Subject: [PATCH] [SNC] Implemented All-Seeing Arbiter --- .../src/mage/cards/a/AllSeeingArbiter.java | 95 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 96 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AllSeeingArbiter.java diff --git a/Mage.Sets/src/mage/cards/a/AllSeeingArbiter.java b/Mage.Sets/src/mage/cards/a/AllSeeingArbiter.java new file mode 100644 index 0000000000..009e012464 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AllSeeingArbiter.java @@ -0,0 +1,95 @@ +package mage.cards.a; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DiscardCardControllerTriggeredAbility; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class AllSeeingArbiter extends CardImpl { + + public AllSeeingArbiter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); + + this.subtype.add(SubType.AVATAR); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever All-Seeing Arbiter enters the battlefield or attacks, draw two cards, then discard a card. + this.addAbility(new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DrawDiscardControllerEffect(2, 1))); + + // Whenever you discard a card, target creature an opponent controls gets -X/-0 until your next turn, where X is the number of different mana values among cards in your graveyard. + Ability ability = new DiscardCardControllerTriggeredAbility(new BoostTargetEffect( + AllSeeingArbiterValue.instance, StaticValue.get(0), Duration.UntilYourNextTurn, true + ), false); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + } + + private AllSeeingArbiter(final AllSeeingArbiter card) { + super(card); + } + + @Override + public AllSeeingArbiter copy() { + return new AllSeeingArbiter(this); + } +} + +enum AllSeeingArbiterValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player controller = game.getPlayer(sourceAbility.getControllerId()); + if (controller == null) { + return 0; + } + HashSet manaValues = new HashSet<>(); + for (UUID cardId : controller.getGraveyard()) { + Card card = game.getCard(cardId); + if (card != null) { + manaValues.add(card.getManaValue()); + } + } + return -manaValues.size(); + } + + @Override + public AllSeeingArbiterValue copy() { + return this; + } + + @Override + public String toString() { + return "-X"; + } + + @Override + public String getMessage() { + return "the number of different mana values among cards in your graveyard"; + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index c95ee7f18a..54a45ffa2a 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -27,6 +27,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { this.hasBasicLands = true; cards.add(new SetCardInfo("A Little Chat", 47, Rarity.UNCOMMON, mage.cards.a.ALittleChat.class)); + cards.add(new SetCardInfo("All-Seeing Arbiter", 34, Rarity.MYTHIC, mage.cards.a.AllSeeingArbiter.class)); cards.add(new SetCardInfo("An Offer You Can't Refuse", 51, Rarity.UNCOMMON, mage.cards.a.AnOfferYouCantRefuse.class)); cards.add(new SetCardInfo("Arc Spitter", 233, Rarity.UNCOMMON, mage.cards.a.ArcSpitter.class)); cards.add(new SetCardInfo("Aven Heartstabber", 166, Rarity.RARE, mage.cards.a.AvenHeartstabber.class));