mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
CantAttach: remove 'can't be enchanted in the future'
This commit is contained in:
@@ -374,7 +374,7 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
|
|||||||
|
|
||||||
public boolean canBeAttachedBy(final Card attach, boolean checkSBA) {
|
public boolean canBeAttachedBy(final Card attach, boolean checkSBA) {
|
||||||
// master mode
|
// master mode
|
||||||
if (!attach.isAttachment() || attach.isCreature()) {
|
if (!attach.isAttachment() || attach.isCreature() || equals(attach)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5188,9 +5188,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return !((hasKeyword("CARDNAME can't be enchanted in the future.") && !isEnchantedBy(aura))
|
return true;
|
||||||
|| (hasKeyword("CARDNAME can't be enchanted.") && !aura.getName().equals("Anti-Magic Aura")
|
|
||||||
&& !(aura.getName().equals("Consecrate Land") && aura.isInZone(ZoneType.Battlefield))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -401,11 +401,11 @@ public class CardProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("AttachedBy")) {
|
} else if (property.startsWith("AttachedBy")) {
|
||||||
if (!card.isEquippedBy(source) && !card.isEnchantedBy(source) && !card.isFortifiedBy(source)) {
|
if (!card.isAttachedBy(source)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.equals("Attached")) {
|
} else if (property.equals("Attached")) {
|
||||||
if (card.getEquipping() != source && !source.equals(card.getAttaching())) {
|
if (!source.isAttachedBy(card)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("AttachedTo")) {
|
} else if (property.startsWith("AttachedTo")) {
|
||||||
@@ -433,8 +433,7 @@ public class CardProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((card.getAttaching() == null || !card.getAttaching().isValid(restriction, sourceController, source, spellAbility))
|
if ((card.getAttaching() == null || !card.getAttaching().isValid(restriction, sourceController, source, spellAbility))) {
|
||||||
&& (card.getEquipping() == null || !card.getEquipping().isValid(restriction, sourceController, source, spellAbility))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -444,7 +443,7 @@ public class CardProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.equals("NotAttachedTo")) {
|
} else if (property.equals("NotAttachedTo")) {
|
||||||
if (card.getEquipping() == source || source.equals(card.getAttaching())) {
|
if (source.isAttachedBy(card)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("EnchantedBy")) {
|
} else if (property.startsWith("EnchantedBy")) {
|
||||||
@@ -546,7 +545,7 @@ public class CardProperty {
|
|||||||
final SpellAbility saTargeting = sa.getSATargetingCard();
|
final SpellAbility saTargeting = sa.getSATargetingCard();
|
||||||
if (saTargeting != null) {
|
if (saTargeting != null) {
|
||||||
for (final Card c : saTargeting.getTargets().getTargetCards()) {
|
for (final Card c : saTargeting.getTargets().getTargetCards()) {
|
||||||
if (!card.isEquippedBy(c)) {
|
if (!card.isAttachedBy(c)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -554,16 +553,16 @@ public class CardProperty {
|
|||||||
}
|
}
|
||||||
} else if (property.substring(10).equals("Enchanted")) {
|
} else if (property.substring(10).equals("Enchanted")) {
|
||||||
if (source.getEnchantingCard() == null ||
|
if (source.getEnchantingCard() == null ||
|
||||||
!card.isEquippedBy(source.getEnchantingCard())) {
|
!card.isAttachedBy(source.getEnchantingCard())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!card.isEquippedBy(source)) {
|
if (!card.isAttachedBy(source)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("FortifiedBy")) {
|
} else if (property.startsWith("FortifiedBy")) {
|
||||||
if (!card.isFortifiedBy(source)) {
|
if (!card.isAttachedBy(source)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("CanBeAttachedBy")) {
|
} else if (property.startsWith("CanBeAttachedBy")) {
|
||||||
|
|||||||
@@ -17,6 +17,18 @@ public class StaticAbilityCantAttach {
|
|||||||
&& !target.isValid(stAb.getParam("Target").split(","), hostCard.getController(), hostCard, null)) {
|
&& !target.isValid(stAb.getParam("Target").split(","), hostCard.getController(), hostCard, null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stAb.hasParam("ValidCardToTarget")) {
|
||||||
|
if (!(target instanceof Card)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Card tcard = (Card) target;
|
||||||
|
|
||||||
|
if (!card.isValid(stAb.getParam("ValidCardToTarget").split(","), tcard.getController(), tcard, null)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user