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 isReminder = false;
boolean isSymbol = false; boolean isSymbol = false;
String oracleText = face.getOracleText(); 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(); int len = oracleText.length();
for(int i = 0; i < len; i++) { for(int i = 0; i < len; i++) {
char c = oracleText.charAt(i); // This is to avoid needless allocations performed by toCharArray() 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); this.removedFromNonCommanderDecks = "NonCommander".equalsIgnoreCase(value);
} }
} else if ("AlternateMode".equals(key)) { } else if ("AlternateMode".equals(key)) {
//System.out.println(faces[curFace].getName());
this.altMode = CardSplitType.smartValueOf(value); this.altMode = CardSplitType.smartValueOf(value);
} else if ("ALTERNATE".equals(key)) { } else if ("ALTERNATE".equals(key)) {
this.curFace = 1; this.curFace = 1;

View File

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