// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing; using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour; using osu.Game.Rulesets.Taiko.Difficulty.Evaluators; namespace osu.Game.Rulesets.Taiko.Difficulty.Skills { /// /// Calculates the colour coefficient of taiko difficulty. /// public class Colour : StrainDecaySkill { protected override double SkillMultiplier => 0.2; protected override double StrainDecayBase => 0.8; /// /// Applies a speed bonus dependent on the time since the last hit. /// /// The interval between the current and previous note hit using the same key. private static double speedBonus(double interval) { return Math.Pow(0.4, interval / 1000); } public Colour(Mod[] mods) : base(mods) { } protected override double StrainValueOf(DifficultyHitObject current) { double difficulty = ColourEvaluator.EvaluateDifficultyOf(current); return difficulty; } public static String GetDebugHeaderLabels() { return "StartTime,Raw,Decayed,CoupledRunLength,RepetitionInterval,EncodingRunLength,Payload(MonoRunLength|MonoCount)"; } // TODO: Remove befor pr public string GetDebugString(DifficultyHitObject current) { double difficulty = ColourEvaluator.EvaluateDifficultyOf(current); difficulty *= speedBonus(current.DeltaTime); TaikoDifficultyHitObject? taikoCurrent = (TaikoDifficultyHitObject)current; TaikoDifficultyHitObjectColour? colour = taikoCurrent?.Colour; if (taikoCurrent != null && colour != null) { List payload = colour.Encoding.Payload; string payloadDisplay = ""; for (int i = 0; i < payload.Count; ++i) { payloadDisplay += $"({payload[i].Payload[0].RunLength}|{payload[i].Payload.Count})"; } return $"{current.StartTime},{difficulty},{CurrentStrain},{colour.Encoding.Payload[0].Payload.Count},{colour.Encoding.RepetitionInterval},{colour.Encoding.Payload.Count},{payloadDisplay}"; } else { return $"{current.StartTime},{difficulty},{CurrentStrain},0,0,0,0,0"; } } } }