mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Integrating a reformatted fix by Seravy which makes Mox Amber AI playable (as well as Reflecting Pool) and fixes auto mana payment for these and other cards that use ManaReflected.
This commit is contained in:
@@ -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());
|
||||
@@ -90,11 +89,12 @@ public class ManaReflectedEffect extends SpellAbilityEffect {
|
||||
} 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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user