@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (!initDone) {
init(source, game);
}
conditionState = condition.apply(game, source);
if (conditionState) {
effect.setTargetPointer(this.targetPointer);
return effect.applies(permanent, source, game);
} else if (otherwiseEffect != null) {
otherwiseEffect.setTargetPointer(this.targetPointer);
return otherwiseEffect.applies(permanent, source, game);
}
if (effect.getDuration() == Duration.OneUse) {
used = true;
}
if (effect.getDuration() == Duration.Custom) {
this.discard();
}
return false;
}