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

@@ -1518,7 +1518,7 @@ public class AbilityUtils {
}
public static final String applyAbilityTextChangeEffects(final String def, final CardTraitBase ability) {
if (ability == null || !ability.isIntrinsic()) {
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;
}

View File

@@ -2,7 +2,8 @@ Name:Etched Champion
ManaCost:3
Types:Artifact Creature Soldier
PT:2/2
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | Condition$ Metalcraft | Description$ Metalcraft - CARDNAME has protection from all colors as long as you control three or more artifacts.
# Lock in text so can't change color words in "Protection from all colors"
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | LockInText$ True | Condition$ Metalcraft | Description$ Metalcraft - CARDNAME has protection from all colors as long as you control three or more artifacts.
SVar:BuffedBy:Artifact
SVar:Picture:http://www.wizards.com/global/images/magic/general/etched_champion.jpg
Oracle:Metalcraft - Etched Champion has protection from all colors as long as you control three or more artifacts.

View File

@@ -1,7 +1,8 @@
Name:Favor of the Mighty
ManaCost:1 W
Types:Tribal Enchantment Giant
S:Mode$ Continuous | Affected$ Creature.greatestCMC | AddKeyword$ Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | Description$ Each creature with the highest converted mana cost has protection from all colors.
# Lock in text so can't change color words in "Protection from all colors"
S:Mode$ Continuous | Affected$ Creature.greatestCMC | AddKeyword$ Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | LockInText$ True | Description$ Each creature with the highest converted mana cost has protection from all colors.
SVar:NonStackingEffect:True
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/favor_of_the_mighty.jpg

View File

@@ -8,5 +8,7 @@ K:Protection from blue
K:Protection from black
K:Protection from red
K:Protection from green
# Lock in keywords so can't change color words in "Protection from all colors"
SVar:LockInKeywords:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/iridescent_angel.jpg
Oracle:Flying, protection from all colors

View File

@@ -3,7 +3,8 @@ ManaCost:4 W W
Types:Creature Angel
PT:4/4
K:Flying
S:Mode$ Continuous | Affected$ Card.Self+untapped | AddKeyword$ Protection from artifacts & Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | Description$ As long as CARDNAME is untapped, it has protection from artifacts and from all colors.
# Lock in text so can't change color words in "Protection from all colors"
S:Mode$ Continuous | Affected$ Card.Self+untapped | AddKeyword$ Protection from artifacts & Protection from white & Protection from blue & Protection from black & Protection from red & Protection from green | LockInText$ True | Description$ As long as CARDNAME is untapped, it has protection from artifacts and from all colors.
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigUntap | TriggerDescription$ Whenever you cast a spell, you may untap CARDNAME.
SVar:TrigUntap:AB$Untap | Cost$ 0 | Defined$ Self
SVar:Picture:http://www.wizards.com/global/images/magic/general/pristine_angel.jpg