Beispiel #1
0
        public TauPlayfield(BeatmapDifficulty difficulty)
        {
            RelativeSizeAxes = Axes.None;
            cursor           = new TauCursor(difficulty);
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            Size             = new Vector2(768);

            AddRangeInternal(new Drawable[]
            {
                new VisualisationContainer(),
                new SkinnableDrawable(new TauSkinComponent(TauSkinComponents.Ring), _ => new PlayfieldPiece()),
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = HitObjectContainer
                },
                judgementLayer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                },
                kiaiExplosionContainer = new Container <KiaiHitExplosion>
                {
                    Name             = "Kiai hit explosions",
                    RelativeSizeAxes = Axes.Both,
                    FillMode         = FillMode.Fit,
                    Blending         = BlendingParameters.Additive,
                    Origin           = Anchor.Centre,
                    Anchor           = Anchor.Centre,
                },
                SliderParticleEmitter = new ParticleEmitter
                {
                    Name             = "Slider particle emitter",
                    RelativeSizeAxes = Axes.Both,
                }
            });

            hitPolicy  = new OrderedHitPolicy(HitObjectContainer);
            NewResult += onNewResult;

            var hitWindows = new TauHitWindows();

            foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
            {
                poolDictionary.Add(result, new DrawableJudgementPool(result, onJudgmentLoaded));
            }

            AddRangeInternal(poolDictionary.Values);

            SliderParticleEmitter.Vortices.Add(new Vortex
            {
                Speed    = 10,
                Scale    = new Vector2(10),
                Position = Extensions.GetCircularPosition(-40, 0),
            });
        }
Beispiel #2
0
        protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
        {
            if (beatmap.HitObjects.Count == 0)
            {
                return new TauDifficultyAttributes {
                           Mods = mods, Skills = skills
                }
            }
            ;

            double aimRating   = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;
            double speedRating = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
            double starRating  = aimRating + speedRating + Math.Abs(aimRating - speedRating) / 2;

            // Uncomment to see aimrating vs speedrating of a map: if aim rating is 3.5 and speed rating is 2.6 then sr will be 352.6
            // starRating = Math.Round(aimRating,1)*100 + Math.Round(speedRating,1);

            HitWindows hitWindows = new TauHitWindows();

            hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);

            // Todo: These int casts are temporary to achieve 1:1 results with osu!stable, and should be removed in the future
            double hitWindowGreat = (int)(hitWindows.WindowFor(HitResult.Great)) / clockRate;
            double preempt        = (int)BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450) / clockRate;

            int maxCombo = beatmap.HitObjects.Count;

            // IReadOnlyList<double> aimPeaks = skills[0].StrainPeaks;

            // 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);

            return(new TauDifficultyAttributes
            {
                StarRating = starRating,
                Mods = mods,
                AimStrain = aimRating,
                SpeedStrain = speedRating,
                ApproachRate = preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5,
                OverallDifficulty = (80 - hitWindowGreat) / 6,
                MaxCombo = maxCombo,
                Skills = skills,
            });
        }