Fixed handling to show playable cards with alternate costs.

This commit is contained in:
LevelX2 2014-11-29 15:05:27 +01:00
parent 03c7a815f7
commit 73a41aef4a
3 changed files with 19 additions and 10 deletions

View file

@ -195,7 +195,9 @@ public class EvokeAbility extends StaticAbility implements AlternativeSourceCost
@Override
public Costs<Cost> getCosts() {
Costs<Cost> alterCosts = new CostsImpl<>();
alterCosts.addAll(evokeCosts);
for (AlternativeCost2 aCost: evokeCosts) {
alterCosts.add(aCost.getCost());
}
return alterCosts;
}
}

View file

@ -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<Cost> getCosts() {
Costs<Cost> alterCosts = new CostsImpl<>();
for (AlternativeCost2 aCost: prowlCosts) {
alterCosts.add(aCost.getCost());
}
return alterCosts;
}
}

View file

@ -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;
// }
// }
}
}