mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
fixed bug #3873
This commit is contained in:
parent
c6029176d3
commit
f1ba86f552
1 changed files with 38 additions and 2 deletions
|
|
@ -40,6 +40,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SetTargetPointer;
|
import mage.constants.SetTargetPointer;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
|
|
@ -57,7 +58,6 @@ public class WarsToll extends CardImpl {
|
||||||
private final static FilterCreaturePermanent filterOpponentCreature = new FilterCreaturePermanent("creature an opponent controls");
|
private final static FilterCreaturePermanent filterOpponentCreature = new FilterCreaturePermanent("creature an opponent controls");
|
||||||
private final static FilterLandPermanent filterOpponentLand = new FilterLandPermanent("an opponent taps a land");
|
private final static FilterLandPermanent filterOpponentLand = new FilterLandPermanent("an opponent taps a land");
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterOpponentCreature.add(new ControllerPredicate(TargetController.OPPONENT));
|
filterOpponentCreature.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||||
filterOpponentLand.add(new ControllerPredicate(TargetController.OPPONENT));
|
filterOpponentLand.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||||
|
|
@ -86,6 +86,42 @@ public class WarsToll extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TapAlEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
protected FilterPermanent filter;
|
||||||
|
|
||||||
|
public TapAlEffect(FilterPermanent filter) {
|
||||||
|
super(Outcome.Tap);
|
||||||
|
this.filter = filter;
|
||||||
|
setText();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TapAlEffect(final TapAlEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
this.filter = effect.filter.copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TapAlEffect copy() {
|
||||||
|
return new TapAlEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||||
|
if (permanent.getControllerId().equals(source.getFirstTarget())) {
|
||||||
|
permanent.tap(game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setText() {
|
||||||
|
staticText = "tap all " + filter.getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class WarsTollEffect extends OneShotEffect {
|
class WarsTollEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filterOpponentCreatures = new FilterCreaturePermanent();
|
private static final FilterCreaturePermanent filterOpponentCreatures = new FilterCreaturePermanent();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue