1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 09:42:55 +08:00

Avoid NaN values during ApplyBeatmap processing()

This commit is contained in:
Dan Balasescu 2023-05-19 14:14:34 +09:00
parent 7cbf48ffcf
commit 2ae34530f7
5 changed files with 22 additions and 9 deletions

View File

@ -25,12 +25,13 @@ namespace osu.Game.Rulesets.Catch.Scoring
protected override double ComputeTotalScore() protected override double ComputeTotalScore()
{ {
double comboRatio = MaxComboPortion > 0 ? ComboPortion / MaxComboPortion : 1;
double fruitHitsRatio = maximumTinyDroplets == 0 ? 0 : (double)hitTinyDroplets / maximumTinyDroplets; double fruitHitsRatio = maximumTinyDroplets == 0 ? 0 : (double)hitTinyDroplets / maximumTinyDroplets;
const int tiny_droplets_portion = 400000; const int tiny_droplets_portion = 400000;
return ( return (
((1000000 - tiny_droplets_portion) + tiny_droplets_portion * (1 - tinyDropletScale)) * ComboPortion / MaxComboPortion + ((1000000 - tiny_droplets_portion) + tiny_droplets_portion * (1 - tinyDropletScale)) * comboRatio +
tiny_droplets_portion * tinyDropletScale * fruitHitsRatio + tiny_droplets_portion * tinyDropletScale * fruitHitsRatio +
BonusPortion BonusPortion
) * ScoreMultiplier; ) * ScoreMultiplier;

View File

@ -18,9 +18,12 @@ namespace osu.Game.Rulesets.Mania.Scoring
protected override double ComputeTotalScore() protected override double ComputeTotalScore()
{ {
double comboRatio = MaxComboPortion > 0 ? ComboPortion / MaxComboPortion : 1;
double accuracyRatio = MaxBasicJudgements > 0 ? (double)CurrentBasicJudgements / MaxBasicJudgements : 1;
return ( return (
200000 * ComboPortion / MaxComboPortion + 200000 * comboRatio +
800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * ((double)CurrentBasicJudgements / MaxBasicJudgements) + 800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyRatio +
BonusPortion BonusPortion
) * ScoreMultiplier; ) * ScoreMultiplier;
} }

View File

@ -15,9 +15,12 @@ namespace osu.Game.Rulesets.Osu.Scoring
protected override double ComputeTotalScore() protected override double ComputeTotalScore()
{ {
double comboRatio = MaxComboPortion > 0 ? ComboPortion / MaxComboPortion : 1;
double accuracyRatio = MaxBasicJudgements > 0 ? (double)CurrentBasicJudgements / MaxBasicJudgements : 1;
return ( return (
700000 * ComboPortion / MaxComboPortion + 700000 * comboRatio +
300000 * Math.Pow(Accuracy.Value, 10) * ((double)CurrentBasicJudgements / MaxBasicJudgements) + 300000 * Math.Pow(Accuracy.Value, 10) * accuracyRatio +
BonusPortion BonusPortion
) * ScoreMultiplier; ) * ScoreMultiplier;
} }

View File

@ -19,9 +19,12 @@ namespace osu.Game.Rulesets.Taiko.Scoring
protected override double ComputeTotalScore() protected override double ComputeTotalScore()
{ {
double comboRatio = MaxComboPortion > 0 ? ComboPortion / MaxComboPortion : 1;
double accuracyRatio = MaxBasicJudgements > 0 ? (double)CurrentBasicJudgements / MaxBasicJudgements : 1;
return ( return (
250000 * ComboPortion / MaxComboPortion + 250000 * comboRatio +
750000 * Math.Pow(Accuracy.Value, 3.6) * ((double)CurrentBasicJudgements / MaxBasicJudgements) + 750000 * Math.Pow(Accuracy.Value, 3.6) * accuracyRatio +
BonusPortion BonusPortion
) * ScoreMultiplier; ) * ScoreMultiplier;
} }

View File

@ -288,11 +288,14 @@ namespace osu.Game.Rulesets.Scoring
protected virtual double ComputeTotalScore() protected virtual double ComputeTotalScore()
{ {
double comboRatio = MaxComboPortion > 0 ? ComboPortion / MaxComboPortion : 1;
double accuracyRatio = MaxBasicJudgements > 0 ? (double)CurrentBasicJudgements / MaxBasicJudgements : 1;
return return
(int)Math.Round (int)Math.Round
(( ((
700000 * ComboPortion / MaxComboPortion + 700000 * comboRatio +
300000 * Math.Pow(Accuracy.Value, 10) * ((double)CurrentBasicJudgements / MaxBasicJudgements) + 300000 * Math.Pow(Accuracy.Value, 10) * accuracyRatio +
BonusPortion BonusPortion
) * ScoreMultiplier); ) * ScoreMultiplier);
} }