1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 14:47:25 +08:00

Remove ClassicScoreMultiplier and DefaultScoreProcessor

This commit is contained in:
Dan Balasescu 2023-05-18 20:52:40 +09:00
parent 00e0411369
commit 8b56a3f87d
10 changed files with 29 additions and 52 deletions

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Catch
{
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableCatchRuleset(this, beatmap, mods);
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this);
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor();
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap, this);

View File

@ -1,4 +1,4 @@
// 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.
using System;
@ -13,15 +13,13 @@ namespace osu.Game.Rulesets.Catch.Scoring
private const int combo_cap = 200;
private const double combo_base = 4;
protected override double ClassicScoreMultiplier => 28;
private double tinyDropletScale;
private int maximumTinyDroplets;
private int hitTinyDroplets;
public CatchScoreProcessor(Ruleset ruleset)
: base(ruleset)
public CatchScoreProcessor()
: base(new CatchRuleset())
{
}

View File

@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Mania
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableManiaRuleset(this, beatmap, mods);
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this);
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new ManiaHealthProcessor(drainStartTime);

View File

@ -1,4 +1,4 @@
// 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.
using System;
@ -11,10 +11,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
{
private const double combo_base = 4;
protected override double ClassicScoreMultiplier => 16;
public ManiaScoreProcessor(Ruleset ruleset)
: base(ruleset)
public ManiaScoreProcessor()
: base(new ManiaRuleset())
{
}

View File

@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Osu
{
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableOsuRuleset(this, beatmap, mods);
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap, this);

View File

@ -1,4 +1,4 @@
// 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.
using System;
@ -8,10 +8,8 @@ namespace osu.Game.Rulesets.Osu.Scoring
{
public partial class OsuScoreProcessor : ScoreProcessor
{
protected override double ClassicScoreMultiplier => 36;
public OsuScoreProcessor(Ruleset ruleset)
: base(ruleset)
public OsuScoreProcessor()
: base(new OsuRuleset())
{
}

View File

@ -1,4 +1,4 @@
// 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.
using System;
@ -12,10 +12,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring
{
private const double combo_base = 4;
protected override double ClassicScoreMultiplier => 22;
public TaikoScoreProcessor(Ruleset ruleset)
: base(ruleset)
public TaikoScoreProcessor()
: base(new TaikoRuleset())
{
}

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko
{
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableTaikoRuleset(this, beatmap, mods);
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor();
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new TaikoHealthProcessor();

View File

@ -232,7 +232,7 @@ namespace osu.Game.Rulesets
/// Creates a <see cref="ScoreProcessor"/> for this <see cref="Ruleset"/>.
/// </summary>
/// <returns>The score processor.</returns>
public virtual ScoreProcessor CreateScoreProcessor() => new DefaultScoreProcessor(this);
public virtual ScoreProcessor CreateScoreProcessor() => new ScoreProcessor(this);
/// <summary>
/// Creates a <see cref="HealthProcessor"/> for this <see cref="Ruleset"/>.
@ -381,23 +381,4 @@ namespace osu.Game.Rulesets
/// </summary>
public virtual RulesetSetupSection? CreateEditorSetupSection() => null;
}
public partial class DefaultScoreProcessor : ScoreProcessor
{
public DefaultScoreProcessor(Ruleset ruleset)
: base(ruleset)
{
}
protected override double ComputeTotalScore()
{
return
(int)Math.Round
((
700000 * ComboPortion / MaxComboPortion +
300000 * Math.Pow(Accuracy.Value, 10) * ((double)CurrentBasicJudgements / MaxBasicJudgements) +
BonusPortion
) * ScoreMultiplier);
}
}
}

View File

@ -18,7 +18,7 @@ using osu.Game.Scoring;
namespace osu.Game.Rulesets.Scoring
{
public abstract partial class ScoreProcessor : JudgementProcessor
public partial class ScoreProcessor : JudgementProcessor
{
public const double MAX_SCORE = 1000000;
@ -82,11 +82,6 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
public IReadOnlyList<HitEvent> HitEvents => hitEvents;
/// <summary>
/// An arbitrary multiplier to scale scores in the <see cref="ScoringMode.Classic"/> scoring mode.
/// </summary>
protected virtual double ClassicScoreMultiplier => 36;
/// <summary>
/// The ruleset this score processor is valid for.
/// </summary>
@ -162,7 +157,7 @@ namespace osu.Game.Rulesets.Scoring
private readonly List<HitEvent> hitEvents = new List<HitEvent>();
private HitObject? lastHitObject;
protected ScoreProcessor(Ruleset ruleset)
public ScoreProcessor(Ruleset ruleset)
{
Ruleset = ruleset;
@ -289,7 +284,16 @@ namespace osu.Game.Rulesets.Scoring
TotalScore.Value = (long)Math.Round(ComputeTotalScore());
}
protected abstract double ComputeTotalScore();
protected virtual double ComputeTotalScore()
{
return
(int)Math.Round
((
700000 * ComboPortion / MaxComboPortion +
300000 * Math.Pow(Accuracy.Value, 10) * ((double)CurrentBasicJudgements / MaxBasicJudgements) +
BonusPortion
) * ScoreMultiplier);
}
/// <summary>
/// Resets this ScoreProcessor to a default state.