Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master

This commit is contained in:
Agetian
2018-02-20 07:55:13 +03:00
10 changed files with 86 additions and 44 deletions

View File

@@ -186,6 +186,11 @@ public class DestroyAi extends SpellAbilityAi {
if (hasXCost) {
// TODO: currently the AI will maximize mana spent on X, trying to maximize damage. This may need improvement.
maxTargets = Math.min(ComputerUtilMana.determineMaxAffordableX(ai, sa), abTgt.getMaxTargets(sa.getHostCard(), sa));
// X can't be more than the lands we have in our hand for "discard X lands"!
if ("ScorchedEarth".equals(logic)) {
int lands = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.Presets.LANDS).size();
maxTargets = Math.min(maxTargets, lands);
}
}
if (sa.hasParam("AIMaxTgtsCount")) {
// Cards that have confusing costs for the AI (e.g. Eliminate the Competition) can have forced max target constraints specified