- Improved LifeGainAI.

This commit is contained in:
Sloth
2015-10-04 08:56:37 +00:00
parent 4f438a7bc9
commit 3b7935d868

View File

@@ -128,17 +128,20 @@ public class LifeGainAi extends SpellAbilityAi {
return false; return false;
} }
} }
if (SpellAbilityAi.isSorcerySpeed(sa)
|| sa.getSubAbility() != null
|| SpellAbilityAi.playReusable(ai, sa)) {
return true;
}
// Save instant-speed life-gain unless it is really worth it // Save instant-speed life-gain unless it is really worth it
if (!SpellAbilityAi.isSorcerySpeed(sa)) {
final float value = 0.9f * lifeAmount / life; final float value = 0.9f * lifeAmount / life;
if (value < 0.2f) { if (value < 0.2f) {
return false; return false;
} else { }
return MyRandom.getRandom().nextFloat() < value; return MyRandom.getRandom().nextFloat() < value;
} }
}
return true;
}
/** /**