ComputerUtil: fixed chooseSomeType

PlayerControllerAi & MessageUtil: fixed output for chooseType
This commit is contained in:
Hanmac
2016-08-04 13:49:12 +00:00
parent c802512ffd
commit be9f6c8ef2
3 changed files with 7 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import forge.ai.ability.ProtectAi;
@@ -1748,7 +1749,7 @@ public class ComputerUtil {
}
} else if (kindOfType.equals("Creature")) {
if (logic != null) {
List <String> valid = CardType.getAllCreatureTypes();
List <String> valid = Lists.newArrayList(CardType.getAllCreatureTypes());
valid.removeAll(invalidTypes);
if (logic.equals("MostProminentOnBattlefield")) {
@@ -1780,7 +1781,7 @@ public class ComputerUtil {
if (logic != null) {
if (logic.equals("MostProminentOppControls")) {
CardCollection list = CardLists.filterControlledBy(game.getCardsIn(ZoneType.Battlefield), ai.getOpponents());
List<String> valid = CardType.getBasicTypes();
List<String> valid = Lists.newArrayList(CardType.getBasicTypes());
valid.removeAll(invalidTypes);
chosen = ComputerUtilCard.getMostProminentType(list, valid);

View File

@@ -353,7 +353,7 @@ public class PlayerControllerAi extends PlayerController {
chosen = validTypes.get(0);
Log.warn("AI has no idea how to choose " + kindOfType +", defaulting to 1st element: chosen");
}
game.getAction().nofityOfValue(sa, null, "Computer picked: " + chosen, player);
game.getAction().nofityOfValue(sa, player, chosen, player);
return chosen;
}