- Improved LifeGainAI.

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

View File

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