* Fixed a bug that the AI did for target selection not check correctly players with hexproof ability.

This commit is contained in:
LevelX2 2015-05-02 09:47:38 +02:00
parent 503dad24b3
commit 8686f4f777
10 changed files with 48 additions and 29 deletions

View file

@ -432,24 +432,24 @@ public class ComputerPlayer extends PlayerImpl implements Player {
UUID opponentId = game.getOpponents(playerId).iterator().next();
if (target instanceof TargetPlayer) {
if (outcome.isGood()) {
if (target.canTarget(playerId, source, game)) {
if (target.canTarget(playerId, playerId, source, game)) {
target.addTarget(playerId, source, game);
return true;
}
if (target.isRequired(source)) {
if (target.canTarget(opponentId, source, game)) {
if (target.canTarget(playerId, opponentId, source, game)) {
target.addTarget(opponentId, source, game);
return true;
}
}
}
else {
if (target.canTarget(opponentId, source, game)) {
if (target.canTarget(playerId, opponentId, source, game)) {
target.addTarget(opponentId, source, game);
return true;
}
if (target.isRequired(source)) {
if (target.canTarget(playerId, source, game)) {
if (target.canTarget(playerId, playerId, source, game)) {
target.addTarget(playerId, source, game);
return true;
}