kind of a band-aid fix for Transcendent Master. It works now at least.

CardFactoryUtil.xCount will now accept Number$12 (and give back 12; 12 is just an example.  works for any int.)
This commit is contained in:
jendave
2011-08-06 13:51:19 +00:00
parent 536aa16c34
commit e05f7e7f3d
3 changed files with 22 additions and 3 deletions

View File

@@ -2578,9 +2578,21 @@ public class Card extends MyObservable {
if (!compare(y, Property, x))
return false;
}
else if (Property.startsWith("counters")) // syntax example: countersGE9 P1P1 or countersLT12TIME (greater number than 99 not supported)
// syntax example: countersGE9 P1P1 or countersLT12TIME (greater number than 99 not supported)
/*
* slapshot5 - fair warning, you cannot use numbers with 2 digits (greater number than 9 not supported
* you can use X and the SVar:X:Number$12 to get two digits. This will need a better fix, and I have the
* beginnings of a regex below
*/
else if (Property.startsWith("counters"))
{
/*
Pattern p = Pattern.compile("[a-z]*[A-Z][A-Z][X0-9]+.*$");
String[] parse = ???
System.out.println("Parsing completed of: "+Property);
for(int i = 0; i < parse.length; i++) {
System.out.println("parse["+i+"]: "+parse[i]);
}*/
int number = 0;
if (Property.substring(10,11).equals("X"))
number = CardFactoryUtil.xCount(source, getSVar("X"));

View File

@@ -3584,6 +3584,12 @@ public class CardFactoryUtil {
final String m[] = {"none"};
if(l.length > 1) m[0] = l[1];
//accept straight numbers
if(l[0].contains("Number$")) {
String number = l[0].replace("Number$", "");
return Integer.parseInt(number);
}
// count valid cards on the battlefield
if(l[0].contains("Valid")) {
String restrictions = l[0].replace("Valid ", "");