diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Bash.cs new file mode 100644 index 0000000000..c9f4d01256 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Bash.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// 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 +{ + public class Bash : TaikoHitObject, IHasEndTime + { + public double EndTime => StartTime + Duration; + + public double Duration { get; set; } + + /// + /// The number of hits required to complete the bash successfully. + /// + public int RequiredHits; + + public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) + { + base.ApplyDefaults(timing, difficulty); + + double spinnerRotationRatio = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); + RequiredHits = (int)Math.Max(1, Duration / 1000f * spinnerRotationRatio); + } + + public override TaikoHitType Type => TaikoHitType.Bash; + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 0e9e6a56b4..699ef87e99 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ +