mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Fixed a bug that the AI did for target selection not check correctly players with hexproof ability.
This commit is contained in:
parent
503dad24b3
commit
8686f4f777
10 changed files with 48 additions and 29 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue