mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
mana effect - will give all colors to choose from if manaAb.expressChoice was empty
This commit is contained in:
@@ -58,7 +58,7 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
String choice = "";
|
||||
byte chosenColor = activator.getController().chooseColor("Select Mana to Produce", sa, colorOptions);
|
||||
if (chosenColor == 0)
|
||||
throw new RuntimeException("AbilityFactoryMana::manaResolve() - " + activator + " color mana choice is empty for " + card.getName());
|
||||
throw new RuntimeException("ManaEffect::resolve() /*combo mana*/ - " + activator + " color mana choice is empty for " + card.getName());
|
||||
|
||||
choice = MagicColor.toShortString(chosenColor);
|
||||
if (nMana != 1) {
|
||||
@@ -81,21 +81,15 @@ 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 |= forge.card.MagicColor.fromName(colorsNeeded.substring(nChar, nChar + 1));
|
||||
}
|
||||
colorMenu = ColorSet.fromMask(mask);
|
||||
}
|
||||
else {
|
||||
colorMenu = ColorSet.fromNames(MagicColor.Constant.ONLY_COLORS);
|
||||
mask |= MagicColor.fromName(colorsNeeded.charAt(nChar));
|
||||
}
|
||||
colorMenu = ColorSet.fromMask(mask == 0 ? MagicColor.ALL_COLORS : mask);
|
||||
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());
|
||||
throw new RuntimeException("ManaEffect::resolve() /*any mana*/ - " + act + " color mana choice is empty for " + card.getName());
|
||||
}
|
||||
choice = MagicColor.toShortString(val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user