- Fixed Heartmender. Completely misunderstood the function of game.getAllPermanents(). Thought that the controllerId parameter provided some filter functionality.

This commit is contained in:
Jeff 2015-02-22 10:54:49 -06:00
parent 9fbd5a04bd
commit 64b6b1a90f

View file

@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.counters.Counter; import mage.counters.Counter;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -93,7 +94,11 @@ class HeartmenderEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
boolean applied = false; boolean applied = false;
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
if (game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game).isEmpty()) {
return true;
}
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null if (creature != null
&& creature.getCounters().getCount(counter.getName()) >= counter.getCount()) { && creature.getCounters().getCount(counter.getName()) >= counter.getCount()) {
creature.removeCounters(counter.getName(), counter.getCount(), game); creature.removeCounters(counter.getName(), counter.getCount(), game);