forked from External/mage
fixes + optimizations + allow games to be paused and resumed
This commit is contained in:
parent
8fd03a5bb5
commit
7c69bc6f30
44 changed files with 430 additions and 331 deletions
|
|
@ -135,16 +135,18 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
|||
*/
|
||||
private void updateOptionalCosts() {
|
||||
Ability abilityOrig = card.getAbilities().get(ability.getId());
|
||||
for (Object object : ability.getOptionalCosts()) {
|
||||
Cost cost = (Cost) object;
|
||||
for (Cost costOrig : abilityOrig.getOptionalCosts()) {
|
||||
if (cost.getId().equals(costOrig.getId())) {
|
||||
if (cost.isPaid()) {
|
||||
costOrig.setPaid();
|
||||
} else {
|
||||
costOrig.clearPaid();
|
||||
if (abilityOrig != null) {
|
||||
for (Object object : ability.getOptionalCosts()) {
|
||||
Cost cost = (Cost) object;
|
||||
for (Cost costOrig : abilityOrig.getOptionalCosts()) {
|
||||
if (cost.getId().equals(costOrig.getId())) {
|
||||
if (cost.isPaid()) {
|
||||
costOrig.setPaid();
|
||||
} else {
|
||||
costOrig.clearPaid();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue