mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- CNS: Added Brago's Representative
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user