2023-05-18 19:52:40 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 16:43:03 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2023-05-09 18:33:33 +08:00
|
|
|
|
using System;
|
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2023-05-09 18:33:33 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Scoring
|
2017-03-16 11:40:35 +08:00
|
|
|
|
{
|
2023-05-09 18:33:33 +08:00
|
|
|
|
public partial class TaikoScoreProcessor : ScoreProcessor
|
2017-03-16 11:40:35 +08:00
|
|
|
|
{
|
2023-05-09 18:33:33 +08:00
|
|
|
|
private const double combo_base = 4;
|
|
|
|
|
|
2023-05-18 19:52:40 +08:00
|
|
|
|
public TaikoScoreProcessor()
|
|
|
|
|
: base(new TaikoRuleset())
|
2022-03-14 14:51:10 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-09 18:33:33 +08:00
|
|
|
|
protected override double ComputeTotalScore()
|
|
|
|
|
{
|
2023-05-09 19:00:14 +08:00
|
|
|
|
return (
|
|
|
|
|
250000 * ComboPortion / MaxComboPortion +
|
|
|
|
|
750000 * Math.Pow(Accuracy.Value, 3.6) * ((double)CurrentBasicJudgements / MaxBasicJudgements) +
|
|
|
|
|
BonusPortion
|
|
|
|
|
) * ScoreMultiplier;
|
2023-05-09 18:33:33 +08:00
|
|
|
|
}
|
2020-07-16 13:13:46 +08:00
|
|
|
|
|
2023-05-09 18:33:33 +08:00
|
|
|
|
protected override void AddScoreChange(JudgementResult result)
|
|
|
|
|
{
|
|
|
|
|
var change = computeScoreChange(result);
|
|
|
|
|
ComboPortion += change.combo;
|
2023-05-19 12:23:04 +08:00
|
|
|
|
BonusPortion += change.bonus;
|
2023-05-09 18:33:33 +08:00
|
|
|
|
}
|
2022-03-10 09:26:09 +08:00
|
|
|
|
|
2023-05-09 18:33:33 +08:00
|
|
|
|
protected override void RemoveScoreChange(JudgementResult result)
|
|
|
|
|
{
|
|
|
|
|
var change = computeScoreChange(result);
|
|
|
|
|
ComboPortion -= change.combo;
|
2023-05-19 12:23:04 +08:00
|
|
|
|
BonusPortion -= change.bonus;
|
2023-05-09 18:33:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2017-03-16 11:40:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|