2019-02-13 14:49:30 +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.
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
|
|
using osu.Game.Rulesets.Difficulty.Skills;
|
|
|
|
using osu.Game.Rulesets.Mania.Difficulty.Preprocessing;
|
2019-12-14 18:02:56 +08:00
|
|
|
using osu.Game.Rulesets.Objects;
|
2019-02-13 14:49:30 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Difficulty.Skills
|
|
|
|
{
|
|
|
|
public class Individual : Skill
|
|
|
|
{
|
|
|
|
protected override double SkillMultiplier => 1;
|
|
|
|
protected override double StrainDecayBase => 0.125;
|
|
|
|
|
|
|
|
private readonly double[] holdEndTimes;
|
|
|
|
|
|
|
|
private readonly int column;
|
|
|
|
|
|
|
|
public Individual(int column, int columnCount)
|
|
|
|
{
|
|
|
|
this.column = column;
|
|
|
|
|
|
|
|
holdEndTimes = new double[columnCount];
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override double StrainValueOf(DifficultyHitObject current)
|
|
|
|
{
|
|
|
|
var maniaCurrent = (ManiaDifficultyHitObject)current;
|
2019-12-14 18:02:56 +08:00
|
|
|
var endTime = maniaCurrent.BaseObject.GetEndTime();
|
2019-02-13 14:49:30 +08:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (maniaCurrent.BaseObject.Column != column)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// We give a slight bonus if something is held meanwhile
|
|
|
|
return holdEndTimes.Any(t => t > endTime) ? 2.5 : 2;
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
holdEndTimes[maniaCurrent.BaseObject.Column] = endTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|