mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Fix the express mana payment sometimes presenting the player with choices which are not legal.
This commit is contained in:
committed by
swordshine
parent
f2f2ef09e2
commit
ccc935a025
@@ -316,8 +316,20 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
} else {
|
} else {
|
||||||
chosen = chosenAbility;
|
chosen = chosenAbility;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorSet colors = ColorSet.fromMask(0 == colorNeeded ? colorCanUse : colorNeeded);
|
ColorSet colors = ColorSet.fromMask(0 == colorNeeded ? colorCanUse : colorNeeded);
|
||||||
chosen.getManaPartRecursive().setExpressChoice(colors);
|
|
||||||
|
// Filter the colors for the express choice so that only actually producible colors can be chosen
|
||||||
|
int producedColorMask = 0;
|
||||||
|
for (final byte color : ManaAtom.MANATYPES) {
|
||||||
|
if (chosen.getManaPartRecursive().getOrigProduced().contains(MagicColor.toShortString(color))
|
||||||
|
&& colors.hasAnyColor(color)) {
|
||||||
|
producedColorMask |= color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ColorSet producedAndNeededColors = ColorSet.fromMask(producedColorMask);
|
||||||
|
|
||||||
|
chosen.getManaPartRecursive().setExpressChoice(producedAndNeededColors);
|
||||||
|
|
||||||
// System.out.println("Chosen sa=" + chosen + " of " + chosen.getHostCard() + " to pay mana");
|
// System.out.println("Chosen sa=" + chosen + " of " + chosen.getHostCard() + " to pay mana");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user