* Willbender - Fixed that it wrongly could not target also abilities.

This commit is contained in:
LevelX2 2016-02-08 19:00:31 +01:00
parent 81590262f6
commit f350dd71c9
2 changed files with 5 additions and 5 deletions

View file

@ -37,7 +37,7 @@ import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.filter.FilterSpell; import mage.filter.FilterStackObject;
import mage.filter.predicate.mageobject.NumberOfTargetsPredicate; import mage.filter.predicate.mageobject.NumberOfTargetsPredicate;
import mage.target.TargetStackObject; import mage.target.TargetStackObject;
@ -47,10 +47,10 @@ import mage.target.TargetStackObject;
*/ */
public class Willbender extends CardImpl { public class Willbender extends CardImpl {
private static final FilterSpell filter = new FilterSpell("spell with a single target"); private static final FilterStackObject FILTER = new FilterStackObject("spell or ability with a single target");
static { static {
filter.add(new NumberOfTargetsPredicate(1)); FILTER.add(new NumberOfTargetsPredicate(1));
} }
public Willbender(UUID ownerId) { public Willbender(UUID ownerId) {
@ -66,7 +66,7 @@ public class Willbender extends CardImpl {
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{U}"))); this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{U}")));
// When Willbender is turned face up, change the target of target spell or ability with a single target. // When Willbender is turned face up, change the target of target spell or ability with a single target.
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new ChooseNewTargetsTargetEffect(true, true)); Ability ability = new TurnedFaceUpSourceTriggeredAbility(new ChooseNewTargetsTargetEffect(true, true));
ability.addTarget(new TargetStackObject(filter)); ability.addTarget(new TargetStackObject(FILTER));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -44,7 +44,7 @@ import mage.game.stack.StackObject;
*/ */
public class FilterStackObject extends FilterObject<StackObject> { public class FilterStackObject extends FilterObject<StackObject> {
protected List<ObjectPlayerPredicate<ObjectPlayer<Permanent>>> extraPredicates = new ArrayList<ObjectPlayerPredicate<ObjectPlayer<Permanent>>>(); protected List<ObjectPlayerPredicate<ObjectPlayer<Permanent>>> extraPredicates = new ArrayList<>();
public FilterStackObject() { public FilterStackObject() {
super("spell or ability"); super("spell or ability");