- Added some more options to the property "SharesColorWith" (for example "SharesColorWith TopOfLibary").

This commit is contained in:
Sloth
2011-11-08 13:00:28 +00:00
parent 232e9a69eb
commit 4495f038bd

View File

@@ -6548,9 +6548,29 @@ public class Card extends GameEntity implements Comparable<Card> {
return false;
}
} else if (property.startsWith("SharesColorWith")) {
if (property.equals("SharesColorWith")) {
if(!sharesColorWith(source)) {
return false;
}
} else {
String restriction = property.split("SharesColorWith ")[1];
if (restriction.equals("TopCardOfLibrary")) {
CardList list = this.getOwner().getCardsIn(Zone.Library);
if (list.isEmpty() || !sharesColorWith(list.get(0))) {
return false;
}
} else {
boolean shares = false;
for (Card card : sourceController.getCardsIn(Constant.Zone.Battlefield)) {
if (card.isValid(restriction, sourceController, source) && sharesColorWith(card)) {
shares = true;
}
}
if(!shares) {
return false;
}
}
}
} else if (property.startsWith("withFlashback")) {
boolean fb = false;
if (hasStartOfUnHiddenKeyword("Flashback")) {