- Making Energy actually a counter instead of it's own Player attribute. This should enable it to be displayed when hovering over the Player image.

This commit is contained in:
Sol
2016-09-03 02:32:49 +00:00
parent da81ed5130
commit b51ab053db
3 changed files with 15 additions and 20 deletions

View File

@@ -566,15 +566,15 @@ public class HumanCostDecision extends CostDecisionMakerBase {
@Override
public PaymentDecision visit(final CostPayEnergy cost) {
final String amount = cost.getAmount();
final int life = player.getLife();
final int energy = player.getCounters(CounterType.ENERGY);
Integer c = cost.convertAmount();
if (c == null) {
final String sVar = ability.getSVar(amount);
// Generalize this
if (sVar.startsWith("XChoice")) {
int limit = life;
final int maxLifePayment = limit < life ? limit : life;
int limit = energy;
final int maxLifePayment = limit < energy ? limit : energy;
c = chooseXValue(maxLifePayment);
} else {
c = AbilityUtils.calculateAmount(source, amount, ability);