mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Little fixes
This commit is contained in:
parent
11f5ae5b59
commit
c02069114d
2 changed files with 31 additions and 31 deletions
|
|
@ -480,19 +480,32 @@ public class AddLandDialog extends MageDialog {
|
|||
white += m.getWhite();
|
||||
}
|
||||
int total = red + green + black + blue + white;
|
||||
int redcards = Math.round(land_number * ((float) red / (float) total));
|
||||
total -= red;
|
||||
land_number -= redcards;
|
||||
int greencards = Math.round(land_number * ((float) green / (float) total));
|
||||
total -= green;
|
||||
land_number -= greencards;
|
||||
int blackcards = Math.round(land_number * ((float) black / (float) total));
|
||||
total -= black;
|
||||
land_number -= blackcards;
|
||||
int bluecards = Math.round(land_number * ((float) blue / (float) total));
|
||||
total -= blue;
|
||||
land_number -= bluecards;
|
||||
int whitecards = land_number;
|
||||
|
||||
int redcards = 0;
|
||||
int greencards = 0;
|
||||
int blackcards = 0;
|
||||
int bluecards = 0;
|
||||
int whitecards = 0;
|
||||
if (total > 0) {
|
||||
redcards = Math.round(land_number * ((float) red / (float) total));
|
||||
total -= red;
|
||||
land_number -= redcards;
|
||||
|
||||
greencards = Math.round(land_number * ((float) green / (float) total));
|
||||
total -= green;
|
||||
land_number -= greencards;
|
||||
|
||||
blackcards = Math.round(land_number * ((float) black / (float) total));
|
||||
total -= black;
|
||||
land_number -= blackcards;
|
||||
|
||||
bluecards = Math.round(land_number * ((float) blue / (float) total));
|
||||
total -= blue;
|
||||
land_number -= bluecards;
|
||||
|
||||
whitecards = land_number;
|
||||
}
|
||||
|
||||
spnMountain.setValue(redcards);
|
||||
spnForest.setValue(greencards);
|
||||
spnSwamp.setValue(blackcards);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue