make existing "doesNotShareNameWith " more flexible

This commit is contained in:
Northmoc
2022-01-11 13:14:47 -05:00
parent 75a35a3236
commit ae58554d16

View File

@@ -92,16 +92,6 @@ public class CardProperty {
}
}
}
} else if (property.startsWith("DifferentName_")) {
Set<String> names = Sets.newHashSet();
for (final Card c : CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), property.substring(14),
sourceController, source, spellAbility)) {
names.add(c.getName());
}
if (names.contains(card.getName())) {
return false;
}
} else if (property.startsWith("BorderColor")) {
if (!property.toUpperCase().contains(card.borderColor().toString())) {
return false;
@@ -960,6 +950,10 @@ public class CardProperty {
}
}
return list.isEmpty();
} else {
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restriction,
sourceController, source, spellAbility);
return !Iterables.any(list, CardPredicates.sharesNameWith(card));
}
}
} else if (property.startsWith("sharesControllerWith")) {