mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Make Rulesets.Mania use the new judgement result structure
This commit is contained in:
@ -7,7 +7,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Mania.Judgements;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
@ -100,7 +99,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||
{
|
||||
if (tail.AllJudged)
|
||||
ApplyJudgement(HitObject.Judgement, j => j.Result = HitResult.Perfect);
|
||||
ApplyResult(Results.Single(), r => r.Type = HitResult.Perfect);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
@ -166,7 +165,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
return false;
|
||||
|
||||
// If the key has been released too early, the user should not receive full score for the release
|
||||
if (HitObject.Judgement.Result == HitResult.Miss)
|
||||
if (Results.Single().Type == HitResult.Miss)
|
||||
holdNote.hasBroken = true;
|
||||
|
||||
// The head note also handles early hits before the body, but we want accurate early hits to count as the body being held
|
||||
@ -205,13 +204,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
{
|
||||
ApplyJudgement(holdNote.HitObject.Tail.Judgement, j =>
|
||||
{
|
||||
j.Result = HitResult.Miss;
|
||||
((HoldNoteTailJudgement)j).HasBroken = holdNote.hasBroken;
|
||||
});
|
||||
}
|
||||
ApplyResult(Results.Single(), r => r.Type = HitResult.Miss);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -220,10 +213,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (result == HitResult.None)
|
||||
return;
|
||||
|
||||
ApplyJudgement(holdNote.HitObject.Tail.Judgement, j =>
|
||||
ApplyResult(Results.Single(), r =>
|
||||
{
|
||||
j.Result = result;
|
||||
((HoldNoteTailJudgement)j).HasBroken = holdNote.hasBroken;
|
||||
if (holdNote.hasBroken && (result == HitResult.Perfect || result == HitResult.Perfect))
|
||||
result = HitResult.Good;
|
||||
|
||||
r.Type = result;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
@ -79,9 +80,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
var startTime = HoldStartTime?.Invoke();
|
||||
|
||||
if (startTime == null || startTime > HitObject.StartTime)
|
||||
ApplyJudgement(HitObject.Judgement, j => j.Result = HitResult.Miss);
|
||||
ApplyResult(Results.Single(), r => r.Type = HitResult.Miss);
|
||||
else
|
||||
ApplyJudgement(HitObject.Judgement, j => j.Result = HitResult.Perfect);
|
||||
ApplyResult(Results.Single(), r => r.Type = HitResult.Perfect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
@ -60,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
ApplyJudgement(HitObject.Judgement, j => j.Result = HitResult.Miss);
|
||||
ApplyResult(Results.Single(), r => r.Type = HitResult.Miss);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -68,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (result == HitResult.None)
|
||||
return;
|
||||
|
||||
ApplyJudgement(HitObject.Judgement, j => j.Result = result);
|
||||
ApplyResult(Results.Single(), r => r.Type = result);
|
||||
}
|
||||
|
||||
public virtual bool OnPressed(ManiaAction action)
|
||||
|
Reference in New Issue
Block a user