From 61d0e7db0d4814369868d4ac9b164c5136663a91 Mon Sep 17 00:00:00 2001 From: Plopman Date: Tue, 13 Aug 2013 19:04:09 +0200 Subject: [PATCH] Fixed ConvertedManaCostPredicate for stackObject --- .../ConvertedManaCostPredicate.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/filter/predicate/mageobject/ConvertedManaCostPredicate.java b/Mage/src/mage/filter/predicate/mageobject/ConvertedManaCostPredicate.java index e6792d5333..edeacbe39b 100644 --- a/Mage/src/mage/filter/predicate/mageobject/ConvertedManaCostPredicate.java +++ b/Mage/src/mage/filter/predicate/mageobject/ConvertedManaCostPredicate.java @@ -28,8 +28,11 @@ package mage.filter.predicate.mageobject; import mage.MageObject; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.VariableManaCost; import mage.filter.Filter; import mage.filter.predicate.IntComparePredicate; +import mage.game.stack.StackObject; /** * @@ -43,7 +46,21 @@ public class ConvertedManaCostPredicate extends IntComparePredicate @Override protected int getInputValue(MageObject input) { - return input.getManaCost().convertedManaCost(); + if(input instanceof StackObject){ + int manaCost = 0; + for(ManaCost cost : input.getManaCost()){ + if(cost instanceof VariableManaCost){ + manaCost += ((StackObject)input).getStackAbility().getManaCostsToPay().getX(); + } + else{ + manaCost += cost.convertedManaCost(); + } + } + return manaCost; + } + else{ + return input.getManaCost().convertedManaCost(); + } } @Override