mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Some fixes to Reflectable Mana in regard to activating during activation of a SA.
This commit is contained in:
@@ -411,7 +411,7 @@ public class AbilityFactory_Mana {
|
|||||||
* @param parents a {@link java.util.ArrayList} object.
|
* @param parents a {@link java.util.ArrayList} object.
|
||||||
* @return a {@link java.util.ArrayList} object.
|
* @return a {@link java.util.ArrayList} object.
|
||||||
*/
|
*/
|
||||||
private static ArrayList<String> reflectableMana(Ability_Mana abMana, AbilityFactory af, ArrayList<String> colors, ArrayList<Card> parents) {
|
public static ArrayList<String> reflectableMana(Ability_Mana abMana, AbilityFactory af, ArrayList<String> colors, ArrayList<Card> parents) {
|
||||||
// Here's the problem with reflectable Mana. If more than one is out, they need to Reflect each other,
|
// Here's the problem with reflectable Mana. If more than one is out, they need to Reflect each other,
|
||||||
// so we basically need to have a recursive list that send the parents so we don't infinite recurse.
|
// so we basically need to have a recursive list that send the parents so we don't infinite recurse.
|
||||||
HashMap<String, String> params = af.getMapParams();
|
HashMap<String, String> params = af.getMapParams();
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package forge.gui.input;
|
|||||||
|
|
||||||
import forge.AllZone;
|
import forge.AllZone;
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.CardUtil;
|
||||||
import forge.Constant;
|
import forge.Constant;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory_Mana;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.card.mana.ManaPool;
|
import forge.card.mana.ManaPool;
|
||||||
import forge.card.spellability.Ability_Mana;
|
import forge.card.spellability.Ability_Mana;
|
||||||
@@ -76,10 +78,19 @@ public class Input_PayManaCostUtil {
|
|||||||
ArrayList<Ability_Mana> colorMatches = new ArrayList<Ability_Mana>();
|
ArrayList<Ability_Mana> colorMatches = new ArrayList<Ability_Mana>();
|
||||||
|
|
||||||
for (Ability_Mana am : abilities) {
|
for (Ability_Mana am : abilities) {
|
||||||
String[] m = ManaPool.formatMana(am);
|
if (am.isReflectedMana()){
|
||||||
for (String color : m)
|
ArrayList<String> reflectableColors = AbilityFactory_Mana.reflectableMana(am, am.getAbilityFactory(), new ArrayList<String>(), new ArrayList<Card>());
|
||||||
if (manaCost.isColor(color)) // convert to long before checking if color
|
for (String color : reflectableColors){
|
||||||
colorMatches.add(am);
|
if (manaCost.isColor(color)) // convert to long before checking if color
|
||||||
|
colorMatches.add(am);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
String[] m = ManaPool.formatMana(am);
|
||||||
|
for (String color : m)
|
||||||
|
if (manaCost.isColor(color)) // convert to long before checking if color
|
||||||
|
colorMatches.add(am);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colorMatches.size() == 0 || colorMatches.size() == abilities.size())
|
if (colorMatches.size() == 0 || colorMatches.size() == abilities.size())
|
||||||
@@ -127,15 +138,31 @@ public class Input_PayManaCostUtil {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public static boolean canMake(Ability_Mana am, String mana) {
|
public static boolean canMake(Ability_Mana am, String mana) {
|
||||||
if (mana.contains("1")) return true;
|
if (mana.contains("1")){
|
||||||
if (mana.contains("S") && am.isSnow()) return true;
|
return true;
|
||||||
|
}
|
||||||
|
if (mana.contains("S") && am.isSnow()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
for (String color : ManaPool.formatMana(am))
|
if (am.isReflectedMana()){
|
||||||
if (mana.contains(color)) return true;
|
ArrayList<String> reflectableColors = AbilityFactory_Mana.reflectableMana(am, am.getAbilityFactory(), new ArrayList<String>(), new ArrayList<Card>());
|
||||||
|
for (String color : reflectableColors){
|
||||||
|
if (mana.contains(getShortColorString(color))){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for (String color : ManaPool.formatMana(am)){
|
||||||
|
if (mana.contains(color)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>getLongColorString.</p>
|
* <p>getLongColorString.</p>
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user