mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Fixed TwoPilesEffect
This commit is contained in:
@@ -1395,6 +1395,7 @@ public class AiController {
|
||||
List<Card> result = new ArrayList<>();
|
||||
switch( sa.getApi()) {
|
||||
case TwoPiles:
|
||||
// TODO: improve AI
|
||||
Card biggest = null;
|
||||
Card smallest = null;
|
||||
biggest = pool.get(0);
|
||||
@@ -1409,7 +1410,7 @@ public class AiController {
|
||||
}
|
||||
result.add(biggest);
|
||||
|
||||
if (max >= 3 && !result.contains(smallest)) {
|
||||
if (max > 3 && !result.contains(smallest)) {
|
||||
result.add(smallest);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -86,9 +86,12 @@ public class TwoPilesEffect extends SpellAbilityEffect {
|
||||
}
|
||||
List<Card> pool = CardLists.getValidCards(pool0, valid, card.getController(), card);
|
||||
int size = pool.size();
|
||||
if (size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// first, separate the cards into piles
|
||||
final List<Card> pile1 = separator.getController().chooseCardsForEffect(pool, sa, "Divide cards into two piles", 1, size - 1, false);
|
||||
final List<Card> pile1 = separator.getController().chooseCardsForEffect(pool, sa, "Divide cards into two piles", 0, size, false);
|
||||
final List<Card> pile2 = Lists.newArrayList(pool);
|
||||
Iterables.removeAll(pile2, pile1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user