- Reorganized PayEnergyConservatively as an if-else chain.

This commit is contained in:
Agetian
2017-06-16 12:40:59 +00:00
parent b8fcd43918
commit 13d29814c4

View File

@@ -225,15 +225,13 @@ public class CountersPutAi extends SpellAbilityAi {
if (playAggro) { if (playAggro) {
// aggro profiles ignore conservative play for this AI logic // aggro profiles ignore conservative play for this AI logic
return true; return true;
} } else if (ai.getCounters(CounterType.ENERGY) > ComputerUtilCard.getMaxSAEnergyCostOnBattlefield(ai) + sa.getPayCosts().getCostEnergy().convertAmount()) {
if (ai.getGame().getCombat() != null && sa.getHostCard() != null) { return true;
} else if (ai.getGame().getCombat() != null && sa.getHostCard() != null) {
if (ai.getGame().getCombat().isAttacking(sa.getHostCard())) { if (ai.getGame().getCombat().isAttacking(sa.getHostCard())) {
return true; return true;
} }
} }
if (ai.getCounters(CounterType.ENERGY) > ComputerUtilCard.getMaxSAEnergyCostOnBattlefield(ai) + sa.getPayCosts().getCostEnergy().convertAmount()) {
return true;
}
} }
if (sa.getConditions() != null && !sa.getConditions().areMet(sa) && sa.getSubAbility() == null) { if (sa.getConditions() != null && !sa.getConditions().areMet(sa) && sa.getSubAbility() == null) {