AF_MoveCounter now accepts Card targeting for a destination

This commit is contained in:
slapshot5
2011-10-30 16:50:19 +00:00
parent 69cd39f9c5
commit 31eb1dca22

View File

@@ -2102,10 +2102,12 @@ public class AbilityFactory_Counters {
source = srcCards.get(0); source = srcCards.get(0);
} }
ArrayList<Card> destCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa); ArrayList<Card> tgtCards;
Card dest = null; Target tgt = af.getAbTgt();
if (destCards.size() > 0) { if (tgt != null) {
dest = destCards.get(0); tgtCards = tgt.getTargetCards();
} else {
tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
} }
Counters cType = Counters.valueOf(params.get("CounterType")); Counters cType = Counters.valueOf(params.get("CounterType"));
@@ -2116,7 +2118,7 @@ public class AbilityFactory_Counters {
sb.append("s"); sb.append("s");
} }
sb.append(" from "); sb.append(" from ");
sb.append(source).append(" to ").append(dest); sb.append(source).append(" to ").append(tgtCards.get(0));
sb.append("."); sb.append(".");
@@ -2259,12 +2261,15 @@ public class AbilityFactory_Counters {
source = srcCards.get(0); source = srcCards.get(0);
} }
ArrayList<Card> destCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa); ArrayList<Card> tgtCards;
Card dest = null; Target tgt = af.getAbTgt();
if (destCards.size() > 0) { if (tgt != null) {
dest = destCards.get(0); tgtCards = tgt.getTargetCards();
} else {
tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
} }
for (Card dest : tgtCards) {
if (null != source && null != dest) { if (null != source && null != dest) {
if (source.getCounters(cType) >= amount) { if (source.getCounters(cType) >= amount) {
if (!dest.hasKeyword("CARDNAME can't have counters placed on it.") if (!dest.hasKeyword("CARDNAME can't have counters placed on it.")
@@ -2275,6 +2280,7 @@ public class AbilityFactory_Counters {
} }
} }
} }
}
} // moveCounterResolve } // moveCounterResolve
} // end class AbilityFactory_Counters } // end class AbilityFactory_Counters