- 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

@@ -5,7 +5,6 @@ Text:no text
A:SP$ LoseLife | Cost$ X B B | Defined$ Opponent | LifeAmount$ X | SubAbility$ SVar=DBGainLife | SpellDescription$ Each opponent loses X life. You gain life equal to the life lost this way.
SVar:DBGainLife:DB$GainLife | Defined$ You | LifeAmount$ X
SVar:X:Count$xPaid
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/exsanguinate.jpg
SetInfo:SOM|Uncommon|http://magiccards.info/scans/en/som/61.jpg

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;