mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +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,7 +58,8 @@ public class ManaReflectedEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
String baseMana;
|
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 colorsNeeded = sa.getManaPart().getExpressChoice();
|
||||||
String choice = "";
|
String choice = "";
|
||||||
|
|
||||||
@@ -69,14 +70,12 @@ public class ManaReflectedEffect extends SpellAbilityEffect {
|
|||||||
mask |= MagicColor.fromName(colorsNeeded.charAt(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"))) {
|
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)));
|
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
|
// Nothing set previously so ask player if needed
|
||||||
if (mask == 0) {
|
if (mask == 0) {
|
||||||
if (colors.size() == 0) {
|
if (colors.isEmpty()) {
|
||||||
return "0";
|
return "0";
|
||||||
} else if (colors.size() == 1) {
|
} else if (colors.size() == 1) {
|
||||||
baseMana = MagicColor.toShortString(colors.iterator().next());
|
baseMana = MagicColor.toShortString(colors.iterator().next());
|
||||||
@@ -90,11 +89,12 @@ public class ManaReflectedEffect extends SpellAbilityEffect {
|
|||||||
} else {
|
} else {
|
||||||
colorMenu = ColorSet.fromMask(mask);
|
colorMenu = ColorSet.fromMask(mask);
|
||||||
byte val = sa.getActivatingPlayer().getController().chooseColor("Select Mana to Produce", sa, colorMenu);
|
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());
|
throw new RuntimeException("ManaEffect::resolve() /*reflected mana*/ - " + sa.getActivatingPlayer() + " color mana choice is empty for " + sa.getHostCard().getName());
|
||||||
}
|
}
|
||||||
baseMana = MagicColor.toShortString(val);
|
baseMana = MagicColor.toShortString(val);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ Name:Mox Amber
|
|||||||
ManaCost:0
|
ManaCost:0
|
||||||
Types:Legendary Artifact
|
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.
|
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
|
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.
|
Oracle:{T}: Add one mana of any color among legendary creatures and planeswalkers you control.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Name:Reflecting Pool
|
Name:Reflecting Pool
|
||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Land
|
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
|
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