public bool OnPressed(KeyBindingPressEvent<ManiaAction> e) { if (AllJudged) return false; if (e.Action != Action.Value) return false; // do not run any of this logic when rewinding, as it inverts order of presses/releases. if (Time.Elapsed < 0) return false; if (CheckHittable?.Invoke(this, Time.Current) == false) return false; // The tail has a lenience applied to it which is factored into the miss window (i.e. the miss judgement will be delayed). // But the hold cannot ever be started within the late-lenience window, so we should skip trying to begin the hold during that time. // Note: Unlike below, we use the tail's start time to determine the time offset. if (Time.Current > Tail.HitObject.StartTime && !Tail.HitObject.HitWindows.CanBeHit(Time.Current - Tail.HitObject.StartTime)) return false; beginHoldAt(Time.Current - Head.HitObject.StartTime); return Head.UpdateResult(); }
protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) { switch (hitObject) { case SliderTailCircle tail: return(new DrawableSliderTail(slider, tail)); case SliderHeadCircle head: return(new DrawableSliderHead(slider, head) { OnShake = Shake, CheckHittable = (d, t) => CheckHittable?.Invoke(d, t) ?? true }); case SliderTick tick: return(new DrawableSliderTick(tick) { Position = tick.Position - slider.Position }); case SliderRepeat repeat: return(new DrawableSliderRepeat(repeat, this) { Position = repeat.Position - slider.Position }); } return(base.CreateNestedHitObject(hitObject)); }
public bool OnPressed(ManiaAction action) { if (AllJudged) { return(false); } if (action != Action.Value) { return(false); } if (CheckHittable?.Invoke(this, Time.Current) == false) { return(false); } // The tail has a lenience applied to it which is factored into the miss window (i.e. the miss judgement will be delayed). // But the hold cannot ever be started within the late-lenience window, so we should skip trying to begin the hold during that time. // Note: Unlike below, we use the tail's start time to determine the time offset. if (Time.Current > Tail.HitObject.StartTime && !Tail.HitObject.HitWindows.CanBeHit(Time.Current - Tail.HitObject.StartTime)) { return(false); } beginHoldAt(Time.Current - Head.HitObject.StartTime); Head.UpdateResult(); return(true); }
protected override void CheckForResult(bool userTriggered, double timeOffset) { if (auto && !userTriggered && timeOffset > hitOffset && CheckHittable?.Invoke(this, Time.Current) != false) { // force success ApplyResult(r => r.Type = HitResult.Great); } else { base.CheckForResult(userTriggered, timeOffset); } }
public virtual bool OnPressed(ManiaAction action) { if (action != Action.Value) { return(false); } if (CheckHittable?.Invoke(this, Time.Current) == false) { return(false); } return(UpdateResult(true)); }
public virtual bool OnPressed(KeyBindingPressEvent <ManiaAction> e) { if (e.Action != Action.Value) { return(false); } if (CheckHittable?.Invoke(this, Time.Current) == false) { return(false); } return(UpdateResult(true)); }
protected override void CheckForResult(bool userTriggered, double timeOffset) { Debug.Assert(HitObject.HitWindows != null); if (CheckValidation == null) { return; } if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) { ApplyResult(r => r.Type = HitResult.Miss); } return; } var validation = CheckValidation.Invoke(HitObject.Angle); if (validation.Item1) { var result = HitObject.HitWindows.ResultFor(timeOffset); if (result == HitResult.None || CheckHittable?.Invoke(this, Time.Current) == false) { return; } if (!validActionPressed) { ApplyResult(r => r.Type = HitResult.Miss); } else { ApplyResult(r => { var beatResult = (TauJudgementResult)r; if (result.IsHit()) { beatResult.DeltaAngle = validation.Item2; } beatResult.Type = result; }); } } }
protected override void CheckForResult(bool userTriggered, double timeOffset) { Debug.Assert(HitObject.HitWindows != null); if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) { ApplyResult(r => r.Type = HitResult.Miss); } return; } var result = HitObject.HitWindows.ResultFor(timeOffset); if (result == HitResult.None || CheckHittable?.Invoke(this, Time.Current) == false) { return; } ApplyResult(r => r.Type = result); }