mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Merge branch 'fix_ai_x_cannot_be_zero' into 'master'
Adds check for AI when X cost is not allowed to be zero See merge request core-developers/forge!5224
This commit is contained in:
@@ -1504,6 +1504,11 @@ public class ComputerUtilMana {
|
|||||||
manaToAdd = AbilityUtils.calculateAmount(card, "X", sa) * xCounter;
|
manaToAdd = AbilityUtils.calculateAmount(card, "X", sa) * xCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (manaToAdd < 1 && !payCosts.getCostMana().canXbe0()) {
|
||||||
|
// AI cannot really handle X costs properly but this keeps AI form violating rules
|
||||||
|
manaToAdd = 1;
|
||||||
|
}
|
||||||
|
|
||||||
String xColor = sa.getParamOrDefault("XColor", "1");
|
String xColor = sa.getParamOrDefault("XColor", "1");
|
||||||
if (card.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) {
|
if (card.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) {
|
||||||
xColor = "WUBRGX";
|
xColor = "WUBRGX";
|
||||||
|
|||||||
Reference in New Issue
Block a user