From 1a667556943b56274990c01f3d5fdeb68548624f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 10:20:20 +0900 Subject: [PATCH 01/11] Fix second hit displaying two judgements, move hitobjects above playfield when hit. --- osu.Game.Modes.Taiko/UI/HitExplosion.cs | 26 +++++++++++++++++------ osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 21 +++++++++++++++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/osu.Game.Modes.Taiko/UI/HitExplosion.cs b/osu.Game.Modes.Taiko/UI/HitExplosion.cs index 94938a700d..e3fd89e2b5 100644 --- a/osu.Game.Modes.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Modes.Taiko/UI/HitExplosion.cs @@ -18,12 +18,21 @@ namespace osu.Game.Modes.Taiko.UI /// internal class HitExplosion : CircularContainer { - private readonly TaikoJudgement judgement; + /// + /// The size of a hit explosion if a hit object has been hit with the second key. + /// + private const float secondhit_scale = 1.5f; + + /// + /// The judgement this hit explosion visualises. + /// + public readonly TaikoJudgement Judgement; + private readonly Box innerFill; public HitExplosion(TaikoJudgement judgement) { - this.judgement = judgement; + Judgement = judgement; Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2); @@ -50,10 +59,7 @@ namespace osu.Game.Modes.Taiko.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - if (judgement.SecondHit) - Size *= 1.5f; - - switch (judgement.TaikoResult) + switch (Judgement.TaikoResult) { case TaikoHitResult.Good: innerFill.Colour = colours.Green; @@ -73,5 +79,13 @@ namespace osu.Game.Modes.Taiko.UI Expire(); } + + /// + /// Transforms this hit explosion to visualise a secondary hit. + /// + public void VisualiseSecondHit() + { + ResizeTo(Size * secondhit_scale, 50); + } } } diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index b6165b785b..8efb815fc0 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -15,6 +15,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; using osu.Game.Modes.Taiko.Objects.Drawable; +using System.Linq; namespace osu.Game.Modes.Taiko.UI { @@ -176,9 +177,7 @@ namespace osu.Game.Modes.Taiko.UI public override void OnJudgement(DrawableHitObject judgedObject) { bool wasHit = judgedObject.Judgement.Result == HitResult.Hit; - - if (wasHit) - hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); + bool secondHit = judgedObject.Judgement.SecondHit; judgementContainer.Add(new DrawableTaikoJudgement(judgedObject.Judgement) { @@ -187,6 +186,22 @@ namespace osu.Game.Modes.Taiko.UI RelativePositionAxes = Axes.X, X = wasHit ? judgedObject.Position.X : 0, }); + + if (!wasHit) + return; + + if (!secondHit) + { + if (judgedObject.X >= -0.05f && !(judgedObject is DrawableSwell)) + { + // If we're far enough away from the left stage, we should bring outselves in front of it + topLevelHitContainer.Add(judgedObject.CreateProxy()); + } + + hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); + } + else + hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit(); } } } \ No newline at end of file From b027d0d3b43230f1ca3ac5e7e832905657a4dcb8 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 10:28:03 +0900 Subject: [PATCH 02/11] Changing duration is wrong, add HitMultiplier. I don't know if this is the best way to handle this/if there's a better way, but this seems pretty sane? This could be expanded on in the future to make swells harder/require more hits with a smaller duration. --- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 3 ++- osu.Game.Modes.Taiko/Objects/Swell.cs | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index cc361628a3..cc5e394987 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -70,7 +70,8 @@ namespace osu.Game.Modes.Taiko.Beatmaps Sample = original.Sample, IsStrong = strong, - EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor + EndTime = original.StartTime + endTimeData.Duration, + HitMultiplier = bash_convert_factor }; } diff --git a/osu.Game.Modes.Taiko/Objects/Swell.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs index 4cbb5904c7..a2d52d1358 100644 --- a/osu.Game.Modes.Taiko/Objects/Swell.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -14,6 +14,12 @@ namespace osu.Game.Modes.Taiko.Objects public double Duration => EndTime - StartTime; + /// + /// 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. + /// + public double HitMultiplier { get; set; } = 1; + /// /// The number of hits required to complete the swell successfully. /// @@ -24,7 +30,7 @@ namespace osu.Game.Modes.Taiko.Objects base.ApplyDefaults(timing, difficulty); double spinnerRotationRatio = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); - RequiredHits = (int)Math.Max(1, Duration / 1000f * spinnerRotationRatio); + RequiredHits = (int)Math.Max(1, Duration / 1000f * spinnerRotationRatio * HitMultiplier); } } } \ No newline at end of file From 3b672fd8424028af9c08882193702e38e4702433 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 1 Apr 2017 23:30:16 +0900 Subject: [PATCH 03/11] Lengthen drum rolls as required by conversion. --- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index cc5e394987..7cc383f622 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -57,7 +57,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps Sample = original.Sample, IsStrong = strong, - Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) + Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) * legacy_velocity_scale }; } From 33e10adfa6336e844efa9124034d5a46abff2aea Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 10:54:13 +0900 Subject: [PATCH 04/11] Rewrite beatmap conversion to allow converting sliders to normal hits. --- .../Beatmaps/TaikoBeatmapConverter.cs | 109 +++++++++++------- 1 file changed, 67 insertions(+), 42 deletions(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 7cc383f622..693e9cadf3 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -7,6 +7,7 @@ using osu.Game.Beatmaps.Samples; using osu.Game.Modes.Objects; using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Taiko.Objects; +using System; using System.Collections.Generic; using System.Linq; @@ -24,75 +25,99 @@ namespace osu.Game.Modes.Taiko.Beatmaps return new Beatmap(original) { - HitObjects = convertHitObjects(original.HitObjects) + HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).ToList() }; } - private List convertHitObjects(List hitObjects) - { - return hitObjects.Select(convertHitObject).ToList(); - } - - private TaikoHitObject convertHitObject(HitObject original) + private IEnumerable convertHitObject(HitObject obj, Beatmap beatmap) { // Check if this HitObject is already a TaikoHitObject, and return it if so - TaikoHitObject originalTaiko = original as TaikoHitObject; + var originalTaiko = obj as TaikoHitObject; if (originalTaiko != null) - return originalTaiko; + yield return originalTaiko; - IHasDistance distanceData = original as IHasDistance; - IHasRepeats repeatsData = original as IHasRepeats; - IHasEndTime endTimeData = original as IHasEndTime; + var distanceData = obj as IHasDistance; + var repeatsData = obj as IHasRepeats; + var endTimeData = obj as IHasEndTime; // Old osu! used hit sounding to determine various hit type information - SampleType sample = original.Sample?.Type ?? SampleType.None; + SampleType sample = obj.Sample?.Type ?? SampleType.None; bool strong = (sample & SampleType.Finish) > 0; if (distanceData != null) { - return new DrumRoll + double sv = beatmap.TimingInfo.SliderVelocityAt(obj.StartTime) * beatmap.BeatmapInfo.Difficulty.SliderMultiplier; + + double l = distanceData.Distance * legacy_velocity_scale; + double v = sv * legacy_velocity_scale; + double bl = beatmap.TimingInfo.BeatLengthAt(obj.StartTime); + + int repeats = repeatsData?.RepeatCount ?? 1; + + double skipPeriod = Math.Min(bl / beatmap.BeatmapInfo.Difficulty.SliderTickRate, distanceData.Duration / repeats); + + if (skipPeriod > 0 && l / v * 1000 < 2 * bl) { - StartTime = original.StartTime, - Sample = original.Sample, - IsStrong = strong, - - Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) * legacy_velocity_scale - }; + for (double j = obj.StartTime; j <= distanceData.EndTime + skipPeriod / 8; j += skipPeriod) + { + // Todo: This should generate different type of hits (including strongs) + // depending on hitobject sound additions (not implemented fully yet) + yield return new CentreHit + { + StartTime = obj.StartTime, + Sample = obj.Sample, + IsStrong = strong + }; + } + } + else + { + yield return new DrumRoll + { + StartTime = obj.StartTime, + Sample = obj.Sample, + IsStrong = strong, + Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) * legacy_velocity_scale + }; + } } - - if (endTimeData != null) + else if (endTimeData != null) { // We compute the end time manually to add in the Bash convert factor - return new Swell + yield return new Swell { - StartTime = original.StartTime, - Sample = original.Sample, + StartTime = obj.StartTime, + Sample = obj.Sample, IsStrong = strong, - EndTime = original.StartTime + endTimeData.Duration, + EndTime = obj.StartTime + endTimeData.Duration, HitMultiplier = bash_convert_factor }; } - - bool isCentre = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0; - - if (isCentre) + else { - return new CentreHit + bool isCentre = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0; + + if (isCentre) { - StartTime = original.StartTime, - Sample = original.Sample, - IsStrong = strong - }; + yield return new CentreHit + { + StartTime = obj.StartTime, + Sample = obj.Sample, + IsStrong = strong + }; + } + else + { + yield return new RimHit + { + StartTime = obj.StartTime, + Sample = obj.Sample, + IsStrong = strong, + }; + } } - - return new RimHit - { - StartTime = original.StartTime, - Sample = original.Sample, - IsStrong = strong, - }; } } } From 3920758981a233b1b05dfcdea98a6a6652a3fbef Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 10:59:49 +0900 Subject: [PATCH 05/11] Rename all occurrences of finishers to strong. --- osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs | 2 +- osu.Game.Modes.Taiko/UI/HitTarget.cs | 14 +++++++------- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs index f4745730db..c2c4093b1b 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs @@ -43,7 +43,7 @@ namespace osu.Game.Modes.Taiko.Judgements public override string MaxResultString => MAX_HIT_RESULT.GetDescription(); /// - /// Whether this Judgement has a secondary hit in the case of finishers. + /// Whether this Judgement has a secondary hit in the case of strong hits. /// public virtual bool SecondHit { get; set; } diff --git a/osu.Game.Modes.Taiko/UI/HitTarget.cs b/osu.Game.Modes.Taiko/UI/HitTarget.cs index 32b2877545..27562cd916 100644 --- a/osu.Game.Modes.Taiko/UI/HitTarget.cs +++ b/osu.Game.Modes.Taiko/UI/HitTarget.cs @@ -21,9 +21,9 @@ namespace osu.Game.Modes.Taiko.UI private const float normal_diameter = TaikoHitObject.CIRCLE_RADIUS * 2; /// - /// Diameter of finisher hit object circles. + /// Diameter of strong hit object circles. /// - private const float finisher_diameter = normal_diameter * 1.5f; + private const float strong_hit_diameter = normal_diameter * 1.5f; /// /// The 1px inner border of the taiko playfield. @@ -47,15 +47,15 @@ namespace osu.Game.Modes.Taiko.UI Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Y = border_offset, - Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - finisher_diameter) / 2f - border_offset), + Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - strong_hit_diameter) / 2f - border_offset), Alpha = 0.1f }, new CircularContainer { - Name = "Finisher Ring", + Name = "Strong Hit Ring", Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(finisher_diameter), + Size = new Vector2(strong_hit_diameter), Masking = true, BorderColour = Color4.White, BorderThickness = border_thickness, @@ -72,7 +72,7 @@ namespace osu.Game.Modes.Taiko.UI }, new CircularContainer { - Name = "Normal Ring", + Name = "Normal Hit Ring", Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(normal_diameter), @@ -96,7 +96,7 @@ namespace osu.Game.Modes.Taiko.UI Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Y = -border_offset, - Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - finisher_diameter) / 2f - border_offset), + Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - strong_hit_diameter) / 2f - border_offset), Alpha = 0.1f }, }; diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index 8efb815fc0..c23d920eda 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -23,7 +23,7 @@ namespace osu.Game.Modes.Taiko.UI { /// /// The play field height. This is relative to the size of hit objects - /// such that the playfield is just a bit larger than finishers. + /// such that the playfield is just a bit larger than strong hits. /// public const float PLAYFIELD_HEIGHT = TaikoHitObject.CIRCLE_RADIUS * 2 * 2; From cd6fdcf0290a108e24a3bcb792095b6990a3c25a Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 11:00:59 +0900 Subject: [PATCH 06/11] Rename spinnerRotationRatio -> baseHitMultiplier. --- osu.Game.Modes.Taiko/Objects/Swell.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Swell.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs index a2d52d1358..db31add4d7 100644 --- a/osu.Game.Modes.Taiko/Objects/Swell.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -29,8 +29,8 @@ namespace osu.Game.Modes.Taiko.Objects { base.ApplyDefaults(timing, difficulty); - double spinnerRotationRatio = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); - RequiredHits = (int)Math.Max(1, Duration / 1000f * spinnerRotationRatio * HitMultiplier); + double baseHitMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); + RequiredHits = (int)Math.Max(1, Duration / 1000f * baseHitMultiplier * HitMultiplier); } } } \ No newline at end of file From 8aa723b6a372f4621f8782f2a1e223b9ca4899e4 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 11:05:15 +0900 Subject: [PATCH 07/11] General fixes. --- osu.Game.Modes.Taiko/Objects/Swell.cs | 2 +- osu.Game.Modes.Taiko/UI/HitExplosion.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Swell.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs index db31add4d7..0b654f6ff4 100644 --- a/osu.Game.Modes.Taiko/Objects/Swell.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -15,7 +15,7 @@ namespace osu.Game.Modes.Taiko.Objects public double Duration => EndTime - StartTime; /// - /// The multiplier for cases in which the number of required hits by a Swell is not + /// 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. /// public double HitMultiplier { get; set; } = 1; diff --git a/osu.Game.Modes.Taiko/UI/HitExplosion.cs b/osu.Game.Modes.Taiko/UI/HitExplosion.cs index e3fd89e2b5..eb43c1a5d0 100644 --- a/osu.Game.Modes.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Modes.Taiko/UI/HitExplosion.cs @@ -19,9 +19,9 @@ namespace osu.Game.Modes.Taiko.UI internal class HitExplosion : CircularContainer { /// - /// The size of a hit explosion if a hit object has been hit with the second key. + /// The size multiplier of a hit explosion if a hit object has been hit with the second key. /// - private const float secondhit_scale = 1.5f; + private const float secondhit_size_multiplier = 1.5f; /// /// The judgement this hit explosion visualises. @@ -85,7 +85,7 @@ namespace osu.Game.Modes.Taiko.UI /// public void VisualiseSecondHit() { - ResizeTo(Size * secondhit_scale, 50); + ResizeTo(Size * secondhit_size_multiplier, 50); } } } From 6e612bbefc029cb2fc788469feeb910e56b22d95 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 14:39:56 +0900 Subject: [PATCH 08/11] Reduce complexity of instantiating circle pieces in hits. --- .../Objects/Drawable/DrawableCentreHit.cs | 16 ++++++---------- .../Objects/Drawable/DrawableHit.cs | 13 +++++++++++-- .../Objects/Drawable/DrawableRimHit.cs | 16 ++++++---------- .../Objects/Drawable/DrawableStrongCentreHit.cs | 16 ++++++---------- .../Objects/Drawable/DrawableStrongRimHit.cs | 16 ++++++---------- 5 files changed, 35 insertions(+), 42 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs index 683d48df10..76eb6bb77d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs @@ -12,24 +12,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { protected override Key[] HitKeys { get; } = { Key.F, Key.J }; - private readonly CirclePiece circlePiece; - public DrawableCentreHit(Hit hit) : base(hit) { - Add(circlePiece = new CirclePiece - { - Children = new[] - { - new CentreHitSymbolPiece() - } - }); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - circlePiece.AccentColour = colours.PinkDarker; + Circle.AccentColour = colours.PinkDarker; } + + protected override CirclePiece CreateCirclePiece() => new CirclePiece + { + Children = new[] { new CentreHitSymbolPiece() } + }; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index c8a7355e3c..f6239da929 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; using System; using System.Linq; @@ -20,15 +21,17 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable protected override Container Content => bodyContainer; + protected readonly CirclePiece Circle; + private readonly Hit hit; + private readonly Container bodyContainer; + /// /// Whether the last key pressed is a valid hit key. /// private bool validKeyPressed; - private readonly Container bodyContainer; - protected DrawableHit(Hit hit) : base(hit) { @@ -38,6 +41,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { Anchor = Anchor.Centre, Origin = Anchor.Centre, + Children = new[] + { + Circle = CreateCirclePiece() + } }); } @@ -100,5 +107,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Expire(); } + + protected abstract CirclePiece CreateCirclePiece(); } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs index cab6819300..893a6fbb4d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs @@ -12,24 +12,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { protected override Key[] HitKeys { get; } = { Key.D, Key.K }; - private readonly CirclePiece circlePiece; - public DrawableRimHit(Hit hit) : base(hit) { - Add(circlePiece = new CirclePiece - { - Children = new[] - { - new RimHitSymbolPiece() - } - }); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - circlePiece.AccentColour = colours.BlueDarker; + Circle.AccentColour = colours.BlueDarker; } + + protected override CirclePiece CreateCirclePiece() => new CirclePiece + { + Children = new[] { new RimHitSymbolPiece() } + }; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs index b4ec0b108a..bac44f48fb 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs @@ -12,24 +12,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { protected override Key[] HitKeys { get; } = { Key.F, Key.J }; - private readonly CirclePiece circlePiece; - public DrawableStrongCentreHit(Hit hit) : base(hit) { - Add(circlePiece = new StrongCirclePiece - { - Children = new [] - { - new CentreHitSymbolPiece() - } - }); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - circlePiece.AccentColour = colours.PinkDarker; + Circle.AccentColour = colours.PinkDarker; } + + protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece + { + Children = new[] { new CentreHitSymbolPiece() } + }; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs index 1f77ad0409..985ba1c2df 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs @@ -12,24 +12,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { protected override Key[] HitKeys { get; } = { Key.D, Key.K }; - private readonly CirclePiece circlePiece; - public DrawableStrongRimHit(Hit hit) : base(hit) { - Add(circlePiece = new StrongCirclePiece - { - Children = new[] - { - new RimHitSymbolPiece() - } - }); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - circlePiece.AccentColour = colours.BlueDarker; + Circle.AccentColour = colours.BlueDarker; } + + protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece + { + Children = new[] { new RimHitSymbolPiece() } + }; } } From ebbf381cd6a160fd27b767867e73fb99625692a3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 14:40:12 +0900 Subject: [PATCH 09/11] Fix kiai not working during gameplay. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs | 1 + osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 ++ osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index 4697625c5e..ea6b0043d7 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -41,6 +41,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Width = (float)(drumRoll.Duration / drumRoll.PreEmpt); Add(circle = CreateCirclePiece()); + circle.KiaiMode = HitObject.Kiai; foreach (var tick in drumRoll.Ticks) { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index f6239da929..87f0e76f60 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -46,6 +46,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Circle = CreateCirclePiece() } }); + + Circle.KiaiMode = HitObject.Kiai; } protected override void CheckJudgement(bool userTriggered) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs index ccd6380542..ec1ab42bfc 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs @@ -128,6 +128,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } }; + + circlePiece.KiaiMode = HitObject.Kiai; } [BackgroundDependencyLoader] From 774e15b89dd94efd1e7fbfd001db55e8aa611adc Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 15:02:21 +0900 Subject: [PATCH 10/11] Set RequiredHits at conversion time to remove HitMultiplier. --- .../Beatmaps/TaikoBeatmapConverter.cs | 5 ++++- osu.Game.Modes.Taiko/Objects/Swell.cs | 19 +------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 693e9cadf3..ec8f64bd2f 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -10,6 +10,7 @@ using osu.Game.Modes.Taiko.Objects; using System; using System.Collections.Generic; using System.Linq; +using osu.Game.Database; namespace osu.Game.Modes.Taiko.Beatmaps { @@ -84,6 +85,8 @@ namespace osu.Game.Modes.Taiko.Beatmaps } else if (endTimeData != null) { + double hitMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.OverallDifficulty, 3, 5, 7.5) * bash_convert_factor; + // We compute the end time manually to add in the Bash convert factor yield return new Swell { @@ -92,7 +95,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps IsStrong = strong, EndTime = obj.StartTime + endTimeData.Duration, - HitMultiplier = bash_convert_factor + RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier) }; } else diff --git a/osu.Game.Modes.Taiko/Objects/Swell.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs index 0b654f6ff4..f55416509a 100644 --- a/osu.Game.Modes.Taiko/Objects/Swell.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -1,9 +1,6 @@ // 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 @@ -14,23 +11,9 @@ namespace osu.Game.Modes.Taiko.Objects public double Duration => EndTime - StartTime; - /// - /// 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. - /// - public double HitMultiplier { get; set; } = 1; - /// /// The number of hits required to complete the swell successfully. /// - public int RequiredHits { get; protected set; } = 10; - - public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) - { - base.ApplyDefaults(timing, difficulty); - - double baseHitMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); - RequiredHits = (int)Math.Max(1, Duration / 1000f * baseHitMultiplier * HitMultiplier); - } + public int RequiredHits = 10; } } \ No newline at end of file From a03cffab587d1e7794c2ad178bf51a5705bdc330 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 15:05:12 +0900 Subject: [PATCH 11/11] No need to compute end time manually anymore. --- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index ec8f64bd2f..97acdeb3e6 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -87,14 +87,13 @@ namespace osu.Game.Modes.Taiko.Beatmaps { double hitMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.OverallDifficulty, 3, 5, 7.5) * bash_convert_factor; - // We compute the end time manually to add in the Bash convert factor yield return new Swell { StartTime = obj.StartTime, Sample = obj.Sample, IsStrong = strong, - EndTime = obj.StartTime + endTimeData.Duration, + EndTime = endTimeData.EndTime, RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier) }; }