mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Don't use damage chaining for simulated AI.
This commit is contained in:
@@ -93,6 +93,9 @@ public class AiController {
|
||||
this.cheatShuffle = canCheatShuffle;
|
||||
}
|
||||
|
||||
public boolean usesSimulation() {
|
||||
return this.useSimulation;
|
||||
}
|
||||
public void setUseSimulation(boolean value) {
|
||||
this.useSimulation = value;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user