Fixed color identity interaction with special cases IE Transguild Courier

This commit is contained in:
Colin Redman 2018-08-01 17:27:56 -06:00
parent 308a55cf9a
commit 7092d16c5d

View file

@ -1,9 +1,6 @@
package mage.cards;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import mage.MageObject;
import mage.MageObjectImpl;
import mage.Mana;
@ -45,6 +42,13 @@ import mage.util.SubTypeList;
import mage.watchers.Watcher;
import org.apache.log4j.Logger;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public abstract class CardImpl extends MageObjectImpl implements Card {
private static final long serialVersionUID = 1L;
@ -852,11 +856,11 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
@Override
public FilterMana getColorIdentity() {
FilterMana mana = new FilterMana();
mana.setBlack(getManaCost().getText().matches(regexBlack));
mana.setBlue(getManaCost().getText().matches(regexBlue));
mana.setGreen(getManaCost().getText().matches(regexGreen));
mana.setRed(getManaCost().getText().matches(regexRed));
mana.setWhite(getManaCost().getText().matches(regexWhite));
mana.setBlack(getManaCost().getText().matches(regexBlack)||color.isBlack());
mana.setBlue(getManaCost().getText().matches(regexBlue)||color.isBlue());
mana.setGreen(getManaCost().getText().matches(regexGreen)||color.isGreen());
mana.setRed(getManaCost().getText().matches(regexRed)||color.isRed());
mana.setWhite(getManaCost().getText().matches(regexWhite)||color.isWhite());
for (String rule : getRules()) {
rule = rule.replaceAll("(?i)<i.*?</i>", ""); // Ignoring reminder text in italic