mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Added miss code and comments for alternative code (additional to b6a3f7edc1
)
This commit is contained in:
parent
b073ff8617
commit
3406ef6b4e
2 changed files with 12 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue