Allow any letter in EQ? expression. It was limited to X previously

This commit is contained in:
Maxmtg
2013-04-21 11:17:34 +00:00
parent 368fac3479
commit 072c541401

View File

@@ -677,8 +677,13 @@ public class AbilityUtils {
}
String valid = type;
if (valid.contains("EQX")) {
valid = valid.replace("X", Integer.toString(calculateAmount(source, "X", sa)));
int eqIndex = valid.indexOf("EQ");
if (eqIndex >= 0) {
char reference = valid.charAt(eqIndex + 2); // take whatever goes after EQ
if( Character.isLetter(reference)) {
String varName = valid.substring(eqIndex + 2, 1);
valid = valid.replace(varName, Integer.toString(calculateAmount(source, varName, sa)));
}
}
return CardLists.getValidCards(list, valid.split(","), sa.getActivatingPlayer(), source);
}