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,21 +164,29 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
boolean choice = true;
|
boolean choice = true;
|
||||||
if (guessAbilityWithRequiredColors) {
|
if (guessAbilityWithRequiredColors) {
|
||||||
// express Mana Choice
|
// express Mana Choice
|
||||||
final ArrayList<SpellAbility> colorMatches = new ArrayList<SpellAbility>();
|
if (colorNeeded == 0) {
|
||||||
for (SpellAbility sa : abilities) {
|
|
||||||
if (colorNeeded != 0 && abilityProducesManaColor(sa, sa.getManaPartRecursive(), colorNeeded)) {
|
|
||||||
colorMatches.add(sa);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colorMatches.isEmpty()) {
|
|
||||||
// can only match colorless just grab the first and move on.
|
|
||||||
// This is wrong. Sometimes all abilities aren't created equal
|
|
||||||
choice = false;
|
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 if (colorMatches.size() < abilities.size()) {
|
else {
|
||||||
// leave behind only color matches
|
final ArrayList<SpellAbility> colorMatches = new ArrayList<SpellAbility>();
|
||||||
abilities = colorMatches;
|
for (SpellAbility sa : abilities) {
|
||||||
|
if (abilityProducesManaColor(sa, sa.getManaPartRecursive(), colorNeeded)) {
|
||||||
|
colorMatches.add(sa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorMatches.isEmpty()) {
|
||||||
|
// can only match colorless just grab the first and move on.
|
||||||
|
// This is wrong. Sometimes all abilities aren't created equal
|
||||||
|
choice = false;
|
||||||
|
}
|
||||||
|
else if (colorMatches.size() < abilities.size()) {
|
||||||
|
// leave behind only color matches
|
||||||
|
abilities = colorMatches;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user