mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
make existing "doesNotShareNameWith " more flexible
This commit is contained in:
@@ -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")) {
|
} else if (property.startsWith("BorderColor")) {
|
||||||
if (!property.toUpperCase().contains(card.borderColor().toString())) {
|
if (!property.toUpperCase().contains(card.borderColor().toString())) {
|
||||||
return false;
|
return false;
|
||||||
@@ -960,6 +950,10 @@ public class CardProperty {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list.isEmpty();
|
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")) {
|
} else if (property.startsWith("sharesControllerWith")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user