From bd8b2533a93dc9e051f3b94064db16fa893d7a0a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 1 Apr 2019 14:07:57 -0400 Subject: [PATCH] Implemented Kaya, Bane of the Dead --- .../src/mage/cards/k/KayaBaneOfTheDead.java | 85 +++++++++++++++++++ Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KayaBaneOfTheDead.java diff --git a/Mage.Sets/src/mage/cards/k/KayaBaneOfTheDead.java b/Mage.Sets/src/mage/cards/k/KayaBaneOfTheDead.java new file mode 100644 index 0000000000..13ab5564c8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KayaBaneOfTheDead.java @@ -0,0 +1,85 @@ +package mage.cards.k; + +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KayaBaneOfTheDead extends CardImpl { + + public KayaBaneOfTheDead(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{W/B}{W/B}{W/B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.KAYA); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); + + // Your opponents and permanents your opponents control with hexproof can be the target of spells and abilities you control as though they didn't have hexproof. + this.addAbility(new SimpleStaticAbility(new KayaBaneOfTheDeadEffect())); + + // -3: Exile target creature. + Ability ability = new LoyaltyAbility(new ExileTargetEffect(), -3); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + private KayaBaneOfTheDead(final KayaBaneOfTheDead card) { + super(card); + } + + @Override + public KayaBaneOfTheDead copy() { + return new KayaBaneOfTheDead(this); + } +} + +class KayaBaneOfTheDeadEffect extends AsThoughEffectImpl { + + KayaBaneOfTheDeadEffect() { + super(AsThoughEffectType.HEXPROOF, Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "your opponents and creatures with hexproof they control " + + "can be the targets of spells and abilities you control as though they didn't have hexproof"; + } + + private KayaBaneOfTheDeadEffect(final KayaBaneOfTheDeadEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public KayaBaneOfTheDeadEffect copy() { + return new KayaBaneOfTheDeadEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId())) { + if (game.getOpponents(source.getControllerId()).contains(sourceId)) { + return true; + } + Permanent creature = game.getPermanent(sourceId); + if (creature != null + && game.getOpponents(source.getControllerId()).contains(creature.getControllerId())) { + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index 6eaf4979fd..46bb32f89c 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -49,6 +49,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Island", 255, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Jace, Wielder of Mysteries", 54, Rarity.RARE, mage.cards.j.JaceWielderOfMysteries.class)); cards.add(new SetCardInfo("Karn's Bastion", 248, Rarity.RARE, mage.cards.k.KarnsBastion.class)); + cards.add(new SetCardInfo("Kaya, Bane of the Dead", 231, Rarity.UNCOMMON, mage.cards.k.KayaBaneOfTheDead.class)); cards.add(new SetCardInfo("Kiora, Behemoth Beckoner", 232, Rarity.UNCOMMON, mage.cards.k.KioraBehemothBeckoner.class)); cards.add(new SetCardInfo("Liliana, Dreadhorde General", 97, Rarity.MYTHIC, mage.cards.l.LilianaDreadhordeGeneral.class)); cards.add(new SetCardInfo("Mountain", 259, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));