- Some changes for the experimental Intuition logic as support for Illusions-Donate.

git-svn-id: http://svn.slightlymagic.net/forge/trunk@35713 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
Agetian 2017-09-22 19:36:48 +00:00
parent a2165f3f42
commit c215bac8b7

View File

@ -548,7 +548,7 @@ public class SpecialCardAi {
Collections.sort(lib, CardLists.CmcComparatorInv); Collections.sort(lib, CardLists.CmcComparatorInv);
// Additional cards which are difficult to auto-classify but which are generally good to Intuition for // Additional cards which are difficult to auto-classify but which are generally good to Intuition for
List<String> highPriorityNamedCards = Lists.newArrayList("Accumulated Knowledge"); List<String> highPriorityNamedCards = Lists.newArrayList("Accumulated Knowledge", "Take Inventory");
// figure out how many of each card we have in deck // figure out how many of each card we have in deck
MapToAmount<String> cardAmount = new LinkedHashMapToAmount<>(); MapToAmount<String> cardAmount = new LinkedHashMapToAmount<>();
@ -556,7 +556,10 @@ public class SpecialCardAi {
cardAmount.add(c.getName()); cardAmount.add(c.getName());
} }
// Trix: see if we can complete the combo // Trix: see if we can complete the combo (if it looks like we might win shortly)
boolean donateComboMightWin = false;
if (ai.getOpponentsSmallestLifeTotal() <= 20) {
donateComboMightWin = true;
int numIllusionsInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Illusions of Grandeur")).size(); int numIllusionsInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Illusions of Grandeur")).size();
int numDonateInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Donate")).size(); int numDonateInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Donate")).size();
int numIllusionsInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Illusions of Grandeur")).size(); int numIllusionsInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Illusions of Grandeur")).size();
@ -578,6 +581,7 @@ public class SpecialCardAi {
} }
return comboList; return comboList;
} }
}
// Create a priority list for cards that we have no more than 4 of and that are not lands // Create a priority list for cards that we have no more than 4 of and that are not lands
CardCollection libPriorityList = new CardCollection(); CardCollection libPriorityList = new CardCollection();
@ -586,6 +590,11 @@ public class SpecialCardAi {
List<String> processed = Lists.newArrayList(); List<String> processed = Lists.newArrayList();
for (int i = 4; i > 0; i--) { for (int i = 4; i > 0; i--) {
for (Card c : lib) { for (Card c : lib) {
if (!donateComboMightWin && (c.getName().equals("Illusions of Grandeur") || c.getName().equals("Donate"))) {
// Probably not worth putting two of the combo pieces into the graveyard
// since one Illusions-Donate is likely to not be enough
continue;
}
if (cardAmount.get(c.getName()) == i && !c.isLand() && !processed.contains(c.getName())) { if (cardAmount.get(c.getName()) == i && !c.isLand() && !processed.contains(c.getName())) {
// if it's a card that is generally good to place in the graveyard, also add it // if it's a card that is generally good to place in the graveyard, also add it
// to the mix // to the mix