2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 12:59:30 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-09-02 17:35:49 +08:00
|
|
|
|
|
2017-07-26 12:22:46 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
2017-05-23 12:55:18 +08:00
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2017-03-13 18:15:25 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects
|
2016-09-02 17:35:49 +08:00
|
|
|
|
{
|
2017-03-13 18:15:25 +08:00
|
|
|
|
public class Spinner : OsuHitObject, IHasEndTime
|
2016-09-02 17:35:49 +08:00
|
|
|
|
{
|
2017-03-13 18:15:25 +08:00
|
|
|
|
public double EndTime { get; set; }
|
|
|
|
|
public double Duration => EndTime - StartTime;
|
2017-02-20 00:41:51 +08:00
|
|
|
|
|
2017-05-14 11:45:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Number of spins required to finish the spinner without miss.
|
|
|
|
|
/// </summary>
|
2017-05-14 14:36:09 +08:00
|
|
|
|
public int SpinsRequired { get; protected set; } = 1;
|
2017-05-14 11:45:35 +08:00
|
|
|
|
|
2017-03-13 18:15:25 +08:00
|
|
|
|
public override bool NewCombo => true;
|
2017-05-14 11:45:35 +08:00
|
|
|
|
|
2017-12-22 20:42:54 +08:00
|
|
|
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
2017-05-14 11:45:35 +08:00
|
|
|
|
{
|
2017-12-22 20:42:54 +08:00
|
|
|
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
2017-05-14 11:45:35 +08:00
|
|
|
|
|
2017-05-14 14:22:49 +08:00
|
|
|
|
SpinsRequired = (int)(Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5));
|
2017-05-24 21:08:14 +08:00
|
|
|
|
|
|
|
|
|
// 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 11:45:35 +08:00
|
|
|
|
}
|
2016-09-02 17:35:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|