示例#1
0
        public override void ApplyBeatmap(IBeatmap beatmap)
        {
            base.ApplyBeatmap(beatmap);

            hpMultiplier     = 1 / (object_count_factor * Math.Max(1, beatmap.HitObjects.OfType <Hit>().Count()) * IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.DrainRate, 0.5, 0.75, 0.98));
            hpMissMultiplier = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.DrainRate, 0.0018, 0.0075, 0.0120);
        }
示例#2
0
        public void TestAroundCentre()
        {
            var beatmap    = new TestBeatmap(new TauRuleset().RulesetInfo);
            var angleRange = (float)IBeatmapDifficultyInfo.DifficultyRange(beatmap.BeatmapInfo.Difficulty.CircleSize, 75, 25, 10);

            createTest(Enumerable.Range(0, (int)angleRange).Select(i => new HitEvent(i / 50f, HitResult.Perfect, new Beat(), new Beat(), new Vector2((i - (angleRange / 2)), 0))).ToList());
        }
示例#3
0
        private void assertTooShort(List <HitObject> hitObjects, IBeatmapDifficultyInfo beatmapDifficulty)
        {
            var issues = check.Run(getContext(hitObjects, beatmapDifficulty)).ToList();

            Assert.That(issues, Has.Count.EqualTo(1));
            Assert.That(issues.First().Template is CheckTooShortSpinners.IssueTemplateTooShort);
        }
示例#4
0
文件: HitWindows.cs 项目: Wieku/osu
        public void SetDifficulty(double difficulty)
        {
            foreach (var range in GetRanges())
            {
                double value = IBeatmapDifficultyInfo.DifficultyRange(difficulty, (range.Min, range.Average, range.Max));

                switch (range.Result)
                {
                case HitResult.Miss:
                    miss = value;
                    break;

                case HitResult.Meh:
                    meh = value;
                    break;

                case HitResult.Ok:
                    ok = value;
                    break;

                case HitResult.Good:
                    good = value;
                    break;

                case HitResult.Great:
                    great = value;
                    break;

                case HitResult.Perfect:
                    perfect = value;
                    break;
                }
            }
        }
示例#5
0
        private void createCatcher(float size)
        {
            circleSize = size;

            beatmapDifficulty = new BeatmapDifficulty
            {
                CircleSize = circleSize
            };

            SetContents(_ =>
            {
                return(new CatchInputManager(catchRuleset)
                {
                    RelativeSizeAxes = Axes.Both,
                    Children = new Drawable[]
                    {
                        new TestCatcherArea(beatmapDifficulty)
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.TopCentre,
                        }
                    }
                });
            });
        }
示例#6
0
        public virtual void CopyFrom(IBeatmapDifficultyInfo other)
        {
            ApproachRate      = other.ApproachRate;
            DrainRate         = other.DrainRate;
            CircleSize        = other.CircleSize;
            OverallDifficulty = other.OverallDifficulty;

            SliderMultiplier = other.SliderMultiplier;
            SliderTickRate   = other.SliderTickRate;
        }
示例#7
0
        protected override Beatmap <ManiaHitObject> ConvertBeatmap(IBeatmap original, CancellationToken cancellationToken)
        {
            IBeatmapDifficultyInfo difficulty = original.Difficulty;

            int seed = (int)MathF.Round(difficulty.DrainRate + difficulty.CircleSize) * 20 + (int)(difficulty.OverallDifficulty * 41.2) + (int)MathF.Round(difficulty.ApproachRate);

            Random = new FastRandom(seed);

            return(base.ConvertBeatmap(original, cancellationToken));
        }
示例#8
0
            public TestCatcherArea(IBeatmapDifficultyInfo beatmapDifficulty)
            {
                var droppedObjectContainer = new DroppedObjectContainer();

                Add(droppedObjectContainer);

                Catcher = new Catcher(droppedObjectContainer, beatmapDifficulty)
                {
                    X = CatchPlayfield.CENTER_X
                };
            }
示例#9
0
        private BeatmapVerifierContext getContext(List <HitObject> hitObjects, IBeatmapDifficultyInfo beatmapDifficulty)
        {
            var beatmap = new Beatmap <HitObject>
            {
                HitObjects  = hitObjects,
                BeatmapInfo = new BeatmapInfo {
                    Difficulty = new BeatmapDifficulty(beatmapDifficulty)
                }
            };

            return(new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap)));
        }
示例#10
0
        public static List <HitEvent> CreateDistributedHitEvents()
        {
            var hitEvents  = new List <HitEvent>();
            var beatmap    = new TestBeatmap(new TauRuleset().RulesetInfo);
            var angleRange = (float)IBeatmapDifficultyInfo.DifficultyRange(beatmap.BeatmapInfo.Difficulty.CircleSize, 75, 25, 10);

            for (int i = 0; i < 100; i++)
            {
                hitEvents.Add(new HitEvent(i - 25, HitResult.Perfect, new Beat(), new Beat(), new Vector2(RNG.NextSingle(-(angleRange / 2), angleRange / 2), 0)));
            }

            return(hitEvents);
        }
示例#11
0
            protected override void UpdateAtLimitedRate(InputState inputState)
            {
                if (HitEvent == null)
                {
                    double preempt = (float)IBeatmapDifficultyInfo.DifficultyRange(SampleApproachRate.Value, 1800, 1200, 450);

                    approach.Scale = new Vector2(1 + 4 * (float)MathHelper.Clamp((HitTime - Clock.CurrentTime) / preempt, 0, 100));
                    Alpha          = (float)MathHelper.Clamp((Clock.CurrentTime - HitTime + 600) / 400, 0, 1);

                    if (Clock.CurrentTime > HitTime + duration)
                    {
                        Expire();
                    }
                }
            }
示例#12
0
文件: TauCursor.cs 项目: Altenhh/tau
        public TauCursor(BeatmapDifficulty difficulty)
        {
            AngleRange = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.CircleSize, 75, 25, 10);

            FillAspectRatio = 1; // 1:1
            FillMode        = FillMode.Fit;
            Anchor          = Anchor.Centre;
            Origin          = Anchor.Centre;

            Alpha = 0;

            Add(PaddleDrawable = new Paddle(AngleRange));

            State.Value = Visibility.Hidden;
        }
示例#13
0
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
        {
            if (beatmap.HitObjects.Count == 0)
            {
                return new CatchDifficultyAttributes {
                           Mods = mods
                }
            }
            ;

            // this is the same as osu!, so there's potential to share the implementation... maybe
            double preempt = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;

            return(new CatchDifficultyAttributes
            {
                StarRating = Math.Sqrt(skills[0].DifficultyValue()) * star_scaling_factor,
                Mods = mods,
                ApproachRate = preempt > 1200.0 ? -(preempt - 1800.0) / 120.0 : -(preempt - 1200.0) / 150.0 + 5.0,
                MaxCombo = beatmap.HitObjects.Count(h => h is Fruit) + beatmap.HitObjects.OfType <JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet)),
            });
        }
示例#14
0
 public TestCatcher(DroppedObjectContainer droppedObjectTarget, IBeatmapDifficultyInfo difficulty)
     : base(droppedObjectTarget, difficulty)
 {
 }
示例#15
0
 private void assertOk(List <HitObject> hitObjects, IBeatmapDifficultyInfo beatmapDifficulty)
 {
     Assert.That(check.Run(getContext(hitObjects, beatmapDifficulty)), Is.Empty);
 }
示例#16
0
 public void ReadFromDifficulty(IBeatmapDifficultyInfo difficulty)
 {
 }
示例#17
0
 public CatchPlayfield(IBeatmapDifficultyInfo difficulty)
 {
     this.difficulty = difficulty;
 }
示例#18
0
 protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
 {
     controlPointInfo.Add(0, new EffectControlPoint {
         KiaiMode = true
     });
     base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
 }
示例#19
0
        protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
        {
            base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

            if (RepeatIndex > 0)
            {
                // Repeat points after the first span should appear behind the still-visible one.
                TimeFadeIn = 0;

                // The next end circle should appear exactly after the previous circle (on the same end) is hit.
                TimePreempt = SpanDuration * 2;
            }
            else
            {
                // taken from osu-stable
                const float first_end_circle_preempt_adjust = 2 / 3f;

                // The first end circle should fade in with the slider.
                TimePreempt = (StartTime - slider.StartTime) + slider.TimePreempt * first_end_circle_preempt_adjust;
            }
        }
示例#20
0
        protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
        {
            base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

            TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);

            double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * DifficultyControlPoint.SliderVelocity;

            Velocity     = scoringDistance / timingPoint.BeatLength;
            TickDistance = scoringDistance / difficulty.SliderTickRate;
        }
示例#21
0
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
        {
            if (beatmap.HitObjects.Count == 0)
            {
                return new OsuDifficultyAttributes {
                           Mods = mods, Skills = skills
                }
            }
            ;

            double aimRating          = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;
            double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
            double speedRating        = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
            double flashlightRating   = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier;

            double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;

            if (mods.Any(h => h is OsuModRelax))
            {
                speedRating = 0.0;
            }

            double baseAimPerformance        = Math.Pow(5 * Math.Max(1, aimRating / 0.0675) - 4, 3) / 100000;
            double baseSpeedPerformance      = Math.Pow(5 * Math.Max(1, speedRating / 0.0675) - 4, 3) / 100000;
            double baseFlashlightPerformance = 0.0;

            if (mods.Any(h => h is OsuModFlashlight))
            {
                baseFlashlightPerformance = Math.Pow(flashlightRating, 2.0) * 25.0;
            }

            double basePerformance =
                Math.Pow(
                    Math.Pow(baseAimPerformance, 1.1) +
                    Math.Pow(baseSpeedPerformance, 1.1) +
                    Math.Pow(baseFlashlightPerformance, 1.1), 1.0 / 1.1
                    );

            double starRating = basePerformance > 0.00001 ? Math.Cbrt(1.12) * 0.027 * (Math.Cbrt(100000 / Math.Pow(2, 1 / 1.1) * basePerformance) + 4) : 0;

            double preempt   = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;
            double drainRate = beatmap.Difficulty.DrainRate;

            int maxCombo = beatmap.HitObjects.Count;

            // Add the ticks + tail of the slider. 1 is subtracted because the head circle would be counted twice (once for the slider itself in the line above)
            maxCombo += beatmap.HitObjects.OfType <Slider>().Sum(s => s.NestedHitObjects.Count - 1);

            int hitCirclesCount = beatmap.HitObjects.Count(h => h is HitCircle);
            int sliderCount     = beatmap.HitObjects.Count(h => h is Slider);
            int spinnerCount    = beatmap.HitObjects.Count(h => h is Spinner);

            return(new OsuDifficultyAttributes
            {
                StarRating = starRating,
                Mods = mods,
                AimStrain = aimRating,
                SpeedStrain = speedRating,
                FlashlightRating = flashlightRating,
                SliderFactor = sliderFactor,
                ApproachRate = preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5,
                OverallDifficulty = (80 - hitWindowGreat) / 6,
                DrainRate = drainRate,
                MaxCombo = maxCombo,
                HitCircleCount = hitCirclesCount,
                SliderCount = sliderCount,
                SpinnerCount = spinnerCount,
                Skills = skills
            });
        }
示例#22
0
文件: JuiceStream.cs 项目: Wieku/osu
        protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
        {
            base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

            TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);

            velocityFactor     = base_scoring_distance * difficulty.SliderMultiplier / timingPoint.BeatLength;
            tickDistanceFactor = base_scoring_distance * difficulty.SliderMultiplier / difficulty.SliderTickRate;
        }
示例#23
0
 public CatchEditorPlayfield(IBeatmapDifficultyInfo difficulty)
     : base(difficulty)
 {
 }
示例#24
0
 public DrawableCatchRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList <Mod> mods = null)
     : base(ruleset, beatmap, mods)
 {
     Direction.Value = ScrollingDirection.Down;
     TimeRange.Value = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450);
 }
示例#25
0
        public PaddleDistributionGraph(IReadOnlyList <HitEvent> hitEvents, IBeatmap beatmap)
        {
            this.hitEvents = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.HitObject is Beat && e.Result.IsHit()).ToList();

            angleRange = (float)IBeatmapDifficultyInfo.DifficultyRange(beatmap.BeatmapInfo.Difficulty.CircleSize, 75, 25, 10);
        }
示例#26
0
        protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
        {
            base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

            double offset;

            if (SpanIndex > 0)
            {
                // Adding 200 to include the offset stable used.
                // This is so on repeats ticks don't appear too late to be visually processed by the player.
                offset = 200;
            }
            else
            {
                offset = TimeFadeIn * 0.66f;
            }

            TimePreempt = (StartTime - SpanStartTime) / 2 + offset;
        }
示例#27
0
 public BeatmapDifficulty(IBeatmapDifficultyInfo source)
 {
     CopyFrom(source);
 }
示例#28
0
 public TauResumeOverlay(BeatmapDifficulty difficulty)
 {
     angleRange = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.CircleSize, 75, 25, 10);
 }
示例#29
0
 public void Setup()
 {
     check      = new CheckTooShortSpinners();
     difficulty = new BeatmapDifficulty();
 }
 protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
 {
     base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
     SpinsRequired = 1;
 }