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 { } else {
return untapPrefTargeting(ai, sa, false); return untapPrefTargeting(ai, sa, false);
} }
} }
@Override @Override

View File

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

View File

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

View File

@@ -167,6 +167,7 @@ public class PossibleTargetSelector {
private void selectTargetsByIndexImpl(int index) { private void selectTargetsByIndexImpl(int index) {
targetingSa.resetTargets(); 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()) { while (targetingSa.getTargets().size() < maxTargets && index < validTargets.size()) {
targetingSa.getTargets().add(validTargets.get(index++)); targetingSa.getTargets().add(validTargets.get(index++));
} }