diff --git a/Mage.Sets/src/mage/cards/a/ArmixFiligreeThrasher.java b/Mage.Sets/src/mage/cards/a/ArmixFiligreeThrasher.java new file mode 100644 index 0000000000..84cc6a1358 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArmixFiligreeThrasher.java @@ -0,0 +1,92 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoWhenCostPaid; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.PartnerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArmixFiligreeThrasher extends CardImpl { + + public ArmixFiligreeThrasher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.GOLEM); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Armix, Filigree Thrasher attacks, you may discard a card. When you do, target creature defending player controls gets -X/-X until end of turn, where X is the number of artifacts you control plus the number of artifact cards in your graveyard. + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new BoostTargetEffect( + ArmixFiligreeThrasherValue.instance, + ArmixFiligreeThrasherValue.instance, + Duration.EndOfTurn, true + ), false, "target creature defending player controls gets -X/-X until end of turn, " + + "where X is the number of artifacts you control plus the number of artifact cards in your graveyard" + ); + this.addAbility(new AttacksTriggeredAbility(new DoWhenCostPaid( + ability, new DiscardCardCost(), "Discard a card?" + ), false)); + + // Partner + this.addAbility(PartnerAbility.getInstance()); + } + + private ArmixFiligreeThrasher(final ArmixFiligreeThrasher card) { + super(card); + } + + @Override + public ArmixFiligreeThrasher copy() { + return new ArmixFiligreeThrasher(this); + } +} + +enum ArmixFiligreeThrasherValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player == null) { + return 0; + } + return -(player.getGraveyard().count( + StaticFilters.FILTER_CARD_ARTIFACT, player.getId(), game + ) + game.getBattlefield().count( + StaticFilters.FILTER_PERMANENT_ARTIFACT, + sourceAbility.getSourceId(), + sourceAbility.getControllerId(), game + )); + } + + @Override + public ArmixFiligreeThrasherValue copy() { + return instance; + } + + @Override + public String getMessage() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index d9a2426307..0107481742 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -37,6 +37,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Arcane Signet", 297, Rarity.UNCOMMON, mage.cards.a.ArcaneSignet.class)); cards.add(new SetCardInfo("Archon of Coronation", 9, Rarity.MYTHIC, mage.cards.a.ArchonOfCoronation.class)); cards.add(new SetCardInfo("Armillary Sphere", 298, Rarity.COMMON, mage.cards.a.ArmillarySphere.class)); + cards.add(new SetCardInfo("Armix, Filigree Thrasher", 108, Rarity.UNCOMMON, mage.cards.a.ArmixFiligreeThrasher.class)); cards.add(new SetCardInfo("Aurora Phoenix", 161, Rarity.RARE, mage.cards.a.AuroraPhoenix.class)); cards.add(new SetCardInfo("Austere Command", 12, Rarity.RARE, mage.cards.a.AustereCommand.class)); cards.add(new SetCardInfo("Averna, the Chaos Bloom", 269, Rarity.RARE, mage.cards.a.AvernaTheChaosBloom.class));