mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Fixed CMC for spells (Escalate is not calculated correctly when more than 1 mode is chosen) fixes #2143.
This commit is contained in:
parent
5b5c13c137
commit
7a4b358f8a
2 changed files with 5 additions and 13 deletions
|
@ -176,8 +176,7 @@ public class SpellAbility extends ActivatedAbilityImpl {
|
|||
return cardName;
|
||||
}
|
||||
|
||||
public int getConvertedManaCost() {
|
||||
int cmc = 0;
|
||||
public int getConvertedXManaCost() {
|
||||
int xMultiplier = 0;
|
||||
for (String symbolString : getManaCosts().getSymbols()) {
|
||||
int index = symbolString.indexOf("{X}");
|
||||
|
@ -187,12 +186,7 @@ public class SpellAbility extends ActivatedAbilityImpl {
|
|||
index = symbolString.indexOf("{X}");
|
||||
}
|
||||
}
|
||||
if (getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) {
|
||||
cmc += getManaCostsToPay().getX() * xMultiplier;
|
||||
} else {
|
||||
cmc += getManaCosts().convertedManaCost() + getManaCostsToPay().getX() * xMultiplier;
|
||||
}
|
||||
return cmc;
|
||||
return getManaCostsToPay().getX() * xMultiplier;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -503,11 +503,9 @@ public class Spell extends StackObjImpl implements Card {
|
|||
return 0;
|
||||
}
|
||||
for (SpellAbility spellAbility : spellAbilities) {
|
||||
cmc += spellAbility.getConvertedManaCost();
|
||||
cmc += spellAbility.getConvertedXManaCost();
|
||||
}
|
||||
if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) {
|
||||
cmc += getCard().getManaCost().convertedManaCost();
|
||||
}
|
||||
return cmc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue