- Switching Pestilence AI to be more generic and use AILogic$ DmgAllCreaturesAndPlayers

This commit is contained in:
Agetian
2017-07-13 06:09:07 +00:00
parent c6ddc9f8dd
commit 05fe27afa6
2 changed files with 3 additions and 5 deletions

View File

@@ -119,7 +119,7 @@ public class DamageAllAi extends SpellAbilityAi {
if (ComputerUtilCombat.predictDamageTo(opp, dmg, source, false) > 0) {
// When using Pestilence to hurt players, do it at
// the end of the opponent's turn only
if ((!source.getName().equals("Pestilence"))
if ((!"DmgAllCreaturesAndPlayers".equals(sa.getParam("AILogic")))
|| ((ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN)
&& (ai.getGame().getNonactivePlayers().contains(ai)))))
// Need further improvement : if able to kill immediately with repeated activations, do not wait
@@ -130,9 +130,7 @@ public class DamageAllAi extends SpellAbilityAi {
if (ComputerUtilCombat.predictDamageTo(ai, dmg, source, false)<1) {
return 1;
}
// enemy is expected to die faster than AI from
// damage
// if repeated
// enemy is expected to die faster than AI from damage if repeated
if (ai.getLife() > ComputerUtilCombat.predictDamageTo(ai, dmg, source, false)
* ((opp.getLife() + ComputerUtilCombat.predictDamageTo(opp, dmg, source, false) - 1)
/ ComputerUtilCombat.predictDamageTo(opp, dmg, source, false))) {