mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Xmldoc colour strain
This commit is contained in:
parent
5010d2044a
commit
8ded5925ff
@ -19,7 +19,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
|
|
||||||
private HitType? previousHitType;
|
private HitType? previousHitType;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Length of the current mono pattern.
|
||||||
|
/// </summary>
|
||||||
private int currentMonoLength = 1;
|
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>();
|
private readonly List<int> monoHistory = new List<int>();
|
||||||
|
|
||||||
protected override double StrainValueOf(DifficultyHitObject current)
|
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)
|
if (taikoCurrent.HitType != null && previousHitType != null && taikoCurrent.HitType != previousHitType)
|
||||||
{
|
{
|
||||||
|
// The colour has changed.
|
||||||
objectStrain = 1.0;
|
objectStrain = 1.0;
|
||||||
|
|
||||||
if (monoHistory.Count < 2)
|
if (monoHistory.Count < 2)
|
||||||
|
{
|
||||||
|
// There needs to be at least two streaks to determine a strain.
|
||||||
objectStrain = 0.0;
|
objectStrain = 0.0;
|
||||||
|
}
|
||||||
else if ((monoHistory[^1] + currentMonoLength) % 2 == 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 *= sameParityPenalty();
|
||||||
|
}
|
||||||
|
|
||||||
objectStrain *= repetitionPenalties();
|
objectStrain *= repetitionPenalties();
|
||||||
currentMonoLength = 1;
|
currentMonoLength = 1;
|
||||||
@ -55,11 +70,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
return objectStrain;
|
return objectStrain;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double sameParityPenalty()
|
/// <summary>
|
||||||
{
|
/// The penalty to apply when the total number of notes in the two most recent colour streaks is even.
|
||||||
return 0.0;
|
/// </summary>
|
||||||
}
|
private double sameParityPenalty() => 0.0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The penalty to apply due to the length of repetition in colour streaks.
|
||||||
|
/// </summary>
|
||||||
private double repetitionPenalties()
|
private double repetitionPenalties()
|
||||||
{
|
{
|
||||||
double penalty = 1.0;
|
double penalty = 1.0;
|
||||||
@ -96,10 +114,6 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
return penalty;
|
return penalty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double repetitionPenalty(int notesSince)
|
private double repetitionPenalty(int notesSince) => Math.Min(1.0, 0.032 * notesSince);
|
||||||
{
|
|
||||||
double n = notesSince;
|
|
||||||
return Math.Min(1.0, 0.032 * n);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user