mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Choice of Damnations - improved AI support, fixed rollback error in AI games;
* Pain's Reward - improved AI support, fixed rollback error in AI games; * Volcano Hellion - improved AI support, fixed rollback error in AI games;
This commit is contained in:
parent
ac98a3a31a
commit
f692a1f097
5 changed files with 79 additions and 35 deletions
|
|
@ -50,10 +50,7 @@ import mage.players.net.UserData;
|
|||
import mage.players.net.UserGroup;
|
||||
import mage.target.*;
|
||||
import mage.target.common.*;
|
||||
import mage.util.Copier;
|
||||
import mage.util.RandomUtil;
|
||||
import mage.util.TournamentUtil;
|
||||
import mage.util.TreeNode;
|
||||
import mage.util.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1666,8 +1663,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
@Override
|
||||
public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variablCost) {
|
||||
log.debug("announceXCost");
|
||||
//TODO: improve this
|
||||
int value = RandomUtil.nextInt(max + 1);
|
||||
int value = RandomUtil.nextInt(CardUtil.overflowInc(max, 1));
|
||||
if (value < min) {
|
||||
value = min;
|
||||
}
|
||||
|
|
@ -1964,9 +1960,8 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
if (message.startsWith("Assign damage to ")) {
|
||||
return min;
|
||||
}
|
||||
//TODO: improve this
|
||||
if (min < max && min == 0) {
|
||||
return RandomUtil.nextInt(max + 1);
|
||||
return RandomUtil.nextInt(CardUtil.overflowInc(max, 1));
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue