Add mono streak index calculation to strain values

This commit is contained in:
Jay Lawton 2024-10-31 15:25:25 +10:00
parent abe2ee90e0
commit ff05bbd63f
1 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,7 @@ public class Stamina : StrainSkill
private double skillMultiplier => 1.1;
private double strainDecayBase => 0.4;
private bool singleColourStamina;
private readonly bool singleColourStamina;
private double currentStrain;
@ -40,8 +40,12 @@ protected override double StrainValueAt(DifficultyHitObject current)
currentStrain *= strainDecay(current.DeltaTime);
currentStrain += StaminaEvaluator.EvaluateDifficultyOf(current) * skillMultiplier;
// Safely prevents previous strains from shifting as new notes are added.
var currentObject = current as TaikoDifficultyHitObject;
int index = currentObject?.Colour.MonoStreak?.HitObjects.IndexOf(currentObject) ?? 0;
if (singleColourStamina)
return ((TaikoDifficultyHitObject)current).Colour.MonoStreak?.RunLength >= 16 ? currentStrain : 0;
return currentStrain / (1 + Math.Exp(-(index - 10) / 2.0));
return currentStrain;
}