mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 15:32:59 +08:00
move distance bonus into its own public function and use that (fixes
bugs)
This commit is contained in:
parent
e25cbda76c
commit
fb311ab8c8
@ -122,9 +122,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
||||
sliderBonus = osuLastObj.TravelDistance / osuLastObj.TravelTime;
|
||||
}
|
||||
|
||||
// The spacing bonus in speed evaluation
|
||||
double currFlowBonus = Math.Pow(osuLastObj.MinimumJumpDistance / 125, 3.6);
|
||||
double prevFlowBonus = Math.Pow(osuLastLastObj.MinimumJumpDistance / 125, 3.6);
|
||||
double currFlowBonus = SpeedEvaluator.CalculateDistanceBonus(osuCurrObj, osuLastObj);
|
||||
double prevFlowBonus = SpeedEvaluator.CalculateDistanceBonus(osuLastObj, osuLastLastObj);
|
||||
double flowBonus = Math.Max(prevFlowBonus, currFlowBonus);
|
||||
|
||||
// Part of the aiming difficulty for this object is accounted for in the speed evaluator, so reduce aim difficulty here
|
||||
|
@ -47,14 +47,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
||||
if (DifficultyCalculationUtils.MillisecondsToBPM(strainTime) > min_speed_bonus)
|
||||
speedBonus = 0.75 * Math.Pow((DifficultyCalculationUtils.BPMToMilliseconds(min_speed_bonus) - strainTime) / speed_balancing_factor, 2);
|
||||
|
||||
double travelDistance = osuPrevObj?.TravelDistance ?? 0;
|
||||
double distance = travelDistance + osuCurrObj.MinimumJumpDistance;
|
||||
|
||||
// Cap distance at single_spacing_threshold
|
||||
distance = Math.Min(distance, single_spacing_threshold);
|
||||
|
||||
// Max distance bonus is 1 * `distance_multiplier` at single_spacing_threshold
|
||||
double distanceBonus = Math.Pow(distance / single_spacing_threshold, 3.6) * distance_multiplier;
|
||||
double distanceBonus = CalculateDistanceBonus(osuCurrObj, osuPrevObj) * distance_multiplier;
|
||||
|
||||
// Base difficulty with all bonuses
|
||||
double difficulty = (1 + speedBonus + distanceBonus) * 1000 / strainTime;
|
||||
@ -62,5 +56,16 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
||||
// Apply penalty if there's doubletappable doubles
|
||||
return difficulty * doubletapness;
|
||||
}
|
||||
|
||||
public static double CalculateDistanceBonus(OsuDifficultyHitObject osuCurrObj, OsuDifficultyHitObject? osuPrevObj)
|
||||
{
|
||||
double travelDistance = osuPrevObj?.TravelDistance ?? 0;
|
||||
double distance = travelDistance + osuCurrObj.MinimumJumpDistance;
|
||||
|
||||
// Cap distance at single_spacing_threshold
|
||||
distance = Math.Min(distance, single_spacing_threshold);
|
||||
|
||||
return Math.Pow(distance / single_spacing_threshold, 3.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user