diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 850b0f7bff0..e6bf175c5d8 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -1490,33 +1490,6 @@ public class Card extends GameEntity implements Comparable { AllZone.getTriggerHandler().runTrigger("CounterAdded", runParams); } - if (counterName.equals(Counters.P1P1) || counterName.equals(Counters.M1M1)) { - // +1/+1 counters should erase -1/-1 counters - int plusOneCounters = 0; - int minusOneCounters = 0; - - final Counters p1Counter = Counters.P1P1; - final Counters m1Counter = Counters.M1M1; - if (this.counters.containsKey(p1Counter)) { - plusOneCounters = this.counters.get(p1Counter); - } - if (this.counters.containsKey(m1Counter)) { - minusOneCounters = this.counters.get(m1Counter); - } - - if (plusOneCounters == minusOneCounters) { - this.counters.remove(m1Counter); - this.counters.remove(p1Counter); - } - if (plusOneCounters > minusOneCounters) { - this.counters.remove(m1Counter); - this.counters.put(p1Counter, (plusOneCounters - minusOneCounters)); - } else { - this.counters.put(m1Counter, (minusOneCounters - plusOneCounters)); - this.counters.remove(p1Counter); - } - } - this.updateObservers(); } @@ -1550,33 +1523,6 @@ public class Card extends GameEntity implements Comparable { AllZone.getTriggerHandler().runTrigger("CounterAdded", runParams); } - if (counterName.equals(Counters.P1P1) || counterName.equals(Counters.M1M1)) { - // +1/+1 counters should erase -1/-1 counters - int plusOneCounters = 0; - int minusOneCounters = 0; - - final Counters p1Counter = Counters.P1P1; - final Counters m1Counter = Counters.M1M1; - if (this.counters.containsKey(p1Counter)) { - plusOneCounters = this.counters.get(p1Counter); - } - if (this.counters.containsKey(m1Counter)) { - minusOneCounters = this.counters.get(m1Counter); - } - - if (plusOneCounters == minusOneCounters) { - this.counters.remove(m1Counter); - this.counters.remove(p1Counter); - } - if (plusOneCounters > minusOneCounters) { - this.counters.remove(m1Counter); - this.counters.put(p1Counter, (plusOneCounters - minusOneCounters)); - } else { - this.counters.put(m1Counter, (minusOneCounters - plusOneCounters)); - this.counters.remove(p1Counter); - } - } - AllZone.getGameAction().checkStateEffects(); this.updateObservers(); diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 87944299f4d..12565899284 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -978,6 +978,28 @@ public class GameAction { } } + // +1/+1 counters should erase -1/-1 counters + if (c.getCounters(Counters.P1P1) > 0 && c.getCounters(Counters.M1M1) > 0) { + + final Counters p1Counter = Counters.P1P1; + final Counters m1Counter = Counters.M1M1; + int plusOneCounters = c.getCounters(Counters.P1P1); + int minusOneCounters = c.getCounters(Counters.M1M1); + + if (plusOneCounters == minusOneCounters) { + c.getCounters().remove(m1Counter); + c.getCounters().remove(p1Counter); + } + if (plusOneCounters > minusOneCounters) { + c.getCounters().remove(m1Counter); + c.getCounters().put(p1Counter, (plusOneCounters - minusOneCounters)); + } else { + c.getCounters().put(m1Counter, (minusOneCounters - plusOneCounters)); + c.getCounters().remove(p1Counter); + } + checkAgain = true; + } + } // while it.hasNext() if (!checkAgain) {