mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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.
|
||||
* @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,
|
||||
// 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();
|
||||
|
||||
@@ -2,7 +2,9 @@ package forge.gui.input;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
import forge.CardUtil;
|
||||
import forge.Constant;
|
||||
import forge.card.abilityFactory.AbilityFactory_Mana;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaPool;
|
||||
import forge.card.spellability.Ability_Mana;
|
||||
@@ -76,11 +78,20 @@ public class Input_PayManaCostUtil {
|
||||
ArrayList<Ability_Mana> colorMatches = new ArrayList<Ability_Mana>();
|
||||
|
||||
for (Ability_Mana am : abilities) {
|
||||
if (am.isReflectedMana()){
|
||||
ArrayList<String> reflectableColors = AbilityFactory_Mana.reflectableMana(am, am.getAbilityFactory(), new ArrayList<String>(), new ArrayList<Card>());
|
||||
for (String color : reflectableColors){
|
||||
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())
|
||||
// can only match colorless just grab the first and move on.
|
||||
@@ -127,14 +138,30 @@ public class Input_PayManaCostUtil {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public static boolean canMake(Ability_Mana am, String mana) {
|
||||
if (mana.contains("1")) return true;
|
||||
if (mana.contains("S") && am.isSnow()) return true;
|
||||
|
||||
for (String color : ManaPool.formatMana(am))
|
||||
if (mana.contains(color)) return true;
|
||||
return false;
|
||||
if (mana.contains("1")){
|
||||
return true;
|
||||
}
|
||||
if (mana.contains("S") && am.isSnow()){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (am.isReflectedMana()){
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>getLongColorString.</p>
|
||||
|
||||
Reference in New Issue
Block a user