mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added a default logic to ProtectionEffect AI.
This commit is contained in:
@@ -113,19 +113,17 @@ public class ProtectEffect extends SpellAbilityEffect {
|
|||||||
} else {
|
} else {
|
||||||
Player ai = sa.getActivatingPlayer();
|
Player ai = sa.getActivatingPlayer();
|
||||||
String choice = choices.get(0);
|
String choice = choices.get(0);
|
||||||
if (sa.hasParam("AILogic")) {
|
final String logic = sa.getParam("AILogic");
|
||||||
final String logic = sa.getParam("AILogic");
|
if (logic == null || logic.equals("MostProminentHumanCreatures")) {
|
||||||
if (logic.equals("MostProminentHumanCreatures")) {
|
List<Card> list = new ArrayList<Card>();
|
||||||
List<Card> list = new ArrayList<Card>();
|
for (Player opp : ai.getOpponents()) {
|
||||||
for (Player opp : ai.getOpponents()) {
|
list.addAll(opp.getCreaturesInPlay());
|
||||||
list.addAll(opp.getCreaturesInPlay());
|
}
|
||||||
}
|
if (list.isEmpty()) {
|
||||||
if (list.isEmpty()) {
|
list = CardLists.filterControlledBy(game.getCardsInGame(), ai.getOpponents());
|
||||||
list = CardLists.filterControlledBy(game.getCardsInGame(), ai.getOpponents());
|
}
|
||||||
}
|
if (!list.isEmpty()) {
|
||||||
if (!list.isEmpty()) {
|
choice = ComputerUtilCard.getMostProminentColor(list);
|
||||||
choice = ComputerUtilCard.getMostProminentColor(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gains.add(choice);
|
gains.add(choice);
|
||||||
|
|||||||
Reference in New Issue
Block a user