ColorIdentity: Check for CDA text

This commit is contained in:
Bug Hunter
2021-05-10 19:36:09 +00:00
committed by Hans Mackowiak
parent 59b68d80ca
commit d9340349fa
2 changed files with 7 additions and 7 deletions

View File

@@ -84,6 +84,12 @@ public final class CardRules implements ICardCharacteristics {
boolean isReminder = false;
boolean isSymbol = false;
String oracleText = face.getOracleText();
// CR 903.4 colors defined by its characteristic-defining abilities
for (String staticAbility : face.getStaticAbilities()) {
if (staticAbility.contains("CharacteristicDefining$ True") && staticAbility.contains("SetColor$ All")) {
res |= MagicColor.ALL_COLORS;
}
}
int len = oracleText.length();
for(int i = 0; i < len; i++) {
char c = oracleText.charAt(i); // This is to avoid needless allocations performed by toCharArray()
@@ -388,7 +394,6 @@ public final class CardRules implements ICardCharacteristics {
this.removedFromNonCommanderDecks = "NonCommander".equalsIgnoreCase(value);
}
} else if ("AlternateMode".equals(key)) {
//System.out.println(faces[curFace].getName());
this.altMode = CardSplitType.smartValueOf(value);
} else if ("ALTERNATE".equals(key)) {
this.curFace = 1;

View File

@@ -167,10 +167,7 @@ public class Zone implements java.io.Serializable, Iterable<Card> {
cardList.clear();
} else {
for (Card c : cardList) {
if (cardList.remove(c)) {
onChanged();
game.fireEvent(new GameEventZone(zoneType, getPlayer(), EventValueChangeType.Removed, c));
}
remove(c);
}
}
}
@@ -208,12 +205,10 @@ public class Zone implements java.io.Serializable, Iterable<Card> {
}
public final List<Card> getCardsAddedThisTurn(final ZoneType origin) {
//System.out.print("Request cards put into " + getZoneType() + " from " + origin + ".Amount: ");
return getCardsAdded(cardsAddedThisTurn, origin);
}
public final List<Card> getCardsAddedLastTurn(final ZoneType origin) {
//System.out.print("Last turn - Request cards put into " + getZoneType() + " from " + origin + ".Amount: ");
return getCardsAdded(cardsAddedLastTurn, origin);
}