use of mage.abilities.effects.common.combat.MustBeBlockedByTargetSourceEffect in project mage by magefree.
the class CrashingBoarsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player defendingPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (defendingPlayer != null) {
Target target = new TargetControlledCreaturePermanent(1, 1, filter, true);
if (target.choose(Outcome.Neutral, defendingPlayer.getId(), source.getSourceId(), game)) {
RequirementEffect effect = new MustBeBlockedByTargetSourceEffect();
effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game));
game.addEffect(effect, source);
}
return true;
}
return false;
}
Aggregations