mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
AF_MoveCounter now accepts Card targeting for a destination
This commit is contained in:
@@ -2102,10 +2102,12 @@ public class AbilityFactory_Counters {
|
||||
source = srcCards.get(0);
|
||||
}
|
||||
|
||||
ArrayList<Card> destCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
|
||||
Card dest = null;
|
||||
if (destCards.size() > 0) {
|
||||
dest = destCards.get(0);
|
||||
ArrayList<Card> tgtCards;
|
||||
Target tgt = af.getAbTgt();
|
||||
if (tgt != null) {
|
||||
tgtCards = tgt.getTargetCards();
|
||||
} else {
|
||||
tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
|
||||
}
|
||||
|
||||
Counters cType = Counters.valueOf(params.get("CounterType"));
|
||||
@@ -2116,7 +2118,7 @@ public class AbilityFactory_Counters {
|
||||
sb.append("s");
|
||||
}
|
||||
sb.append(" from ");
|
||||
sb.append(source).append(" to ").append(dest);
|
||||
sb.append(source).append(" to ").append(tgtCards.get(0));
|
||||
|
||||
sb.append(".");
|
||||
|
||||
@@ -2259,12 +2261,15 @@ public class AbilityFactory_Counters {
|
||||
source = srcCards.get(0);
|
||||
}
|
||||
|
||||
ArrayList<Card> destCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
|
||||
Card dest = null;
|
||||
if (destCards.size() > 0) {
|
||||
dest = destCards.get(0);
|
||||
ArrayList<Card> tgtCards;
|
||||
Target tgt = af.getAbTgt();
|
||||
if (tgt != null) {
|
||||
tgtCards = tgt.getTargetCards();
|
||||
} else {
|
||||
tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa);
|
||||
}
|
||||
|
||||
for (Card dest : tgtCards) {
|
||||
if (null != source && null != dest) {
|
||||
if (source.getCounters(cType) >= amount) {
|
||||
if (!dest.hasKeyword("CARDNAME can't have counters placed on it.")
|
||||
@@ -2275,6 +2280,7 @@ public class AbilityFactory_Counters {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // moveCounterResolve
|
||||
|
||||
} // end class AbilityFactory_Counters
|
||||
|
||||
Reference in New Issue
Block a user