Implemented Wintermoor Commander

This commit is contained in:
Evan Kranzler 2019-09-06 21:47:17 -04:00
parent c6d1e5786d
commit 3b5d6fedc9
2 changed files with 73 additions and 0 deletions

View file

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

View file

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