@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) { return condition.apply(game, source); } return false; }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { if (lockedInCondition && !(condition instanceof FixedCondition)) { condition = new FixedCondition(condition.apply(game, source)); } 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 (!conditionState && effect.getDuration() == Duration.OneUse) { used = true; } if (!conditionState && effect.getDuration() == Duration.Custom) { this.discard(); } return false; }