mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
* Small fix to ManaOptions.
This commit is contained in:
parent
b4636b2ce1
commit
4f6fb64811
1 changed files with 4 additions and 4 deletions
|
@ -225,15 +225,15 @@ public class ManaOptions extends ArrayList<Mana> {
|
||||||
if (isEmpty()) {
|
if (isEmpty()) {
|
||||||
this.add(new Mana());
|
this.add(new Mana());
|
||||||
}
|
}
|
||||||
boolean addAny = false;
|
boolean repeatable = false;
|
||||||
if (addMana.getAny() == 1 && addMana.count() == 1) {
|
if (addMana.getAny() == 1 && addMana.count() == 1 && onlyManaCosts) {
|
||||||
addAny = true; // only replace to any will be repeated
|
repeatable = true; // only replace to any with mana costs only will be repeated if able
|
||||||
}
|
}
|
||||||
for (Mana mana: this) {
|
for (Mana mana: this) {
|
||||||
while (mana.includesMana(cost)) {
|
while (mana.includesMana(cost)) {
|
||||||
mana.subtract(cost);
|
mana.subtract(cost);
|
||||||
mana.add(addMana);
|
mana.add(addMana);
|
||||||
if (!addAny) {
|
if (!repeatable) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue