mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
prevent proliferate affecting manashards
This commit is contained in:
@@ -19,6 +19,7 @@ package forge.game;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -280,7 +281,10 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
|
||||
|
||||
// Counters!
|
||||
public boolean hasCounters() {
|
||||
return !counters.isEmpty();
|
||||
if (counters.isEmpty())
|
||||
return false;
|
||||
int size = counters.entrySet().stream().filter(ct -> !ct.getKey().is(CounterEnumType.MANASHARDS)).collect(Collectors.toList()).size();
|
||||
return size > 0;
|
||||
}
|
||||
|
||||
// get all counters from a card
|
||||
|
||||
@@ -9,10 +9,7 @@ import forge.game.GameEntityCounterTable;
|
||||
import forge.game.ability.AbilityKey;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.CounterType;
|
||||
import forge.game.card.*;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerController;
|
||||
import forge.game.player.PlayerPredicates;
|
||||
@@ -68,6 +65,8 @@ public class CountersProliferateEffect extends SpellAbilityEffect {
|
||||
GameEntityCounterTable table = new GameEntityCounterTable();
|
||||
for (final GameEntity ge : result) {
|
||||
for (final CounterType ct : ge.getCounters().keySet()) {
|
||||
if (ct.is(CounterEnumType.MANASHARDS))
|
||||
continue;
|
||||
ge.addCounter(ct, 1, p, table);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user