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:
@@ -79,15 +79,21 @@ public class ManaEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
String colorsNeeded = abMana.getExpressChoice();
|
String colorsNeeded = abMana.getExpressChoice();
|
||||||
String choice = "";
|
String choice = "";
|
||||||
|
|
||||||
ColorSet colorMenu = null;
|
ColorSet colorMenu = null;
|
||||||
byte mask = 0;
|
if (colorsNeeded.length() > 1 && colorsNeeded.length() < 5) {
|
||||||
//loop through colors to make menu
|
byte mask = 0;
|
||||||
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
|
//loop through colors to make menu
|
||||||
mask |= MagicColor.fromName(colorsNeeded.charAt(nChar));
|
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
|
||||||
|
mask |= forge.card.MagicColor.fromName(colorsNeeded.substring(nChar, nChar + 1));
|
||||||
|
}
|
||||||
|
colorMenu = ColorSet.fromMask(mask);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
colorMenu = ColorSet.fromNames(MagicColor.Constant.ONLY_COLORS);
|
||||||
}
|
}
|
||||||
colorMenu = ColorSet.fromMask(mask);
|
|
||||||
byte val = act.getController().chooseColor("Select Mana to Produce", sa, colorMenu);
|
byte val = act.getController().chooseColor("Select Mana to Produce", sa, colorMenu);
|
||||||
|
|
||||||
if (0 == val) {
|
if (0 == val) {
|
||||||
throw new RuntimeException("AbilityFactoryMana::manaResolve() - " + act + " color mana choice is empty for " + card.getName());
|
throw new RuntimeException("AbilityFactoryMana::manaResolve() - " + act + " color mana choice is empty for " + card.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user