Esempio n. 1
0
        protected override double ComputeDifficulty(Dictionary <String, String> CategoryDifficulty)
        {
            // Fill our custom DifficultyHitObject class, that carries additional information
            DifficultyHitObjects = new List <DifficultyHitObjectFruits>(HitObjects.Count);

            float catcherWidth     = 305 / GameBase.GameField.Ratio * HitObjectManager.SpriteRatio * 0.7f;
            float catcherWidthHalf = catcherWidth / 2;

            HitObjectManagerFruits hom = HitObjectManager as HitObjectManagerFruits;

            hom.InitializeHyperDash(catcherWidth);

            catcherWidthHalf *= 0.8f;

            foreach (HitObject hitObject in HitObjects)
            {
                // We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations.
                if (!(hitObject is HitCircleFruitsTickTiny) && !(hitObject is HitCircleFruitsSpin))
                {
                    DifficultyHitObjects.Add(new DifficultyHitObjectFruits(hitObject, catcherWidthHalf));
                }
            }

            // Sort DifficultyHitObjects by StartTime of the HitObjects - just to make sure. Not using CompareTo, since it results in a crash (HitObjectBase inherits MarshalByRefObject)
            DifficultyHitObjects.Sort((a, b) => a.BaseHitObject.StartTime - b.BaseHitObject.StartTime);

            if (CalculateStrainValues() == false)
            {
                return(0);
            }

            double StarRating = Math.Sqrt(CalculateDifficulty()) * STAR_SCALING_FACTOR;

            if (CategoryDifficulty != null)
            {
                CategoryDifficulty.Add("Aim", StarRating.ToString("0.00", GameBase.nfi));

                double PreEmpt = HitObjectManager.PreEmpt / TimeRate;

                CategoryDifficulty.Add("AR", (PreEmpt > 1200.0 ? -(PreEmpt - 1800.0) / 120.0 : -(PreEmpt - 1200.0) / 150.0 + 5.0).ToString("0.00", GameBase.nfi));
                CategoryDifficulty.Add("Max combo", DifficultyHitObjects.Count.ToString(GameBase.nfi));
            }

            return(StarRating);
        }
Esempio n. 2
0
        private void InitializeHyperDash()
        {
            HitObjectManagerFruits hom = hitObjectManager as HitObjectManagerFruits;

            hom.InitializeHyperDash(catcherWidth);
        }