From 3b5d6fedc918345f7702f2d94fff827f0e39d11e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 6 Sep 2019 21:47:17 -0400 Subject: [PATCH] Implemented Wintermoor Commander --- .../src/mage/cards/w/WintermoorCommander.java | 72 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/w/WintermoorCommander.java diff --git a/Mage.Sets/src/mage/cards/w/WintermoorCommander.java b/Mage.Sets/src/mage/cards/w/WintermoorCommander.java new file mode 100644 index 0000000000..4ebf50678a --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WintermoorCommander.java @@ -0,0 +1,72 @@ +package mage.cards.w; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WintermoorCommander extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent(SubType.KNIGHT, "Knights you control"); + private static final DynamicValue xValue + = new PermanentsOnBattlefieldCount(filter); + private static final FilterPermanent filter2 + = new FilterControlledPermanent(SubType.KNIGHT, "another target Knight you control"); + + static { + filter2.add(AnotherPredicate.instance); + } + + public WintermoorCommander(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(0); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Wintermoor Commander's toughness is equal to the number of Knights you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(xValue, Duration.EndOfGame))); + + // Whenever Wintermoor Commander attacks, another target Knight you control gains indestructible until end of turn. + Ability ability = new AttacksTriggeredAbility(new GainAbilityTargetEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ), false); + ability.addTarget(new TargetPermanent(filter2)); + this.addAbility(ability); + } + + private WintermoorCommander(final WintermoorCommander card) { + super(card); + } + + @Override + public WintermoorCommander copy() { + return new WintermoorCommander(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 0de7741858..af77c028db 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -78,6 +78,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class)); cards.add(new SetCardInfo("Tome of Legends", 332, Rarity.RARE, mage.cards.t.TomeOfLegends.class)); cards.add(new SetCardInfo("Wind-Scarred Crag", 308, Rarity.COMMON, mage.cards.w.WindScarredCrag.class)); + cards.add(new SetCardInfo("Wintermoor Commander", 205, Rarity.UNCOMMON, mage.cards.w.WintermoorCommander.class)); cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class)); cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));