mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
* Fixed a bug of cost reduction calculation.
This commit is contained in:
parent
a8f855608e
commit
0b832c9b11
1 changed files with 2 additions and 1 deletions
|
@ -225,10 +225,11 @@ public class CardUtil {
|
||||||
for (ManaCost manaCost : manaCosts) {
|
for (ManaCost manaCost : manaCosts) {
|
||||||
Mana mana = manaCost.getOptions().get(0);
|
Mana mana = manaCost.getOptions().get(0);
|
||||||
int colorless = mana != null ? mana.getColorless() : 0;
|
int colorless = mana != null ? mana.getColorless() : 0;
|
||||||
if (!updated && restToReduce != 0 && colorless > 0) {
|
if (restToReduce != 0 && colorless > 0) {
|
||||||
if ((colorless - restToReduce) > 0) {
|
if ((colorless - restToReduce) > 0) {
|
||||||
int newColorless = colorless - restToReduce;
|
int newColorless = colorless - restToReduce;
|
||||||
adjustedCost.add(new GenericManaCost(newColorless));
|
adjustedCost.add(new GenericManaCost(newColorless));
|
||||||
|
restToReduce = 0;
|
||||||
} else {
|
} else {
|
||||||
restToReduce -= colorless;
|
restToReduce -= colorless;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue