- Minor update to EffectAI to prevent negative "fight" logic from falling through to the random return in canPlayAI(). Prevent Polukranos activation from targeting shielded or creatures that can regenerate.

This commit is contained in:
excessum
2014-04-18 03:15:27 +00:00
parent d8646997b0
commit d1609866ff
2 changed files with 4 additions and 1 deletions

View File

@@ -260,7 +260,8 @@ public class DamageDealAi extends DamageAiBase {
continue; continue;
} }
final int assignedDamage = ComputerUtilCombat.getEnoughDamageToKill(humanCreature, dmg, source, false, noPrevention); final int assignedDamage = ComputerUtilCombat.getEnoughDamageToKill(humanCreature, dmg, source, false, noPrevention);
if (assignedDamage <= dmg) { if (assignedDamage <= dmg
&& humanCreature.getShield().isEmpty() && !ComputerUtil.canRegenerate(humanCreature.getController(), humanCreature)) {
tcs.add(humanCreature); tcs.add(humanCreature);
tgt.addDividedAllocation(humanCreature, assignedDamage); tgt.addDividedAllocation(humanCreature, assignedDamage);
lastTgt = humanCreature; lastTgt = humanCreature;

View File

@@ -166,6 +166,8 @@ public class EffectAi extends SpellAbilityAi {
tgtFight.getTargets().add(aiCreature); tgtFight.getTargets().add(aiCreature);
sa.getTargets().add(humanCreature); sa.getTargets().add(humanCreature);
return true; return true;
} else {
return false;
} }
} }
} }