mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-12 08:48:39 +00:00
CountersPutEffect: support "EachType" in "CounterTypes"
This commit is contained in:
@@ -285,8 +285,25 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
types = types.replace("ChosenFromList", "");
|
types = types.replace("ChosenFromList", "");
|
||||||
}
|
}
|
||||||
for (String type : types.split(",")) {
|
for (String type : types.split(",")) {
|
||||||
|
if (type.contains("EachType")) {
|
||||||
|
CardCollectionView counterCards =
|
||||||
|
CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield),
|
||||||
|
type.split("_")[1], card.getController(), card, sa);
|
||||||
|
List <CounterType> counterTypes = Lists.newArrayList();
|
||||||
|
for (Card c : counterCards) {
|
||||||
|
for (final Map.Entry<CounterType, Integer> map : c.getCounters().entrySet()) {
|
||||||
|
if (!counterTypes.contains(map.getKey())) {
|
||||||
|
counterTypes.add(map.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (CounterType ct : counterTypes) {
|
||||||
|
resolvePerType(sa, placer, ct, counterAmount, table, false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
typesToAdd.add(CounterType.getType(type));
|
typesToAdd.add(CounterType.getType(type));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (CounterType ct : typesToAdd) {
|
for (CounterType ct : typesToAdd) {
|
||||||
if (obj instanceof Player) {
|
if (obj instanceof Player) {
|
||||||
((Player) obj).addCounter(ct, counterAmount, placer, table);
|
((Player) obj).addCounter(ct, counterAmount, placer, table);
|
||||||
|
|||||||
Reference in New Issue
Block a user