@Override public void run() { if (elapsedTime() > ELAPSE_TIME) { if (!target().invulnerable()) { synchronized (target().curses()) { target().curses().add(effect().get(0).clone()); } } setActivate(false, false); } else { applyEffect(target(), contains(target())); Audio.attemptReplay(Audio.BOUND_OF_FREEDOM); } }
@Override public void setActivate(boolean activate, boolean forceAdjust) { if (activate) { if (!activate() && (available() || forceAdjust)) { if (owner().distance(target()) < CAST_RANGE) { super.setActivate(true, forceAdjust); setTarget(owner().target()); setPosition(target().position().clone()); targetPreviousPosition = target().position().clone(); schedule(); setStartTime(Clocks.masterClock.currentTime()); Audio.playSound(Audio.BOUND_OF_FREEDOM); } } } else { clearTask(); super.setActivate(false, forceAdjust); } }
@Override protected void schedule() { setTimerID(Clocks.masterClock.scheduleFixedRate(this, UNIT_TIME, TimeUnit.MILLISECONDS)); Audio.playSound(Audio.SOUL_DIVE); }