mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
finalized change for PR
This commit is contained in:
@ -21,12 +21,14 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
private const double pi_over_2 = Math.PI / 2;
|
||||
|
||||
private const double rhythmMultiplier = 1.5;
|
||||
private const int HistoryTimeMax = 3000; // 3 seconds of calculatingRhythmBonus max.
|
||||
|
||||
private double skillMultiplier => 1400;
|
||||
private double strainDecayBase => 0.3;
|
||||
|
||||
private double currentTapStrain = 1;
|
||||
private double currentMovementStrain = 1;
|
||||
private double currentRhythm = 1;
|
||||
|
||||
protected override int ReducedSectionCount => 5;
|
||||
protected override double DifficultyMultiplier => 1.04;
|
||||
@ -37,8 +39,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
|
||||
protected override int HistoryLength => 32;
|
||||
|
||||
private const int HistoryTimeMax = 3000; // 4 seconds of calculatingRhythmBonus max.
|
||||
|
||||
public Speed(Mod[] mods)
|
||||
: base(mods)
|
||||
{
|
||||
@ -52,8 +52,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
/// <summary>
|
||||
/// Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current <see cref="OsuDifficultyHitObject"/>.
|
||||
/// </summary>
|
||||
private double calculateRhythmBonus(double startTime)
|
||||
private double calculateRhythmBonus(DifficultyHitObject current)
|
||||
{
|
||||
if (current.BaseObject is Spinner)
|
||||
return 0;
|
||||
|
||||
// {doubles, triplets, quads, quints, 6-tuplets, 7 Tuplets, greater}
|
||||
int previousIslandSize = -1;
|
||||
double[] islandTimes = {0, 0, 0, 0, 0, 0, 0};
|
||||
@ -72,7 +75,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
if (effectiveRatio > 0.5)
|
||||
effectiveRatio = 0.5 + (effectiveRatio - 0.5) * 10; // extra buff for 1/3 -> 1/4 etc transitions.
|
||||
|
||||
double currHistoricalDecay = Math.Max(0, (HistoryTimeMax - (startTime - Previous[i - 1].StartTime))) / HistoryTimeMax;
|
||||
double currHistoricalDecay = Math.Max(0, (HistoryTimeMax - (current.StartTime - Previous[i - 1].StartTime))) / HistoryTimeMax;
|
||||
|
||||
if (firstDeltaSwitch)
|
||||
{
|
||||
@ -125,56 +128,24 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
return Math.Sqrt(4 + rhythmComplexitySum * rhythmMultiplier) / 2;
|
||||
}
|
||||
|
||||
private double tapStrainOf(DifficultyHitObject current)
|
||||
private double tapStrainOf(DifficultyHitObject current, double speedBonus)
|
||||
{
|
||||
if (current.BaseObject is Spinner)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var osuCurrent = (OsuDifficultyHitObject)current;
|
||||
|
||||
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
|
||||
double deltaTime = Math.Max(max_speed_bonus, current.DeltaTime);
|
||||
|
||||
double speedBonus = 1.0;
|
||||
if (deltaTime < min_speed_bonus)
|
||||
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
|
||||
|
||||
double angleBonus = 1.0;
|
||||
|
||||
if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
|
||||
{
|
||||
angleBonus = 1 + Math.Pow(Math.Sin(1.5 * (angle_bonus_begin - osuCurrent.Angle.Value)), 2) / 3.57;
|
||||
|
||||
if (osuCurrent.Angle.Value < pi_over_2)
|
||||
{
|
||||
angleBonus = 1.28;
|
||||
if (distance < 90 && osuCurrent.Angle.Value < pi_over_4)
|
||||
angleBonus += (1 - angleBonus) * Math.Min((90 - distance) / 10, 1);
|
||||
else if (distance < 90)
|
||||
angleBonus += (1 - angleBonus) * Math.Min((90 - distance) / 10, 1) * Math.Sin((pi_over_2 - osuCurrent.Angle.Value) / pi_over_4);
|
||||
}
|
||||
}
|
||||
|
||||
return ((1 + (speedBonus - 1) * 0.75) * 0.95) / osuCurrent.StrainTime;
|
||||
}
|
||||
|
||||
private double movementStrainOf(DifficultyHitObject current)
|
||||
private double movementStrainOf(DifficultyHitObject current, double speedBonus)
|
||||
{
|
||||
if (current.BaseObject is Spinner)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var osuCurrent = (OsuDifficultyHitObject)current;
|
||||
|
||||
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
|
||||
double deltaTime = Math.Max(max_speed_bonus, current.DeltaTime);
|
||||
|
||||
double speedBonus = 1.0;
|
||||
if (deltaTime < min_speed_bonus)
|
||||
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
|
||||
|
||||
double angleBonus = 1.0;
|
||||
|
||||
@ -197,17 +168,25 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
|
||||
private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
|
||||
|
||||
protected override double CalculateInitialStrain(double time) => (currentMovementStrain + currentTapStrain * calculateRhythmBonus(time)) * strainDecay(time - Previous[0].StartTime);
|
||||
protected override double CalculateInitialStrain(double time) => (currentMovementStrain + currentTapStrain * currentRhythm) * strainDecay(time - Previous[0].StartTime);
|
||||
|
||||
protected override double StrainValueAt(DifficultyHitObject current)
|
||||
{
|
||||
double speedBonus = 1.0;
|
||||
double deltaTime = Math.Max(max_speed_bonus, current.DeltaTime);
|
||||
|
||||
if (deltaTime < min_speed_bonus)
|
||||
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
|
||||
|
||||
currentRhythm = calculateRhythmBonus(current);
|
||||
|
||||
currentTapStrain *= strainDecay(current.DeltaTime);
|
||||
currentTapStrain += tapStrainOf(current) * skillMultiplier;
|
||||
currentTapStrain += tapStrainOf(current, speedBonus) * skillMultiplier;
|
||||
|
||||
currentMovementStrain *= strainDecay(current.DeltaTime);
|
||||
currentMovementStrain += movementStrainOf(current) * skillMultiplier;
|
||||
currentMovementStrain += movementStrainOf(current, speedBonus) * skillMultiplier;
|
||||
|
||||
return currentMovementStrain + currentTapStrain * calculateRhythmBonus(current.StartTime);
|
||||
return currentMovementStrain + currentTapStrain * currentRhythm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user