@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { Permanent blocker = game.getPermanent(event.getSourceId()); if (filter.match(blocker, game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } return true; } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { if (event.getTargetId().equals(source.getControllerId())) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null && !sourcePermanent.isTapped()) { Permanent damageSource = game.getPermanent(event.getSourceId()); if (damageSource != null && filter.match(damageSource, game)) { return true; } } } } return false; }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); }
@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return !filterBlockedBy.match(blocker, source.getSourceId(), source.getControllerId(), game); }