Skip to content

Commit

Permalink
Apply various inspections
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Nov 12, 2023
1 parent 4df1eb1 commit a04f9aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Catch/CatchRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyIn
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);

double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);
double preempt = adjustedDifficulty.ApproachRate < 6 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);

preempt /= rate;
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));

return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
return adjustedDifficulty;
}
}
}
6 changes: 2 additions & 4 deletions osu.Game.Rulesets.Osu/OsuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,15 @@ public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyIn
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);

double preempt = adjustedDifficulty.ApproachRate < 5 ?
(1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) :
(1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);
double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);
preempt /= rate;
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));

double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty;
hitwindow /= rate;
adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6;

return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
return adjustedDifficulty;
}
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Taiko/TaikoRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyIn
hitwindow /= rate;
adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitwindow) / 15 + 5);

return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
return adjustedDifficulty;
}
}
}

0 comments on commit a04f9aa

Please sign in to comment.