* Void Winnower - Fixed that the check for even casting costs did not work correctly.

This commit is contained in:
LevelX2 2015-11-14 11:14:50 +01:00
parent 50b5602459
commit d3000da3a3
11 changed files with 163 additions and 25 deletions

View file

@ -491,21 +491,8 @@ public class Spell extends StackObjImpl implements Card {
if (faceDown) {
return 0;
}
for (Ability spellAbility : spellAbilities) {
int xMultiplier = 0;
for (String symbolString : spellAbility.getManaCosts().getSymbols()) {
int index = symbolString.indexOf("{X}");
while (index != -1) {
xMultiplier++;
symbolString = symbolString.substring(index + 3);
index = symbolString.indexOf("{X}");
}
}
if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) {
cmc += spellAbility.getManaCostsToPay().getX() * xMultiplier;
} else {
cmc += spellAbility.getManaCosts().convertedManaCost() + spellAbility.getManaCostsToPay().getX() * xMultiplier;
}
for (SpellAbility spellAbility : spellAbilities) {
cmc += spellAbility.getConvertedManaCost();
}
if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) {
cmc += getCard().getManaCost().convertedManaCost();