Fix non* targeting restrictions (e.g. nonland)

This commit is contained in:
drdev
2014-10-13 04:10:05 +00:00
parent 84da2570d8
commit 5c6d9736b2
3 changed files with 6 additions and 6 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;