mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Fixed "human can kill" test in DestroyAllAi.
This commit is contained in:
@@ -114,6 +114,10 @@ public class DestroyAllAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (humanlist.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// if only creatures are affected evaluate both lists and pass only if
|
// if only creatures are affected evaluate both lists and pass only if
|
||||||
// human creatures are more valuable
|
// human creatures are more valuable
|
||||||
if (CardLists.getNotType(humanlist, "Creature").isEmpty() && CardLists.getNotType(computerlist, "Creature").isEmpty()) {
|
if (CardLists.getNotType(humanlist, "Creature").isEmpty() && CardLists.getNotType(computerlist, "Creature").isEmpty()) {
|
||||||
@@ -127,8 +131,15 @@ public class DestroyAllAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
// test whether the human can kill the ai next turn
|
// test whether the human can kill the ai next turn
|
||||||
Combat combat = new Combat(ai.getOpponent());
|
Combat combat = new Combat(ai.getOpponent());
|
||||||
|
boolean containsAttacker = false;
|
||||||
for (Card att : ai.getOpponent().getCreaturesInPlay()) {
|
for (Card att : ai.getOpponent().getCreaturesInPlay()) {
|
||||||
combat.addAttacker(att, ai);
|
if (ComputerUtilCombat.canAttackNextTurn(att, ai)) {
|
||||||
|
combat.addAttacker(att, ai);
|
||||||
|
containsAttacker = containsAttacker | humanlist.contains(att);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!containsAttacker) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
AiBlockController block = new AiBlockController(ai);
|
AiBlockController block = new AiBlockController(ai);
|
||||||
block.assignBlockersForCombat(combat);
|
block.assignBlockersForCombat(combat);
|
||||||
@@ -146,8 +157,7 @@ public class DestroyAllAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} // otherwise evaluate both lists by CMC and pass only if human permanents are more valuable
|
} // otherwise evaluate both lists by CMC and pass only if human permanents are more valuable
|
||||||
else if ((ComputerUtilCard.evaluatePermanentList(computerlist) + 3) >= ComputerUtilCard
|
else if ((ComputerUtilCard.evaluatePermanentList(computerlist) + 3) >= ComputerUtilCard.evaluatePermanentList(humanlist)) {
|
||||||
.evaluatePermanentList(humanlist)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user