mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
Fixed a bug of computer player handling TargetCreatureOrPlayerAmount.
This commit is contained in:
parent
edd1563c12
commit
d46b4a7248
1 changed files with 12 additions and 1 deletions
|
@ -692,7 +692,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
UUID opponentId = game.getOpponents(playerId).iterator().next();
|
||||
if (target instanceof TargetCreatureOrPlayerAmount) {
|
||||
if (game.getPlayer(opponentId).getLife() <= target.getAmountRemaining()) {
|
||||
if (outcome.equals(Outcome.Damage) && game.getPlayer(opponentId).getLife() <= target.getAmountRemaining()) {
|
||||
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
||||
return true;
|
||||
}
|
||||
|
@ -711,6 +711,17 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (outcome.isGood() && target.canTarget(playerId, playerId, source, game)) {
|
||||
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
||||
return true;
|
||||
} else if (target.canTarget(playerId, opponentId, source, game)){
|
||||
// no permanent target so take opponent
|
||||
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
||||
return true;
|
||||
} else if (target.canTarget(playerId, playerId, source, game)) {
|
||||
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue