- The AI will no longer use gain life abilities if the amount is zero or less.

This commit is contained in:
jendave
2011-08-06 20:05:18 +00:00
parent 414197706b
commit f64b39ab74

View File

@@ -143,10 +143,15 @@ public class AbilityFactory_AlterLife {
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
Random r = new Random();
HashMap<String,String> params = af.getMapParams();
Ability_Cost abCost = sa.getPayCosts();
final Card source = sa.getSourceCard();
int life = AllZone.ComputerPlayer.getLife();
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
String amountStr = af.getMapParams().get("LifeAmount");
//don't use it if no life to gain
if (lifeAmount <= 0) return false;
if (abCost != null){
// AI currently disabled for these costs