This commit is contained in:
TRT
2021-11-30 15:33:48 +01:00
parent f2776fc9fd
commit 32be6ce9a8
4 changed files with 3 additions and 6 deletions

View File

@@ -69,7 +69,6 @@ public class UntapAi extends SpellAbilityAi {
} else {
return untapPrefTargeting(ai, sa, false);
}
}
@Override

View File

@@ -7,7 +7,6 @@ import java.util.List;
import java.util.Set;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilCost;
import forge.ai.PlayerControllerAi;
import forge.ai.simulation.GameStateEvaluator.Score;
import forge.game.Game;

View File

@@ -97,7 +97,7 @@ public class GameStateEvaluator {
}
debugPrint("My cards in hand: " + myCards);
debugPrint("Their cards in hand: " + theirCards);
if (myCards > aiPlayer.getMaxHandSize()) {
if (!aiPlayer.isUnlimitedHandSize() && myCards > aiPlayer.getMaxHandSize()) {
// Count excess cards for less.
score += myCards - aiPlayer.getMaxHandSize();
myCards = aiPlayer.getMaxHandSize();
@@ -107,12 +107,10 @@ public class GameStateEvaluator {
score += 2 * aiPlayer.getLife();
int opponentIndex = 1;
int opponentLife = 0;
for (Player opponent : game.getPlayers()) {
if (opponent != aiPlayer) {
for (Player opponent : aiPlayer.getOpponents()) {
debugPrint(" Opponent " + opponentIndex + " life: -" + opponent.getLife());
opponentLife += opponent.getLife();
opponentIndex++;
}
}
score -= 2* opponentLife / (game.getPlayers().size() - 1);
int summonSickScore = score;

View File

@@ -167,6 +167,7 @@ public class PossibleTargetSelector {
private void selectTargetsByIndexImpl(int index) {
targetingSa.resetTargets();
// TODO this currently checks from max amount to just one but it doesn't check all combinations
while (targetingSa.getTargets().size() < maxTargets && index < validTargets.size()) {
targetingSa.getTargets().add(validTargets.get(index++));
}