- Added Counterlash.

This commit is contained in:
Sloth
2012-02-18 12:20:18 +00:00
parent b97321aed1
commit 9c87d513f1
5 changed files with 41 additions and 10 deletions

1
.gitattributes vendored
View File

@@ -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/counterbalance.txt svneol=native#text/plain
res/cardsfolder/c/counterbore.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/counterintelligence.txt svneol=native#text/plain
res/cardsfolder/c/counterlash.txt -text
res/cardsfolder/c/counterspell.txt svneol=native#text/plain res/cardsfolder/c/counterspell.txt svneol=native#text/plain
res/cardsfolder/c/countersquall.txt svneol=native#text/plain res/cardsfolder/c/countersquall.txt svneol=native#text/plain
res/cardsfolder/c/countryside_crusher.txt -text res/cardsfolder/c/countryside_crusher.txt -text

View File

@@ -2,7 +2,7 @@ Name:Bone to Ash
ManaCost:2 U U ManaCost:2 U U
Types:Instant Types:Instant
Text:no text 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:DBDraw:DB$Draw | NumCards$ 1
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/bone_to_ash.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/bone_to_ash.jpg

View File

@@ -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

View File

@@ -2445,6 +2445,22 @@ public class AbilityFactory {
source = (Card) (o); source = (Card) (o);
type = type.replace("Triggered", "Card"); 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")) { } else if (type.startsWith("Remembered")) {
boolean hasRememberedCard = false; boolean hasRememberedCard = false;
for (final Object o : source.getRemembered()) { for (final Object o : source.getRemembered()) {

View File

@@ -190,6 +190,7 @@ public final class AbilityFactoryPlay {
} else { } else {
sb.append(" "); sb.append(" ");
} }
sb.append("Play ");
ArrayList<Card> tgtCards; ArrayList<Card> tgtCards;
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
@@ -199,8 +200,9 @@ public final class AbilityFactoryPlay {
tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa); tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
} }
sb.append("Cast "); if (params.containsKey("Valid")) {
// TODO Someone fix this Description when Copying Charms sb.append("cards");
} else {
final Iterator<Card> it = tgtCards.iterator(); final Iterator<Card> it = tgtCards.iterator();
while (it.hasNext()) { while (it.hasNext()) {
sb.append(it.next()); sb.append(it.next());
@@ -208,8 +210,9 @@ public final class AbilityFactoryPlay {
sb.append(", "); sb.append(", ");
} }
} }
}
if (params.containsKey("WithoutManaCost")) { if (params.containsKey("WithoutManaCost")) {
sb.append(" without paying its mana cost"); sb.append(" without paying the mana cost");
} }
sb.append("."); sb.append(".");
@@ -339,7 +342,7 @@ public final class AbilityFactoryPlay {
zone = Zone.smartValueOf(params.get("ValidZone")); zone = Zone.smartValueOf(params.get("ValidZone"));
} }
tgtCards = AllZoneUtil.getCardsIn(zone); 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")) { } else if (params.containsKey("Defined")) {
tgtCards = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa)); tgtCards = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa));
} else if (tgt != null) { } else if (tgt != null) {