Implemented Kaya, Bane of the Dead

This commit is contained in:
Evan Kranzler 2019-04-01 14:07:57 -04:00
parent 7d4ada3b9c
commit bd8b2533a9
2 changed files with 86 additions and 0 deletions

View file

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

View file

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