use of mage.filter.predicate.permanent.ControllerIdPredicate in project mage by magefree.
the class MassDiminishEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(source.getFirstTarget()));
game.addEffect(new SetPowerToughnessAllEffect(1, 1, Duration.UntilYourNextTurn, filter, true), source);
return true;
}
use of mage.filter.predicate.permanent.ControllerIdPredicate in project mage by magefree.
the class NecriteTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
FilterPermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(defendingPlayerId));
Target target = new TargetPermanent(filter);
this.getTargets().clear();
this.addTarget(target);
return true;
}
return false;
}
use of mage.filter.predicate.permanent.ControllerIdPredicate in project mage by magefree.
the class SkirkCommandoTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
Player player = game.getPlayer(event.getPlayerId());
if (player != null) {
getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player " + player.getName() + " controls");
filter.add(new ControllerIdPredicate(event.getPlayerId()));
addTarget(new TargetCreaturePermanent(filter));
return true;
}
}
return false;
}
use of mage.filter.predicate.permanent.ControllerIdPredicate in project mage by magefree.
the class TopplegeistAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null) {
FilterCreaturePermanent FILTER = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
FILTER.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(FILTER));
return true;
}
}
return false;
}
use of mage.filter.predicate.permanent.ControllerIdPredicate in project mage by magefree.
the class ToothCollectorAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null) {
FilterCreaturePermanent FILTER = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
FILTER.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(FILTER));
return true;
}
}
return false;
}
Aggregations