Fix changing color words in "Protection from all colors".

This commit is contained in:
elcnesh
2014-08-16 07:53:22 +00:00
parent 8be5331329
commit 55efef6406
6 changed files with 21 additions and 12 deletions

View File

@@ -1517,8 +1517,8 @@ public class AbilityUtils {
return sas;
}
public static final String applyAbilityTextChangeEffects(final String def, final CardTraitBase ability) {
if (ability == null || !ability.isIntrinsic()) {
public static final String applyAbilityTextChangeEffects(final String def, final CardTraitBase ability) {
if (ability == null || !ability.isIntrinsic() || ability.getMapParams().containsKey("LockInText")) {
return def;
}
return applyTextChangeEffects(def, ability.getHostCard());

View File

@@ -4593,6 +4593,10 @@ public class Card extends GameEntity implements Comparable<Card> {
}
private final void updateKeywordsChangedText(final Long timestamp) {
if (this.hasSVar("LockInKeywords")) {
return;
}
final List<String> addKeywords = Lists.newArrayList(),
removeKeywords = Lists.newArrayList(this.keywordsGrantedByTextChanges);
@@ -4608,7 +4612,9 @@ public class Card extends GameEntity implements Comparable<Card> {
}
private final void updateKeywordsOnRemoveChangedText(final KeywordsChange k) {
this.keywordsGrantedByTextChanges.removeAll(k.getKeywords());
if (k != null) {
this.keywordsGrantedByTextChanges.removeAll(k.getKeywords());
}
}
/**
@@ -8403,12 +8409,10 @@ public class Card extends GameEntity implements Comparable<Card> {
return true;
}
if (this.getKeyword() != null) {
final List<String> list = this.getKeyword();
String kw = "";
for (int i = 0; i < list.size(); i++) {
kw = list.get(i);
final List<String> keywords = this.getKeyword();
if (keywords != null) {
for (int i = 0; i < keywords.size(); i++) {
final String kw = keywords.get(i);
if (!kw.startsWith("Protection")) {
continue;
}