From 12e9728e019c8508bca56a729940656c5d2b921e Mon Sep 17 00:00:00 2001 From: TRT <> Date: Sun, 22 Aug 2021 16:49:24 +0200 Subject: [PATCH] Fix protection from colorless --- .../java/forge/game/ability/effects/ProtectEffect.java | 7 +------ forge-game/src/main/java/forge/game/card/Card.java | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java index 6e70f7dc965..114aed22927 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java @@ -27,7 +27,6 @@ public class ProtectEffect extends SpellAbilityEffect { */ @Override protected String getStackDescription(SpellAbility sa) { - final List 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 tgtCards = getTargetCards(sa); - if (!tgtCards.isEmpty()) { - final Iterator it = tgtCards.iterator(); while (it.hasNext()) { final Card tgtC = it.next(); @@ -111,7 +108,7 @@ public class ProtectEffect extends SpellAbilityEffect { choser = tgtCards.get(0).getController(); } final String choice = choser.getController().chooseProtectionType(Localizer.getInstance().getMessage("lblChooseAProtection"), sa, choices); - if( null == choice) + if (null == choice) return; gains.add(choice); game.getAction().notifyOfValue(sa, choser, Lang.joinHomogenous(gains), choser); @@ -188,7 +185,6 @@ public class ProtectEffect extends SpellAbilityEffect { } } // protectResolve() - public static List getProtectionList(final SpellAbility sa) { final List gains = new ArrayList<>(); @@ -211,5 +207,4 @@ public class ProtectEffect extends SpellAbilityEffect { return gains; } - } diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 0eb3c559be5..39301119b1d 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -5693,6 +5693,10 @@ public class Card extends GameEntity implements Comparable, 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