- Extended use of the dealsFirstStrikeDamage function.

This commit is contained in:
Sloth
2014-04-06 07:52:22 +00:00
parent ab6d4c933f
commit 331e1ae505
2 changed files with 6 additions and 6 deletions

View File

@@ -285,7 +285,7 @@ public class AiBlockController {
// Try to block an attacker without first strike with a gang of first strikers
for (final Card attacker : attackersLeft) {
if (!attacker.hasKeyword("First Strike") && !attacker.hasKeyword("Double Strike")) {
if (!ComputerUtilCombat.dealsFirstStrikeDamage(attacker, false)) {
blockers = getPossibleBlockers(combat, attacker, blockersLeft, false);
final List<Card> firstStrikeBlockers = new ArrayList<Card>();
final List<Card> blockGang = new ArrayList<Card>();
@@ -341,8 +341,8 @@ public class AiBlockController {
usableBlockers = CardLists.filter(blockers, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
if ((attacker.hasKeyword("First Strike") || attacker.hasKeyword("Double Strike"))
&& !(c.hasKeyword("First Strike") || c.hasKeyword("Double Strike"))) {
if (ComputerUtilCombat.dealsFirstStrikeDamage(attacker, false)
&& !ComputerUtilCombat.dealsFirstStrikeDamage(c, false)) {
return false;
}
return lifeInDanger || (ComputerUtilCard.evaluateCreature(c) + diff) < ComputerUtilCard.evaluateCreature(attacker);
@@ -591,7 +591,7 @@ public class AiBlockController {
// than the attacker
// Don't use blockers without First Strike or Double Strike if
// attacker has it
if (attacker.hasKeyword("First Strike") || attacker.hasKeyword("Double Strike")) {
if (ComputerUtilCombat.dealsFirstStrikeDamage(attacker, false)) {
safeBlockers = CardLists.getKeyword(blockers, "First Strike");
safeBlockers.addAll(CardLists.getKeyword(blockers, "Double Strike"));
} else {

View File

@@ -744,7 +744,7 @@ public class ComputerUtilCombat {
// if the attacker has first strike and wither the blocker will deal
// less damage than expected
if ((attacker.hasKeyword("First Strike") || attacker.hasKeyword("Double Strike"))
if (ComputerUtilCombat.dealsFirstStrikeDamage(attacker, withoutAbilities)
&& (attacker.hasKeyword("Wither") || attacker.hasKeyword("Infect"))
&& !(blocker.hasKeyword("First Strike") || blocker.hasKeyword("Double Strike") || blocker
.hasKeyword("CARDNAME can't have counters placed on it."))) {
@@ -1063,7 +1063,7 @@ public class ComputerUtilCombat {
// if the defender has first strike and wither the attacker will deal
// less damage than expected
if (null != blocker) {
if ((blocker.hasKeyword("First Strike") || blocker.hasKeyword("Double Strike"))
if (ComputerUtilCombat.dealsFirstStrikeDamage(blocker, withoutAbilities)
&& (blocker.hasKeyword("Wither") || blocker.hasKeyword("Infect"))
&& !(attacker.hasKeyword("First Strike") || attacker.hasKeyword("Double Strike") || attacker
.hasKeyword("CARDNAME can't have counters placed on it."))) {