mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix color choice
This commit is contained in:
@@ -8,7 +8,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import forge.card.mana.ManaCost;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -1082,8 +1081,7 @@ public class ComputerUtilCard {
|
||||
//chosen.add(MagicColor.Constant.GREEN);
|
||||
chosen.add(getMostProminentColor(ai.getAllCards(), colorChoices));
|
||||
}
|
||||
//convert to proper case same with the colorChoices..
|
||||
return chosen.stream().map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1)).collect(Collectors.toList());
|
||||
return chosen;
|
||||
}
|
||||
|
||||
public static boolean useRemovalNow(final SpellAbility sa, final Card c, final int dmg, ZoneType destination) {
|
||||
|
||||
@@ -82,14 +82,13 @@ public class ChooseColorEffect extends SpellAbilityEffect {
|
||||
}
|
||||
noNotify = null;
|
||||
} else {
|
||||
colorChoices = colorChoices.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
chosenColors = p.getController().chooseColors(prompt, sa, cntMin, cntMax, colorChoices);
|
||||
chosenColors = chosenColors.stream().map(DeckRecognizer::getColorNameByLocalisedName).collect(Collectors.toList());
|
||||
}
|
||||
if (chosenColors.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
card.setChosenColors(chosenColors);
|
||||
chosenColors = chosenColors.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
p.getGame().getAction().notifyOfValue(sa, p, Lang.joinHomogenous(chosenColors), noNotify);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import forge.util.ImageUtil;
|
||||
@@ -49,6 +50,7 @@ import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckRecognizer;
|
||||
import forge.deck.DeckSection;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameEntity;
|
||||
@@ -1712,8 +1714,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
@Override
|
||||
public List<String> chooseColors(final String message, final SpellAbility sa, final int min, final int max,
|
||||
final List<String> options) {
|
||||
return getGui().getChoices(message, min, max, options);
|
||||
List<String> options) {
|
||||
options = options.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
List<String> choices = getGui().getChoices(message, min, max, options);
|
||||
return choices.stream().map(DeckRecognizer::getColorNameByLocalisedName).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user