diff --git a/Mage/src/main/java/mage/abilities/costs/AlternativeCost2.java b/Mage/src/main/java/mage/abilities/costs/AlternativeCost2.java index 588cc09ea95..767c3d3c1b9 100644 --- a/Mage/src/main/java/mage/abilities/costs/AlternativeCost2.java +++ b/Mage/src/main/java/mage/abilities/costs/AlternativeCost2.java @@ -4,11 +4,11 @@ package mage.abilities.costs; import mage.game.Game; /** + * Virtual alternative cost, it must be tranformed to simple cost on activate in your + * custom ability (see askToActivateAlternativeCosts). Example: DashAbility * * @author LevelX2 */ - - public interface AlternativeCost2 extends Cost { String getName(); diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index a93b200ac90..9f17e6cee31 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -3303,6 +3303,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (alternateSourceCostsAbility.getCosts().canPay(ability, ability, playerId, game)) { ManaCostsImpl manaCosts = new ManaCostsImpl(); for (Cost cost : alternateSourceCostsAbility.getCosts()) { + // AlternativeCost2 replaced by real cost on activate, so getPlayable need to extract that costs here if (cost instanceof AlternativeCost2) { if (((AlternativeCost2) cost).getCost() instanceof ManaCost) { manaCosts.add((ManaCost) ((AlternativeCost2) cost).getCost()); @@ -3351,8 +3352,15 @@ public abstract class PlayerImpl implements Player, Serializable { if (((Ability) alternateSourceCosts).getCosts().canPay(ability, ability, playerId, game)) { ManaCostsImpl manaCosts = new ManaCostsImpl(); for (Cost cost : ((Ability) alternateSourceCosts).getCosts()) { - if (cost instanceof ManaCost) { - manaCosts.add((ManaCost) cost); + // AlternativeCost2 replaced by real cost on activate, so getPlayable need to extract that costs here + if (cost instanceof AlternativeCost2) { + if (((AlternativeCost2) cost).getCost() instanceof ManaCost) { + manaCosts.add((ManaCost) ((AlternativeCost2) cost).getCost()); + } + } else { + if (cost instanceof ManaCost) { + manaCosts.add((ManaCost) cost); + } } }