- CNS: Added Brago's Representative

This commit is contained in:
swordshine
2014-05-19 06:00:43 +00:00
parent 9e2faccccd
commit 933488f9e9
7 changed files with 88 additions and 23 deletions

View File

@@ -1810,7 +1810,19 @@ public class ComputerUtil {
return chosen;
}
public static String vote(Player ai, List<String> options, String logic) {
if (logic == null) {
return Aggregates.random(options);
} else {
switch (logic) {
case "GraceOrCondemnation":
return ai.getCreaturesInPlay().size() > ai.getOpponent().getCreaturesInPlay().size() ? "Grace" : "Condemnation";
default: return Iterables.getFirst(options, null);
}
}
}
public static List<Card> getSafeTargets(final Player ai, SpellAbility sa, List<Card> validCards) {
List<Card> safeCards = new ArrayList<Card>(validCards);
safeCards = CardLists.filter(safeCards, new Predicate<Card>() {
@@ -1935,4 +1947,5 @@ public class ComputerUtil {
return bestBoardPosition;
}
}

View File

@@ -367,6 +367,12 @@ public class PlayerControllerAi extends PlayerController {
return chosen;
}
@Override
public String vote(SpellAbility sa, String prompt, List<String> options) {
String result = ComputerUtil.vote(player, options, sa.getParam("AILogic"));
return result;
}
/* (non-Javadoc)
* @see forge.game.player.PlayerController#confirmReplacementEffect(forge.card.replacement.ReplacementEffect, forge.card.spellability.SpellAbility, java.lang.String)
*/