From 14651c1816693b7528bed588f4ba9c5de6bd6638 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 14 Jan 2021 18:02:49 -0500 Subject: [PATCH] [KHM] Implemented Fearless Liberator --- Mage.Sets/src/mage/cards/d/Duskwielder.java | 4 +- .../src/mage/cards/e/EradicatorValkyrie.java | 22 ++++------- .../src/mage/cards/f/FearlessLiberator.java | 39 +++++++++++++++++++ .../src/mage/cards/g/GoldmawChampion.java | 3 +- Mage.Sets/src/mage/cards/h/HagiMob.java | 3 +- .../src/mage/cards/u/UsherOfTheFallen.java | 5 +-- .../mage/cards/v/VarragothBloodskySire.java | 19 +++++---- Mage.Sets/src/mage/sets/Kaldheim.java | 1 + .../mage/abilities/keyword/BoastAbility.java | 5 +++ 9 files changed, 66 insertions(+), 35 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/f/FearlessLiberator.java diff --git a/Mage.Sets/src/mage/cards/d/Duskwielder.java b/Mage.Sets/src/mage/cards/d/Duskwielder.java index 05e9ae1a5e..c099dd9a03 100644 --- a/Mage.Sets/src/mage/cards/d/Duskwielder.java +++ b/Mage.Sets/src/mage/cards/d/Duskwielder.java @@ -28,9 +28,7 @@ public final class Duskwielder extends CardImpl { this.toughness = new MageInt(2); // Boast — {1}: Target opponent loses 1 life and you gain 1 life. - Ability ability = new BoastAbility( - new LoseLifeTargetEffect(1), new GenericManaCost(1) - ); + Ability ability = new BoastAbility(new LoseLifeTargetEffect(1), new GenericManaCost(1)); ability.addEffect(new GainLifeEffect(1).concatBy("and")); ability.addTarget(new TargetOpponent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java b/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java index 850bcb9a35..d967ce8bf5 100644 --- a/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java +++ b/Mage.Sets/src/mage/cards/e/EradicatorValkyrie.java @@ -1,35 +1,27 @@ 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.HexproofFromPlaneswalkersAbility; 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.constants.SubType; +import mage.filter.StaticFilters; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** - * * @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}"); @@ -48,7 +40,9 @@ public final class EradicatorValkyrie extends CardImpl { 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 ability = new BoastAbility(new SacrificeOpponentsEffect( + StaticFilters.FILTER_PERMANENT_CREATURE_OR_PLANESWALKER + ), "{1}{B}"); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FearlessLiberator.java b/Mage.Sets/src/mage/cards/f/FearlessLiberator.java new file mode 100644 index 0000000000..ef19243ab2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FearlessLiberator.java @@ -0,0 +1,39 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.BoastAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.permanent.token.DwarfBerserkerToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FearlessLiberator extends CardImpl { + + public FearlessLiberator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.DWARF); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Boast — {2}{R}: Create a 2/1 red Dwarf Berserker creature token. + this.addAbility(new BoastAbility(new CreateTokenEffect(new DwarfBerserkerToken()), "{2}{R}")); + } + + private FearlessLiberator(final FearlessLiberator card) { + super(card); + } + + @Override + public FearlessLiberator copy() { + return new FearlessLiberator(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoldmawChampion.java b/Mage.Sets/src/mage/cards/g/GoldmawChampion.java index f2c25fc783..2ceb40c0df 100644 --- a/Mage.Sets/src/mage/cards/g/GoldmawChampion.java +++ b/Mage.Sets/src/mage/cards/g/GoldmawChampion.java @@ -2,7 +2,6 @@ package mage.cards.g; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.BoastAbility; import mage.cards.CardImpl; @@ -27,7 +26,7 @@ public final class GoldmawChampion extends CardImpl { this.toughness = new MageInt(3); // Boast — {1}{W}: Tap target creature. - Ability ability = new BoastAbility(new TapTargetEffect(), new ManaCostsImpl<>("{1}{W}")); + Ability ability = new BoastAbility(new TapTargetEffect(), "{1}{W}"); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HagiMob.java b/Mage.Sets/src/mage/cards/h/HagiMob.java index eec65407ac..009b09007c 100644 --- a/Mage.Sets/src/mage/cards/h/HagiMob.java +++ b/Mage.Sets/src/mage/cards/h/HagiMob.java @@ -2,7 +2,6 @@ package mage.cards.h; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.BoastAbility; import mage.cards.CardImpl; @@ -27,7 +26,7 @@ public final class HagiMob extends CardImpl { this.toughness = new MageInt(4); // Boast — {1}{R}: Hagi Mob deals 1 damage to any target. - Ability ability = new BoastAbility(new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}")); + Ability ability = new BoastAbility(new DamageTargetEffect(1), "{1}{R}"); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/u/UsherOfTheFallen.java b/Mage.Sets/src/mage/cards/u/UsherOfTheFallen.java index 3da60d6af8..3e225311ff 100644 --- a/Mage.Sets/src/mage/cards/u/UsherOfTheFallen.java +++ b/Mage.Sets/src/mage/cards/u/UsherOfTheFallen.java @@ -1,7 +1,6 @@ package mage.cards.u; import mage.MageInt; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.BoastAbility; import mage.cards.CardImpl; @@ -26,9 +25,7 @@ public final class UsherOfTheFallen extends CardImpl { this.toughness = new MageInt(1); // Boast — {1}{W}: Create a 1/1 white Human Warrior creature token. - this.addAbility(new BoastAbility( - new CreateTokenEffect(new HumanWarriorToken()), new ManaCostsImpl<>("{1}{W}") - )); + this.addAbility(new BoastAbility(new CreateTokenEffect(new HumanWarriorToken()), "{1}{W}")); } private UsherOfTheFallen(final UsherOfTheFallen card) { diff --git a/Mage.Sets/src/mage/cards/v/VarragothBloodskySire.java b/Mage.Sets/src/mage/cards/v/VarragothBloodskySire.java index 8676887683..5eb5b1e72a 100644 --- a/Mage.Sets/src/mage/cards/v/VarragothBloodskySire.java +++ b/Mage.Sets/src/mage/cards/v/VarragothBloodskySire.java @@ -1,27 +1,26 @@ package mage.cards.v; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.keyword.BoastAbility; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.SearchEffect; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.SuperType; +import mage.abilities.keyword.BoastAbility; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** - * * @author weirddan455 */ public final class VarragothBloodskySire extends CardImpl { @@ -39,7 +38,7 @@ public final class VarragothBloodskySire extends CardImpl { this.addAbility(DeathtouchAbility.getInstance()); // Boast -- {1}{B}:Target player searches their library for a card, then shuffles their library and puts that card on top of it. - Ability ability = new BoastAbility(new VarragothBloodskySireEffect(), new ManaCostsImpl("{1}{B}")); + Ability ability = new BoastAbility(new VarragothBloodskySireEffect(), "{1}{B}"); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index ca12cfdbf4..d57da61f6e 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -102,6 +102,7 @@ public final class Kaldheim extends ExpansionSet { 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("Faceless Haven", 255, Rarity.RARE, mage.cards.f.FacelessHaven.class)); + cards.add(new SetCardInfo("Fearless Liberator", 135, Rarity.UNCOMMON, mage.cards.f.FearlessLiberator.class)); cards.add(new SetCardInfo("Feed the Serpent", 95, Rarity.COMMON, mage.cards.f.FeedTheSerpent.class)); cards.add(new SetCardInfo("Fire Giant's Fury", 389, Rarity.UNCOMMON, mage.cards.f.FireGiantsFury.class)); cards.add(new SetCardInfo("Firja, Judge of Valor", 209, Rarity.UNCOMMON, mage.cards.f.FirjaJudgeOfValor.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java b/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java index 3661a8bf10..c231dedd37 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java @@ -3,6 +3,7 @@ package mage.abilities.keyword; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.condition.common.BoastCondition; import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.hint.common.BoastHint; import mage.constants.Zone; @@ -14,6 +15,10 @@ import mage.watchers.common.AttackedThisTurnWatcher; */ public class BoastAbility extends ActivatedAbilityImpl { + public BoastAbility(Effect effect, String manaString) { + this(effect, new ManaCostsImpl<>(manaString)); + } + public BoastAbility(Effect effect, Cost cost) { super(Zone.BATTLEFIELD, effect, cost); this.maxActivationsPerTurn = 1;