From c895253d5beb51ae0cfa31827c6bced9db8bd96a Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 22:04:07 +1000 Subject: [PATCH] Fix Pyramid of the Pantheon, Fix SourceHasCounterCondition 'toString' --- .../mage/cards/p/PyramidOfThePantheon.java | 2 +- .../common/SourceHasCounterCondition.java | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java index 568e3b220c..9fb79dec0f 100644 --- a/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java +++ b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java @@ -61,7 +61,7 @@ public class PyramidOfThePantheon extends CardImpl { this.addAbility(new ActivateIfConditionManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost(), - new SourceHasCounterCondition(CounterType.BRICK, 1))); + new SourceHasCounterCondition(CounterType.BRICK, 3))); } public PyramidOfThePantheon(final PyramidOfThePantheon card) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceHasCounterCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceHasCounterCondition.java index 96434483e0..b252edbd18 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceHasCounterCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceHasCounterCondition.java @@ -35,7 +35,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; /** - * + * * @author nantuko */ public class SourceHasCounterCondition implements Condition { @@ -82,12 +82,26 @@ public class SourceHasCounterCondition implements Condition { return count >= from; } return count >= from && count <= to; - } else { // single compare (lte) + } else // single compare (lte) + { if (card != null) { return card.getCounters(game).getCount(counterType) >= amount; - } else { + } else { return permanent.getCounters(game).getCount(counterType) >= amount; } } } + + @Override + public String toString() { + if (from != -1) { //range compare + if (to == Integer.MAX_VALUE) { + return "{this} has equal to or more than " + from + " " + this.counterType.toString() + " counters"; + } + return "{this} has between " + from + " and " + to + " " + this.counterType.toString() + " counters"; + } else // single compare (lte) + { + return "{this} has equal or more than " + amount + " " + this.counterType.toString() + " counters"; + } + } }