mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fix a bug with Tawnos Urza's Apprentice caught by the predicate refactor (#5220)
This commit is contained in:
parent
a68667e582
commit
a94dbe1c9d
2 changed files with 26 additions and 2 deletions
|
@ -17,7 +17,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterStackObject;
|
||||
import mage.filter.predicate.ability.ArtifactSourcePredicate;
|
||||
import mage.filter.predicate.other.StackObjectWithArtifactSourcePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -34,7 +34,7 @@ public final class TawnosUrzasApprentice extends CardImpl {
|
|||
private final static FilterStackObject filter = new FilterStackObject("activated or triggered ability you control from an artifact source");
|
||||
|
||||
static {
|
||||
filter.add(new ArtifactSourcePredicate());
|
||||
filter.add(new StackObjectWithArtifactSourcePredicate());
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
package mage.filter.predicate.other;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class StackObjectWithArtifactSourcePredicate implements Predicate<StackObject> {
|
||||
|
||||
@Override
|
||||
public boolean apply(StackObject input, Game game) {
|
||||
MageObject sourceObject = game.getObject(input.getSourceId());
|
||||
return sourceObject != null && sourceObject.isArtifact();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Source(Artifact)";
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue