mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
spjspj - undo changes to SweepEffect
This commit is contained in:
parent
d01307e5ea
commit
5bba477147
1 changed files with 3 additions and 24 deletions
|
|
@ -32,7 +32,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
|
@ -49,8 +48,6 @@ import mage.util.CardUtil;
|
|||
public class SweepEffect extends OneShotEffect {
|
||||
|
||||
private final String sweepSubtype;
|
||||
private FilterPermanent setFilter = null;
|
||||
private boolean notTarget = true;
|
||||
|
||||
public SweepEffect(String sweepSubtype) {
|
||||
super(Outcome.Benefit);
|
||||
|
|
@ -58,21 +55,9 @@ public class SweepEffect extends OneShotEffect {
|
|||
this.staticText = "<i>Sweep</i> - Return any number of " + sweepSubtype + (sweepSubtype.endsWith("s") ? "" : "s") + " you control to their owner's hand";
|
||||
}
|
||||
|
||||
public SweepEffect(FilterPermanent filter, String text, boolean notTarget) {
|
||||
super(Outcome.Benefit);
|
||||
this.sweepSubtype = text;
|
||||
this.staticText = "Return any number of " + text + " you control to their owner's hand";
|
||||
this.setFilter = filter;
|
||||
this.notTarget = notTarget;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SweepEffect(final SweepEffect effect) {
|
||||
super(effect);
|
||||
this.sweepSubtype = effect.sweepSubtype;
|
||||
this.setFilter = effect.setFilter;
|
||||
this.notTarget = effect.notTarget;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -84,15 +69,9 @@ public class SweepEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
FilterPermanent filter;
|
||||
if (setFilter == null) {
|
||||
filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
|
||||
FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
|
||||
filter.add(new SubtypePredicate(sweepSubtype));
|
||||
} else {
|
||||
filter = setFilter;
|
||||
}
|
||||
|
||||
Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, notTarget);
|
||||
Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
|
||||
controller.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue