mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Merge branch 'master' into fix-hitobject-sample-stuck-on-future-seek
This commit is contained in:
@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
|
|||||||
public void TestDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Droplet { StartTime = 1000 }), shouldMiss);
|
public void TestDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Droplet { StartTime = 1000 }), shouldMiss);
|
||||||
|
|
||||||
// We only care about testing misses, hits are tested via JuiceStream
|
// We only care about testing misses, hits are tested via JuiceStream
|
||||||
[TestCase(false)]
|
[TestCase(true)]
|
||||||
public void TestTinyDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new TinyDroplet { StartTime = 1000 }), shouldMiss);
|
public void TestTinyDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new TinyDroplet { StartTime = 1000 }), shouldMiss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,31 +8,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
public class CatchBananaJudgement : CatchJudgement
|
public class CatchBananaJudgement : CatchJudgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.LargeBonus;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 1100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.75;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool ShouldExplodeFor(JudgementResult result) => true;
|
public override bool ShouldExplodeFor(JudgementResult result) => true;
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,6 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
public class CatchDropletJudgement : CatchJudgement
|
public class CatchDropletJudgement : CatchJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result)
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 30;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,18 +11,6 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
public override HitResult MaxResult => HitResult.Perfect;
|
public override HitResult MaxResult => HitResult.Perfect;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 300;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether fruit on the platter should explode or drop.
|
/// Whether fruit on the platter should explode or drop.
|
||||||
/// Note that this is only checked if the owning object is also <see cref="IHasComboInformation.LastInCombo" />
|
/// Note that this is only checked if the owning object is also <see cref="IHasComboInformation.LastInCombo" />
|
||||||
|
@ -7,30 +7,6 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
public class CatchTinyDropletJudgement : CatchJudgement
|
public class CatchTinyDropletJudgement : CatchJudgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.SmallTickHit;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 0.02;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -86,7 +85,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
if (CheckPosition == null) return;
|
if (CheckPosition == null) return;
|
||||||
|
|
||||||
if (timeOffset >= 0 && Result != null)
|
if (timeOffset >= 0 && Result != null)
|
||||||
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateStateTransforms(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
|
@ -7,6 +7,5 @@ namespace osu.Game.Rulesets.Catch.Scoring
|
|||||||
{
|
{
|
||||||
public class CatchScoreProcessor : ScoreProcessor
|
public class CatchScoreProcessor : ScoreProcessor
|
||||||
{
|
{
|
||||||
public override HitWindows CreateHitWindows() => new CatchHitWindows();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public void OnNewResult(DrawableCatchHitObject judgedObject, JudgementResult result)
|
public void OnNewResult(DrawableCatchHitObject judgedObject, JudgementResult result)
|
||||||
{
|
{
|
||||||
if (!result.Judgement.AffectsCombo || !result.HasResult)
|
if (!result.Type.AffectsCombo() || !result.HasResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (result.Type == HitResult.Miss)
|
if (result.Type == HitResult.Miss)
|
||||||
@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public void OnRevertResult(DrawableCatchHitObject judgedObject, JudgementResult result)
|
public void OnRevertResult(DrawableCatchHitObject judgedObject, JudgementResult result)
|
||||||
{
|
{
|
||||||
if (!result.Judgement.AffectsCombo || !result.HasResult)
|
if (!result.Type.AffectsCombo() || !result.HasResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateCombo(result.ComboAtJudgement, judgedObject.AccentColour.Value);
|
updateCombo(result.ComboAtJudgement, judgedObject.AccentColour.Value);
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Rulesets.Catch.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public void OnNewResult(DrawableCatchHitObject fruit, JudgementResult result)
|
public void OnNewResult(DrawableCatchHitObject fruit, JudgementResult result)
|
||||||
{
|
{
|
||||||
if (result.Judgement is IgnoreJudgement)
|
if (!result.Type.IsScorable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void runAfterLoaded(Action action)
|
void runAfterLoaded(Action action)
|
||||||
|
@ -45,9 +45,9 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Miss);
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
assertNoteJudgement(HitResult.Perfect);
|
assertNoteJudgement(HitResult.IgnoreHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Miss);
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Miss);
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Perfect);
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Perfect);
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Perfect);
|
assertTailJudgement(HitResult.Perfect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Perfect);
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
assertTickJudgement(HitResult.Miss);
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Perfect);
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Perfect);
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Meh);
|
assertTailJudgement(HitResult.Meh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Miss);
|
assertTailJudgement(HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Perfect);
|
assertTickJudgement(HitResult.LargeTickHit);
|
||||||
assertTailJudgement(HitResult.Meh);
|
assertTailJudgement(HitResult.Meh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
assertTickJudgement(HitResult.Miss);
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
assertTailJudgement(HitResult.Meh);
|
assertTailJudgement(HitResult.Meh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,10 +280,10 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
}, beatmap);
|
}, beatmap);
|
||||||
|
|
||||||
AddAssert("first hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[0].NestedHitObjects.Contains(j.HitObject))
|
AddAssert("first hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[0].NestedHitObjects.Contains(j.HitObject))
|
||||||
.All(j => j.Type == HitResult.Miss));
|
.All(j => !j.Type.IsHit()));
|
||||||
|
|
||||||
AddAssert("second hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[1].NestedHitObjects.Contains(j.HitObject))
|
AddAssert("second hold note missed", () => judgementResults.Where(j => beatmap.HitObjects[1].NestedHitObjects.Contains(j.HitObject))
|
||||||
.All(j => j.Type == HitResult.Perfect));
|
.All(j => j.Type.IsHit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertHeadJudgement(HitResult result)
|
private void assertHeadJudgement(HitResult result)
|
||||||
|
@ -7,18 +7,6 @@ namespace osu.Game.Rulesets.Mania.Judgements
|
|||||||
{
|
{
|
||||||
public class HoldNoteTickJudgement : ManiaJudgement
|
public class HoldNoteTickJudgement : ManiaJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => result == MaxResult ? 20 : 0;
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 0.01;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,34 +2,10 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Judgements
|
namespace osu.Game.Rulesets.Mania.Judgements
|
||||||
{
|
{
|
||||||
public class ManiaJudgement : Judgement
|
public class ManiaJudgement : Judgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Meh:
|
|
||||||
return 50;
|
|
||||||
|
|
||||||
case HitResult.Ok:
|
|
||||||
return 100;
|
|
||||||
|
|
||||||
case HitResult.Good:
|
|
||||||
return 200;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
|
||||||
return 300;
|
|
||||||
|
|
||||||
case HitResult.Perfect:
|
|
||||||
return 350;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
{
|
{
|
||||||
if (Tail.AllJudged)
|
if (Tail.AllJudged)
|
||||||
{
|
{
|
||||||
ApplyResult(r => r.Type = HitResult.Perfect);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
endHold();
|
endHold();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -17,6 +16,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawableHoldNoteTick : DrawableManiaHitObject<HoldNoteTick>
|
public class DrawableHoldNoteTick : DrawableManiaHitObject<HoldNoteTick>
|
||||||
{
|
{
|
||||||
|
public override bool DisplayResult => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// References the time at which the user started holding the hold note.
|
/// References the time at which the user started holding the hold note.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -73,9 +74,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
var startTime = HoldStartTime?.Invoke();
|
var startTime = HoldStartTime?.Invoke();
|
||||||
|
|
||||||
if (startTime == null || startTime > HitObject.StartTime)
|
if (startTime == null || startTime > HitObject.StartTime)
|
||||||
ApplyResult(r => r.Type = HitResult.Miss);
|
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||||
else
|
else
|
||||||
ApplyResult(r => r.Type = HitResult.Perfect);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,5 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
protected override double DefaultAccuracyPortion => 0.95;
|
protected override double DefaultAccuracyPortion => 0.95;
|
||||||
|
|
||||||
protected override double DefaultComboPortion => 0.05;
|
protected override double DefaultComboPortion => 0.05;
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,9 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
|
|
||||||
private Drawable getResult(HitResult result)
|
private Drawable getResult(HitResult result)
|
||||||
{
|
{
|
||||||
|
if (!hitresult_mapping.ContainsKey(result))
|
||||||
|
return null;
|
||||||
|
|
||||||
string filename = this.GetManiaSkinConfig<string>(hitresult_mapping[result])?.Value
|
string filename = this.GetManiaSkinConfig<string>(hitresult_mapping[result])?.Value
|
||||||
?? default_hitresult_skin_filenames[result];
|
?? default_hitresult_skin_filenames[result];
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
if (result.IsHit)
|
if (result.IsHit)
|
||||||
hitPolicy.HandleHit(judgedObject);
|
hitPolicy.HandleHit(judgedObject);
|
||||||
|
|
||||||
if (!result.IsHit || !judgedObject.DisplayResult || !DisplayJudgements.Value)
|
if (!result.IsHit || !DisplayJudgements.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HitObjectArea.Explosions.Add(hitExplosionPool.Get(e => e.Apply(result)));
|
HitObjectArea.Explosions.Add(hitExplosionPool.Get(e => e.Apply(result)));
|
||||||
|
@ -209,9 +209,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
addJudgementAssert(hitObjects[0], HitResult.Great);
|
addJudgementAssert(hitObjects[0], HitResult.Great);
|
||||||
addJudgementAssert(hitObjects[1], HitResult.Great);
|
addJudgementAssert(hitObjects[1], HitResult.IgnoreHit);
|
||||||
addJudgementAssert("slider head", () => ((Slider)hitObjects[1]).HeadCircle, HitResult.Miss);
|
addJudgementAssert("slider head", () => ((Slider)hitObjects[1]).HeadCircle, HitResult.Miss);
|
||||||
addJudgementAssert("slider tick", () => ((Slider)hitObjects[1]).NestedHitObjects[1] as SliderTick, HitResult.Great);
|
addJudgementAssert("slider tick", () => ((Slider)hitObjects[1]).NestedHitObjects[1] as SliderTick, HitResult.LargeTickHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -252,9 +252,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
addJudgementAssert(hitObjects[0], HitResult.Great);
|
addJudgementAssert(hitObjects[0], HitResult.Great);
|
||||||
addJudgementAssert(hitObjects[1], HitResult.Great);
|
addJudgementAssert(hitObjects[1], HitResult.IgnoreHit);
|
||||||
addJudgementAssert("slider head", () => ((Slider)hitObjects[1]).HeadCircle, HitResult.Great);
|
addJudgementAssert("slider head", () => ((Slider)hitObjects[1]).HeadCircle, HitResult.Great);
|
||||||
addJudgementAssert("slider tick", () => ((Slider)hitObjects[1]).NestedHitObjects[1] as SliderTick, HitResult.Great);
|
addJudgementAssert("slider tick", () => ((Slider)hitObjects[1]).NestedHitObjects[1] as SliderTick, HitResult.LargeTickHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -331,7 +331,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
});
|
});
|
||||||
|
|
||||||
addJudgementAssert(hitObjects[0], HitResult.Great);
|
addJudgementAssert(hitObjects[0], HitResult.Great);
|
||||||
addJudgementAssert(hitObjects[1], HitResult.Great);
|
addJudgementAssert(hitObjects[1], HitResult.IgnoreHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addJudgementAssert(OsuHitObject hitObject, HitResult result)
|
private void addJudgementAssert(OsuHitObject hitObject, HitResult result)
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_2 },
|
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_2 },
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertMaxJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_1 },
|
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_1 },
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertMaxJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_1 },
|
new OsuReplayFrame { Position = new Vector2(0, 0), Actions = { OsuAction.RightButton }, Time = time_during_slide_1 },
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertMaxJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -288,7 +288,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
new OsuReplayFrame { Position = new Vector2(slider_path_length, OsuHitObject.OBJECT_RADIUS * 1.199f), Actions = { OsuAction.LeftButton }, Time = time_slider_end },
|
new OsuReplayFrame { Position = new Vector2(slider_path_length, OsuHitObject.OBJECT_RADIUS * 1.199f), Actions = { OsuAction.LeftButton }, Time = time_slider_end },
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Tracking kept", assertGreatJudge);
|
AddAssert("Tracking kept", assertMaxJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -312,13 +312,13 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
AddAssert("Tracking dropped", assertMidSliderJudgementFail);
|
AddAssert("Tracking dropped", assertMidSliderJudgementFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool assertGreatJudge() => judgementResults.Any() && judgementResults.All(t => t.Type == HitResult.Great);
|
private bool assertMaxJudge() => judgementResults.Any() && judgementResults.All(t => t.Type == t.Judgement.MaxResult);
|
||||||
|
|
||||||
private bool assertHeadMissTailTracked() => judgementResults[^2].Type == HitResult.Great && judgementResults.First().Type == HitResult.Miss;
|
private bool assertHeadMissTailTracked() => judgementResults[^2].Type == HitResult.IgnoreHit && judgementResults.First().Type == HitResult.Miss;
|
||||||
|
|
||||||
private bool assertMidSliderJudgements() => judgementResults[^2].Type == HitResult.Great;
|
private bool assertMidSliderJudgements() => judgementResults[^2].Type == HitResult.IgnoreHit;
|
||||||
|
|
||||||
private bool assertMidSliderJudgementFail() => judgementResults[^2].Type == HitResult.Miss;
|
private bool assertMidSliderJudgementFail() => judgementResults[^2].Type == HitResult.IgnoreMiss;
|
||||||
|
|
||||||
private ScoreAccessibleReplayPlayer currentPlayer;
|
private ScoreAccessibleReplayPlayer currentPlayer;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
// multipled by 2 to nullify the score multiplier. (autoplay mod selected)
|
// multipled by 2 to nullify the score multiplier. (autoplay mod selected)
|
||||||
var totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2;
|
var totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2;
|
||||||
return totalScore == (int)(drawableSpinner.RotationTracker.RateAdjustedRotation / 360) * SpinnerTick.SCORE_PER_TICK;
|
return totalScore == (int)(drawableSpinner.RotationTracker.RateAdjustedRotation / 360) * new SpinnerTick().CreateJudgement().MaxNumericResult;
|
||||||
});
|
});
|
||||||
|
|
||||||
addSeekStep(0);
|
addSeekStep(0);
|
||||||
|
@ -7,10 +7,6 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
|||||||
{
|
{
|
||||||
public class OsuIgnoreJudgement : OsuJudgement
|
public class OsuIgnoreJudgement : OsuJudgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.IgnoreHit;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => 0;
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,23 +9,5 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
|||||||
public class OsuJudgement : Judgement
|
public class OsuJudgement : Judgement
|
||||||
{
|
{
|
||||||
public override HitResult MaxResult => HitResult.Great;
|
public override HitResult MaxResult => HitResult.Great;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case HitResult.Meh:
|
|
||||||
return 50;
|
|
||||||
|
|
||||||
case HitResult.Good:
|
|
||||||
return 100;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
|
||||||
return 300;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
@ -50,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (sliderRepeat.StartTime <= Time.Current)
|
if (sliderRepeat.StartTime <= Time.Current)
|
||||||
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateInitialTransforms()
|
protected override void UpdateInitialTransforms()
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
@ -46,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (!userTriggered && timeOffset >= 0)
|
if (!userTriggered && timeOffset >= 0)
|
||||||
ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : HitResult.Miss);
|
ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePosition() => Position = HitObject.Position - slider.Position;
|
private void updatePosition() => Position = HitObject.Position - slider.Position;
|
||||||
|
@ -10,7 +10,6 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -64,7 +63,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (timeOffset >= 0)
|
if (timeOffset >= 0)
|
||||||
ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : HitResult.Miss);
|
ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateInitialTransforms()
|
protected override void UpdateInitialTransforms()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableSpinnerTick : DrawableOsuHitObject
|
public class DrawableSpinnerTick : DrawableOsuHitObject
|
||||||
@ -18,6 +16,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
/// Apply a judgement result.
|
/// Apply a judgement result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hit">Whether this tick was reached.</param>
|
/// <param name="hit">Whether this tick was reached.</param>
|
||||||
internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : HitResult.Miss);
|
internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SpinnerBonusDisplay : CompositeDrawable
|
public class SpinnerBonusDisplay : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
private static readonly int score_per_tick = new SpinnerBonusTick().CreateJudgement().MaxNumericResult;
|
||||||
|
|
||||||
private readonly OsuSpriteText bonusCounter;
|
private readonly OsuSpriteText bonusCounter;
|
||||||
|
|
||||||
public SpinnerBonusDisplay()
|
public SpinnerBonusDisplay()
|
||||||
@ -36,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
displayedCount = count;
|
displayedCount = count;
|
||||||
bonusCounter.Text = $"{SpinnerBonusTick.SCORE_PER_TICK * count}";
|
bonusCounter.Text = $"{score_per_tick * count}";
|
||||||
bonusCounter.FadeOutFromOne(1500);
|
bonusCounter.FadeOutFromOne(1500);
|
||||||
bonusCounter.ScaleTo(1.5f).Then().ScaleTo(1f, 1000, Easing.OutQuint);
|
bonusCounter.ScaleTo(1.5f).Then().ScaleTo(1f, 1000, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public class SliderRepeatJudgement : OsuJudgement
|
public class SliderRepeatJudgement : OsuJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => result == MaxResult ? 30 : 0;
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public class SliderTailJudgement : OsuJudgement
|
public class SliderTailJudgement : OsuJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => 0;
|
public override HitResult MaxResult => HitResult.IgnoreHit;
|
||||||
|
|
||||||
public override bool AffectsCombo => false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public class SliderTickJudgement : OsuJudgement
|
public class SliderTickJudgement : OsuJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => result == MaxResult ? 10 : 0;
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,6 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public class SpinnerBonusTick : SpinnerTick
|
public class SpinnerBonusTick : SpinnerTick
|
||||||
{
|
{
|
||||||
public new const int SCORE_PER_TICK = 50;
|
|
||||||
|
|
||||||
public SpinnerBonusTick()
|
public SpinnerBonusTick()
|
||||||
{
|
{
|
||||||
Samples.Add(new HitSampleInfo { Name = "spinnerbonus" });
|
Samples.Add(new HitSampleInfo { Name = "spinnerbonus" });
|
||||||
@ -20,9 +18,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public class OsuSpinnerBonusTickJudgement : OsuSpinnerTickJudgement
|
public class OsuSpinnerBonusTickJudgement : OsuSpinnerTickJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => result == MaxResult ? SCORE_PER_TICK : 0;
|
public override HitResult MaxResult => HitResult.LargeBonus;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => base.HealthIncreaseFor(result) * 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,19 +9,13 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public class SpinnerTick : OsuHitObject
|
public class SpinnerTick : OsuHitObject
|
||||||
{
|
{
|
||||||
public const int SCORE_PER_TICK = 10;
|
|
||||||
|
|
||||||
public override Judgement CreateJudgement() => new OsuSpinnerTickJudgement();
|
public override Judgement CreateJudgement() => new OsuSpinnerTickJudgement();
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
|
|
||||||
public class OsuSpinnerTickJudgement : OsuJudgement
|
public class OsuSpinnerTickJudgement : OsuJudgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.SmallBonus;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => result == MaxResult ? SCORE_PER_TICK : 0;
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => result == MaxResult ? 0.6 * base.HealthIncreaseFor(result) : 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,5 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
return new OsuJudgementResult(hitObject, judgement);
|
return new OsuJudgementResult(hitObject, judgement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new OsuHitWindows();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|||||||
createDrawableRuleset();
|
createDrawableRuleset();
|
||||||
|
|
||||||
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle);
|
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle);
|
||||||
assertStateAfterResult(new JudgementResult(new StrongHitObject(), new TaikoStrongJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Idle);
|
assertStateAfterResult(new JudgementResult(new StrongHitObject(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|||||||
createDrawableRuleset();
|
createDrawableRuleset();
|
||||||
|
|
||||||
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Good }, TaikoMascotAnimationState.Kiai);
|
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Good }, TaikoMascotAnimationState.Kiai);
|
||||||
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoStrongJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Kiai);
|
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Kiai);
|
||||||
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Fail);
|
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,19 +7,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public class TaikoDrumRollTickJudgement : TaikoJudgement
|
public class TaikoDrumRollTickJudgement : TaikoJudgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.SmallTickHit;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
case HitResult.Great:
|
|
||||||
return 200;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
|
@ -10,21 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public override HitResult MaxResult => HitResult.Great;
|
public override HitResult MaxResult => HitResult.Great;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
case HitResult.Good:
|
|
||||||
return 100;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
|
||||||
return 300;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
|
@ -7,9 +7,9 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public class TaikoStrongJudgement : TaikoJudgement
|
public class TaikoStrongJudgement : TaikoJudgement
|
||||||
{
|
{
|
||||||
|
public override HitResult MaxResult => HitResult.SmallBonus;
|
||||||
|
|
||||||
// MainObject already changes the HP
|
// MainObject already changes the HP
|
||||||
protected override double HealthIncreaseFor(HitResult result) => 0;
|
protected override double HealthIncreaseFor(HitResult result) => 0;
|
||||||
|
|
||||||
public override bool AffectsCombo => false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
if (!MainObject.Judged)
|
if (!MainObject.Judged)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyResult(r => r.Type = MainObject.IsHit ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = MainObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnPressed(TaikoAction action) => false;
|
public override bool OnPressed(TaikoAction action) => false;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
@ -34,14 +33,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
{
|
{
|
||||||
if (timeOffset > HitObject.HitWindow)
|
if (timeOffset > HitObject.HitWindow)
|
||||||
ApplyResult(r => r.Type = HitResult.Miss);
|
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.Abs(timeOffset) > HitObject.HitWindow)
|
if (Math.Abs(timeOffset) > HitObject.HitWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyResult(r => r.Type = HitResult.Great);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateStateTransforms(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
@ -74,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
if (!MainObject.Judged)
|
if (!MainObject.Judged)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyResult(r => r.Type = MainObject.IsHit ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = MainObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnPressed(TaikoAction action) => false;
|
public override bool OnPressed(TaikoAction action) => false;
|
||||||
|
@ -257,19 +257,19 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
if (!MainObject.Result.IsHit)
|
if (!MainObject.Result.IsHit)
|
||||||
{
|
{
|
||||||
ApplyResult(r => r.Type = HitResult.Miss);
|
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
{
|
{
|
||||||
if (timeOffset - MainObject.Result.TimeOffset > second_hit_window)
|
if (timeOffset - MainObject.Result.TimeOffset > second_hit_window)
|
||||||
ApplyResult(r => r.Type = HitResult.Miss);
|
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.Abs(timeOffset - MainObject.Result.TimeOffset) <= second_hit_window)
|
if (Math.Abs(timeOffset - MainObject.Result.TimeOffset) <= second_hit_window)
|
||||||
ApplyResult(r => r.Type = MainObject.Result.Type);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnPressed(TaikoAction action)
|
public override bool OnPressed(TaikoAction action)
|
||||||
|
@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nextTick?.TriggerResult(HitResult.Great);
|
nextTick?.TriggerResult(true);
|
||||||
|
|
||||||
var numHits = ticks.Count(r => r.IsHit);
|
var numHits = ticks.Count(r => r.IsHit);
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
tick.TriggerResult(HitResult.Miss);
|
tick.TriggerResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hitResult = numHits > HitObject.RequiredHits / 2 ? HitResult.Good : HitResult.Miss;
|
var hitResult = numHits > HitObject.RequiredHits / 2 ? HitResult.Good : HitResult.Miss;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
@ -19,10 +18,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
protected override void UpdateInitialTransforms() => this.FadeOut();
|
protected override void UpdateInitialTransforms() => this.FadeOut();
|
||||||
|
|
||||||
public void TriggerResult(HitResult type)
|
public void TriggerResult(bool hit)
|
||||||
{
|
{
|
||||||
HitObject.StartTime = Time.Current;
|
HitObject.StartTime = Time.Current;
|
||||||
ApplyResult(r => r.Type = type);
|
ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
|
@ -10,7 +10,5 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
|||||||
protected override double DefaultAccuracyPortion => 0.75;
|
protected override double DefaultAccuracyPortion => 0.75;
|
||||||
|
|
||||||
protected override double DefaultComboPortion => 0.25;
|
protected override double DefaultComboPortion => 0.25;
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new TaikoHitWindows();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,64 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Skinning
|
namespace osu.Game.Rulesets.Taiko.Skinning
|
||||||
{
|
{
|
||||||
public class LegacyHitExplosion : CompositeDrawable
|
public class LegacyHitExplosion : CompositeDrawable
|
||||||
{
|
{
|
||||||
public LegacyHitExplosion(Drawable sprite)
|
private readonly Drawable sprite;
|
||||||
{
|
private readonly Drawable strongSprite;
|
||||||
InternalChild = sprite;
|
|
||||||
|
|
||||||
|
private DrawableStrongNestedHit nestedStrongHit;
|
||||||
|
private bool switchedToStrongSprite;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new legacy hit explosion.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Contrary to stable's, this implementation doesn't require a frame-perfect hit
|
||||||
|
/// for the strong sprite to be displayed.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="sprite">The normal legacy explosion sprite.</param>
|
||||||
|
/// <param name="strongSprite">The strong legacy explosion sprite.</param>
|
||||||
|
public LegacyHitExplosion(Drawable sprite, Drawable strongSprite = null)
|
||||||
|
{
|
||||||
|
this.sprite = sprite;
|
||||||
|
this.strongSprite = strongSprite;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(DrawableHitObject judgedObject)
|
||||||
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
AddInternal(sprite.With(s =>
|
||||||
|
{
|
||||||
|
s.Anchor = Anchor.Centre;
|
||||||
|
s.Origin = Anchor.Centre;
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (strongSprite != null)
|
||||||
|
{
|
||||||
|
AddInternal(strongSprite.With(s =>
|
||||||
|
{
|
||||||
|
s.Alpha = 0;
|
||||||
|
s.Anchor = Anchor.Centre;
|
||||||
|
s.Origin = Anchor.Centre;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (judgedObject is DrawableHit hit)
|
||||||
|
nestedStrongHit = hit.NestedHitObjects.SingleOrDefault() as DrawableStrongNestedHit;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -33,5 +76,25 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
|||||||
|
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
if (shouldSwitchToStrongSprite() && !switchedToStrongSprite)
|
||||||
|
{
|
||||||
|
sprite.FadeOut(50, Easing.OutQuint);
|
||||||
|
strongSprite.FadeIn(50, Easing.OutQuint);
|
||||||
|
switchedToStrongSprite = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool shouldSwitchToStrongSprite()
|
||||||
|
{
|
||||||
|
if (nestedStrongHit == null || strongSprite == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return nestedStrongHit.IsHit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
|||||||
var r = result.NewValue;
|
var r = result.NewValue;
|
||||||
|
|
||||||
// always ignore hitobjects that don't affect combo (drumroll ticks etc.)
|
// always ignore hitobjects that don't affect combo (drumroll ticks etc.)
|
||||||
if (r?.Judgement.AffectsCombo == false)
|
if (r?.Type.AffectsCombo() == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
passing = r == null || r.Type > HitResult.Miss;
|
passing = r == null || r.Type > HitResult.Miss;
|
||||||
|
@ -74,15 +74,23 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGood:
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGoodStrong:
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGreat:
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGreatStrong:
|
|
||||||
case TaikoSkinComponents.TaikoExplosionMiss:
|
case TaikoSkinComponents.TaikoExplosionMiss:
|
||||||
|
|
||||||
var sprite = this.GetAnimation(getHitName(taikoComponent.Component), true, false);
|
var missSprite = this.GetAnimation(getHitName(taikoComponent.Component), true, false);
|
||||||
if (sprite != null)
|
if (missSprite != null)
|
||||||
return new LegacyHitExplosion(sprite);
|
return new LegacyHitExplosion(missSprite);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
case TaikoSkinComponents.TaikoExplosionGood:
|
||||||
|
case TaikoSkinComponents.TaikoExplosionGreat:
|
||||||
|
|
||||||
|
var hitName = getHitName(taikoComponent.Component);
|
||||||
|
var hitSprite = this.GetAnimation(hitName, true, false);
|
||||||
|
var strongHitSprite = this.GetAnimation($"{hitName}k", true, false);
|
||||||
|
|
||||||
|
if (hitSprite != null)
|
||||||
|
return new LegacyHitExplosion(hitSprite, strongHitSprite);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@ -109,17 +117,11 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
|||||||
case TaikoSkinComponents.TaikoExplosionGood:
|
case TaikoSkinComponents.TaikoExplosionGood:
|
||||||
return "taiko-hit100";
|
return "taiko-hit100";
|
||||||
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGoodStrong:
|
|
||||||
return "taiko-hit100k";
|
|
||||||
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGreat:
|
case TaikoSkinComponents.TaikoExplosionGreat:
|
||||||
return "taiko-hit300";
|
return "taiko-hit300";
|
||||||
|
|
||||||
case TaikoSkinComponents.TaikoExplosionGreatStrong:
|
|
||||||
return "taiko-hit300k";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(component), "Invalid result type");
|
throw new ArgumentOutOfRangeException(nameof(component), $"Invalid component type: {component}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SampleChannel GetSample(ISampleInfo sampleInfo) => Source.GetSample(new LegacyTaikoSampleInfo(sampleInfo));
|
public override SampleChannel GetSample(ISampleInfo sampleInfo) => Source.GetSample(new LegacyTaikoSampleInfo(sampleInfo));
|
||||||
|
@ -17,9 +17,7 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
BarLine,
|
BarLine,
|
||||||
TaikoExplosionMiss,
|
TaikoExplosionMiss,
|
||||||
TaikoExplosionGood,
|
TaikoExplosionGood,
|
||||||
TaikoExplosionGoodStrong,
|
|
||||||
TaikoExplosionGreat,
|
TaikoExplosionGreat,
|
||||||
TaikoExplosionGreatStrong,
|
|
||||||
Scroller,
|
Scroller,
|
||||||
Mascot,
|
Mascot,
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Textures;
|
|||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.Taiko.Judgements;
|
using osu.Game.Rulesets.Taiko.Judgements;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
lastObjectHit = true;
|
lastObjectHit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.Judgement.AffectsCombo)
|
if (!result.Type.AffectsCombo())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lastObjectHit = result.IsHit;
|
lastObjectHit = result.IsHit;
|
||||||
@ -115,7 +116,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool triggerComboClear(JudgementResult judgementResult)
|
private bool triggerComboClear(JudgementResult judgementResult)
|
||||||
=> (judgementResult.ComboAtJudgement + 1) % 50 == 0 && judgementResult.Judgement.AffectsCombo && judgementResult.IsHit;
|
=> (judgementResult.ComboAtJudgement + 1) % 50 == 0 && judgementResult.Type.AffectsCombo() && judgementResult.IsHit;
|
||||||
|
|
||||||
private bool triggerSwellClear(JudgementResult judgementResult)
|
private bool triggerSwellClear(JudgementResult judgementResult)
|
||||||
=> judgementResult.Judgement is TaikoSwellJudgement && judgementResult.IsHit;
|
=> judgementResult.Judgement is TaikoSwellJudgement && judgementResult.IsHit;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -10,7 +9,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
@ -50,10 +48,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Child = skinnable = new SkinnableDrawable(new TaikoSkinComponent(getComponentName(JudgedObject)), _ => new DefaultHitExplosion(JudgedObject, result));
|
Child = skinnable = new SkinnableDrawable(new TaikoSkinComponent(getComponentName(result)), _ => new DefaultHitExplosion(JudgedObject, result));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TaikoSkinComponents getComponentName(DrawableHitObject judgedObject)
|
private static TaikoSkinComponents getComponentName(HitResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
@ -61,28 +59,13 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
return TaikoSkinComponents.TaikoExplosionMiss;
|
return TaikoSkinComponents.TaikoExplosionMiss;
|
||||||
|
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
return useStrongExplosion(judgedObject)
|
return TaikoSkinComponents.TaikoExplosionGood;
|
||||||
? TaikoSkinComponents.TaikoExplosionGoodStrong
|
|
||||||
: TaikoSkinComponents.TaikoExplosionGood;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return useStrongExplosion(judgedObject)
|
return TaikoSkinComponents.TaikoExplosionGreat;
|
||||||
? TaikoSkinComponents.TaikoExplosionGreatStrong
|
|
||||||
: TaikoSkinComponents.TaikoExplosionGreat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(judgedObject), "Invalid result type");
|
throw new ArgumentOutOfRangeException(nameof(result), $"Invalid result type: {result}");
|
||||||
}
|
|
||||||
|
|
||||||
private bool useStrongExplosion(DrawableHitObject judgedObject)
|
|
||||||
{
|
|
||||||
if (!(judgedObject.HitObject is Hit))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!(judgedObject.NestedHitObjects.SingleOrDefault() is DrawableStrongNestedHit nestedHit))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return judgedObject.Result.Type == nestedHit.Result.Type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -215,16 +215,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
private void addDrumRollHit(DrawableDrumRollTick drawableTick) =>
|
private void addDrumRollHit(DrawableDrumRollTick drawableTick) =>
|
||||||
drumRollHitContainer.Add(new DrawableFlyingHit(drawableTick));
|
drumRollHitContainer.Add(new DrawableFlyingHit(drawableTick));
|
||||||
|
|
||||||
/// <remarks>
|
private void addExplosion(DrawableHitObject drawableObject, HitResult result, HitType type)
|
||||||
/// As legacy skins have different explosions for singular and double strong hits,
|
|
||||||
/// explosion addition is scheduled to ensure that both hits are processed if they occur on the same frame.
|
|
||||||
/// </remarks>
|
|
||||||
private void addExplosion(DrawableHitObject drawableObject, HitResult result, HitType type) => Schedule(() =>
|
|
||||||
{
|
{
|
||||||
hitExplosionContainer.Add(new HitExplosion(drawableObject, result));
|
hitExplosionContainer.Add(new HitExplosion(drawableObject, result));
|
||||||
if (drawableObject.HitObject.Kiai)
|
if (drawableObject.HitObject.Kiai)
|
||||||
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
|
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
|
||||||
});
|
}
|
||||||
|
|
||||||
private class ProxyContainer : LifetimeManagementContainer
|
private class ProxyContainer : LifetimeManagementContainer
|
||||||
{
|
{
|
||||||
|
@ -170,7 +170,7 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 0 });
|
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 0 });
|
||||||
for (double time = 0; time < 5000; time += 100)
|
for (double time = 0; time < 5000; time += 100)
|
||||||
beatmap.HitObjects.Add(new JudgeableHitObject(false) { StartTime = time });
|
beatmap.HitObjects.Add(new JudgeableHitObject(HitResult.LargeBonus) { StartTime = time });
|
||||||
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 5000 });
|
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 5000 });
|
||||||
|
|
||||||
createProcessor(beatmap);
|
createProcessor(beatmap);
|
||||||
@ -236,23 +236,23 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
private class JudgeableHitObject : HitObject
|
private class JudgeableHitObject : HitObject
|
||||||
{
|
{
|
||||||
private readonly bool affectsCombo;
|
private readonly HitResult maxResult;
|
||||||
|
|
||||||
public JudgeableHitObject(bool affectsCombo = true)
|
public JudgeableHitObject(HitResult maxResult = HitResult.Perfect)
|
||||||
{
|
{
|
||||||
this.affectsCombo = affectsCombo;
|
this.maxResult = maxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Judgement CreateJudgement() => new TestJudgement(affectsCombo);
|
public override Judgement CreateJudgement() => new TestJudgement(maxResult);
|
||||||
protected override HitWindows CreateHitWindows() => new HitWindows();
|
protected override HitWindows CreateHitWindows() => new HitWindows();
|
||||||
|
|
||||||
private class TestJudgement : Judgement
|
private class TestJudgement : Judgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo { get; }
|
public override HitResult MaxResult { get; }
|
||||||
|
|
||||||
public TestJudgement(bool affectsCombo)
|
public TestJudgement(HitResult maxResult)
|
||||||
{
|
{
|
||||||
AffectsCombo = affectsCombo;
|
MaxResult = maxResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
public double Duration { get; set; } = 5000;
|
public double Duration { get; set; } = 5000;
|
||||||
|
|
||||||
public JudgeableLongHitObject()
|
public JudgeableLongHitObject()
|
||||||
: base(false)
|
: base(HitResult.LargeBonus)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestNoScoreIncreaseFromMiss()
|
public void TestNoScoreIncreaseFromMiss()
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap<TestHitObject> { HitObjects = { new TestHitObject() } };
|
var beatmap = new Beatmap<HitObject> { HitObjects = { new HitObject() } };
|
||||||
|
|
||||||
var scoreProcessor = new ScoreProcessor();
|
var scoreProcessor = new ScoreProcessor();
|
||||||
scoreProcessor.ApplyBeatmap(beatmap);
|
scoreProcessor.ApplyBeatmap(beatmap);
|
||||||
|
|
||||||
// Apply a miss judgement
|
// Apply a miss judgement
|
||||||
scoreProcessor.ApplyResult(new JudgementResult(new TestHitObject(), new TestJudgement()) { Type = HitResult.Miss });
|
scoreProcessor.ApplyResult(new JudgementResult(new HitObject(), new TestJudgement()) { Type = HitResult.Miss });
|
||||||
|
|
||||||
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(0.0));
|
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(0.0));
|
||||||
}
|
}
|
||||||
@ -31,37 +31,25 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestOnlyBonusScore()
|
public void TestOnlyBonusScore()
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap<TestBonusHitObject> { HitObjects = { new TestBonusHitObject() } };
|
var beatmap = new Beatmap<HitObject> { HitObjects = { new HitObject() } };
|
||||||
|
|
||||||
var scoreProcessor = new ScoreProcessor();
|
var scoreProcessor = new ScoreProcessor();
|
||||||
scoreProcessor.ApplyBeatmap(beatmap);
|
scoreProcessor.ApplyBeatmap(beatmap);
|
||||||
|
|
||||||
// Apply a judgement
|
// Apply a judgement
|
||||||
scoreProcessor.ApplyResult(new JudgementResult(new TestBonusHitObject(), new TestBonusJudgement()) { Type = HitResult.Perfect });
|
scoreProcessor.ApplyResult(new JudgementResult(new HitObject(), new TestJudgement(HitResult.LargeBonus)) { Type = HitResult.LargeBonus });
|
||||||
|
|
||||||
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(100));
|
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(Judgement.LARGE_BONUS_SCORE));
|
||||||
}
|
|
||||||
|
|
||||||
private class TestHitObject : HitObject
|
|
||||||
{
|
|
||||||
public override Judgement CreateJudgement() => new TestJudgement();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestJudgement : Judgement
|
private class TestJudgement : Judgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => 100;
|
public override HitResult MaxResult { get; }
|
||||||
}
|
|
||||||
|
|
||||||
private class TestBonusHitObject : HitObject
|
public TestJudgement(HitResult maxResult = HitResult.Perfect)
|
||||||
{
|
{
|
||||||
public override Judgement CreateJudgement() => new TestBonusJudgement();
|
MaxResult = maxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestBonusJudgement : Judgement
|
|
||||||
{
|
|
||||||
public override bool AffectsCombo => false;
|
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => 100;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,10 @@ namespace osu.Game.Tests.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(ScoringMode.Standardised, HitResult.Meh, 750_000)]
|
[TestCase(ScoringMode.Standardised, HitResult.Meh, 750_000)]
|
||||||
[TestCase(ScoringMode.Standardised, HitResult.Good, 800_000)]
|
[TestCase(ScoringMode.Standardised, HitResult.Good, 900_000)]
|
||||||
[TestCase(ScoringMode.Standardised, HitResult.Great, 1_000_000)]
|
[TestCase(ScoringMode.Standardised, HitResult.Great, 1_000_000)]
|
||||||
[TestCase(ScoringMode.Classic, HitResult.Meh, 50)]
|
[TestCase(ScoringMode.Classic, HitResult.Meh, 50)]
|
||||||
[TestCase(ScoringMode.Classic, HitResult.Good, 100)]
|
[TestCase(ScoringMode.Classic, HitResult.Good, 200)]
|
||||||
[TestCase(ScoringMode.Classic, HitResult.Great, 300)]
|
[TestCase(ScoringMode.Classic, HitResult.Great, 300)]
|
||||||
public void TestSingleOsuHit(ScoringMode scoringMode, HitResult hitResult, int expectedScore)
|
public void TestSingleOsuHit(ScoringMode scoringMode, HitResult hitResult, int expectedScore)
|
||||||
{
|
{
|
||||||
|
@ -11,9 +11,11 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Leaderboards;
|
using osu.Game.Online.Leaderboards;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Users.Drawables;
|
using osu.Game.Users.Drawables;
|
||||||
|
using osu.Game.Utils;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -55,6 +57,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
highAccuracyColour = colours.GreenLight;
|
highAccuracyColour = colours.GreenLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The statistics that appear in the table, in order of appearance.
|
||||||
|
/// </summary>
|
||||||
|
private readonly List<HitResult> statisticResultTypes = new List<HitResult>();
|
||||||
|
|
||||||
private bool showPerformancePoints;
|
private bool showPerformancePoints;
|
||||||
|
|
||||||
public void DisplayScores(IReadOnlyList<ScoreInfo> scores, bool showPerformanceColumn)
|
public void DisplayScores(IReadOnlyList<ScoreInfo> scores, bool showPerformanceColumn)
|
||||||
@ -65,11 +72,12 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
showPerformancePoints = showPerformanceColumn;
|
showPerformancePoints = showPerformanceColumn;
|
||||||
|
statisticResultTypes.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < scores.Count; i++)
|
for (int i = 0; i < scores.Count; i++)
|
||||||
backgroundFlow.Add(new ScoreTableRowBackground(i, scores[i], row_height));
|
backgroundFlow.Add(new ScoreTableRowBackground(i, scores[i], row_height));
|
||||||
|
|
||||||
Columns = createHeaders(scores.FirstOrDefault());
|
Columns = createHeaders(scores);
|
||||||
Content = scores.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
|
Content = scores.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +87,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
backgroundFlow.Clear();
|
backgroundFlow.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TableColumn[] createHeaders(ScoreInfo score)
|
private TableColumn[] createHeaders(IReadOnlyList<ScoreInfo> scores)
|
||||||
{
|
{
|
||||||
var columns = new List<TableColumn>
|
var columns = new List<TableColumn>
|
||||||
{
|
{
|
||||||
@ -92,10 +100,17 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 120))
|
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 120))
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var statistic in score.SortedStatistics.Take(score.SortedStatistics.Count() - 1))
|
// All statistics across all scores, unordered.
|
||||||
columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 35, maxSize: 60)));
|
var allScoreStatistics = scores.SelectMany(s => s.GetStatisticsForDisplay().Select(stat => stat.result)).ToHashSet();
|
||||||
|
|
||||||
columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95)));
|
foreach (var result in OrderAttributeUtils.GetValuesInOrder<HitResult>())
|
||||||
|
{
|
||||||
|
if (!allScoreStatistics.Contains(result))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
columns.Add(new TableColumn(result.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 35, maxSize: 60)));
|
||||||
|
statisticResultTypes.Add(result);
|
||||||
|
}
|
||||||
|
|
||||||
if (showPerformancePoints)
|
if (showPerformancePoints)
|
||||||
columns.Add(new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)));
|
columns.Add(new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)));
|
||||||
@ -148,13 +163,18 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var kvp in score.SortedStatistics)
|
var availableStatistics = score.GetStatisticsForDisplay().ToDictionary(tuple => tuple.result);
|
||||||
|
|
||||||
|
foreach (var result in statisticResultTypes)
|
||||||
{
|
{
|
||||||
|
if (!availableStatistics.TryGetValue(result, out var stat))
|
||||||
|
stat = (result, 0, null);
|
||||||
|
|
||||||
content.Add(new OsuSpriteText
|
content.Add(new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = $"{kvp.Value}",
|
Text = stat.maxCount == null ? $"{stat.count}" : $"{stat.count}/{stat.maxCount}",
|
||||||
Font = OsuFont.GetFont(size: text_size),
|
Font = OsuFont.GetFont(size: text_size),
|
||||||
Colour = kvp.Value == 0 ? Color4.Gray : Color4.White
|
Colour = stat.count == 0 ? Color4.Gray : Color4.White
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
ppColumn.Alpha = value.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0;
|
ppColumn.Alpha = value.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0;
|
||||||
ppColumn.Text = $@"{value.PP:N0}";
|
ppColumn.Text = $@"{value.PP:N0}";
|
||||||
|
|
||||||
statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
|
statisticsColumns.ChildrenEnumerable = value.GetStatisticsForDisplay().Select(s => createStatisticsColumn(s.result, s.count, s.maxCount));
|
||||||
modsColumn.Mods = value.Mods;
|
modsColumn.Mods = value.Mods;
|
||||||
|
|
||||||
if (scoreManager != null)
|
if (scoreManager != null)
|
||||||
@ -125,9 +125,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextColumn createStatisticsColumn(HitResult hitResult, int count) => new TextColumn(hitResult.GetDescription(), smallFont, bottom_columns_min_width)
|
private TextColumn createStatisticsColumn(HitResult hitResult, int count, int? maxCount) => new TextColumn(hitResult.GetDescription(), smallFont, bottom_columns_min_width)
|
||||||
{
|
{
|
||||||
Text = count.ToString()
|
Text = maxCount == null ? $"{count}" : $"{count}/{maxCount}"
|
||||||
};
|
};
|
||||||
|
|
||||||
private class InfoColumn : CompositeDrawable
|
private class InfoColumn : CompositeDrawable
|
||||||
|
@ -7,10 +7,6 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
public class IgnoreJudgement : Judgement
|
public class IgnoreJudgement : Judgement
|
||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override HitResult MaxResult => HitResult.IgnoreHit;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => 0;
|
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
@ -11,31 +12,69 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class Judgement
|
public class Judgement
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The score awarded for a small bonus.
|
||||||
|
/// </summary>
|
||||||
|
public const int SMALL_BONUS_SCORE = 10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The score awarded for a large bonus.
|
||||||
|
/// </summary>
|
||||||
|
public const int LARGE_BONUS_SCORE = 50;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default health increase for a maximum judgement, as a proportion of total health.
|
/// The default health increase for a maximum judgement, as a proportion of total health.
|
||||||
/// By default, each maximum judgement restores 5% of total health.
|
/// By default, each maximum judgement restores 5% of total health.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected const double DEFAULT_MAX_HEALTH_INCREASE = 0.05;
|
protected const double DEFAULT_MAX_HEALTH_INCREASE = 0.05;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this <see cref="Judgement"/> should affect the current combo.
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Has no effect. Use HitResult members instead (e.g. use small-tick or bonus to not affect combo).")] // Can be removed 20210328
|
||||||
|
public virtual bool AffectsCombo => true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this <see cref="Judgement"/> should be counted as base (combo) or bonus score.
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Has no effect. Use HitResult members instead (e.g. use small-tick or bonus to not affect combo).")] // Can be removed 20210328
|
||||||
|
public virtual bool IsBonus => !AffectsCombo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum <see cref="HitResult"/> that can be achieved.
|
/// The maximum <see cref="HitResult"/> that can be achieved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual HitResult MaxResult => HitResult.Perfect;
|
public virtual HitResult MaxResult => HitResult.Perfect;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this <see cref="Judgement"/> should affect the current combo.
|
/// The minimum <see cref="HitResult"/> that can be achieved - the inverse of <see cref="MaxResult"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual bool AffectsCombo => true;
|
public HitResult MinResult
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (MaxResult)
|
||||||
|
{
|
||||||
|
case HitResult.SmallBonus:
|
||||||
|
case HitResult.LargeBonus:
|
||||||
|
case HitResult.IgnoreHit:
|
||||||
|
return HitResult.IgnoreMiss;
|
||||||
|
|
||||||
/// <summary>
|
case HitResult.SmallTickHit:
|
||||||
/// Whether this <see cref="Judgement"/> should be counted as base (combo) or bonus score.
|
return HitResult.SmallTickMiss;
|
||||||
/// </summary>
|
|
||||||
public virtual bool IsBonus => !AffectsCombo;
|
case HitResult.LargeTickHit:
|
||||||
|
return HitResult.LargeTickMiss;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return HitResult.Miss;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The numeric score representation for the maximum achievable result.
|
/// The numeric score representation for the maximum achievable result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaxNumericResult => NumericResultFor(MaxResult);
|
public int MaxNumericResult => ToNumericResult(MaxResult);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The health increase for the maximum achievable result.
|
/// The health increase for the maximum achievable result.
|
||||||
@ -47,14 +86,15 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="result">The <see cref="HitResult"/> to find the numeric score representation for.</param>
|
/// <param name="result">The <see cref="HitResult"/> to find the numeric score representation for.</param>
|
||||||
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
|
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
|
||||||
protected virtual int NumericResultFor(HitResult result) => result > HitResult.Miss ? 1 : 0;
|
[Obsolete("Has no effect. Use ToNumericResult(HitResult) (standardised across all rulesets).")] // Can be made non-virtual 20210328
|
||||||
|
protected virtual int NumericResultFor(HitResult result) => ToNumericResult(result);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the numeric score representation of a <see cref="JudgementResult"/>.
|
/// Retrieves the numeric score representation of a <see cref="JudgementResult"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric score representation for.</param>
|
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric score representation for.</param>
|
||||||
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
|
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
|
||||||
public int NumericResultFor(JudgementResult result) => NumericResultFor(result.Type);
|
public int NumericResultFor(JudgementResult result) => ToNumericResult(result.Type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the numeric health increase of a <see cref="HitResult"/>.
|
/// Retrieves the numeric health increase of a <see cref="HitResult"/>.
|
||||||
@ -65,6 +105,21 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case HitResult.SmallTickHit:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||||
|
|
||||||
|
case HitResult.SmallTickMiss:
|
||||||
|
return -DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||||
|
|
||||||
|
case HitResult.LargeTickHit:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||||
|
|
||||||
|
case HitResult.LargeTickMiss:
|
||||||
|
return -DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||||
|
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
return -DEFAULT_MAX_HEALTH_INCREASE;
|
return -DEFAULT_MAX_HEALTH_INCREASE;
|
||||||
|
|
||||||
@ -83,8 +138,11 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return DEFAULT_MAX_HEALTH_INCREASE * 1.05;
|
return DEFAULT_MAX_HEALTH_INCREASE * 1.05;
|
||||||
|
|
||||||
default:
|
case HitResult.SmallBonus:
|
||||||
return 0;
|
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||||
|
|
||||||
|
case HitResult.LargeBonus:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE * 0.2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +153,42 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
|
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
|
||||||
public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type);
|
public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type);
|
||||||
|
|
||||||
public override string ToString() => $"AffectsCombo:{AffectsCombo} MaxResult:{MaxResult} MaxScore:{MaxNumericResult}";
|
public override string ToString() => $"MaxResult:{MaxResult} MaxScore:{MaxNumericResult}";
|
||||||
|
|
||||||
|
public static int ToNumericResult(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case HitResult.SmallTickHit:
|
||||||
|
return 10;
|
||||||
|
|
||||||
|
case HitResult.LargeTickHit:
|
||||||
|
return 30;
|
||||||
|
|
||||||
|
case HitResult.Meh:
|
||||||
|
return 50;
|
||||||
|
|
||||||
|
case HitResult.Ok:
|
||||||
|
return 100;
|
||||||
|
|
||||||
|
case HitResult.Good:
|
||||||
|
return 200;
|
||||||
|
|
||||||
|
case HitResult.Great:
|
||||||
|
return 300;
|
||||||
|
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 350;
|
||||||
|
|
||||||
|
case HitResult.SmallBonus:
|
||||||
|
return SMALL_BONUS_SCORE;
|
||||||
|
|
||||||
|
case HitResult.LargeBonus:
|
||||||
|
return LARGE_BONUS_SCORE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether a successful hit occurred.
|
/// Whether a successful hit occurred.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsHit => Type > HitResult.Miss;
|
public bool IsHit => Type.IsHit();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="JudgementResult"/>.
|
/// Creates a new <see cref="JudgementResult"/>.
|
||||||
|
@ -16,8 +16,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override string Description => "SS or quit.";
|
public override string Description => "SS or quit.";
|
||||||
|
|
||||||
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||||
=> !(result.Judgement is IgnoreJudgement)
|
=> result.Type.AffectsAccuracy()
|
||||||
&& result.Judgement.AffectsCombo
|
|
||||||
&& result.Type != result.Judgement.MaxResult;
|
&& result.Type != result.Judgement.MaxResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
healthProcessor.FailConditions += FailCondition;
|
healthProcessor.FailConditions += FailCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) => !result.IsHit && result.Judgement.AffectsCombo;
|
protected virtual bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||||
|
=> result.Type.AffectsCombo()
|
||||||
|
&& !result.IsHit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
@ -473,6 +474,30 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
if (!Result.HasResult)
|
if (!Result.HasResult)
|
||||||
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
||||||
|
|
||||||
|
// Some (especially older) rulesets use scorable judgements instead of the newer ignorehit/ignoremiss judgements.
|
||||||
|
// Can be removed 20210328
|
||||||
|
if (Result.Judgement.MaxResult == HitResult.IgnoreHit)
|
||||||
|
{
|
||||||
|
HitResult originalType = Result.Type;
|
||||||
|
|
||||||
|
if (Result.Type == HitResult.Miss)
|
||||||
|
Result.Type = HitResult.IgnoreMiss;
|
||||||
|
else if (Result.Type >= HitResult.Meh && Result.Type <= HitResult.Perfect)
|
||||||
|
Result.Type = HitResult.IgnoreHit;
|
||||||
|
|
||||||
|
if (Result.Type != originalType)
|
||||||
|
{
|
||||||
|
Logger.Log($"{GetType().ReadableName()} applied an invalid hit result ({originalType}) when {nameof(HitResult.IgnoreMiss)} or {nameof(HitResult.IgnoreHit)} is expected.\n"
|
||||||
|
+ $"This has been automatically adjusted to {Result.Type}, and support will be removed from 2020-03-28 onwards.", level: LogLevel.Important);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"{GetType().ReadableName()} applied an invalid hit result (was: {Result.Type}, expected: [{Result.Judgement.MinResult} ... {Result.Judgement.MaxResult}]).");
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that the judgement is given a valid time offset, because this may not get set by the caller
|
// Ensure that the judgement is given a valid time offset, because this may not get set by the caller
|
||||||
var endTime = HitObject.GetEndTime();
|
var endTime = HitObject.GetEndTime();
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
base.ApplyResultInternal(result);
|
base.ApplyResultInternal(result);
|
||||||
|
|
||||||
if (!result.Judgement.IsBonus)
|
if (!result.Type.IsBonus())
|
||||||
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
|
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,15 +2,19 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using osu.Game.Utils;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Scoring
|
namespace osu.Game.Rulesets.Scoring
|
||||||
{
|
{
|
||||||
|
[HasOrderedElements]
|
||||||
public enum HitResult
|
public enum HitResult
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates that the object has not been judged yet.
|
/// Indicates that the object has not been judged yet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description(@"")]
|
[Description(@"")]
|
||||||
|
[Order(14)]
|
||||||
None,
|
None,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -21,47 +25,175 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// "too far in the future). It should also define when a forced miss should be triggered (as a result of no user input in time).
|
/// "too far in the future). It should also define when a forced miss should be triggered (as a result of no user input in time).
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[Description(@"Miss")]
|
[Description(@"Miss")]
|
||||||
|
[Order(5)]
|
||||||
Miss,
|
Miss,
|
||||||
|
|
||||||
[Description(@"Meh")]
|
[Description(@"Meh")]
|
||||||
|
[Order(4)]
|
||||||
Meh,
|
Meh,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optional judgement.
|
/// Optional judgement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description(@"OK")]
|
[Description(@"OK")]
|
||||||
|
[Order(3)]
|
||||||
Ok,
|
Ok,
|
||||||
|
|
||||||
[Description(@"Good")]
|
[Description(@"Good")]
|
||||||
|
[Order(2)]
|
||||||
Good,
|
Good,
|
||||||
|
|
||||||
[Description(@"Great")]
|
[Description(@"Great")]
|
||||||
|
[Order(1)]
|
||||||
Great,
|
Great,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optional judgement.
|
/// Optional judgement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description(@"Perfect")]
|
[Description(@"Perfect")]
|
||||||
|
[Order(0)]
|
||||||
Perfect,
|
Perfect,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates small tick miss.
|
/// Indicates small tick miss.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Order(11)]
|
||||||
SmallTickMiss,
|
SmallTickMiss,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates a small tick hit.
|
/// Indicates a small tick hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description(@"S Tick")]
|
||||||
|
[Order(7)]
|
||||||
SmallTickHit,
|
SmallTickHit,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates a large tick miss.
|
/// Indicates a large tick miss.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Order(10)]
|
||||||
LargeTickMiss,
|
LargeTickMiss,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates a large tick hit.
|
/// Indicates a large tick hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LargeTickHit
|
[Description(@"L Tick")]
|
||||||
|
[Order(6)]
|
||||||
|
LargeTickHit,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates a small bonus.
|
||||||
|
/// </summary>
|
||||||
|
[Description("S Bonus")]
|
||||||
|
[Order(9)]
|
||||||
|
SmallBonus,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates a large bonus.
|
||||||
|
/// </summary>
|
||||||
|
[Description("L Bonus")]
|
||||||
|
[Order(8)]
|
||||||
|
LargeBonus,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates a miss that should be ignored for scoring purposes.
|
||||||
|
/// </summary>
|
||||||
|
[Order(13)]
|
||||||
|
IgnoreMiss,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates a hit that should be ignored for scoring purposes.
|
||||||
|
/// </summary>
|
||||||
|
[Order(12)]
|
||||||
|
IgnoreHit,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class HitResultExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> increases/decreases the combo, and affects the combo portion of the score.
|
||||||
|
/// </summary>
|
||||||
|
public static bool AffectsCombo(this HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
case HitResult.Meh:
|
||||||
|
case HitResult.Ok:
|
||||||
|
case HitResult.Good:
|
||||||
|
case HitResult.Great:
|
||||||
|
case HitResult.Perfect:
|
||||||
|
case HitResult.LargeTickHit:
|
||||||
|
case HitResult.LargeTickMiss:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> affects the accuracy portion of the score.
|
||||||
|
/// </summary>
|
||||||
|
public static bool AffectsAccuracy(this HitResult result)
|
||||||
|
=> IsScorable(result) && !IsBonus(result);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> should be counted as bonus score.
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsBonus(this HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.SmallBonus:
|
||||||
|
case HitResult.LargeBonus:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> represents a successful hit.
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsHit(this HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.None:
|
||||||
|
case HitResult.IgnoreMiss:
|
||||||
|
case HitResult.Miss:
|
||||||
|
case HitResult.SmallTickMiss:
|
||||||
|
case HitResult.LargeTickMiss:
|
||||||
|
return false;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> is scorable.
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsScorable(this HitResult result) => result >= HitResult.Miss && result < HitResult.IgnoreMiss;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> is valid within a given <see cref="HitResult"/> range.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="result">The <see cref="HitResult"/> to check.</param>
|
||||||
|
/// <param name="minResult">The minimum <see cref="HitResult"/>.</param>
|
||||||
|
/// <param name="maxResult">The maximum <see cref="HitResult"/>.</param>
|
||||||
|
/// <returns>Whether <see cref="HitResult"/> falls between <paramref name="minResult"/> and <paramref name="maxResult"/>.</returns>
|
||||||
|
public static bool IsValidHitResult(this HitResult result, HitResult minResult, HitResult maxResult)
|
||||||
|
{
|
||||||
|
if (result == HitResult.None)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (result == minResult || result == maxResult)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
Debug.Assert(minResult <= maxResult);
|
||||||
|
return result > minResult && result < maxResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
private double maxBaseScore;
|
private double maxBaseScore;
|
||||||
private double rollingMaxBaseScore;
|
private double rollingMaxBaseScore;
|
||||||
private double baseScore;
|
private double baseScore;
|
||||||
private double bonusScore;
|
|
||||||
|
|
||||||
private readonly List<HitEvent> hitEvents = new List<HitEvent>();
|
private readonly List<HitEvent> hitEvents = new List<HitEvent>();
|
||||||
private HitObject lastHitObject;
|
private HitObject lastHitObject;
|
||||||
@ -116,14 +115,15 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (result.FailedAtJudgement)
|
if (result.FailedAtJudgement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (result.Judgement.AffectsCombo)
|
if (!result.Type.IsScorable())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (result.Type.AffectsCombo())
|
||||||
{
|
{
|
||||||
switch (result.Type)
|
switch (result.Type)
|
||||||
{
|
{
|
||||||
case HitResult.None:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
|
case HitResult.LargeTickMiss:
|
||||||
Combo.Value = 0;
|
Combo.Value = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -133,22 +133,16 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double scoreIncrease = result.Type == HitResult.Miss ? 0 : result.Judgement.NumericResultFor(result);
|
double scoreIncrease = result.Type.IsHit() ? result.Judgement.NumericResultFor(result) : 0;
|
||||||
|
|
||||||
if (result.Judgement.IsBonus)
|
if (!result.Type.IsBonus())
|
||||||
{
|
{
|
||||||
if (result.IsHit)
|
|
||||||
bonusScore += scoreIncrease;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (result.HasResult)
|
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1;
|
|
||||||
|
|
||||||
baseScore += scoreIncrease;
|
baseScore += scoreIncrease;
|
||||||
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1;
|
||||||
|
|
||||||
hitEvents.Add(CreateHitEvent(result));
|
hitEvents.Add(CreateHitEvent(result));
|
||||||
lastHitObject = result.HitObject;
|
lastHitObject = result.HitObject;
|
||||||
|
|
||||||
@ -171,22 +165,19 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (result.FailedAtJudgement)
|
if (result.FailedAtJudgement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double scoreIncrease = result.Type == HitResult.Miss ? 0 : result.Judgement.NumericResultFor(result);
|
if (!result.Type.IsScorable())
|
||||||
|
return;
|
||||||
|
|
||||||
if (result.Judgement.IsBonus)
|
double scoreIncrease = result.Type.IsHit() ? result.Judgement.NumericResultFor(result) : 0;
|
||||||
{
|
|
||||||
if (result.IsHit)
|
|
||||||
bonusScore -= scoreIncrease;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (result.HasResult)
|
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) - 1;
|
|
||||||
|
|
||||||
|
if (!result.Type.IsBonus())
|
||||||
|
{
|
||||||
baseScore -= scoreIncrease;
|
baseScore -= scoreIncrease;
|
||||||
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) - 1;
|
||||||
|
|
||||||
Debug.Assert(hitEvents.Count > 0);
|
Debug.Assert(hitEvents.Count > 0);
|
||||||
lastHitObject = hitEvents[^1].LastHitObject;
|
lastHitObject = hitEvents[^1].LastHitObject;
|
||||||
hitEvents.RemoveAt(hitEvents.Count - 1);
|
hitEvents.RemoveAt(hitEvents.Count - 1);
|
||||||
@ -207,7 +198,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
return GetScore(mode, maxHighestCombo,
|
return GetScore(mode, maxHighestCombo,
|
||||||
maxBaseScore > 0 ? baseScore / maxBaseScore : 0,
|
maxBaseScore > 0 ? baseScore / maxBaseScore : 0,
|
||||||
maxHighestCombo > 0 ? (double)HighestCombo.Value / maxHighestCombo : 0,
|
maxHighestCombo > 0 ? (double)HighestCombo.Value / maxHighestCombo : 0,
|
||||||
bonusScore);
|
scoreResultCounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -217,9 +208,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// <param name="maxCombo">The maximum combo achievable in the beatmap.</param>
|
/// <param name="maxCombo">The maximum combo achievable in the beatmap.</param>
|
||||||
/// <param name="accuracyRatio">The accuracy percentage achieved by the player.</param>
|
/// <param name="accuracyRatio">The accuracy percentage achieved by the player.</param>
|
||||||
/// <param name="comboRatio">The proportion of <paramref name="maxCombo"/> achieved by the player.</param>
|
/// <param name="comboRatio">The proportion of <paramref name="maxCombo"/> achieved by the player.</param>
|
||||||
/// <param name="bonusScore">Any bonus score to be added.</param>
|
/// <param name="statistics">Any statistics to be factored in.</param>
|
||||||
/// <returns>The total score.</returns>
|
/// <returns>The total score.</returns>
|
||||||
public double GetScore(ScoringMode mode, int maxCombo, double accuracyRatio, double comboRatio, double bonusScore)
|
public double GetScore(ScoringMode mode, int maxCombo, double accuracyRatio, double comboRatio, Dictionary<HitResult, int> statistics)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
@ -228,14 +219,18 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
double accuracyScore = accuracyPortion * accuracyRatio;
|
double accuracyScore = accuracyPortion * accuracyRatio;
|
||||||
double comboScore = comboPortion * comboRatio;
|
double comboScore = comboPortion * comboRatio;
|
||||||
|
|
||||||
return (max_score * (accuracyScore + comboScore) + bonusScore) * scoreMultiplier;
|
return (max_score * (accuracyScore + comboScore) + getBonusScore(statistics)) * scoreMultiplier;
|
||||||
|
|
||||||
case ScoringMode.Classic:
|
case ScoringMode.Classic:
|
||||||
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
|
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
|
||||||
return bonusScore + (accuracyRatio * maxCombo * 300) * (1 + Math.Max(0, (comboRatio * maxCombo) - 1) * scoreMultiplier / 25);
|
return getBonusScore(statistics) + (accuracyRatio * maxCombo * 300) * (1 + Math.Max(0, (comboRatio * maxCombo) - 1) * scoreMultiplier / 25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double getBonusScore(Dictionary<HitResult, int> statistics)
|
||||||
|
=> statistics.GetOrDefault(HitResult.SmallBonus) * Judgement.SMALL_BONUS_SCORE
|
||||||
|
+ statistics.GetOrDefault(HitResult.LargeBonus) * Judgement.LARGE_BONUS_SCORE;
|
||||||
|
|
||||||
private ScoreRank rankFrom(double acc)
|
private ScoreRank rankFrom(double acc)
|
||||||
{
|
{
|
||||||
if (acc == 1)
|
if (acc == 1)
|
||||||
@ -282,7 +277,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
baseScore = 0;
|
baseScore = 0;
|
||||||
rollingMaxBaseScore = 0;
|
rollingMaxBaseScore = 0;
|
||||||
bonusScore = 0;
|
|
||||||
|
|
||||||
TotalScore.Value = 0;
|
TotalScore.Value = 0;
|
||||||
Accuracy.Value = 1;
|
Accuracy.Value = 1;
|
||||||
@ -309,9 +303,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
score.Rank = Rank.Value;
|
score.Rank = Rank.Value;
|
||||||
score.Date = DateTimeOffset.Now;
|
score.Date = DateTimeOffset.Now;
|
||||||
|
|
||||||
var hitWindows = CreateHitWindows();
|
foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r.IsScorable()))
|
||||||
|
|
||||||
foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
|
|
||||||
score.Statistics[result] = GetStatistic(result);
|
score.Statistics[result] = GetStatistic(result);
|
||||||
|
|
||||||
score.HitEvents = hitEvents;
|
score.HitEvents = hitEvents;
|
||||||
@ -320,6 +312,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a <see cref="HitWindows"/> for this processor.
|
/// Create a <see cref="HitWindows"/> for this processor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Method is now unused.")] // Can be removed 20210328
|
||||||
public virtual HitWindows CreateHitWindows() => new HitWindows();
|
public virtual HitWindows CreateHitWindows() => new HitWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@ -147,8 +148,6 @@ namespace osu.Game.Scoring
|
|||||||
[JsonProperty("statistics")]
|
[JsonProperty("statistics")]
|
||||||
public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>();
|
public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>();
|
||||||
|
|
||||||
public IOrderedEnumerable<KeyValuePair<HitResult, int>> SortedStatistics => Statistics.OrderByDescending(pair => pair.Key);
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[Column("Statistics")]
|
[Column("Statistics")]
|
||||||
public string StatisticsJson
|
public string StatisticsJson
|
||||||
@ -186,6 +185,48 @@ namespace osu.Game.Scoring
|
|||||||
[JsonProperty("position")]
|
[JsonProperty("position")]
|
||||||
public int? Position { get; set; }
|
public int? Position { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<(HitResult result, int count, int? maxCount)> GetStatisticsForDisplay()
|
||||||
|
{
|
||||||
|
foreach (var key in OrderAttributeUtils.GetValuesInOrder<HitResult>())
|
||||||
|
{
|
||||||
|
if (key.IsBonus())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int value = Statistics.GetOrDefault(key);
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case HitResult.SmallTickHit:
|
||||||
|
{
|
||||||
|
int total = value + Statistics.GetOrDefault(HitResult.SmallTickMiss);
|
||||||
|
if (total > 0)
|
||||||
|
yield return (key, value, total);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case HitResult.LargeTickHit:
|
||||||
|
{
|
||||||
|
int total = value + Statistics.GetOrDefault(HitResult.LargeTickMiss);
|
||||||
|
if (total > 0)
|
||||||
|
yield return (key, value, total);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case HitResult.SmallTickMiss:
|
||||||
|
case HitResult.LargeTickMiss:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (value > 0 || key == HitResult.Miss)
|
||||||
|
yield return (key, value, null);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
protected class DeserializedMod : IMod
|
protected class DeserializedMod : IMod
|
||||||
{
|
{
|
||||||
|
@ -181,7 +181,7 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
scoreProcessor.Mods.Value = score.Mods;
|
scoreProcessor.Mods.Value = score.Mods;
|
||||||
|
|
||||||
Value = (long)Math.Round(scoreProcessor.GetScore(ScoringMode.Value, beatmapMaxCombo, score.Accuracy, (double)score.MaxCombo / beatmapMaxCombo, 0));
|
Value = (long)Math.Round(scoreProcessor.GetScore(ScoringMode.Value, beatmapMaxCombo, score.Accuracy, (double)score.MaxCombo / beatmapMaxCombo, score.Statistics));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Leaderboards;
|
using osu.Game.Online.Leaderboards;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -116,7 +117,7 @@ namespace osu.Game.Screens.Ranking.Contracted
|
|||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 5),
|
Spacing = new Vector2(0, 5),
|
||||||
ChildrenEnumerable = score.SortedStatistics.Select(s => createStatistic(s.Key.GetDescription(), s.Value.ToString()))
|
ChildrenEnumerable = score.GetStatisticsForDisplay().Select(s => createStatistic(s.result, s.count, s.maxCount))
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -198,6 +199,9 @@ namespace osu.Game.Screens.Ranking.Contracted
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Drawable createStatistic(HitResult result, int count, int? maxCount)
|
||||||
|
=> createStatistic(result.GetDescription(), maxCount == null ? $"{count}" : $"{count}/{maxCount}");
|
||||||
|
|
||||||
private Drawable createStatistic(string key, string value) => new Container
|
private Drawable createStatistic(string key, string value) => new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
@ -65,8 +65,9 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
};
|
};
|
||||||
|
|
||||||
var bottomStatistics = new List<StatisticDisplay>();
|
var bottomStatistics = new List<StatisticDisplay>();
|
||||||
foreach (var stat in score.SortedStatistics)
|
|
||||||
bottomStatistics.Add(new HitResultStatistic(stat.Key, stat.Value));
|
foreach (var (key, value, maxCount) in score.GetStatisticsForDisplay())
|
||||||
|
bottomStatistics.Add(new HitResultStatistic(key, value, maxCount));
|
||||||
|
|
||||||
statisticDisplays.AddRange(topStatistics);
|
statisticDisplays.AddRange(topStatistics);
|
||||||
statisticDisplays.AddRange(bottomStatistics);
|
statisticDisplays.AddRange(bottomStatistics);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -16,6 +17,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
public class CounterStatistic : StatisticDisplay
|
public class CounterStatistic : StatisticDisplay
|
||||||
{
|
{
|
||||||
private readonly int count;
|
private readonly int count;
|
||||||
|
private readonly int? maxCount;
|
||||||
|
|
||||||
private RollingCounter<int> counter;
|
private RollingCounter<int> counter;
|
||||||
|
|
||||||
@ -24,10 +26,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="header">The name of the statistic.</param>
|
/// <param name="header">The name of the statistic.</param>
|
||||||
/// <param name="count">The value to display.</param>
|
/// <param name="count">The value to display.</param>
|
||||||
public CounterStatistic(string header, int count)
|
/// <param name="maxCount">The maximum value of <paramref name="count"/>. Not displayed if null.</param>
|
||||||
|
public CounterStatistic(string header, int count, int? maxCount = null)
|
||||||
: base(header)
|
: base(header)
|
||||||
{
|
{
|
||||||
this.count = count;
|
this.count = count;
|
||||||
|
this.maxCount = maxCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Appear()
|
public override void Appear()
|
||||||
@ -36,7 +40,33 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
counter.Current.Value = count;
|
counter.Current.Value = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateContent() => counter = new Counter();
|
protected override Drawable CreateContent()
|
||||||
|
{
|
||||||
|
var container = new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Child = counter = new Counter
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (maxCount != null)
|
||||||
|
{
|
||||||
|
container.Add(new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
Font = OsuFont.Torus.With(size: 12, fixedWidth: true),
|
||||||
|
Spacing = new Vector2(-2, 0),
|
||||||
|
Text = $"/{maxCount}"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
private class Counter : RollingCounter<int>
|
private class Counter : RollingCounter<int>
|
||||||
{
|
{
|
||||||
|
@ -12,8 +12,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
{
|
{
|
||||||
private readonly HitResult result;
|
private readonly HitResult result;
|
||||||
|
|
||||||
public HitResultStatistic(HitResult result, int count)
|
public HitResultStatistic(HitResult result, int count, int? maxCount = null)
|
||||||
: base(result.GetDescription(), count)
|
: base(result.GetDescription(), count, maxCount)
|
||||||
{
|
{
|
||||||
this.result = result;
|
this.result = result;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,12 @@ namespace osu.Game.Tests
|
|||||||
Statistics[HitResult.Meh] = 50;
|
Statistics[HitResult.Meh] = 50;
|
||||||
Statistics[HitResult.Good] = 100;
|
Statistics[HitResult.Good] = 100;
|
||||||
Statistics[HitResult.Great] = 300;
|
Statistics[HitResult.Great] = 300;
|
||||||
|
Statistics[HitResult.SmallTickHit] = 50;
|
||||||
|
Statistics[HitResult.SmallTickMiss] = 25;
|
||||||
|
Statistics[HitResult.LargeTickHit] = 100;
|
||||||
|
Statistics[HitResult.LargeTickMiss] = 50;
|
||||||
|
Statistics[HitResult.SmallBonus] = 10;
|
||||||
|
Statistics[HitResult.SmallBonus] = 50;
|
||||||
|
|
||||||
Position = 1;
|
Position = 1;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ namespace osu.Game.Users
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Background.Width = 0.5f;
|
Background.Width = 0.5f;
|
||||||
|
Background.Origin = Anchor.CentreRight;
|
||||||
|
Background.Anchor = Anchor.CentreRight;
|
||||||
Background.Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(1), Color4.White.Opacity(0.3f));
|
Background.Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(1), Color4.White.Opacity(0.3f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user