mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
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:
@@ -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"));
|
||||
|
||||
@@ -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 ", "");
|
||||
|
||||
Reference in New Issue
Block a user