- Better tweak for Exalted AI.

This commit is contained in:
Sloth
2012-07-31 11:02:24 +00:00
parent 9933e67c0e
commit b34872b6af

View File

@@ -547,7 +547,7 @@ public class ComputerUtilAttack {
if (exalted) { if (exalted) {
CardListUtil.sortAttack(this.attackers); CardListUtil.sortAttack(this.attackers);
System.out.println("Exalted"); System.out.println("Exalted");
this.aiAggression = 2; this.aiAggression = 6;
for (Card attacker : this.attackers) { for (Card attacker : this.attackers) {
if (CombatUtil.canAttack(attacker, combat) && this.shouldAttack(attacker, this.blockers, combat)) { if (CombatUtil.canAttack(attacker, combat) && this.shouldAttack(attacker, this.blockers, combat)) {
combat.addAttacker(attacker); combat.addAttacker(attacker);
@@ -912,6 +912,12 @@ public class ComputerUtilAttack {
// decide if the creature should attack based on the prevailing strategy // decide if the creature should attack based on the prevailing strategy
// choice in aiAggression // choice in aiAggression
switch (this.aiAggression) { switch (this.aiAggression) {
case 6: // Exalted: expecting to at least kill a creature of equal value or not be blocked
if ((canKillAll && isWorthLessThanAllKillers) || !canBeBlocked) {
System.out.println(attacker.getName() + " = attacking expecting to kill creature, or is unblockable");
return true;
}
break;
case 5: // all out attacking case 5: // all out attacking
System.out.println(attacker.getName() + " = all out attacking"); System.out.println(attacker.getName() + " = all out attacking");
return true; return true;
@@ -920,6 +926,7 @@ public class ComputerUtilAttack {
System.out.println(attacker.getName() + " = attacking expecting to at least trade with something"); System.out.println(attacker.getName() + " = attacking expecting to at least trade with something");
return true; return true;
} }
break;
case 3: // expecting to at least kill a creature of equal value, not be case 3: // expecting to at least kill a creature of equal value, not be
// blocked // blocked
if ((canKillAll && isWorthLessThanAllKillers) || (canKillAllDangerous && !canBeKilledByOne) if ((canKillAll && isWorthLessThanAllKillers) || (canKillAllDangerous && !canBeKilledByOne)
@@ -928,17 +935,20 @@ public class ComputerUtilAttack {
+ " = attacking expecting to kill creature or cause damage, or is unblockable"); + " = attacking expecting to kill creature or cause damage, or is unblockable");
return true; return true;
} }
break;
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 || hasAttackEffect) && !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;
} }
break;
case 1: // unblockable creatures only case 1: // unblockable creatures only
if (!canBeBlocked) { if (!canBeBlocked) {
System.out.println(attacker.getName() + " = attacking expecting not to be blocked"); System.out.println(attacker.getName() + " = attacking expecting not to be blocked");
return true; return true;
} }
break;
default: default:
break; break;
} }