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