mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Prevent prompting for X if user can't control what X is
This commit is contained in:
@@ -228,6 +228,8 @@ public class HumanPlaySpellAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (needX && manaCost != null && manaCost.getAmountOfX() > 0) {
|
if (needX && manaCost != null && manaCost.getAmountOfX() > 0) {
|
||||||
|
String sVar = ability.getSVar("X"); //only prompt for new X value if card doesn't determine it another way
|
||||||
|
if ("Count$xPaid".equals(sVar) || StringUtils.isNumeric(sVar)) {
|
||||||
Integer value = controller.announceRequirements(ability, "X", allowZero && manaCost.canXbe0());
|
Integer value = controller.announceRequirements(ability, "X", allowZero && manaCost.canXbe0());
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -236,11 +238,12 @@ public class HumanPlaySpellAbility {
|
|||||||
ability.setSVar("X", value.toString());
|
ability.setSVar("X", value.toString());
|
||||||
card.setSVar("X", value.toString());
|
card.setSVar("X", value.toString());
|
||||||
|
|
||||||
// announce to subabilities
|
// announce to sub-abilities
|
||||||
SpellAbility sub = ability;
|
SpellAbility sub = ability;
|
||||||
while ((sub = sub.getSubAbility()) != null) {
|
while ((sub = sub.getSubAbility()) != null) {
|
||||||
sub.setSVar("X", value.toString());
|
sub.setSVar("X", value.toString());
|
||||||
};
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user