- Experimental: attempting to improve the AI choice for all-in assault for battlefield situations where the defender will have several, but not enough, defenders with evasion (e.g. Flying).

- Currently only enabled for the Experimental AI profile for the testing period.
This commit is contained in:
Agetian
2017-08-21 17:07:46 +00:00
parent a0f640c739
commit 92b985d24d
7 changed files with 86 additions and 3 deletions

View File

@@ -424,10 +424,21 @@ public class AiAttackController {
final Player opp = this.defendingOpponent;
CardCollection accountedBlockers = new CardCollection(this.blockers);
for (Card attacker : attackers) {
if (!CombatUtil.canBeBlocked(attacker, this.blockers, null)
if (!CombatUtil.canBeBlocked(attacker, accountedBlockers, null)
|| attacker.hasKeyword("You may have CARDNAME assign its combat damage as though it weren't blocked.")) {
unblockedAttackers.add(attacker);
} else {
if (ai.getController().isAI()) {
AiController aic = ((PlayerControllerAi)ai.getController()).getAi();
if (aic.getBooleanProperty(AiProps.COMBAT_ASSAULT_ATTACK_EVASION_PREDICTION)) {
// Attempt to identify which blockers will already be taken (blocking other things),
// such that Flying, Shadow, Reach, and other mechanics can be properly accounted for.
List<Card> potentialBestBlockers = CombatUtil.getPotentialBestBlockers(attacker, accountedBlockers, null);
accountedBlockers.removeAll(potentialBestBlockers);
}
}
}
}

View File

@@ -53,7 +53,8 @@ public enum AiProps { /** */
STRIPMINE_HIGH_PRIORITY_ON_SKIPPED_LANDDROP ("false"),
TOKEN_GENERATION_ABILITY_CHANCE ("100"), /** */
TOKEN_GENERATION_ALWAYS_IF_FROM_PLANESWALKER ("true"), /** */
TOKEN_GENERATION_ALWAYS_IF_OPP_ATTACKS ("true"); /** */
TOKEN_GENERATION_ALWAYS_IF_OPP_ATTACKS ("true"),
COMBAT_ASSAULT_ATTACK_EVASION_PREDICTION ("false"); /** */
private final String strDefaultVal;