mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
updated verify check to handle mana abilities being split
This commit is contained in:
parent
524b9fcd44
commit
a2ae0bc9b8
1 changed files with 14 additions and 1 deletions
|
|
@ -1449,7 +1449,6 @@ public class VerifyCardDataTest {
|
||||||
if (refText.contains("[") && refText.contains("]")) {
|
if (refText.contains("[") && refText.contains("]")) {
|
||||||
refText = refText.replace("[", "").replace("]", "");
|
refText = refText.replace("[", "").replace("]", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// evergreen keyword fix
|
// evergreen keyword fix
|
||||||
for (String s : refText.split("[\\$\\\n]")) {
|
for (String s : refText.split("[\\$\\\n]")) {
|
||||||
if (Arrays
|
if (Arrays
|
||||||
|
|
@ -1472,6 +1471,20 @@ public class VerifyCardDataTest {
|
||||||
.replace("\n•", "<br>&bull ");
|
.replace("\n•", "<br>&bull ");
|
||||||
refText += "<br>";
|
refText += "<br>";
|
||||||
}
|
}
|
||||||
|
// mana ability fix
|
||||||
|
for (String s : refText.split("[\\$\\\n]")) {
|
||||||
|
if (!s.startsWith("{T}: Add {") || !s.contains("} or {")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String newStr = "";
|
||||||
|
for (String c : s.split("[\\{\\}]")) {
|
||||||
|
if ("WUBRG".contains(c) && c.length() > 0) {
|
||||||
|
newStr += "{T}: Add {" + c + "}.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
refText = refText.replace(s, newStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String[] refRules = refText.split("[\\$\\\n]"); // ref card's abilities can be splited by \n or $ chars
|
String[] refRules = refText.split("[\\$\\\n]"); // ref card's abilities can be splited by \n or $ chars
|
||||||
for (int i = 0; i < refRules.length; i++) {
|
for (int i = 0; i < refRules.length; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue