mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
// 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;
|
|
using osu.Game.Rulesets.Judgements;
|
|
using osu.Game.Rulesets.Scoring;
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Scoring
|
|
{
|
|
public partial class TaikoScoreProcessor : ScoreProcessor
|
|
{
|
|
private const double combo_base = 4;
|
|
|
|
public TaikoScoreProcessor()
|
|
: base(new TaikoRuleset())
|
|
{
|
|
}
|
|
|
|
protected override double ComputeTotalScore()
|
|
{
|
|
return (
|
|
250000 * ComboPortion / MaxComboPortion +
|
|
750000 * Math.Pow(Accuracy.Value, 3.6) * ((double)CurrentBasicJudgements / MaxBasicJudgements) +
|
|
BonusPortion
|
|
) * ScoreMultiplier;
|
|
}
|
|
|
|
protected override void AddScoreChange(JudgementResult result)
|
|
{
|
|
var change = computeScoreChange(result);
|
|
ComboPortion += change.combo;
|
|
BonusPortion += change.bonus;
|
|
}
|
|
|
|
protected override void RemoveScoreChange(JudgementResult result)
|
|
{
|
|
var change = computeScoreChange(result);
|
|
ComboPortion -= change.combo;
|
|
BonusPortion -= change.bonus;
|
|
}
|
|
|
|
private (double combo, double bonus) computeScoreChange(JudgementResult result)
|
|
{
|
|
double hitValue = Judgement.ToNumericResult(result.Type);
|
|
|
|
if (result.HitObject is StrongNestedHitObject strong)
|
|
{
|
|
double strongBonus = strong.Parent is DrumRollTick ? 3 : 7;
|
|
hitValue *= strongBonus;
|
|
}
|
|
|
|
if (result.Type.IsBonus())
|
|
return (0, hitValue);
|
|
|
|
return (hitValue * Math.Min(Math.Max(0.5, Math.Log(result.ComboAtJudgement, combo_base)), Math.Log(400, combo_base)), 0);
|
|
}
|
|
}
|
|
}
|