mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Clean up
This commit is contained in:
@@ -69,7 +69,6 @@ public class UntapAi extends SpellAbilityAi {
|
||||
} else {
|
||||
return untapPrefTargeting(ai, sa, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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++));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user