From f250a73e9e6a3edae62b4e99bc23eecb71ee7198 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 22 Sep 2018 22:25:29 -0400 Subject: [PATCH] fixed Lazav, the Multifarious ability --- .../mage/cards/l/LazavTheMultifarious.java | 42 +++++++++---------- .../src/mage/cards/r/RunawaySteamKin.java | 3 +- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java b/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java index 446426e94e..ae2ebcf6b0 100644 --- a/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java +++ b/Mage.Sets/src/mage/cards/l/LazavTheMultifarious.java @@ -16,18 +16,18 @@ import mage.constants.SuperType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.TargetController; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; -import mage.filter.predicate.other.OwnerPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; import mage.players.Player; -import mage.target.common.TargetCardInGraveyard; -import mage.target.targetadjustment.XCMCGraveyardAdjuster; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetadjustment.TargetAdjuster; import mage.target.targetpointer.FixedTarget; import mage.util.functions.ApplyToPermanent; @@ -37,12 +37,6 @@ import mage.util.functions.ApplyToPermanent; */ public final class LazavTheMultifarious extends CardImpl { - private static final FilterCard filter = new FilterCreatureCard("creature card in your graveyard with converted mana cost X"); - - static { - filter.add(new OwnerPredicate(TargetController.YOU)); - } - public LazavTheMultifarious(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}"); @@ -61,8 +55,7 @@ public final class LazavTheMultifarious extends CardImpl { new LazavTheMultifariousEffect(), new ManaCostsImpl("{X}") ); - ability.addTarget(new TargetCardInGraveyard(filter)); - ability.setTargetAdjuster(XCMCGraveyardAdjuster.instance); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); this.addAbility(ability); } @@ -76,6 +69,19 @@ public final class LazavTheMultifarious extends CardImpl { } } +enum LazavTheMultifariousAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + FilterCard filterCard = new FilterCreatureCard("creature card with converted mana cost " + xValue + " in your graveyard"); + filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetCardInYourGraveyard(filterCard)); + } +} + class LazavTheMultifariousEffect extends OneShotEffect { LazavTheMultifariousEffect() { @@ -124,20 +130,13 @@ class LazavTheMultifariousEffect extends OneShotEffect { class LazavTheMultifariousApplier extends ApplyToPermanent { - private static final FilterCard filter = new FilterCreatureCard("creature card in your graveyard with converted mana cost X"); - - static { - filter.add(new OwnerPredicate(TargetController.YOU)); - } - @Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { Ability ability = new SimpleActivatedAbility( new LazavTheMultifariousEffect(), new ManaCostsImpl("{X}") ); - ability.addTarget(new TargetCardInGraveyard(filter)); - ability.setTargetAdjuster(XCMCGraveyardAdjuster.instance); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); permanent.getAbilities().add(ability); permanent.setName("Lazav, the Multifarious"); permanent.addSuperType(SuperType.LEGENDARY); @@ -150,8 +149,7 @@ class LazavTheMultifariousApplier extends ApplyToPermanent { new LazavTheMultifariousEffect(), new ManaCostsImpl("{X}") ); - ability.addTarget(new TargetCardInGraveyard(filter)); - ability.setTargetAdjuster(XCMCGraveyardAdjuster.instance); + ability.setTargetAdjuster(LazavTheMultifariousAdjuster.instance); mageObject.getAbilities().add(ability); mageObject.setName("Lazav, the Multifarious"); mageObject.addSuperType(SuperType.LEGENDARY); diff --git a/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java b/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java index 948b28a3e9..aa58060ec1 100644 --- a/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java +++ b/Mage.Sets/src/mage/cards/r/RunawaySteamKin.java @@ -52,8 +52,7 @@ public final class RunawaySteamKin extends CardImpl { // Remove three +1/+1 counters from Runaway Steam-Kin: Add {R}{R}{R}. this.addAbility(new SimpleManaAbility( - Zone.BATTLEFIELD, - Mana.RedMana(3), + Zone.BATTLEFIELD, Mana.RedMana(3), new RemoveCountersSourceCost(CounterType.P1P1.createInstance(3)) )); }