mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
- Fixed Heartmender. Completely misunderstood the function of game.getAllPermanents(). Thought that the controllerId parameter provided some filter functionality.
This commit is contained in:
parent
9fbd5a04bd
commit
64b6b1a90f
1 changed files with 6 additions and 1 deletions
|
@ -40,6 +40,7 @@ import mage.constants.Rarity;
|
|||
import mage.constants.TargetController;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -93,7 +94,11 @@ class HeartmenderEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
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
|
||||
&& creature.getCounters().getCount(counter.getName()) >= counter.getCount()) {
|
||||
creature.removeCounters(counter.getName(), counter.getCount(), game);
|
||||
|
|
Loading…
Reference in a new issue