mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Fix non* targeting restrictions (e.g. nonland)
This commit is contained in:
@@ -199,6 +199,10 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
|
||||
if (subtypes.contains(t)) {
|
||||
return true;
|
||||
}
|
||||
char firstChar = t.charAt(0);
|
||||
if (Character.isLowerCase(firstChar)) {
|
||||
t = Character.toUpperCase(firstChar) + t.substring(1); //ensure string is proper case for enum types
|
||||
}
|
||||
CoreType type = stringToCoreType.get(t);
|
||||
if (type != null) {
|
||||
return hasType(type);
|
||||
|
||||
@@ -292,7 +292,6 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
||||
}
|
||||
|
||||
public final boolean checkOtherRestrictions(final Card c, final SpellAbility sa, final Player activator) {
|
||||
|
||||
final Game game = activator.getGame();
|
||||
|
||||
if (this.getCardsInHand() != -1) {
|
||||
@@ -398,7 +397,6 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
||||
if (!Expressions.compare(svarValue, this.getsVarOperator(), operandValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this.getsVarToCheck() != null) {
|
||||
@@ -408,7 +406,6 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
||||
if (!Expressions.compare(svarValue, this.getsVarOperator(), operandValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@ public final class InputSelectTargets extends InputSyncronizedBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
// leave this in temporarily, there some seriously wrong things going on here
|
||||
// Can be targeted doesn't check if the target is a valid type, only if a card is generally "targetable"
|
||||
//If the card is not a valid target
|
||||
if (!card.canBeTargetedBy(sa)) {
|
||||
showMessage(sa.getHostCard() + " - Cannot target this card (Shroud? Protection? Restrictions).");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user