Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Dec 20, 2023
2 parents c87ba76 + c23dd1f commit 130be4b
Show file tree
Hide file tree
Showing 42 changed files with 456 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Edit.Blueprints.Components;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Edit;
Expand All @@ -17,7 +18,7 @@ public partial class BananaShowerPlacementBlueprint : CatchPlacementBlueprint<Ba
private double placementStartTime;
private double placementEndTime;

protected override bool IsValidForPlacement => HitObject.Duration > 0;
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);

public BananaShowerPlacementBlueprint()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Edit.Blueprints.Components;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Edit;
Expand All @@ -24,7 +25,7 @@ public partial class JuiceStreamPlacementBlueprint : CatchPlacementBlueprint<Jui

private InputManager inputManager = null!;

protected override bool IsValidForPlacement => HitObject.Duration > 0;
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);

public JuiceStreamPlacementBlueprint()
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected override double ComputeTotalScore(double comboProgress, double accurac
}

protected override double GetComboScoreChange(JudgementResult result)
=> Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base));
=> GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base));

public override ScoreRank RankFromAccuracy(double accuracy)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Mods;
using osu.Game.Rulesets.Mania.Objects;
Expand All @@ -25,8 +26,8 @@ public partial class TestSceneManiaModDoubleTime : ModTestScene
public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData
{
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
&& Player.ScoreProcessor.Accuracy.Value == 1
&& Player.ScoreProcessor.TotalScore.Value == 1_000_000,
&& Precision.AlmostEquals(Player.ScoreProcessor.Accuracy.Value, 0.9836, 0.01)
&& Player.ScoreProcessor.TotalScore.Value == 946_049,
Autoplay = false,
Beatmap = new Beatmap
{
Expand All @@ -53,7 +54,7 @@ public void TestHitWindowWithDoubleTime()
Mod = doubleTime,
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
&& Player.ScoreProcessor.Accuracy.Value == 1
&& Player.ScoreProcessor.TotalScore.Value == (long)(1_000_010 * doubleTime.ScoreMultiplier),
&& Player.ScoreProcessor.TotalScore.Value == (long)(1_000_000 * doubleTime.ScoreMultiplier),
Autoplay = false,
Beatmap = new Beatmap
{
Expand Down
8 changes: 3 additions & 5 deletions osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,10 @@ public void TestPressAtStartThenReleaseAndImmediatelyRepress()
});

assertHeadJudgement(HitResult.Perfect);
// judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult.
assertComboAtJudgement(1, 1);
assertComboAtJudgement(0, 1);
assertTailJudgement(HitResult.Meh);
assertComboAtJudgement(2, 0);
// judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult.
assertComboAtJudgement(4, 1);
assertComboAtJudgement(1, 0);
assertComboAtJudgement(3, 1);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void TestSimultaneousTickAndNote()
AddAssert("all objects perfectly judged",
() => judgementResults.Select(result => result.Type),
() => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult)));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_030));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000));
}

[Test]
Expand Down Expand Up @@ -87,7 +87,7 @@ public void TestSimultaneousLongNotes()
AddAssert("all objects perfectly judged",
() => judgementResults.Select(result => result.Type),
() => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult)));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_040));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000));
}

private void performTest(List<ManiaHitObject> hitObjects, List<ReplayFrame> frames)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
using osu.Game.Rulesets.Mania.Objects;
Expand All @@ -23,7 +24,7 @@ public partial class HoldNotePlacementBlueprint : ManiaPlacementBlueprint<HoldNo
[Resolved]
private IScrollingInfo scrollingInfo { get; set; } = null!;

protected override bool IsValidForPlacement => HitObject.Duration > 0;
protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);

public HoldNotePlacementBlueprint()
: base(new HoldNote())
Expand Down
5 changes: 5 additions & 0 deletions osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ namespace osu.Game.Rulesets.Mania.Mods
public class ManiaModDoubleTime : ModDoubleTime, IManiaRateAdjustmentMod
{
public HitWindows HitWindows { get; set; } = new ManiaHitWindows();

// For now, all rate-increasing mods should be given a 1x multiplier in mania because it doesn't always
// make the map harder and is more of a personal preference.
// In the future, we can consider adjusting this by experimenting with not applying the hitwindow leniency.
public override double ScoreMultiplier => 1;
}
}
5 changes: 5 additions & 0 deletions osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ namespace osu.Game.Rulesets.Mania.Mods
public class ManiaModNightcore : ModNightcore<ManiaHitObject>, IManiaRateAdjustmentMod
{
public HitWindows HitWindows { get; set; } = new ManiaHitWindows();

// For now, all rate-increasing mods should be given a 1x multiplier in mania because it doesn't always
// make the map any harder and is more of a personal preference.
// In the future, we can consider adjusting this by experimenting with not applying the hitwindow leniency.
public override double ScoreMultiplier => 1;
}
}
40 changes: 0 additions & 40 deletions osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
using osu.Game.Graphics;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.Mania.Skinning.Default;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Screens.Edit;
Expand All @@ -40,8 +38,6 @@ public partial class DrawableNote : DrawableManiaHitObject<Note>, IKeyBindingHan

private Drawable headPiece;

private DrawableNotePerfectBonus perfectBonus;

public DrawableNote()
: this(null)
{
Expand Down Expand Up @@ -93,10 +89,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (!userTriggered)
{
if (!HitObject.HitWindows.CanBeHit(timeOffset))
{
perfectBonus.TriggerResult(false);
ApplyResult(r => r.Type = r.Judgement.MinResult);
}

return;
}
Expand All @@ -107,16 +100,9 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)

result = GetCappedResult(result);

perfectBonus.TriggerResult(result == HitResult.Perfect);
ApplyResult(r => r.Type = result);
}

public override void MissForcefully()
{
perfectBonus.TriggerResult(false);
base.MissForcefully();
}

/// <summary>
/// Some objects in mania may want to limit the max result.
/// </summary>
Expand All @@ -137,32 +123,6 @@ public virtual void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
{
}

protected override void AddNestedHitObject(DrawableHitObject hitObject)
{
switch (hitObject)
{
case DrawableNotePerfectBonus bonus:
AddInternal(perfectBonus = bonus);
break;
}
}

protected override void ClearNestedHitObjects()
{
RemoveInternal(perfectBonus, false);
}

protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject)
{
switch (hitObject)
{
case NotePerfectBonus bonus:
return new DrawableNotePerfectBonus(bonus);
}

return base.CreateNestedHitObject(hitObject);
}

private void updateSnapColour()
{
if (beatmap == null || HitObject == null) return;
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions osu.Game.Rulesets.Mania/Objects/Note.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Threading;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mania.Judgements;

Expand All @@ -13,12 +12,5 @@ namespace osu.Game.Rulesets.Mania.Objects
public class Note : ManiaHitObject
{
public override Judgement CreateJudgement() => new ManiaJudgement();

protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{
base.CreateNestedHitObjects(cancellationToken);

AddNested(new NotePerfectBonus { StartTime = StartTime });
}
}
}
20 changes: 0 additions & 20 deletions osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs

This file was deleted.

43 changes: 40 additions & 3 deletions osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,50 @@ protected override IEnumerable<HitObject> EnumerateHitObjects(IBeatmap beatmap)

protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)
{
return 10000 * comboProgress
+ 990000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress
return 150000 * comboProgress
+ 850000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress
+ bonusPortion;
}

protected override double GetNumericResultFor(JudgementResult result)
{
switch (result.Type)
{
case HitResult.Perfect:
return 305;
}

return base.GetNumericResultFor(result);
}

protected override double GetMaxNumericResultFor(JudgementResult result)
{
switch (result.Judgement.MaxResult)
{
case HitResult.Perfect:
return 305;
}

return base.GetMaxNumericResultFor(result);
}

protected override double GetComboScoreChange(JudgementResult result)
=> Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base));
{
double numericResult;

switch (result.Type)
{
case HitResult.Perfect:
numericResult = 300;
break;

default:
numericResult = GetNumericResultFor(result);
break;
}

return numericResult * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base));
}

private class JudgementOrderComparer : IComparer<HitObject>
{
Expand Down
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Mania/UI/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ private void load(GameHost host)
TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy());

RegisterPool<Note, DrawableNote>(10, 50);
RegisterPool<NotePerfectBonus, DrawableNotePerfectBonus>(10, 50);
RegisterPool<HoldNote, DrawableHoldNote>(10, 50);
RegisterPool<HeadNote, DrawableHoldNoteHead>(10, 50);
RegisterPool<TailNote, DrawableHoldNoteTail>(10, 50);
Expand Down
6 changes: 1 addition & 5 deletions osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModAutopilot : Mod, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
public class OsuModAutopilot : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
{
public override string Name => "Autopilot";
public override string Acronym => "AP";
Expand All @@ -37,10 +37,6 @@ public class OsuModAutopilot : Mod, IApplicableFailOverride, IUpdatableByPlayfie
typeof(ModTouchDevice)
};

public bool PerformFail() => false;

public bool RestartOnFail => false;

private OsuInputManager inputManager = null!;

private List<OsuReplayFrame> replayFrames = null!;
Expand Down
Loading

0 comments on commit 130be4b

Please sign in to comment.