osu/osu.Game.Rulesets.Osu/Objects/Spinner.cs

33 lines
1.2 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-04-18 07:05:58 +00:00
using osu.Game.Rulesets.Objects.Types;
2017-05-14 03:45:35 +00:00
using osu.Game.Database;
using osu.Game.Beatmaps.ControlPoints;
2017-04-18 07:05:58 +00:00
namespace osu.Game.Rulesets.Osu.Objects
{
public class Spinner : OsuHitObject, IHasEndTime
{
public double EndTime { get; set; }
public double Duration => EndTime - StartTime;
2017-05-14 03:45:35 +00:00
/// <summary>
/// Number of spins required to finish the spinner without miss.
/// </summary>
2017-05-14 06:36:09 +00:00
public int SpinsRequired { get; protected set; } = 1;
2017-05-14 03:45:35 +00:00
public override bool NewCombo => true;
2017-05-14 03:45:35 +00:00
public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
2017-05-14 03:45:35 +00:00
{
base.ApplyDefaults(controlPointInfo, difficulty);
2017-05-14 03:45:35 +00:00
2017-05-14 06:22:49 +00:00
SpinsRequired = (int)(Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5));
// spinning doesn't match 1:1 with stable, so let's fudge them easier for the time being.
SpinsRequired = (int)(SpinsRequired * 0.6);
2017-05-14 03:45:35 +00:00
}
}
}