- Adding Energy and PayEnergy for Players (still needs UI updates)

This commit is contained in:
Sol
2016-09-03 01:15:05 +00:00
parent b529cfa5a2
commit 4e36fdc2b3
6 changed files with 178 additions and 28 deletions

View File

@@ -316,6 +316,24 @@ public class AiCostDecision extends CostDecisionMakerBase {
return PaymentDecision.number(c);
}
@Override
public PaymentDecision visit(CostPayEnergy cost) {
Integer c = cost.convertAmount();
if (c == null) {
final String sVar = ability.getSVar(cost.getAmount());
// Generalize cost
if (sVar.equals("XChoice")) {
return null;
} else {
c = AbilityUtils.calculateAmount(source, cost.getAmount(), ability);
}
}
if (!player.canPayEnergy(c)) {
return null;
}
return PaymentDecision.number(c);
}
@Override
public PaymentDecision visit(CostPutCardToLib cost) {