From 10daaa390619b05ae8e158089f42c5a6a171fa2c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 10 Sep 2019 17:23:51 -0400 Subject: [PATCH] Implemented Worthy Knight --- Mage.Sets/src/mage/cards/w/WorthyKnight.java | 49 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 50 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/w/WorthyKnight.java diff --git a/Mage.Sets/src/mage/cards/w/WorthyKnight.java b/Mage.Sets/src/mage/cards/w/WorthyKnight.java new file mode 100644 index 0000000000..d3521c5897 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WorthyKnight.java @@ -0,0 +1,49 @@ +package mage.cards.w; + +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.HumanToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WorthyKnight extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a Knight spell"); + + static { + filter.add(new SubtypePredicate(SubType.HUMAN)); + } + + public WorthyKnight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast a Knight spell, create a 1/1 white Human creature token. + this.addAbility(new SpellCastControllerTriggeredAbility( + new CreateTokenEffect(new HumanToken()), filter, false + )); + } + + private WorthyKnight(final WorthyKnight card) { + super(card); + } + + @Override + public WorthyKnight copy() { + return new WorthyKnight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 0face6239d..c939d1b31c 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -124,6 +124,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Witch's Vengeance", 111, Rarity.RARE, mage.cards.w.WitchsVengeance.class)); cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class)); cards.add(new SetCardInfo("Workshop Elders", 318, Rarity.RARE, mage.cards.w.WorkshopElders.class)); + cards.add(new SetCardInfo("Worthy Knight", 36, Rarity.RARE, mage.cards.w.WorthyKnight.class)); // This is here to prevent the incomplete adventure implementation from causing problems and will be removed cards.removeIf(setCardInfo -> AdventureCard.class.isAssignableFrom(setCardInfo.getCardClass()));