mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
General refactoring (no more casts :D).
This commit is contained in:
@ -44,7 +44,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
{
|
||||
if (Judgement.Result.HasValue) return false;
|
||||
|
||||
((PositionalJudgementInfo)Judgement).PositionOffset = Vector2.Zero; //todo: set to correct value
|
||||
Judgement.PositionOffset = Vector2.Zero; //todo: set to correct value
|
||||
UpdateJudgement(true);
|
||||
return true;
|
||||
},
|
||||
@ -80,12 +80,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
|
||||
double hitOffset = Math.Abs(Judgement.TimeOffset);
|
||||
|
||||
OsuJudgementInfo osuJudgement = (OsuJudgementInfo)Judgement;
|
||||
|
||||
if (hitOffset < HitObject.HitWindowFor(OsuScoreResult.Hit50))
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
osuJudgement.Score = HitObject.ScoreResultForOffset(hitOffset);
|
||||
Judgement.Score = HitObject.ScoreResultForOffset(hitOffset);
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.ComponentModel;
|
||||
using osu.Game.Modes.Judgements;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
|
@ -125,27 +125,24 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
var j = (OsuJudgementInfo)Judgement;
|
||||
var sc = (OsuJudgementInfo)initialCircle.Judgement;
|
||||
|
||||
if (!userTriggered && Time.Current >= HitObject.EndTime)
|
||||
{
|
||||
var ticksCount = ticks.Children.Count() + 1;
|
||||
var ticksHit = ticks.Children.Count(t => t.Judgement.Result == HitResult.Hit);
|
||||
if (sc.Result == HitResult.Hit)
|
||||
if (initialCircle.Judgement.Result == HitResult.Hit)
|
||||
ticksHit++;
|
||||
|
||||
var hitFraction = (double)ticksHit / ticksCount;
|
||||
if (hitFraction == 1 && sc.Score == OsuScoreResult.Hit300)
|
||||
j.Score = OsuScoreResult.Hit300;
|
||||
else if (hitFraction >= 0.5 && sc.Score >= OsuScoreResult.Hit100)
|
||||
j.Score = OsuScoreResult.Hit100;
|
||||
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;
|
||||
else if (hitFraction > 0)
|
||||
j.Score = OsuScoreResult.Hit50;
|
||||
Judgement.Score = OsuScoreResult.Hit50;
|
||||
else
|
||||
j.Score = OsuScoreResult.Miss;
|
||||
Judgement.Score = OsuScoreResult.Miss;
|
||||
|
||||
j.Result = j.Score != OsuScoreResult.Miss ? HitResult.Hit : HitResult.Miss;
|
||||
Judgement.Result = Judgement.Score != OsuScoreResult.Miss ? HitResult.Hit : HitResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
using osu.Game.Modes.Judgements;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
@ -72,12 +71,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
var j = (OsuJudgementInfo)Judgement;
|
||||
|
||||
if (Judgement.TimeOffset >= 0)
|
||||
{
|
||||
j.Result = Tracking ? HitResult.Hit : HitResult.Miss;
|
||||
j.Score = Tracking ? OsuScoreResult.SliderTick : OsuScoreResult.Miss;
|
||||
Judgement.Result = Tracking ? HitResult.Hit : HitResult.Miss;
|
||||
Judgement.Score = Tracking ? OsuScoreResult.SliderTick : OsuScoreResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
{
|
||||
if (Time.Current < HitObject.StartTime) return;
|
||||
|
||||
var j = (OsuJudgementInfo)Judgement;
|
||||
|
||||
disc.ScaleTo(Interpolation.ValueAt(Math.Sqrt(Progress), scaleToCircle, Vector2.One, 0, 1), 100);
|
||||
|
||||
if (Progress >= 1)
|
||||
@ -86,24 +84,24 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
{
|
||||
if (Progress >= 1)
|
||||
{
|
||||
j.Score = OsuScoreResult.Hit300;
|
||||
j.Result = HitResult.Hit;
|
||||
Judgement.Score = OsuScoreResult.Hit300;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
else if (Progress > .9)
|
||||
{
|
||||
j.Score = OsuScoreResult.Hit100;
|
||||
j.Result = HitResult.Hit;
|
||||
Judgement.Score = OsuScoreResult.Hit100;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
else if (Progress > .75)
|
||||
{
|
||||
j.Score = OsuScoreResult.Hit50;
|
||||
j.Result = HitResult.Hit;
|
||||
Judgement.Score = OsuScoreResult.Hit50;
|
||||
Judgement.Result = HitResult.Hit;
|
||||
}
|
||||
else
|
||||
{
|
||||
j.Score = OsuScoreResult.Miss;
|
||||
Judgement.Score = OsuScoreResult.Miss;
|
||||
if (Time.Current >= HitObject.EndTime)
|
||||
j.Result = HitResult.Miss;
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user