[SNC] Implemented All-Seeing Arbiter

This commit is contained in:
Daniel Bomar 2022-04-12 11:35:37 -05:00
parent 2415a1665b
commit ec17073175
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 96 additions and 0 deletions

View file

@ -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<Integer> 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";
}
}

View file

@ -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));