1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Cleanup of code

This commit is contained in:
MBmasher 2021-08-10 16:06:20 +10:00
parent 6b1a4a53d4
commit f4ceb17064
2 changed files with 7 additions and 5 deletions

View File

@ -192,7 +192,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty
{ {
double flashlightValue = 0.0; double flashlightValue = 0.0;
if (mods.Any(h => h is OsuModFlashlight)) { if (mods.Any(h => h is OsuModFlashlight))
{
flashlightValue = Math.Pow(Attributes.FlashlightStrain, 2.0) * 25.0; flashlightValue = Math.Pow(Attributes.FlashlightStrain, 2.0) * 25.0;
// Add an additional bonus for HDFL. // Add an additional bonus for HDFL.

View File

@ -40,19 +40,20 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{ {
double cumulativeStrainTime = 0.0; double cumulativeStrainTime = 0.0;
for (int i = 0; i < Previous.Count; i++) { for (int i = 0; i < Previous.Count; i++)
{
var osuPrevious = (OsuDifficultyHitObject)Previous[i]; var osuPrevious = (OsuDifficultyHitObject)Previous[i];
var osuPreviousHitObject = (OsuHitObject)(osuPrevious.BaseObject); var osuPreviousHitObject = (OsuHitObject)(osuPrevious.BaseObject);
if (!(osuPrevious.BaseObject is Spinner)) { if (!(osuPrevious.BaseObject is Spinner))
{
double jumpDistance = (osuHitObject.StackedPosition - osuPreviousHitObject.EndPosition).Length; double jumpDistance = (osuHitObject.StackedPosition - osuPreviousHitObject.EndPosition).Length;
cumulativeStrainTime += osuPrevious.StrainTime; cumulativeStrainTime += osuPrevious.StrainTime;
// We want to nerf objects that can be easily seen within the Flashlight circle radius. // We want to nerf objects that can be easily seen within the Flashlight circle radius.
if (i == 0 && jumpDistance < 50.0) { if (i == 0 && jumpDistance < 50.0)
smallDistNerf = jumpDistance / 50.0; smallDistNerf = jumpDistance / 50.0;
}
result += Math.Pow(0.8, i) * scalingFactor * jumpDistance / cumulativeStrainTime; result += Math.Pow(0.8, i) * scalingFactor * jumpDistance / cumulativeStrainTime;
} }