2017-03-17 05:01:32 +00:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Game.Beatmaps.Timing;
|
|
|
|
|
using osu.Game.Database;
|
|
|
|
|
using osu.Game.Modes.Objects.Types;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Modes.Taiko.Objects
|
|
|
|
|
{
|
2017-03-25 11:57:49 +00:00
|
|
|
|
public class Swell : TaikoHitObject, IHasEndTime
|
2017-03-17 05:01:32 +00:00
|
|
|
|
{
|
2017-03-17 05:43:00 +00:00
|
|
|
|
public double EndTime { get; set; }
|
2017-03-17 05:01:32 +00:00
|
|
|
|
|
2017-03-17 05:43:00 +00:00
|
|
|
|
public double Duration => EndTime - StartTime;
|
2017-03-17 05:01:32 +00:00
|
|
|
|
|
2017-04-03 01:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The multiplier for cases in which the number of required hits by a Swell is not
|
|
|
|
|
/// dependent on solely the overall difficulty and the duration of the swell.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double HitMultiplier { get; set; } = 1;
|
|
|
|
|
|
2017-03-17 05:01:32 +00:00
|
|
|
|
/// <summary>
|
2017-03-25 11:57:49 +00:00
|
|
|
|
/// The number of hits required to complete the swell successfully.
|
2017-03-17 05:01:32 +00:00
|
|
|
|
/// </summary>
|
2017-03-28 06:05:45 +00:00
|
|
|
|
public int RequiredHits { get; protected set; } = 10;
|
2017-03-17 05:01:32 +00:00
|
|
|
|
|
|
|
|
|
public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty)
|
|
|
|
|
{
|
|
|
|
|
base.ApplyDefaults(timing, difficulty);
|
|
|
|
|
|
|
|
|
|
double spinnerRotationRatio = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5);
|
2017-04-03 01:28:03 +00:00
|
|
|
|
RequiredHits = (int)Math.Max(1, Duration / 1000f * spinnerRotationRatio * HitMultiplier);
|
2017-03-17 05:01:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|