mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:17:51 +08:00
Add ScoreV1 calculation for ManiaRuleset
This commit is contained in:
parent
3ec97121e1
commit
13d1f9c902
@ -33,9 +33,13 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
|
||||
public override int Version => 20220902;
|
||||
|
||||
private readonly IWorkingBeatmap workingBeatmap;
|
||||
|
||||
public ManiaDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
workingBeatmap = beatmap;
|
||||
|
||||
isForCurrentRuleset = beatmap.BeatmapInfo.Ruleset.MatchesOnlineID(ruleset);
|
||||
originalOverallDifficulty = beatmap.BeatmapInfo.Difficulty.OverallDifficulty;
|
||||
}
|
||||
@ -48,6 +52,8 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
HitWindows hitWindows = new ManiaHitWindows();
|
||||
hitWindows.SetDifficulty(beatmap.Difficulty.OverallDifficulty);
|
||||
|
||||
ManiaScoreV1Processor sv1Processor = new ManiaScoreV1Processor(mods);
|
||||
|
||||
return new ManiaDifficultyAttributes
|
||||
{
|
||||
StarRating = skills[0].DifficultyValue() * star_scaling_factor,
|
||||
@ -55,7 +61,9 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
// In osu-stable mania, rate-adjustment mods don't affect the hit window.
|
||||
// This is done the way it is to introduce fractional differences in order to match osu-stable for the time being.
|
||||
GreatHitWindow = Math.Ceiling((int)(getHitWindow300(mods) * clockRate) / clockRate),
|
||||
MaxCombo = beatmap.HitObjects.Sum(maxComboForObject)
|
||||
MaxCombo = beatmap.HitObjects.Sum(maxComboForObject),
|
||||
LegacyTotalScore = sv1Processor.TotalScore,
|
||||
LegacyComboScore = sv1Processor.TotalScore
|
||||
};
|
||||
}
|
||||
|
||||
|
24
osu.Game.Rulesets.Mania/Difficulty/ManiaScoreV1Processor.cs
Normal file
24
osu.Game.Rulesets.Mania/Difficulty/ManiaScoreV1Processor.cs
Normal file
@ -0,0 +1,24 @@
|
||||
// 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.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Rulesets.Mania.Mods;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
{
|
||||
internal class ManiaScoreV1Processor
|
||||
{
|
||||
public int TotalScore { get; private set; }
|
||||
|
||||
public ManiaScoreV1Processor(IReadOnlyList<Mod> mods)
|
||||
{
|
||||
double multiplier = mods.Where(m => m is not (ModHidden or ModHardRock or ModDoubleTime or ModFlashlight or ManiaModFadeIn))
|
||||
.Select(m => m.ScoreMultiplier)
|
||||
.Aggregate((c, n) => c * n);
|
||||
|
||||
TotalScore = (int)(1000000 * multiplier);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user