diff --git a/src/forge/AbilityFactory_Bounce.java b/src/forge/AbilityFactory_Bounce.java index 4bbc27e0e8a..ac8750c4a3b 100644 --- a/src/forge/AbilityFactory_Bounce.java +++ b/src/forge/AbilityFactory_Bounce.java @@ -180,7 +180,7 @@ public class AbilityFactory_Bounce { Card choice = null; if (list.getNotType("Creature").size() == 0) - choice = CardFactoryUtil.AI_getBestCreature(list); //if the targets are only creatures, take the best + choice = CardFactoryUtil.AI_getBestCreatureToBounce(list); //if the targets are only creatures, take the best else choice = CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), true); diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index aad9ca5ec07..af5f0f09a24 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -517,7 +517,6 @@ public class CardFactoryUtil { all = all.getType("Creature"); Card biggest = null; - //if flying creature is small, get biggest non-flying creature if(all.size() != 0) { biggest = all.get(0); @@ -527,6 +526,28 @@ public class CardFactoryUtil { return biggest; } + //This selection rates tokens higher + public static Card AI_getBestCreatureToBounce(CardList list) { + CardList all = list; + all = all.getType("Creature"); + Card biggest = null; //returns null if list.size() == 0 + int biggestvalue = 0; + int newvalue = 0; + + if(all.size() != 0) { + biggest = all.get(0); + + for(int i = 0; i < all.size(); i++) { + biggestvalue = evaluateCreature(biggest); + if (biggest.isToken()) biggestvalue += 100; // raise the value of tokens + newvalue = evaluateCreature(all.get(i)); + if (all.get(i).isToken()) newvalue += 100; // raise the value of tokens + if(evaluateCreature(biggest) < evaluateCreature(all.get(i))) biggest = all.get(i); + } + } + return biggest; + } + //returns null if list.size() == 0 public static Card AI_getWorstCreature(CardList list) { CardList all = list;