mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +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);
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user