mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Beamtown Bullies now properly targets opponent (#10439)
* Beamtown Bullies now properly targets opponent Fixes magefree/mage#9975 * Fixed filter initialization
This commit is contained in:
parent
2194aee865
commit
b0809c4a7a
4 changed files with 28 additions and 41 deletions
|
|
@ -31,11 +31,12 @@ public class FilterPlayer extends FilterImpl<Player> {
|
|||
this.extraPredicates.addAll(filter.extraPredicates);
|
||||
}
|
||||
|
||||
public void add(ObjectSourcePlayerPredicate predicate) {
|
||||
public FilterPlayer add(ObjectSourcePlayerPredicate predicate) {
|
||||
if (isLockedFilter()) {
|
||||
throw new UnsupportedOperationException("You may not modify a locked filter");
|
||||
}
|
||||
extraPredicates.add(predicate);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package mage.filter.predicate.other;
|
||||
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public enum ActivePlayerPredicate implements Predicate<Player> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Player input, Game game) {
|
||||
return game.isActivePlayer(input.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package mage.target.common;
|
||||
|
||||
import mage.filter.FilterOpponent;
|
||||
import mage.filter.predicate.other.PlayerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
* @author Arketec
|
||||
*/
|
||||
public class TargetOpponentWhoseTurnItIs extends TargetPlayer {
|
||||
|
||||
public TargetOpponentWhoseTurnItIs(Game game) {
|
||||
this(game,false);
|
||||
|
||||
}
|
||||
|
||||
public TargetOpponentWhoseTurnItIs(Game game, boolean notTarget) {
|
||||
super(1, 1, notTarget, new FilterOpponent());
|
||||
super.filter.add(new PlayerIdPredicate(game.getActivePlayerId()));
|
||||
}
|
||||
|
||||
private TargetOpponentWhoseTurnItIs(final TargetOpponentWhoseTurnItIs target) {
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetOpponentWhoseTurnItIs copy() {
|
||||
return new TargetOpponentWhoseTurnItIs(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue