mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Fixed ManaEffect with AnyMana crashing, e.g. for Chromatic Star (temporarily fixed it by reverting the relevant part to the previous version, feel free to revert and commit a more optimal fix)
This commit is contained in:
@@ -81,13 +81,19 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
String choice = "";
|
||||
|
||||
ColorSet colorMenu = null;
|
||||
if (colorsNeeded.length() > 1 && colorsNeeded.length() < 5) {
|
||||
byte mask = 0;
|
||||
//loop through colors to make menu
|
||||
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
|
||||
mask |= MagicColor.fromName(colorsNeeded.charAt(nChar));
|
||||
mask |= forge.card.MagicColor.fromName(colorsNeeded.substring(nChar, nChar + 1));
|
||||
}
|
||||
colorMenu = ColorSet.fromMask(mask);
|
||||
}
|
||||
else {
|
||||
colorMenu = ColorSet.fromNames(MagicColor.Constant.ONLY_COLORS);
|
||||
}
|
||||
byte val = act.getController().chooseColor("Select Mana to Produce", sa, colorMenu);
|
||||
|
||||
if (0 == val) {
|
||||
throw new RuntimeException("AbilityFactoryMana::manaResolve() - " + act + " color mana choice is empty for " + card.getName());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user