diff --git a/.gitattributes b/.gitattributes index e714080d7ba..ccfa0906886 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1689,6 +1689,7 @@ res/cardsfolder/c/counsel_of_the_soratami.txt svneol=native#text/plain res/cardsfolder/c/counterbalance.txt svneol=native#text/plain res/cardsfolder/c/counterbore.txt svneol=native#text/plain res/cardsfolder/c/counterintelligence.txt svneol=native#text/plain +res/cardsfolder/c/counterlash.txt -text res/cardsfolder/c/counterspell.txt svneol=native#text/plain res/cardsfolder/c/countersquall.txt svneol=native#text/plain res/cardsfolder/c/countryside_crusher.txt -text diff --git a/res/cardsfolder/b/bone_to_ash.txt b/res/cardsfolder/b/bone_to_ash.txt index 38d97f70177..014520b8b30 100644 --- a/res/cardsfolder/b/bone_to_ash.txt +++ b/res/cardsfolder/b/bone_to_ash.txt @@ -2,7 +2,7 @@ Name:Bone to Ash ManaCost:2 U U Types:Instant Text:no text -A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | TgtPrompt$ Select target Creature spell | ValidTgts$ Creature | SubAbility$ DBDraw | SpellDescription$ Counter target creature spell. Draw a card +A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | TgtPrompt$ Select target Creature spell | ValidTgts$ Creature | SubAbility$ DBDraw | SpellDescription$ Counter target creature spell. Draw a card. SVar:DBDraw:DB$Draw | NumCards$ 1 SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/bone_to_ash.jpg diff --git a/res/cardsfolder/c/counterlash.txt b/res/cardsfolder/c/counterlash.txt new file mode 100644 index 00000000000..08b196c086b --- /dev/null +++ b/res/cardsfolder/c/counterlash.txt @@ -0,0 +1,11 @@ +Name:Counterlash +ManaCost:4 U U +Types:Instant +Text:no text +A:SP$ Counter | Cost$ 4 U U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | SubAbility$ DBPlay | SpellDescription$ Counter target spell. You may cast a nonland card in your hand that shares a card type with that spell without paying its mana cost. +SVar:DBPlay:DB$ Play | Valid$ Targeted.sharesTypeWith+nonLand+YouCtrl | ValidZone$ Hand | WithoutManaCost$ True | Optional$ True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/counterlash.jpg +SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/33.jpg +Oracle:Counter target spell. You may cast a nonland card in your hand that shares a card type with that spell without paying its mana cost. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index b2f25ec3171..5b8074c81ce 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -2445,6 +2445,22 @@ public class AbilityFactory { source = (Card) (o); type = type.replace("Triggered", "Card"); + } else if (type.contains("Targeted")) { + source = null; + final SpellAbility parent = AbilityFactory.findParentsTargetedCard(sa); + if (parent != null) { + if (parent.getTarget() != null) { + if (!parent.getTarget().getTargetCards().isEmpty()) { + source = parent.getTarget().getTargetCards().get(0); + } else if (!parent.getTarget().getTargetSAs().isEmpty()) { + source = parent.getTarget().getTargetSAs().get(0).getSourceCard(); + } + } + } + if (source == null) { + return new CardList(); + } + type = type.replace("Targeted", "Card"); } else if (type.startsWith("Remembered")) { boolean hasRememberedCard = false; for (final Object o : source.getRemembered()) { diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryPlay.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryPlay.java index 741940838c7..b8d900d9ce0 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryPlay.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryPlay.java @@ -190,6 +190,7 @@ public final class AbilityFactoryPlay { } else { sb.append(" "); } + sb.append("Play "); ArrayList tgtCards; final Target tgt = sa.getTarget(); @@ -199,17 +200,19 @@ public final class AbilityFactoryPlay { tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa); } - sb.append("Cast "); - // TODO Someone fix this Description when Copying Charms - final Iterator it = tgtCards.iterator(); - while (it.hasNext()) { - sb.append(it.next()); - if (it.hasNext()) { - sb.append(", "); + if (params.containsKey("Valid")) { + sb.append("cards"); + } else { + final Iterator it = tgtCards.iterator(); + while (it.hasNext()) { + sb.append(it.next()); + if (it.hasNext()) { + sb.append(", "); + } } } if (params.containsKey("WithoutManaCost")) { - sb.append(" without paying its mana cost"); + sb.append(" without paying the mana cost"); } sb.append("."); @@ -339,7 +342,7 @@ public final class AbilityFactoryPlay { zone = Zone.smartValueOf(params.get("ValidZone")); } tgtCards = AllZoneUtil.getCardsIn(zone); - tgtCards = tgtCards.getValidCards(params.get("Valid"), controller, source); + tgtCards = AbilityFactory.filterListByType(tgtCards, params.get("Valid"), sa); } else if (params.containsKey("Defined")) { tgtCards = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa)); } else if (tgt != null) {