mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
ComputerUtilCost: checkDiscardCost: remove from hand what is already selected for discard
This commit is contained in:
@@ -100,6 +100,9 @@ public class ComputerUtilCost {
|
|||||||
if (cost == null) {
|
if (cost == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CardCollection hand = new CardCollection(ai.getCardsIn(ZoneType.Hand));
|
||||||
|
|
||||||
for (final CostPart part : cost.getCostParts()) {
|
for (final CostPart part : cost.getCostParts()) {
|
||||||
if (part instanceof CostDiscard) {
|
if (part instanceof CostDiscard) {
|
||||||
final CostDiscard disc = (CostDiscard) part;
|
final CostDiscard disc = (CostDiscard) part;
|
||||||
@@ -108,7 +111,7 @@ public class ComputerUtilCost {
|
|||||||
if (type.equals("CARDNAME") && source.getAbilityText().contains("Bloodrush")) {
|
if (type.equals("CARDNAME") && source.getAbilityText().contains("Bloodrush")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final CardCollection typeList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Hand), type.split(","), source.getController(), source, null);
|
final CardCollection typeList = CardLists.getValidCards(hand, type.split(","), source.getController(), source, null);
|
||||||
if (typeList.size() > ai.getMaxHandSize()) {
|
if (typeList.size() > ai.getMaxHandSize()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -119,6 +122,7 @@ public class ComputerUtilCost {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
typeList.remove(pref);
|
typeList.remove(pref);
|
||||||
|
hand.remove(pref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user