- The AI will no longer clone its own legendary creatures.

This commit is contained in:
Sloth
2012-10-25 21:05:06 +00:00
parent 62e2ec0f36
commit ce4ff71371
9 changed files with 20 additions and 10 deletions

View File

@@ -1877,13 +1877,18 @@ public final class AbilityFactoryChoose {
choices = CardLists.filterControlledBy(choices, ai.getOpponent());
}
if (params.get("AILogic").equals("AtLeast1")) {
if (choices.size() < 1) {
if (choices.isEmpty()) {
return false;
}
} else if (params.get("AILogic").equals("AtLeast2") || params.get("AILogic").equals("BestBlocker")) {
if (choices.size() < 2) {
return false;
}
} else if (params.get("AILogic").equals("Clone")) {
choices = CardLists.getValidCards(choices, "Permanent.YouDontCtrl,Permanent.NonLegendary", host.getController(), host);
if (choices.isEmpty()) {
return false;
}
}
}
@@ -1983,10 +1988,15 @@ public final class AbilityFactoryChoose {
}
} else { // Computer
if (params.containsKey("AILogic") && params.get("AILogic").equals("BestBlocker")) {
if (CardLists.filter(choices, Presets.UNTAPPED).isEmpty()) {
if (!CardLists.filter(choices, Presets.UNTAPPED).isEmpty()) {
choices = CardLists.filter(choices, Presets.UNTAPPED);
}
chosen.add(CardFactoryUtil.getBestCreatureAI(choices));
} else if (params.containsKey("AILogic") && params.get("AILogic").equals("Clone")) {
if (!CardLists.getValidCards(choices, "Permanent.YouDontCtrl,Permanent.NonLegendary", host.getController(), host).isEmpty()) {
choices = CardLists.getValidCards(choices, "Permanent.YouDontCtrl,Permanent.NonLegendary", host.getController(), host);
}
chosen.add(CardFactoryUtil.getBestAI(choices));
} else {
chosen.add(CardFactoryUtil.getBestAI(choices));
}