- The AI will now try to avoid destroying cards with the SacMe SVar.

This commit is contained in:
Sloth
2014-04-04 14:37:30 +00:00
parent 9d2b6a1f9f
commit f90b74a864
2 changed files with 10 additions and 2 deletions

View File

@@ -98,6 +98,9 @@ public class DestroyAi extends SpellAbilityAi {
} }
} }
} }
if (c.hasSVar("SacMe")) {
return false;
}
//Check for undying //Check for undying
return (!c.hasKeyword("Undying") || c.getCounters(CounterType.P1P1) > 0); return (!c.hasKeyword("Undying") || c.getCounters(CounterType.P1P1) > 0);
} }
@@ -116,7 +119,7 @@ public class DestroyAi extends SpellAbilityAi {
}); });
} }
if (list.size() == 0) { if (list.isEmpty()) {
return false; return false;
} }
// target loop // target loop

View File

@@ -67,6 +67,11 @@ public class SacrificeAi extends SpellAbilityAi {
List<Card> list = List<Card> list =
CardLists.getValidCards(ai.getOpponent().getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), sa.getHostCard()); CardLists.getValidCards(ai.getOpponent().getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), sa.getHostCard());
for (Card c : list) {
if (c.hasSVar("SacMe") && Integer.parseInt(c.getSVar("SacMe")) > 3) {
return false;
}
}
if (!destroy) { if (!destroy) {
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(sa)); list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(sa));
} else { } else {
@@ -76,7 +81,7 @@ public class SacrificeAi extends SpellAbilityAi {
} }
} }
if (list.size() == 0) { if (list.isEmpty()) {
return false; return false;
} }