Merge branch 'protection' into 'master'

Fix protection from colorless

See merge request core-developers/forge!5246
This commit is contained in:
Hans Mackowiak
2021-08-22 15:01:52 +00:00
2 changed files with 5 additions and 6 deletions

View File

@@ -27,7 +27,6 @@ public class ProtectEffect extends SpellAbilityEffect {
*/
@Override
protected String getStackDescription(SpellAbility sa) {
final List<String> gains = getProtectionList(sa);
final boolean choose = sa.hasParam("Choices");
final String joiner = choose ? "or" : "and";
@@ -36,9 +35,7 @@ public class ProtectEffect extends SpellAbilityEffect {
List<Card> tgtCards = getTargetCards(sa);
if (!tgtCards.isEmpty()) {
final Iterator<Card> it = tgtCards.iterator();
while (it.hasNext()) {
final Card tgtC = it.next();
@@ -188,7 +185,6 @@ public class ProtectEffect extends SpellAbilityEffect {
}
} // protectResolve()
public static List<String> getProtectionList(final SpellAbility sa) {
final List<String> gains = new ArrayList<>();
@@ -211,5 +207,4 @@ public class ProtectEffect extends SpellAbilityEffect {
return gains;
}
}

View File

@@ -5693,6 +5693,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
if (!source.isColorless() && !colorlessDamage) {
return true;
}
} else if (kw.equals("Protection from colorless")) {
if (source.isColorless() || colorlessDamage) {
return true;
}
} else if (kw.equals("Protection from everything")) {
return true;
} else if (kw.startsWith("Protection:")) { // uses isValid; Protection:characteristic:desc:exception