1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Xmldoc colour strain

This commit is contained in:
smoogipoo 2020-08-13 13:47:35 +09:00
parent 5010d2044a
commit 8ded5925ff

View File

@ -19,7 +19,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
private HitType? previousHitType;
/// <summary>
/// Length of the current mono pattern.
/// </summary>
private int currentMonoLength = 1;
/// <summary>
/// List of the last <see cref="mono_history_max_length"/> most recent mono patterns, with the most recent at the end of the list.
/// </summary>
private readonly List<int> monoHistory = new List<int>();
protected override double StrainValueOf(DifficultyHitObject current)
@ -36,12 +43,20 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
if (taikoCurrent.HitType != null && previousHitType != null && taikoCurrent.HitType != previousHitType)
{
// The colour has changed.
objectStrain = 1.0;
if (monoHistory.Count < 2)
{
// There needs to be at least two streaks to determine a strain.
objectStrain = 0.0;
}
else if ((monoHistory[^1] + currentMonoLength) % 2 == 0)
{
// The last streak in the history is guaranteed to be a different type to the current streak.
// If the total number of notes in the two streaks is even, apply a penalty.
objectStrain *= sameParityPenalty();
}
objectStrain *= repetitionPenalties();
currentMonoLength = 1;
@ -55,11 +70,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
return objectStrain;
}
private double sameParityPenalty()
{
return 0.0;
}
/// <summary>
/// The penalty to apply when the total number of notes in the two most recent colour streaks is even.
/// </summary>
private double sameParityPenalty() => 0.0;
/// <summary>
/// The penalty to apply due to the length of repetition in colour streaks.
/// </summary>
private double repetitionPenalties()
{
double penalty = 1.0;
@ -96,10 +114,6 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
return penalty;
}
private double repetitionPenalty(int notesSince)
{
double n = notesSince;
return Math.Min(1.0, 0.032 * n);
}
private double repetitionPenalty(int notesSince) => Math.Min(1.0, 0.032 * notesSince);
}
}