mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Avoid prompting for color when using "Add one mana of any color" effect to pay for a colorless cost
This commit is contained in:
@@ -164,9 +164,16 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
boolean choice = true;
|
boolean choice = true;
|
||||||
if (guessAbilityWithRequiredColors) {
|
if (guessAbilityWithRequiredColors) {
|
||||||
// express Mana Choice
|
// express Mana Choice
|
||||||
|
if (colorNeeded == 0) {
|
||||||
|
choice = false;
|
||||||
|
//avoid unnecessary prompt by pretending we need White
|
||||||
|
//for the sake of "Add one mana of any color" effects
|
||||||
|
colorNeeded = MagicColor.WHITE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
final ArrayList<SpellAbility> colorMatches = new ArrayList<SpellAbility>();
|
final ArrayList<SpellAbility> colorMatches = new ArrayList<SpellAbility>();
|
||||||
for (SpellAbility sa : abilities) {
|
for (SpellAbility sa : abilities) {
|
||||||
if (colorNeeded != 0 && abilityProducesManaColor(sa, sa.getManaPartRecursive(), colorNeeded)) {
|
if (abilityProducesManaColor(sa, sa.getManaPartRecursive(), colorNeeded)) {
|
||||||
colorMatches.add(sa);
|
colorMatches.add(sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,6 +188,7 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
abilities = colorMatches;
|
abilities = colorMatches;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final SpellAbility chosen = abilities.size() > 1 && choice ? GuiChoose.one("Choose mana ability", abilities) : abilities.get(0);
|
final SpellAbility chosen = abilities.size() > 1 && choice ? GuiChoose.one("Choose mana ability", abilities) : abilities.get(0);
|
||||||
ColorSet colors = ColorSet.fromMask(0 == colorNeeded ? colorCanUse : colorNeeded);
|
ColorSet colors = ColorSet.fromMask(0 == colorNeeded ? colorCanUse : colorNeeded);
|
||||||
|
|||||||
Reference in New Issue
Block a user