- Added the AI SVar "HasAttackEffect".

This commit is contained in:
Sloth
2012-05-16 10:35:11 +00:00
parent 8f8c2f90e5
commit ad063ae1a3

View File

@@ -782,6 +782,7 @@ public class ComputerUtilAttack {
// wither or infect // wither or infect
boolean isWorthLessThanAllKillers = true; boolean isWorthLessThanAllKillers = true;
boolean canBeBlocked = false; boolean canBeBlocked = false;
boolean hasAttackEffect = attacker.getSVar("HasAttackEffect").equals("TRUE");
int numberOfPossibleBlockers = 0; int numberOfPossibleBlockers = 0;
if (!this.isEffectiveAttacker(attacker, combat)) { if (!this.isEffectiveAttacker(attacker, combat)) {
@@ -855,7 +856,7 @@ public class ComputerUtilAttack {
} }
case 2: // attack expecting to attract a group block or destroying a case 2: // attack expecting to attract a group block or destroying a
// single blocker and surviving // single blocker and surviving
if ((canKillAll && !canBeKilledByOne) || !canBeBlocked) { if (((canKillAll || hasAttackEffect) && !canBeKilledByOne) || !canBeBlocked) {
System.out.println(attacker.getName() + " = attacking expecting to survive or attract group block"); System.out.println(attacker.getName() + " = attacking expecting to survive or attract group block");
return true; return true;
} }