From 9bc4bf33a6c9f3183b8b7c67a7db28a9a14e3c96 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:53:30 +0900 Subject: [PATCH] Use HitWindows for taiko --- .../Objects/Drawables/DrawableHit.cs | 17 +++++------- osu.Game.Rulesets.Taiko/Objects/Hit.cs | 26 ------------------- 2 files changed, 7 insertions(+), 36 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 38188f89f3..1b8d95c0cf 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -38,30 +38,27 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { if (!userTriggered) { - if (timeOffset > HitObject.HitWindowGood) + if (!HitObject.HitWindows.CanBeHit(timeOffset)) AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); return; } - double hitOffset = Math.Abs(timeOffset); - - if (hitOffset > HitObject.HitWindowMiss) + var result = HitObject.HitWindows.ResultFor(Math.Abs(timeOffset)); + if (result == null) return; - if (!validKeyPressed) + if (!validKeyPressed || result == HitResult.Miss) AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); - else if (hitOffset < HitObject.HitWindowGood) + else { AddJudgement(new TaikoJudgement { - Result = hitOffset < HitObject.HitWindowGreat ? HitResult.Great : HitResult.Good, + Result = result.Value, Final = !HitObject.IsStrong }); SecondHitAllowed = true; } - else - AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); } public override bool OnPressed(TaikoAction action) @@ -90,7 +87,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables switch (State.Value) { case ArmedState.Idle: - this.Delay(HitObject.HitWindowMiss).Expire(); + this.Delay(HitObject.HitWindows.Miss / 2).Expire(); break; case ArmedState.Miss: this.FadeOut(100) diff --git a/osu.Game.Rulesets.Taiko/Objects/Hit.cs b/osu.Game.Rulesets.Taiko/Objects/Hit.cs index 531f4b82f6..c91a1f1714 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Hit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Hit.cs @@ -1,35 +1,9 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; - namespace osu.Game.Rulesets.Taiko.Objects { public class Hit : TaikoHitObject { - /// - /// The hit window that results in a "GREAT" hit. - /// - public double HitWindowGreat = 35; - - /// - /// The hit window that results in a "GOOD" hit. - /// - public double HitWindowGood = 80; - - /// - /// The hit window that results in a "MISS". - /// - public double HitWindowMiss = 95; - - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) - { - base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - - HitWindowGreat = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 50, 35, 20); - HitWindowGood = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 120, 80, 50); - HitWindowMiss = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 135, 95, 70); - } } }