forked from External/mage
* Fixed commander format check. It ignores now mana symbols of reminder text like used for Extort (Fixes #553).
This commit is contained in:
parent
9bdaef5b34
commit
f1b063f339
1 changed files with 8 additions and 14 deletions
|
|
@ -156,35 +156,29 @@ public class Commander extends DeckValidator {
|
|||
public FilterMana getColorIdentity(Card card){
|
||||
FilterMana mana = new FilterMana();
|
||||
mana.setBlack(card.getManaCost().getText().matches(regexBlack));
|
||||
mana.setBlue(card.getManaCost().getText().matches(regexBlue));
|
||||
mana.setGreen(card.getManaCost().getText().matches(regexGreen));
|
||||
mana.setRed(card.getManaCost().getText().matches(regexRed));
|
||||
mana.setWhite(card.getManaCost().getText().matches(regexWhite));
|
||||
|
||||
for(String rule : card.getRules()){
|
||||
rule = rule.replaceAll("(?i)<i.*?</i>", ""); // Ignoring reminder text in italic
|
||||
if(rule.matches(regexBlack)){
|
||||
mana.setBlack(true);
|
||||
}
|
||||
}
|
||||
mana.setBlue(card.getManaCost().getText().matches(regexBlue));
|
||||
for(String rule : card.getRules()){
|
||||
if(rule.matches(regexBlue)){
|
||||
mana.setBlue(true);
|
||||
}
|
||||
}
|
||||
mana.setGreen(card.getManaCost().getText().matches(regexGreen));
|
||||
for(String rule : card.getRules()){
|
||||
if(rule.matches(regexGreen)){
|
||||
mana.setGreen(true);
|
||||
}
|
||||
}
|
||||
mana.setRed(card.getManaCost().getText().matches(regexRed));
|
||||
for(String rule : card.getRules()){
|
||||
if(rule.matches(regexRed)){
|
||||
mana.setRed(true);
|
||||
}
|
||||
}
|
||||
mana.setWhite(card.getManaCost().getText().matches(regexWhite));
|
||||
for(String rule : card.getRules()){
|
||||
if(rule.matches(regexWhite)){
|
||||
mana.setWhite(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return mana;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue