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
|
//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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user