mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI, game: added source info in "choose number/amount" dialogs, added auto-choose for single possible value (part of #13638);
This commit is contained in:
parent
06242496d7
commit
e320bf241c
83 changed files with 142 additions and 106 deletions
|
|
@ -2368,9 +2368,15 @@ public class ComputerPlayer extends PlayerImpl {
|
|||
|
||||
@Override
|
||||
// TODO: add AI support with outcome and replace random with min/max
|
||||
public int getAmount(int min, int max, String message, Game game) {
|
||||
public int getAmount(int min, int max, String message, Ability source, Game game) {
|
||||
log.debug("getAmount");
|
||||
if (min < max && min == 0) {
|
||||
|
||||
// fast calc on nothing to choose
|
||||
if (min >= max) {
|
||||
return min;
|
||||
}
|
||||
|
||||
if (min == 0) {
|
||||
return RandomUtil.nextInt(CardUtil.overflowInc(max, 1));
|
||||
}
|
||||
return min;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue