mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Attempt to standardise miss handling logic
This commit is contained in:
parent
fcf47267fd
commit
eb8fb8092d
@ -62,14 +62,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
/// </remarks>
|
||||
public virtual void PlayAnimation()
|
||||
{
|
||||
if (Result.IsHit())
|
||||
{
|
||||
JudgementText
|
||||
.FadeInFromZero(300, Easing.OutQuint)
|
||||
.ScaleTo(Vector2.One)
|
||||
.ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
if (Result.IsMiss())
|
||||
{
|
||||
this.ScaleTo(1.6f);
|
||||
this.ScaleTo(1, 100, Easing.In);
|
||||
@ -80,6 +73,13 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||
this.RotateTo(0);
|
||||
this.RotateTo(40, 800, Easing.InQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
JudgementText
|
||||
.FadeInFromZero(300, Easing.OutQuint)
|
||||
.ScaleTo(Vector2.One)
|
||||
.ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint);
|
||||
}
|
||||
|
||||
this.FadeOutFromOne(800);
|
||||
|
||||
|
@ -269,6 +269,25 @@ namespace osu.Game.Rulesets.Scoring
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> represents a miss of any type.
|
||||
/// </summary>
|
||||
public static bool IsMiss(this HitResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case HitResult.IgnoreMiss:
|
||||
case HitResult.Miss:
|
||||
case HitResult.SmallTickMiss:
|
||||
case HitResult.LargeTickMiss:
|
||||
case HitResult.ComboBreak:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> represents a successful hit.
|
||||
/// </summary>
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Skinning
|
||||
});
|
||||
}
|
||||
|
||||
if (result.IsHit())
|
||||
if (!result.IsMiss())
|
||||
{
|
||||
//new judgement shows old as a temporary effect
|
||||
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true)
|
||||
|
@ -52,18 +52,7 @@ namespace osu.Game.Skinning
|
||||
if (animation?.FrameCount > 1 && !forceTransforms)
|
||||
return;
|
||||
|
||||
if (result.IsHit())
|
||||
{
|
||||
this.ScaleTo(0.6f).Then()
|
||||
.ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8
|
||||
.Delay(fade_in_length * 0.2f) // t = 1.0
|
||||
.ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2
|
||||
// stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2.
|
||||
// so we need to force the current value to be correct at 1.2 (0.95) then complete the
|
||||
// second half of the transform.
|
||||
.ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4
|
||||
}
|
||||
else
|
||||
if (result.IsMiss())
|
||||
{
|
||||
bool isTick = result != HitResult.Miss;
|
||||
|
||||
@ -92,6 +81,17 @@ namespace osu.Game.Skinning
|
||||
.Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ScaleTo(0.6f).Then()
|
||||
.ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8
|
||||
.Delay(fade_in_length * 0.2f) // t = 1.0
|
||||
.ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2
|
||||
// stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2.
|
||||
// so we need to force the current value to be correct at 1.2 (0.95) then complete the
|
||||
// second half of the transform.
|
||||
.ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable GetAboveHitObjectsProxiedContent() => CreateProxy();
|
||||
|
@ -453,7 +453,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
private Drawable? getJudgementAnimation(HitResult result)
|
||||
{
|
||||
if (!result.IsHit())
|
||||
if (result.IsMiss())
|
||||
return this.GetAnimation("hit0", true, false);
|
||||
|
||||
switch (result)
|
||||
|
Loading…
Reference in New Issue
Block a user