From c37701ef1e553104594ce0b6e94d8784fa1ba7b5 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Sat, 30 Jun 2018 17:45:04 +0200 Subject: [PATCH] CantBeCounteredBy : make Autumns veil card text changing work --- forge-game/src/main/java/forge/game/card/Card.java | 5 ++++- .../main/java/forge/game/card/CardFactoryUtil.java | 13 +++++++++---- forge-gui/res/cardsfolder/a/autumns_veil.txt | 2 +- .../res/cardsfolder/upcoming/rustwing_falcon.txt | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) 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 e15af7417d0..da7329f345d 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -1445,7 +1445,10 @@ public class Card extends GameEntity implements Comparable { } } } - if (keyword.startsWith("etbCounter")) { + if (keyword.startsWith("CantBeCounteredBy")) { + final String[] p = keyword.split(":"); + sbLong.append(p[2]).append("\r\n"); + } else if (keyword.startsWith("etbCounter")) { final String[] p = keyword.split(":"); final StringBuilder s = new StringBuilder(); if (p.length > 4) { diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index bfd9bc21280..e3c5eaf573b 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -300,10 +300,15 @@ public class CardFactoryUtil { if (!isCounterable(c)) { return false; } - // Autumn's Veil - if (c.hasKeyword("CARDNAME can't be countered by blue or black spells.") && sa.isSpell() - && (sa.getHostCard().isBlack() || sa.getHostCard().isBlue())) { - return false; + + for (KeywordInterface k : c.getKeywords()) { + final String o = k.getOriginal(); + if (o.startsWith("CantBeCounteredBy")) { + final String m[] = o.split(":"); + if (sa.isValid(m[1].split(","), c.getController(), c, null)) { + return false; + } + } } return true; } diff --git a/forge-gui/res/cardsfolder/a/autumns_veil.txt b/forge-gui/res/cardsfolder/a/autumns_veil.txt index 29443357f34..5c1fefce1fe 100644 --- a/forge-gui/res/cardsfolder/a/autumns_veil.txt +++ b/forge-gui/res/cardsfolder/a/autumns_veil.txt @@ -2,7 +2,7 @@ Name:Autumn's Veil ManaCost:G Types:Instant A:SP$ Effect | Cost$ G | Name$ Autumn's Veil Effect | StaticAbilities$ AntiBlueBlack,STCantBeTarget | SpellDescription$ Spells you control can't be countered by blue or black spells this turn, and creatures you control can't be the targets of blue or black spells this turn. -SVar:AntiBlueBlack:Mode$ Continuous | Affected$ Card.YouCtrl | AffectedZone$ Stack | EffectZone$ Command | AddHiddenKeyword$ CARDNAME can't be countered by blue or black spells. | Description$ Spells you control can't be countered by blue or black spells this turn. +SVar:AntiBlueBlack:Mode$ Continuous | Affected$ Card.YouCtrl | AffectedZone$ Stack | EffectZone$ Command | AddHiddenKeyword$ CantBeCounteredBy:Spell.Blue,Spell.Black:CARDNAME can't be countered by blue or black spells. | Description$ Spells you control can't be countered by blue or black spells this turn. SVar:STCantBeTarget:Mode$ CantTarget | ValidCard$ Creature.YouCtrl | ValidSource$ Card.Blue,Card.Black | ValidSA$ Spell | EffectZone$ Command | Description$ Creatures you control can't be the targets of blue or black spells this turn. SVar:RemAIDeck:True SVar:RemRandomDeck:True diff --git a/forge-gui/res/cardsfolder/upcoming/rustwing_falcon.txt b/forge-gui/res/cardsfolder/upcoming/rustwing_falcon.txt index c1e4aca5a51..cf3bd9260eb 100644 --- a/forge-gui/res/cardsfolder/upcoming/rustwing_falcon.txt +++ b/forge-gui/res/cardsfolder/upcoming/rustwing_falcon.txt @@ -3,3 +3,4 @@ ManaCost:W Types:Creature Bird K:Flying PT:1/2 +Oracle:Flying