From d2194e3d2a51e7e6851977af222657d9462ab5fb Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 14:01:32 +0900 Subject: [PATCH 1/4] Implement Bash. --- osu.Game.Modes.Taiko/Objects/Bash.cs | 32 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 33 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/Bash.cs 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 @@ + From d478a58a89545c08f544129838746316069dc943 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 14:43:00 +0900 Subject: [PATCH 2/4] Invert getters and setters for EndTime / Duration. --- osu.Game.Modes.Taiko/Objects/Bash.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Bash.cs index c9f4d01256..895b25e987 100644 --- a/osu.Game.Modes.Taiko/Objects/Bash.cs +++ b/osu.Game.Modes.Taiko/Objects/Bash.cs @@ -10,9 +10,9 @@ namespace osu.Game.Modes.Taiko.Objects { public class Bash : TaikoHitObject, IHasEndTime { - public double EndTime => StartTime + Duration; + public double EndTime { get; set; } - public double Duration { get; set; } + public double Duration => EndTime - StartTime; /// /// The number of hits required to complete the bash successfully. From b9006e4026ad0f0f613e2ab7ad1ae60733d4fa21 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 13:04:09 +0900 Subject: [PATCH 3/4] Remove Type. --- osu.Game.Modes.Taiko/Objects/Bash.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Bash.cs index 895b25e987..1b771cb1d5 100644 --- a/osu.Game.Modes.Taiko/Objects/Bash.cs +++ b/osu.Game.Modes.Taiko/Objects/Bash.cs @@ -26,7 +26,5 @@ public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficul 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 From b3dde2c399aae4cfcd7bc32698fa425642d75b16 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:35:39 +0900 Subject: [PATCH 4/4] A bit more protection. --- osu.Game.Modes.Taiko/Objects/Bash.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Bash.cs index 1b771cb1d5..b8b4eea6a9 100644 --- a/osu.Game.Modes.Taiko/Objects/Bash.cs +++ b/osu.Game.Modes.Taiko/Objects/Bash.cs @@ -17,7 +17,7 @@ public class Bash : TaikoHitObject, IHasEndTime /// /// The number of hits required to complete the bash successfully. /// - public int RequiredHits; + public int RequiredHits { get; protected set; } public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) {