- Improved tapUnpreferredTargeting AI.

This commit is contained in:
Sloth
2013-05-12 13:02:01 +00:00
parent 79e5574915
commit 960ce927b6

View File

@@ -247,9 +247,15 @@ public abstract class TapAiBase extends SpellAbilityAi {
list = CardLists.getValidCards(list, tgt.getValidTgts(), source.getController(), source);
list = CardLists.getTargetableCards(list, sa);
// try to tap anything controlled by the computer
List<Card> tapList = CardLists.filterControlledBy(list, ai.getOpponents());
if (tapTargetList(ai, sa, tapList, mandatory)) {
return true;
}
// filter by enchantments and planeswalkers, their tapped state doesn't matter.
final String[] tappablePermanents = { "Enchantment", "Planeswalker" };
List<Card> tapList = CardLists.getValidCards(list, tappablePermanents, source.getController(), source);
tapList = CardLists.getValidCards(list, tappablePermanents, source.getController(), source);
if (tapTargetList(ai, sa, tapList, mandatory)) {
return true;