From 4f4ea502e16bb655c3bbc7123806dbad59efad6d Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sun, 10 Jan 2021 21:07:18 -0600 Subject: [PATCH] [KHM] Implemented Eradicator Valkyrie (#7367) --- .../src/mage/cards/e/EradicatorValkyrie.java | 64 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + .../HexproofFromPlaneswalkersAbility.java | 47 ++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java create mode 100644 Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java diff --git a/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java b/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java new file mode 100644 index 0000000000..850bcb9a35 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java @@ -0,0 +1,64 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeOpponentsEffect; +import mage.abilities.keyword.BoastAbility; +import mage.abilities.keyword.HexproofFromPlaneswalkersAbility; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class EradicatorValkyrie extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("creature or planeswalker"); + + static { + filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.PLANESWALKER.getPredicate())); + } + + public EradicatorValkyrie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + + this.subtype.add(SubType.ANGEL); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Hexproof from planeswalkers + this.addAbility(HexproofFromPlaneswalkersAbility.getInstance()); + + // Boast — {1}{B}, Sacrifice a creature: Each opponent sacrifices a creature or planeswalker. + Ability ability = new BoastAbility(new SacrificeOpponentsEffect(filter), new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + private EradicatorValkyrie(final EradicatorValkyrie card) { + super(card); + } + + @Override + public EradicatorValkyrie copy() { + return new EradicatorValkyrie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 0755ecc794..9165750d0b 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -69,6 +69,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Elderfang Ritualist", 385, Rarity.UNCOMMON, mage.cards.e.ElderfangRitualist.class)); cards.add(new SetCardInfo("Elven Ambush", 391, Rarity.UNCOMMON, mage.cards.e.ElvenAmbush.class)); cards.add(new SetCardInfo("Elvish Warmaster", 167, Rarity.RARE, mage.cards.e.ElvishWarmaster.class)); + cards.add(new SetCardInfo("Eradicator Valkyrie", 94, Rarity.MYTHIC, mage.cards.e.EradicatorValkyrie.class)); cards.add(new SetCardInfo("Esika's Chariot", 169, Rarity.RARE, mage.cards.e.EsikasChariot.class)); cards.add(new SetCardInfo("Esika, God of the Tree", 168, Rarity.MYTHIC, mage.cards.e.EsikaGodOfTheTree.class)); cards.add(new SetCardInfo("Fire Giant's Fury", 389, Rarity.UNCOMMON, mage.cards.f.FireGiantsFury.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java b/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java new file mode 100644 index 0000000000..1cbb997ed0 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java @@ -0,0 +1,47 @@ +package mage.abilities.keyword; + +import mage.MageObject; +import mage.game.Game; + +import java.io.ObjectStreamException; + +/** + * Hexproof from planesalkers + * + * @author weirddan455 + */ +public class HexproofFromPlaneswalkersAbility extends HexproofBaseAbility { + + private static final HexproofFromPlaneswalkersAbility instance; + + static { + instance = new HexproofFromPlaneswalkersAbility(); + } + + private Object readResolve() throws ObjectStreamException { + return instance; + } + + public static HexproofFromPlaneswalkersAbility getInstance() { + return instance; + } + + private HexproofFromPlaneswalkersAbility() { + super(); + } + + @Override + public boolean checkObject(MageObject source, Game game) { + return source.isPlaneswalker(); + } + + @Override + public HexproofFromPlaneswalkersAbility copy() { + return instance; + } + + @Override + public String getRule() { + return "hexproof from planeswalkers"; + } +}