private double computeDifficultyValue(ManiaDifficultyAttributes attributes) { double difficultyValue = Math.Pow(5 * Math.Max(1, attributes.StarRating / 0.2) - 4.0, 2.2) / 135.0; difficultyValue *= 1.0 + 0.1 * Math.Min(1.0, totalHits / 1500.0); if (scaledScore <= 500000) { difficultyValue = 0; } else if (scaledScore <= 600000) { difficultyValue *= (scaledScore - 500000) / 100000 * 0.3; } else if (scaledScore <= 700000) { difficultyValue *= 0.3 + (scaledScore - 600000) / 100000 * 0.25; } else if (scaledScore <= 800000) { difficultyValue *= 0.55 + (scaledScore - 700000) / 100000 * 0.20; } else if (scaledScore <= 900000) { difficultyValue *= 0.75 + (scaledScore - 800000) / 100000 * 0.15; } else { difficultyValue *= 0.90 + (scaledScore - 900000) / 100000 * 0.1; } return(difficultyValue); }
private double computeAccuracyValue(double difficultyValue, ManiaDifficultyAttributes attributes) { if (attributes.GreatHitWindow <= 0) { return(0); } // Lots of arbitrary values from testing. // Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution double accuracyValue = Math.Max(0.0, 0.2 - (attributes.GreatHitWindow - 34) * 0.006667) * difficultyValue * Math.Pow(Math.Max(0.0, scaledScore - 960000) / 40000, 1.1); return(accuracyValue); }