mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixed AI ignoring "DiscardValid" parameter.
This commit is contained in:
@@ -85,12 +85,13 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
} // discardStackDescription()
|
} // discardStackDescription()
|
||||||
|
|
||||||
private List<Card> discardComputerChooses(SpellAbility sa, Player victim, Player chooser, int numCards, String[] dValid, boolean isReveal){
|
private List<Card> discardComputerChooses(SpellAbility sa, Player victim, Player chooser, int numCards, String[] dValid, boolean isReveal){
|
||||||
// AI
|
final Card source = sa.getSourceCard();
|
||||||
final List<Card> dPChHand = new ArrayList<Card>(victim.getCardsIn(ZoneType.Hand));
|
List<Card> dPChHand = new ArrayList<Card>(victim.getCardsIn(ZoneType.Hand));
|
||||||
|
dPChHand = CardLists.getValidCards(dPChHand, dValid, source.getController(), source);
|
||||||
final List<Card> discarded = new ArrayList<Card>();
|
final List<Card> discarded = new ArrayList<Card>();
|
||||||
|
|
||||||
if (victim.isComputer()) { // discard AI cards
|
if (victim.isComputer()) { // discard AI cards
|
||||||
int max = chooser.getCardsIn(ZoneType.Hand).size();
|
int max = dPChHand.size();
|
||||||
max = Math.min(max, numCards);
|
max = Math.min(max, numCards);
|
||||||
List<Card> list = ((AIPlayer)victim).getAi().getCardsToDiscard(max, dValid, sa);
|
List<Card> list = ((AIPlayer)victim).getAi().getCardsToDiscard(max, dValid, sa);
|
||||||
if (isReveal) {
|
if (isReveal) {
|
||||||
|
|||||||
Reference in New Issue
Block a user