Fix filter on Anathemancer

This commit is contained in:
xenohedron 2023-04-25 21:16:14 -04:00
parent b3d0f51263
commit cd7701d4fd
2 changed files with 9 additions and 6 deletions

View file

@ -12,7 +12,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.TargetPlayer;
@ -61,8 +62,10 @@ enum AnathemancerCount implements DynamicValue {
if (sourceAbility.getFirstTarget() == null) {
return 0;
}
FilterLandPermanent filter = FilterLandPermanent.nonbasicLands();
filter.add(new ControllerIdPredicate(sourceAbility.getFirstTarget()));
return game.getBattlefield().count(
StaticFilters.FILTER_LANDS_NONBASIC,
filter,
sourceAbility.getControllerId(),
sourceAbility, game
);

View file

@ -38,7 +38,7 @@ public final class Pallimud extends CardImpl {
this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment)));
// Pallimud's power is equal to the number of tapped lands the chosen player controls.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new AnathemancerCount())));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PallimudCount())));
}
private Pallimud(final Pallimud card) {
@ -51,7 +51,7 @@ public final class Pallimud extends CardImpl {
}
}
class AnathemancerCount implements DynamicValue {
class PallimudCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
@ -69,8 +69,8 @@ class AnathemancerCount implements DynamicValue {
}
@Override
public AnathemancerCount copy() {
return new AnathemancerCount();
public PallimudCount copy() {
return new PallimudCount();
}
@Override