mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Improved changeHiddenOriginResolveAI dealing with unwanted moves.
This commit is contained in:
@@ -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()) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user