From 73a41aef4a83d4ff1f60c368e8d230b56d764f4e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Nov 2014 15:05:27 +0100 Subject: [PATCH] Fixed handling to show playable cards with alternate costs. --- Mage/src/mage/abilities/keyword/EvokeAbility.java | 4 +++- Mage/src/mage/abilities/keyword/ProwlAbility.java | 10 ++++++++++ Mage/src/mage/players/PlayerImpl.java | 15 ++++++--------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Mage/src/mage/abilities/keyword/EvokeAbility.java b/Mage/src/mage/abilities/keyword/EvokeAbility.java index fd32438b0e..d3e07b4e72 100644 --- a/Mage/src/mage/abilities/keyword/EvokeAbility.java +++ b/Mage/src/mage/abilities/keyword/EvokeAbility.java @@ -195,7 +195,9 @@ public class EvokeAbility extends StaticAbility implements AlternativeSourceCost @Override public Costs getCosts() { Costs alterCosts = new CostsImpl<>(); - alterCosts.addAll(evokeCosts); + for (AlternativeCost2 aCost: evokeCosts) { + alterCosts.add(aCost.getCost()); + } return alterCosts; } } diff --git a/Mage/src/mage/abilities/keyword/ProwlAbility.java b/Mage/src/mage/abilities/keyword/ProwlAbility.java index e88559195b..35711dcbe9 100644 --- a/Mage/src/mage/abilities/keyword/ProwlAbility.java +++ b/Mage/src/mage/abilities/keyword/ProwlAbility.java @@ -39,6 +39,7 @@ import mage.abilities.costs.AlternativeCost2Impl; import mage.abilities.costs.AlternativeSourceCosts; import mage.abilities.costs.Cost; import mage.abilities.costs.Costs; +import mage.abilities.costs.CostsImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.cards.Card; import mage.constants.Outcome; @@ -200,4 +201,13 @@ public class ProwlAbility extends StaticAbility implements AlternativeSourceCost reminderText = sb.toString(); } + + @Override + public Costs getCosts() { + Costs alterCosts = new CostsImpl<>(); + for (AlternativeCost2 aCost: prowlCosts) { + alterCosts.add(aCost.getCost()); + } + return alterCosts; + } } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 4b6aa3a959..5e6ef80956 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2167,9 +2167,6 @@ public abstract class PlayerImpl implements Player, Serializable { playable.add(ability); } } -// if (ability instanceof AlternativeSourceCosts) { -// -// } } } } @@ -2279,12 +2276,12 @@ public abstract class PlayerImpl implements Player, Serializable { break; } } - for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) { - if (!playable.contains(ability.getSourceId()) && canPlay(ability, available, card, game)) { - playable.add(card.getId()); - break; - } - } +// for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) { +// if (!playable.contains(ability.getSourceId()) && canPlay(ability, available, card, game)) { +// playable.add(card.getId()); +// break; +// } +// } } }