- Improved changeHiddenOriginResolveAI dealing with unwanted moves.

This commit is contained in:
Sloth
2012-08-29 14:48:27 +00:00
parent 46c98bed4a
commit bd0471ae36
2 changed files with 13 additions and 13 deletions

View File

@@ -1139,21 +1139,20 @@ public final class AbilityFactoryChangeZone {
return true; return true;
} }
}); });
if (type.contains("Basic")) { if (ZoneType.Exile.equals(destination) || origin.contains(ZoneType.Battlefield)) {
// Exiling or bouncing stuff
if (destZone.getPlayer().isHuman()) {
c = CardFactoryUtil.getBestAI(fetchList);
} else {
c = CardFactoryUtil.getWorstAI(fetchList);
}
} else if (origin.contains(ZoneType.Library)
&& (type.contains("Basic") || AbilityFactoryChangeZone.areAllBasics(type))) {
c = AbilityFactoryChangeZone.basicManaFixing(fetchList); c = AbilityFactoryChangeZone.basicManaFixing(fetchList);
} else if (AbilityFactoryChangeZone.areAllBasics(type)) { } else if (ZoneType.Battlefield.equals(destination) && fetchList.getNotType("Creature").size() == 0) {
c = AbilityFactoryChangeZone.basicManaFixing(fetchList, type);
} else if (fetchList.getNotType("Creature").size() == 0) {
c = AbilityFactoryChangeZone.chooseCreature(fetchList); c = AbilityFactoryChangeZone.chooseCreature(fetchList);
} else if (ZoneType.Battlefield.equals(destination) || ZoneType.Graveyard.equals(destination)) { } else if (ZoneType.Battlefield.equals(destination) || ZoneType.Graveyard.equals(destination)) {
c = CardFactoryUtil.getMostExpensivePermanentAI(fetchList, sa, false); c = CardFactoryUtil.getBestAI(fetchList);
} else if (ZoneType.Exile.equals(destination)) {
// Exiling your own stuff, if Exiling opponents stuff choose best
if (destZone.getPlayer().isHuman()) {
c = CardFactoryUtil.getMostExpensivePermanentAI(fetchList, sa, false);
} else {
c = CardFactoryUtil.getCheapestPermanentAI(fetchList, sa, false);
}
} else { } else {
// Don't fetch another tutor with the same name // Don't fetch another tutor with the same name
if (origin.contains(ZoneType.Library) && !fetchList.getNotName(card.getName()).isEmpty()) { if (origin.contains(ZoneType.Library) && !fetchList.getNotName(card.getName()).isEmpty()) {

View File

@@ -717,7 +717,7 @@ public class CardFactoryUtil {
* @return a {@link forge.Card} object. * @return a {@link forge.Card} object.
*/ */
public static Card getWorstAI(final CardList list) { public static Card getWorstAI(final CardList list) {
return CardFactoryUtil.getWorstPermanentAI(list, false, false, false, true); return CardFactoryUtil.getWorstPermanentAI(list, false, false, false, false);
} }
// returns null if list.size() == 0 // returns null if list.size() == 0
@@ -770,6 +770,7 @@ public class CardFactoryUtil {
if (list.size() == 0) { if (list.size() == 0) {
return null; return null;
} }
System.out.println("getWorstPermanentAI: " + list);
if (biasEnch && (list.getType("Enchantment").size() > 0)) { if (biasEnch && (list.getType("Enchantment").size() > 0)) {
return CardFactoryUtil.getCheapestPermanentAI(list.getType("Enchantment"), null, false); return CardFactoryUtil.getCheapestPermanentAI(list.getType("Enchantment"), null, false);