support for "CanEnchantEquippedBy" restriction

This commit is contained in:
Northmoc
2021-07-15 20:39:39 -04:00
parent e757af41f7
commit 01d4d6b22e

View File

@@ -453,6 +453,9 @@ public class CardProperty {
} }
} else if (property.startsWith("CanEnchant")) { } else if (property.startsWith("CanEnchant")) {
final String restriction = property.substring(10); final String restriction = property.substring(10);
if (restriction.equals("EquippedBy")) {
if (!source.getEquipping().canBeAttached(card)) return false;
}
if (restriction.equals("Remembered")) { if (restriction.equals("Remembered")) {
for (final Object rem : source.getRemembered()) { for (final Object rem : source.getRemembered()) {
if (!(rem instanceof Card) || !((Card) rem).canBeAttached(card)) if (!(rem instanceof Card) || !((Card) rem).canBeAttached(card))