- The AI will no longer use AF LoseLife abilities with X=0.

This commit is contained in:
Sloth
2011-11-24 11:23:52 +00:00
parent 4f20a1c8f7
commit 7c32e1f750
2 changed files with 11 additions and 8 deletions

View File

@@ -608,7 +608,17 @@ public class AbilityFactoryAlterLife {
// TODO handle proper calculation of X values based on Cost and what
// would be paid
final int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
int amount = AbilityFactory.calculateAmount(af.getHostCard(), amountStr, sa);
if (amountStr.equals("X") && source.getSVar(amountStr).equals("Count$xPaid")) {
// Set PayX here to maximum value.
amount = ComputerUtil.determineLeftoverMana(sa);
source.setSVar("PayX", Integer.toString(amount));
}
if (amount <= 0) {
return false;
}
if (abCost != null) {
// AI currently disabled for these costs
@@ -657,12 +667,6 @@ public class AbilityFactoryAlterLife {
sa.getTarget().addTarget(AllZone.getHumanPlayer());
}
if (amountStr.equals("X") && source.getSVar(amountStr).equals("Count$xPaid")) {
// Set PayX here to maximum value.
final int xPay = ComputerUtil.determineLeftoverMana(sa);
source.setSVar("PayX", Integer.toString(xPay));
}
boolean randomReturn = r.nextFloat() <= .6667;
if (AbilityFactory.playReusable(sa) || priority) {
randomReturn = true;