mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
extended sharesCreatureTypeWith capability
This commit is contained in:
@@ -6889,8 +6889,28 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
}
|
||||
} else if (property.startsWith("sharesCreatureTypeWith")) {
|
||||
if (!this.sharesCreatureTypeWith(source)) {
|
||||
return false;
|
||||
if (property.equals("sharesCreatureTypeWith")) {
|
||||
if (!this.sharesCreatureTypeWith(source)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
final String restriction = property.split("sharesCreatureTypeWith ")[1];
|
||||
if (restriction.equals("TopCardOfLibrary")) {
|
||||
final CardList list = sourceController.getCardsIn(Zone.Library);
|
||||
if (list.isEmpty() || !this.sharesCreatureTypeWith(list.get(0))) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
boolean shares = false;
|
||||
for (final Card card : sourceController.getCardsIn(Constant.Zone.Battlefield)) {
|
||||
if (card.isValid(restriction, sourceController, source) && this.sharesCreatureTypeWith(card)) {
|
||||
shares = true;
|
||||
}
|
||||
}
|
||||
if (!shares) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (property.startsWith("sharesTypeWith")) {
|
||||
if (!this.sharesTypeWith(source)) {
|
||||
|
||||
Reference in New Issue
Block a user