mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Fix mulligan with zero cards
This commit is contained in:
@@ -2066,7 +2066,7 @@ public class ComputerUtil {
|
||||
// Computer mulligans if there are no cards with converted mana cost of 0 in its hand
|
||||
public static boolean wantMulligan(Player ai, int cardsToReturn) {
|
||||
final CardCollectionView handList = ai.getCardsIn(ZoneType.Hand);
|
||||
return scoreHand(handList, ai, cardsToReturn) <= 0;
|
||||
return !handList.isEmpty() && scoreHand(handList, ai, cardsToReturn) <= 0;
|
||||
}
|
||||
|
||||
public static CardCollection getPartialParisCandidates(Player ai) {
|
||||
|
||||
@@ -116,7 +116,6 @@ public class CardFactory {
|
||||
//out.setFaceDown(in.isFaceDown());
|
||||
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -740,7 +739,6 @@ public class CardFactory {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sa.hasParam("GainThisAbility") && (sa instanceof SpellAbility)) {
|
||||
SpellAbility root = ((SpellAbility) sa).getRootAbility();
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ public abstract class AbstractMulligan {
|
||||
|
||||
public void mulligan() {
|
||||
CardCollection toMulligan = new CardCollection(player.getCardsIn(ZoneType.Hand));
|
||||
if (toMulligan.isEmpty()) return;
|
||||
revealPreMulligan(toMulligan);
|
||||
for (final Card c : toMulligan) {
|
||||
player.getGame().getAction().moveToLibrary(c, null);
|
||||
|
||||
Reference in New Issue
Block a user