- Don't use damage chaining for simulated AI.

This commit is contained in:
Agetian
2018-12-12 12:43:21 +03:00
parent 709e04d9ad
commit 7b6ad78ba2
2 changed files with 8 additions and 0 deletions

View File

@@ -93,6 +93,9 @@ public class AiController {
this.cheatShuffle = canCheatShuffle;
}
public boolean usesSimulation() {
return this.useSimulation;
}
public void setUseSimulation(boolean value) {
this.useSimulation = value;
}

View File

@@ -1017,6 +1017,11 @@ public class DamageDealAi extends DamageAiBase {
Game game = ai.getGame();
int chance = ((PlayerControllerAi)ai.getController()).getAi().getIntProperty(AiProps.CHANCE_TO_CHAIN_TWO_DAMAGE_SPELLS);
if (((PlayerControllerAi)ai.getController()).getAi().usesSimulation()) {
// simulated AI shouldn't use paired decisions, it tries to find complex decisions on its own
return null;
}
if (chance > 0 && (ComputerUtilCombat.lifeInDanger(ai, game.getCombat()) || ComputerUtil.aiLifeInDanger(ai, true, 0))) {
chance = 100; // in danger, do it even if normally the chance is low (unless chaining is completely disabled)
}