Implemented Kestia, the Cultivator

This commit is contained in:
Evan Kranzler 2018-07-25 12:58:19 -04:00
parent 7c6dfe3e56
commit 91244c09dc
3 changed files with 79 additions and 2 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksAllTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.abilities.keyword.BestowAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SetTargetPointer;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.EnchantedPredicate;
/**
*
* @author TheElk801
*/
public final class KestiaTheCultivator extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("an enchanted creature or enchantment creature you control");
static {
filter.add(Predicates.or(
new EnchantedPredicate(),
new CardTypePredicate(CardType.ENCHANTMENT)
));
filter.add(new ControllerPredicate(TargetController.YOU));
}
public KestiaTheCultivator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{G}{W}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.NYMPH);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Bestow {3}{G}{W}{U}
this.addAbility(new BestowAbility(this, "{3}{G}{W}{U}"));
// Enchanted creature gets +4/+4.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new BoostEnchantedEffect(4, 4, Duration.WhileOnBattlefield)
));
// Whenever an enchanted creature or enchantment creature you control attacks, draw a card.
this.addAbility(new AttacksAllTriggeredAbility(
new DrawCardSourceControllerEffect(1),
false, filter, SetTargetPointer.NONE, false
));
}
public KestiaTheCultivator(final KestiaTheCultivator card) {
super(card);
}
@Override
public KestiaTheCultivator copy() {
return new KestiaTheCultivator(this);
}
}

View file

@ -42,6 +42,7 @@ public final class Commander2018 extends ExpansionSet {
cards.add(new SetCardInfo("Forge of Heroes", 58, Rarity.COMMON, mage.cards.f.ForgeOfHeroes.class));
cards.add(new SetCardInfo("Fury Storm", 22, Rarity.RARE, mage.cards.f.FuryStorm.class));
cards.add(new SetCardInfo("Hydra Omnivore", 153, Rarity.MYTHIC, mage.cards.h.HydraOmnivore.class));
cards.add(new SetCardInfo("Kestia, the Cultivator", 42, Rarity.MYTHIC, mage.cards.k.KestiaTheCultivator.class));
cards.add(new SetCardInfo("Loyal Apprentice", 23, Rarity.UNCOMMON, mage.cards.l.LoyalApprentice.class));
cards.add(new SetCardInfo("Loyal Drake", 10, Rarity.UNCOMMON, mage.cards.l.LoyalDrake.class));
cards.add(new SetCardInfo("Loyal Guardian", 31, Rarity.UNCOMMON, mage.cards.l.LoyalGuardian.class));

View file

@ -1,4 +1,3 @@
package mage.abilities.common;
import java.util.UUID;
@ -102,7 +101,10 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever a " + filter.getMessage() + " attacks" + (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "") + ", " + super.getRule();
return "Whenever " + (filter.getMessage().startsWith("an") ? "" : "a ")
+ filter.getMessage() + " attacks"
+ (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "")
+ ", " + super.getRule();
}
}