mirror of
https://github.com/magefree/mage.git
synced 2026-01-22 19:29:59 -08:00
remove unnecessary filter constructors from TargetLandPermanent
This commit is contained in:
parent
abb88e9527
commit
78c8686876
35 changed files with 310 additions and 354 deletions
|
|
@ -1,7 +1,5 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -11,9 +9,11 @@ import mage.filter.predicate.permanent.TappedPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* "Untap (up to) X lands" effect
|
||||
*/
|
||||
|
|
@ -65,7 +65,7 @@ public class UntapLandsEffect extends OneShotEffect {
|
|||
} else {
|
||||
tappedLands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).size();
|
||||
}
|
||||
TargetLandPermanent target = new TargetLandPermanent(upTo ? 0 : Math.min(tappedLands, amount), amount, filter, true);
|
||||
TargetPermanent target = new TargetPermanent(upTo ? 0 : Math.min(tappedLands, amount), amount, filter, true);
|
||||
if (target.canChoose(source.getControllerId(), source, game)) {
|
||||
|
||||
// UI Shortcut: Check if any lands are already tapped. If there are equal/fewer than amount, give the option to add those in to be untapped now.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -14,20 +13,12 @@ public class TargetLandPermanent extends TargetPermanent {
|
|||
this(1);
|
||||
}
|
||||
|
||||
public TargetLandPermanent(FilterLandPermanent filter) {
|
||||
this(1, 1, filter, false);
|
||||
}
|
||||
|
||||
public TargetLandPermanent(int numTargets) {
|
||||
this(numTargets, numTargets);
|
||||
}
|
||||
|
||||
public TargetLandPermanent(int numTargets, int maxNumTargets) {
|
||||
this(numTargets, maxNumTargets, maxNumTargets > 1 ? StaticFilters.FILTER_LANDS : StaticFilters.FILTER_LAND, false);
|
||||
}
|
||||
|
||||
public TargetLandPermanent(int minNumTargets, int maxNumTargets, FilterLandPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
super(numTargets, maxNumTargets, maxNumTargets > 1 ? StaticFilters.FILTER_LANDS : StaticFilters.FILTER_LAND, false);
|
||||
}
|
||||
|
||||
protected TargetLandPermanent(final TargetLandPermanent target) {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@ package mage.target.common;
|
|||
import mage.constants.SuperType;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class TargetNonBasicLandPermanent extends TargetLandPermanent {
|
||||
public class TargetNonBasicLandPermanent extends TargetPermanent {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue