1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-26 17:00:08 -09:00

Changes to try and better handle X mana costs with minimum X values with AI decisions

This commit is contained in:
Michael Simons 2018-06-03 22:50:56 -04:00
parent de9042dafe
commit b0d1f86890

View file

@ -1472,18 +1472,25 @@ public class ComputerPlayer extends PlayerImpl implements Player {
int numAvailable = getAvailableManaProducers(game).size() - ability.getManaCosts().convertedManaCost();
if (numAvailable < 0) {
numAvailable = 0;
}
if (numAvailable > max) {
numAvailable = max;
} else {
if (numAvailable < min) {
numAvailable = min;
}
if (numAvailable > max) {
numAvailable = max;
}
}
return numAvailable;
}
@Override
public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variablCost) {
log.debug("announceXMana");
log.debug("announceXCost");
//TODO: improve this
int value = RandomUtil.nextInt(max + 1);
if (value < min) {
value = min;
}
if (value < max) {
value++;
}