mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- The AI will now try to avoid destroying cards with the SacMe SVar.
This commit is contained in:
@@ -98,6 +98,9 @@ public class DestroyAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c.hasSVar("SacMe")) {
|
||||
return false;
|
||||
}
|
||||
//Check for undying
|
||||
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;
|
||||
}
|
||||
// target loop
|
||||
|
||||
@@ -67,6 +67,11 @@ public class SacrificeAi extends SpellAbilityAi {
|
||||
|
||||
List<Card> list =
|
||||
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) {
|
||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(sa));
|
||||
} else {
|
||||
@@ -76,7 +81,7 @@ public class SacrificeAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
if (list.size() == 0) {
|
||||
if (list.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user