예제 #1
0
        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();
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
 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);
     }
 }
예제 #5
0
        public virtual bool OnPressed(ManiaAction action)
        {
            if (action != Action.Value)
            {
                return(false);
            }

            if (CheckHittable?.Invoke(this, Time.Current) == false)
            {
                return(false);
            }

            return(UpdateResult(true));
        }
예제 #6
0
        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));
        }
예제 #7
0
파일: DrawableBeat.cs 프로젝트: Altenhh/tau
        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;
                    });
                }
            }
        }
예제 #8
0
        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);
        }