Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap Taiko hit objects to match Stable #22553

Merged
merged 2 commits into from Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs
Expand Up @@ -2,13 +2,15 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Rulesets.UI;

namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IApplicableToDrawableHitObject
{
public void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset)
{
Expand All @@ -18,5 +20,11 @@ public void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRules
var playfield = (TaikoPlayfield)drawableRuleset.Playfield;
playfield.ClassicHitTargetPosition.Value = true;
}

public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
if (drawable is DrawableHit)
drawable.SnapJudgementLocation = true;
}
}
}
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
Expand Up @@ -207,6 +207,9 @@ protected override void UpdateHitStateTransforms(ArmedState state)
const float gravity_time = 300;
const float gravity_travel_height = 200;

if (SnapJudgementLocation)
MainPiece.MoveToX(-X);

this.ScaleTo(0.8f, gravity_time * 2, Easing.OutQuad);

this.MoveToY(-gravity_travel_height, gravity_time, Easing.Out)
Expand Down
9 changes: 9 additions & 0 deletions osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
Expand Up @@ -662,6 +662,15 @@ public virtual void OnKilled()
/// </remarks>
public virtual double MaximumJudgementOffset => HitObject.HitWindows?.WindowFor(HitResult.Miss) ?? 0;

/// <summary>
/// Whether the location of the hit should be snapped to the hit target before animating.
/// </summary>
/// <remarks>
/// This is how osu-stable worked, but notably is not how TnT works.
/// It results in less visual feedback on hit accuracy.
/// </remarks>
public bool SnapJudgementLocation { get; set; }
Comment on lines +665 to +672
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peppy Why is this all the way up here in DrawableHitObject? Surely it makes more sense to have it more localised, even to taiko alone?

I was scrolling past DHO today and I was quite surprised to see this here. The property doesn't even semantically make sense for any ruleset that isn't scrolling.

Copy link
Sponsor Member

@peppy peppy Feb 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to have been a large oversight. #22617


/// <summary>
/// Applies the <see cref="Result"/> of this <see cref="DrawableHitObject"/>, notifying responders such as
/// the <see cref="ScoreProcessor"/> of the <see cref="JudgementResult"/>.
Expand Down