mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
ColorIdentity: Check for CDA text
This commit is contained in:
committed by
Hans Mackowiak
parent
59b68d80ca
commit
d9340349fa
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user