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 #4906
This commit is contained in:
parent
de9042dafe
commit
b0d1f86890
1 changed files with 11 additions and 4 deletions
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue