mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Merge branch 'protection' into 'master'
Fix protection from colorless See merge request core-developers/forge!5246
This commit is contained in:
@@ -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();
|
||||
@@ -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<String> getProtectionList(final SpellAbility sa) {
|
||||
final List<String> gains = new ArrayList<>();
|
||||
|
||||
@@ -211,5 +207,4 @@ public class ProtectEffect extends SpellAbilityEffect {
|
||||
return gains;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user