2020-05-11 13:50:02 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
2022-06-28 10:38:58 +08:00
|
|
|
|
using System;
|
2022-07-05 14:41:40 +08:00
|
|
|
|
using System.Collections.Generic;
|
2020-05-11 13:50:02 +08:00
|
|
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
|
|
|
using osu.Game.Rulesets.Difficulty.Skills;
|
2021-02-06 12:06:16 +08:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2022-06-23 17:10:30 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
|
2022-07-05 14:41:40 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour;
|
2022-06-28 10:38:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Difficulty.Evaluators;
|
2020-05-11 13:50:02 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|
|
|
|
{
|
2020-08-23 01:34:16 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Calculates the colour coefficient of taiko difficulty.
|
|
|
|
|
/// </summary>
|
2021-08-17 06:14:29 +08:00
|
|
|
|
public class Colour : StrainDecaySkill
|
2020-05-11 13:50:02 +08:00
|
|
|
|
{
|
2022-07-05 14:41:40 +08:00
|
|
|
|
protected override double SkillMultiplier => 0.7;
|
2020-05-22 19:50:21 +08:00
|
|
|
|
protected override double StrainDecayBase => 0.4;
|
2020-05-11 13:50:02 +08:00
|
|
|
|
|
2022-06-28 10:38:58 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Applies a speed bonus dependent on the time since the last hit.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="interval">The interval between the current and previous note hit using the same key.</param>
|
|
|
|
|
private static double speedBonus(double interval)
|
|
|
|
|
{
|
|
|
|
|
return Math.Pow(0.4, interval / 1000);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-06 12:06:16 +08:00
|
|
|
|
public Colour(Mod[] mods)
|
|
|
|
|
: base(mods)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-13 00:35:56 +08:00
|
|
|
|
protected override double StrainValueOf(DifficultyHitObject current)
|
2020-05-22 19:50:21 +08:00
|
|
|
|
{
|
2022-06-28 10:38:58 +08:00
|
|
|
|
double difficulty = ColourEvaluator.EvaluateDifficultyOf(current);
|
2022-07-01 14:27:23 +08:00
|
|
|
|
return difficulty;
|
|
|
|
|
}
|
2022-06-25 22:42:56 +08:00
|
|
|
|
|
2022-07-05 14:41:40 +08:00
|
|
|
|
public static String GetDebugHeaderLabels()
|
|
|
|
|
{
|
|
|
|
|
return "StartTime,Raw,Decayed,CoupledRunLength,RepetitionInterval,EncodingRunLength,Payload(MonoRunLength|MonoCount)";
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-01 14:27:23 +08:00
|
|
|
|
// 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)
|
|
|
|
|
{
|
2022-07-05 14:41:40 +08:00
|
|
|
|
List<ColourEncoding> payload = colour.Encoding.Payload;
|
2022-07-01 14:27:23 +08:00
|
|
|
|
string payloadDisplay = "";
|
2022-07-05 14:41:40 +08:00
|
|
|
|
for (int i = 0; i < payload.Count; ++i)
|
2022-07-01 14:27:23 +08:00
|
|
|
|
{
|
2022-07-05 14:41:40 +08:00
|
|
|
|
payloadDisplay += $"({payload[i].Payload[0].RunLength}|{payload[i].Payload.Count})";
|
2022-07-01 14:27:23 +08:00
|
|
|
|
}
|
2022-06-23 17:10:30 +08:00
|
|
|
|
|
2022-07-05 14:41:40 +08:00
|
|
|
|
return $"{current.StartTime},{difficulty},{CurrentStrain},{colour.Encoding.Payload[0].Payload.Count},{colour.Encoding.RepetitionInterval},{colour.Encoding.Payload.Count},{payloadDisplay}";
|
2022-07-01 14:27:23 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-07-05 14:41:40 +08:00
|
|
|
|
return $"{current.StartTime},{difficulty},{CurrentStrain},0,0,0,0,0";
|
2022-07-01 14:27:23 +08:00
|
|
|
|
}
|
2020-08-19 01:44:41 +08:00
|
|
|
|
}
|
2020-05-11 13:50:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|