diff --git a/forge-game/src/main/java/forge/game/ability/effects/ManaReflectedEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ManaReflectedEffect.java index e14fc85c627..d7b3a0df4a9 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ManaReflectedEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ManaReflectedEffect.java @@ -58,25 +58,24 @@ public class ManaReflectedEffect extends SpellAbilityEffect { String baseMana; - // Obey already made choice by AI + // TODO: This effect explicitly obeys express color choice as set by auto payment and AI routines in order + // to avoid misplays. Perhaps a better solution is possible? String colorsNeeded = sa.getManaPart().getExpressChoice(); String choice = ""; ColorSet colorMenu = null; byte mask = 0; - //loop through colors to make menu + // loop through colors to make menu for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) { mask |= MagicColor.fromName(colorsNeeded.charAt(nChar)); } - // AI wanted a "color" but result came up with no colors -> AI wanted Colorless! - // Is that a thing? I assume it is? if ((mask == 0) && (!("".equals(sa.getManaPart().getExpressChoice()))) && (colors.contains("colorless"))) { baseMana = MagicColor.toShortString(player.getController().chooseColorAllowColorless("Select Mana to Produce", sa.getHostCard(), ColorSet.fromMask(mask))); - } else + } else { // Nothing set previously so ask player if needed if (mask == 0) { - if (colors.size() == 0) { + if (colors.isEmpty()) { return "0"; } else if (colors.size() == 1) { baseMana = MagicColor.toShortString(colors.iterator().next()); @@ -86,15 +85,16 @@ public class ManaReflectedEffect extends SpellAbilityEffect { } else { baseMana = MagicColor.toShortString(player.getController().chooseColor("Select Mana to Produce", sa, ColorSet.fromNames(colors))); } - } + } } else { colorMenu = ColorSet.fromMask(mask); byte val = sa.getActivatingPlayer().getController().chooseColor("Select Mana to Produce", sa, colorMenu); - if (0 == val) { + if (val == 0) { throw new RuntimeException("ManaEffect::resolve() /*reflected mana*/ - " + sa.getActivatingPlayer() + " color mana choice is empty for " + sa.getHostCard().getName()); } baseMana = MagicColor.toShortString(val); } + } final StringBuilder sb = new StringBuilder(); if (amount == 0) { diff --git a/forge-gui/res/cardsfolder/m/mox_amber.txt b/forge-gui/res/cardsfolder/m/mox_amber.txt index 622cef365a0..259578e7093 100644 --- a/forge-gui/res/cardsfolder/m/mox_amber.txt +++ b/forge-gui/res/cardsfolder/m/mox_amber.txt @@ -2,6 +2,5 @@ Name:Mox Amber ManaCost:0 Types:Legendary Artifact A:AB$ ManaReflected | Cost$ T | ColorOrType$ Color | Valid$ Creature.Legendary+YouCtrl,Planeswalker.Legendary+YouCtrl | ReflectProperty$ Is | SpellDescription$ Add one mana of any color among legendary creatures and planeswalkers you control. -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/mox_amber.jpg Oracle:{T}: Add one mana of any color among legendary creatures and planeswalkers you control. diff --git a/forge-gui/res/cardsfolder/r/reflecting_pool.txt b/forge-gui/res/cardsfolder/r/reflecting_pool.txt index 26e65377400..7c2617e67bd 100644 --- a/forge-gui/res/cardsfolder/r/reflecting_pool.txt +++ b/forge-gui/res/cardsfolder/r/reflecting_pool.txt @@ -1,6 +1,6 @@ Name:Reflecting Pool ManaCost:no cost Types:Land -A:AB$ ManaReflected | Cost$ T | ColorOrType$ Type | Valid$ Land.YouCtrl | ReflectProperty$ Produce | SpellDescription$ Add to your mana pool one mana of any type that a land you control could produce. +A:AB$ ManaReflected | Cost$ T | ColorOrType$ Type | Valid$ Land.YouCtrl | ReflectProperty$ Produce | SpellDescription$ Add one mana of any type that a land you control could produce. SVar:Picture:http://www.wizards.com/global/images/magic/general/reflecting_pool.jpg -Oracle:{T}: Add to your mana pool one mana of any type that a land you control could produce. +Oracle:{T}: Add one mana of any type that a land you control could produce.