- 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

View File

@@ -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()) {

View File

@@ -190,6 +190,7 @@ public final class AbilityFactoryPlay {
} else {
sb.append(" ");
}
sb.append("Play ");
ArrayList<Card> 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<Card> 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<Card> 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) {