GUI: fixed broken add lands and random deck dialogs in deck editor (#7562);

This commit is contained in:
Oleg Agafonov 2021-02-13 20:26:06 +04:00
parent e94fd1b456
commit eb64a7bb73
7 changed files with 34 additions and 20 deletions

View file

@ -191,7 +191,7 @@ public final class DeckGenerator {
while (count < spellCount) {
Card card = cardPool.get(RandomUtil.nextInt(retrievedCount)).getMockCard();
if (genPool.isValidSpellCard(card)) {
int cardCMC = card.getManaCost().convertedManaCost();
int cardCMC = card.getConvertedManaCost();
for (DeckGeneratorCMC.CMC deckCMC : deckCMCs) {
if (cardCMC >= deckCMC.min && cardCMC <= deckCMC.max) {
int currentAmount = deckCMC.getAmount();

View file

@ -473,12 +473,13 @@ public class AddLandDialog extends MageDialog {
land_number = 0;
}
for (Card cd : cards) {
Mana m = cd.getManaCost().getMana();
red += m.getRed();
green += m.getGreen();
black += m.getBlack();
blue += m.getBlue();
white += m.getWhite();
for (String s : cd.getManaCostSymbols()) {
if (s.contains("W")) white++;
if (s.contains("U")) blue++;
if (s.contains("B")) black++;
if (s.contains("R")) red++;
if (s.contains("G")) green++;
}
}
int total = red + green + black + blue + white;