mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Merge pull request #3116 from spjspj/master
Fix Pyramid of the Pantheon, Fix SourceHasCounterCondition 'toString'
This commit is contained in:
commit
9c487b7310
2 changed files with 18 additions and 4 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue