mirror of
https://github.com/Relintai/mtg-forge-ios.git
synced 2025-01-08 15:39:35 +01:00
- 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:
parent
a2165f3f42
commit
c215bac8b7
@ -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,27 +556,31 @@ 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)
|
||||||
int numIllusionsInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
boolean donateComboMightWin = false;
|
||||||
int numDonateInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Donate")).size();
|
if (ai.getOpponentsSmallestLifeTotal() <= 20) {
|
||||||
int numIllusionsInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
donateComboMightWin = true;
|
||||||
int numIllusionsOTB = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
int numIllusionsInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
||||||
int numDonateInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Donate")).size();
|
int numDonateInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.nameEquals("Donate")).size();
|
||||||
CardCollection comboList = new CardCollection();
|
int numIllusionsInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
||||||
if ((numIllusionsInHand > 0 || numIllusionsOTB > 0) && numDonateInHand == 0 && numDonateInLib >= 3) {
|
int numIllusionsOTB = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Illusions of Grandeur")).size();
|
||||||
for (Card c : lib) {
|
int numDonateInLib = CardLists.filter(ai.getCardsIn(ZoneType.Library), CardPredicates.nameEquals("Donate")).size();
|
||||||
if (c.getName().equals("Donate")) {
|
CardCollection comboList = new CardCollection();
|
||||||
comboList.add(c);
|
if ((numIllusionsInHand > 0 || numIllusionsOTB > 0) && numDonateInHand == 0 && numDonateInLib >= 3) {
|
||||||
|
for (Card c : lib) {
|
||||||
|
if (c.getName().equals("Donate")) {
|
||||||
|
comboList.add(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return comboList;
|
||||||
return comboList;
|
} else if (numDonateInHand > 0 && numIllusionsInHand == 0 && numIllusionsInLib >= 3) {
|
||||||
} else if (numDonateInHand > 0 && numIllusionsInHand == 0 && numIllusionsInLib >= 3) {
|
for (Card c : lib) {
|
||||||
for (Card c : lib) {
|
if (c.getName().equals("Illusions of Grandeur")) {
|
||||||
if (c.getName().equals("Illusions of Grandeur")) {
|
comboList.add(c);
|
||||||
comboList.add(c);
|
}
|
||||||
}
|
}
|
||||||
|
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
|
||||||
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user