Пример #1
0
        protected override void CheckForResult(bool userTriggered, double timeOffset)
        {
            if (userTriggered || Time.Current < HitObject.EndTime)
            {
                return;
            }

            ApplyResult(r => r.Type = NestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult);
        }
Пример #2
0
        protected override void CheckForResult(bool userTriggered, double timeOffset)
        {
            if (userTriggered || Time.Current < HitObject.EndTime)
            {
                return;
            }

            // If only the nested hitobjects are judged, then the slider's own judgement is ignored for scoring purposes.
            // But the slider needs to still be judged with a reasonable hit/miss result for visual purposes (hit/miss transforms, etc).
            if (HitObject.OnlyJudgeNestedObjects)
            {
                ApplyResult(r => r.Type = NestedHitObjects.Any(h => h.Result.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult);
                return;
            }

            // Otherwise, if this slider also needs to be judged, apply judgement proportionally to the number of nested hitobjects hit. This is the classic osu!stable scoring.
            ApplyResult(r =>
            {
                int totalTicks = NestedHitObjects.Count;
                int hitTicks   = NestedHitObjects.Count(h => h.IsHit);

                if (hitTicks == totalTicks)
                {
                    r.Type = HitResult.Great;
                }
                else if (hitTicks == 0)
                {
                    r.Type = HitResult.Miss;
                }
                else
                {
                    double hitFraction = (double)hitTicks / totalTicks;
                    r.Type             = hitFraction >= 0.5 ? HitResult.Ok : HitResult.Meh;
                }
            });
        }