mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Clean up ConniveAi a little bit. (#2371)
* - Update the MTGDecksNet conversion and AI playability test toolchain to the latest version (Python 3 compatible). * - Make the input/output folders generic * - Make the input/output folders generic, part 2. * - Add the Scryfall all-prices.txt generator script. * - Minor code cleanup. * - Improve ConniveAi for Change of Plans. * - Check if the AI can draw cards for ConniveAI * - Improve the price generation script to account for the Scryfall set code to Forge set code mapping. - Tweak paths in some of the scripts. * - Fix scryfallPricesGenerator. * - Clean up ConniveAi code, limit the X choice to available mana.
This commit is contained in:
@@ -2,6 +2,7 @@ package forge.ai.ability;
|
||||
|
||||
import forge.ai.ComputerUtil;
|
||||
import forge.ai.ComputerUtilCard;
|
||||
import forge.ai.ComputerUtilMana;
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
@@ -23,10 +24,10 @@ public class ConniveAi extends SpellAbilityAi {
|
||||
// Filter AI-specific targets if provided
|
||||
list = ComputerUtil.filterAITgts(sa, ai, list, false);
|
||||
|
||||
int maxTargets = sa.getMaxTargets();
|
||||
if ("X".equals(sa.getParam("TargetMax")) && "Count$xPaid".equals(sa.getSVar("X"))) {
|
||||
// TODO: consider making the library margin (currently hardcoded to 5) a configurable AI parameter
|
||||
maxTargets = Math.min(list.size(), Math.max(0, ai.getCardsIn(ZoneType.Library).size() - 5));
|
||||
int maxTargets = Math.min(list.size(), Math.max(0, ai.getCardsIn(ZoneType.Library).size() - 5));
|
||||
maxTargets = Math.min(maxTargets, ComputerUtilMana.getAvailableManaEstimate(ai));
|
||||
sa.setXManaCostPaid(maxTargets);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user