mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Combine Judgement.HitResults into one.
This commit is contained in:
@ -69,20 +69,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (Judgement.TimeOffset > HitObject.HitWindowFor(OsuScoreResult.Hit50))
|
||||
if (Judgement.TimeOffset > HitObject.HitWindowFor(HitResult.Meh))
|
||||
Judgement.Result = HitResult.Miss;
|
||||
return;
|
||||
}
|
||||
|
||||
double hitOffset = Math.Abs(Judgement.TimeOffset);
|
||||
|
||||
if (hitOffset < HitObject.HitWindowFor(OsuScoreResult.Hit50))
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.Score = HitObject.ScoreResultForOffset(hitOffset);
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
Judgement.Result = HitObject.ScoreResultForOffset(Math.Abs(Judgement.TimeOffset));
|
||||
}
|
||||
|
||||
protected override void UpdateInitialState()
|
||||
|
@ -21,8 +21,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
Alpha = 0;
|
||||
}
|
||||
|
||||
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 };
|
||||
|
||||
protected sealed override void UpdateState(ArmedState state)
|
||||
{
|
||||
FinishTransforms();
|
||||
@ -65,18 +63,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
[Description(@"Amazing")]
|
||||
Perfect
|
||||
}
|
||||
|
||||
public enum OsuScoreResult
|
||||
{
|
||||
[Description(@"Miss")]
|
||||
Miss,
|
||||
[Description(@"50")]
|
||||
Hit50,
|
||||
[Description(@"100")]
|
||||
Hit100,
|
||||
[Description(@"300")]
|
||||
Hit300,
|
||||
[Description(@"10")]
|
||||
SliderTick
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
bouncer2.Position = slider.Curve.PositionAt(body.SnakedEnd ?? 0);
|
||||
|
||||
//todo: we probably want to reconsider this before adding scoring, but it looks and feels nice.
|
||||
if (initialCircle.Judgement?.Result != HitResult.Hit)
|
||||
if (initialCircle.Judgement?.Result <= HitResult.Miss)
|
||||
initialCircle.Position = slider.Curve.PositionAt(progress);
|
||||
|
||||
foreach (var c in components) c.UpdateProgress(progress, repeat);
|
||||
@ -126,21 +126,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
if (!userTriggered && Time.Current >= slider.EndTime)
|
||||
{
|
||||
var ticksCount = ticks.Children.Count + 1;
|
||||
var ticksHit = ticks.Children.Count(t => t.Judgement.Result == HitResult.Hit);
|
||||
if (initialCircle.Judgement.Result == HitResult.Hit)
|
||||
var ticksHit = ticks.Children.Count(t => t.Judgement.Result > HitResult.Miss);
|
||||
if (initialCircle.Judgement.Result > HitResult.Miss)
|
||||
ticksHit++;
|
||||
|
||||
var hitFraction = (double)ticksHit / ticksCount;
|
||||
if (hitFraction == 1 && initialCircle.Judgement.Score == OsuScoreResult.Hit300)
|
||||
Judgement.Score = OsuScoreResult.Hit300;
|
||||
else if (hitFraction >= 0.5 && initialCircle.Judgement.Score >= OsuScoreResult.Hit100)
|
||||
Judgement.Score = OsuScoreResult.Hit100;
|
||||
if (hitFraction == 1 && initialCircle.Judgement.Result == HitResult.Great)
|
||||
Judgement.Result = HitResult.Great;
|
||||
else if (hitFraction >= 0.5 && initialCircle.Judgement.Result >= HitResult.Good)
|
||||
Judgement.Result = HitResult.Good;
|
||||
else if (hitFraction > 0)
|
||||
Judgement.Score = OsuScoreResult.Hit50;
|
||||
Judgement.Result = HitResult.Meh;
|
||||
else
|
||||
Judgement.Score = OsuScoreResult.Miss;
|
||||
|
||||
Judgement.Result = Judgement.Score != OsuScoreResult.Miss ? HitResult.Hit : HitResult.Miss;
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -22,8 +21,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
public override bool RemoveWhenNotAlive => false;
|
||||
|
||||
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.SliderTick };
|
||||
|
||||
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
|
||||
{
|
||||
this.sliderTick = sliderTick;
|
||||
@ -52,10 +49,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (Judgement.TimeOffset >= 0)
|
||||
{
|
||||
Judgement.Result = Tracking ? HitResult.Hit : HitResult.Miss;
|
||||
Judgement.Score = Tracking ? OsuScoreResult.SliderTick : OsuScoreResult.Miss;
|
||||
}
|
||||
Judgement.Result = Tracking ? HitResult.Perfect : HitResult.Miss;
|
||||
}
|
||||
|
||||
protected override void UpdatePreemptState()
|
||||
|
@ -129,26 +129,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
if (!userTriggered && Time.Current >= spinner.EndTime)
|
||||
{
|
||||
if (Progress >= 1)
|
||||
{
|
||||
Judgement.Score = OsuScoreResult.Hit300;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
Judgement.Result = HitResult.Great;
|
||||
else if (Progress > .9)
|
||||
{
|
||||
Judgement.Score = OsuScoreResult.Hit100;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
Judgement.Result = HitResult.Good;
|
||||
else if (Progress > .75)
|
||||
{
|
||||
Judgement.Score = OsuScoreResult.Hit50;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Judgement.Score = OsuScoreResult.Miss;
|
||||
if (Time.Current >= spinner.EndTime)
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
Judgement.Result = HitResult.Meh;
|
||||
else if (Time.Current >= spinner.EndTime)
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using OpenTK;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
@ -42,30 +42,30 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
public virtual bool NewCombo { get; set; }
|
||||
public int ComboIndex { get; set; }
|
||||
|
||||
public double HitWindowFor(OsuScoreResult result)
|
||||
public double HitWindowFor(HitResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
default:
|
||||
return 300;
|
||||
case OsuScoreResult.Hit50:
|
||||
case HitResult.Meh:
|
||||
return 150;
|
||||
case OsuScoreResult.Hit100:
|
||||
case HitResult.Good:
|
||||
return 80;
|
||||
case OsuScoreResult.Hit300:
|
||||
case HitResult.Great:
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
|
||||
public OsuScoreResult ScoreResultForOffset(double offset)
|
||||
public HitResult ScoreResultForOffset(double offset)
|
||||
{
|
||||
if (offset < HitWindowFor(OsuScoreResult.Hit300))
|
||||
return OsuScoreResult.Hit300;
|
||||
if (offset < HitWindowFor(OsuScoreResult.Hit100))
|
||||
return OsuScoreResult.Hit100;
|
||||
if (offset < HitWindowFor(OsuScoreResult.Hit50))
|
||||
return OsuScoreResult.Hit50;
|
||||
return OsuScoreResult.Miss;
|
||||
if (offset < HitWindowFor(HitResult.Great))
|
||||
return HitResult.Great;
|
||||
if (offset < HitWindowFor(HitResult.Good))
|
||||
return HitResult.Good;
|
||||
if (offset < HitWindowFor(HitResult.Meh))
|
||||
return HitResult.Meh;
|
||||
return HitResult.Miss;
|
||||
}
|
||||
|
||||
public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
||||
|
Reference in New Issue
Block a user