2023-05-18 11:52:40 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 08:43:03 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-05-09 10:33:33 +00:00
|
|
|
|
using System;
|
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2023-05-09 10:33:33 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Scoring
|
2017-03-16 03:40:35 +00:00
|
|
|
|
{
|
2023-05-09 10:33:33 +00:00
|
|
|
|
public partial class TaikoScoreProcessor : ScoreProcessor
|
2017-03-16 03:40:35 +00:00
|
|
|
|
{
|
2023-05-09 10:33:33 +00:00
|
|
|
|
private const double combo_base = 4;
|
|
|
|
|
|
2023-05-18 11:52:40 +00:00
|
|
|
|
public TaikoScoreProcessor()
|
|
|
|
|
: base(new TaikoRuleset())
|
2022-03-14 06:51:10 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 08:27:02 +00:00
|
|
|
|
protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)
|
2023-05-09 10:33:33 +00:00
|
|
|
|
{
|
2023-05-19 08:27:02 +00:00
|
|
|
|
return 250000 * comboProgress
|
|
|
|
|
+ 750000 * Math.Pow(Accuracy.Value, 3.6) * accuracyProgress
|
2023-05-19 05:37:26 +00:00
|
|
|
|
+ bonusPortion;
|
2023-05-09 10:33:33 +00:00
|
|
|
|
}
|
2020-07-16 05:13:46 +00:00
|
|
|
|
|
2023-05-19 05:37:26 +00:00
|
|
|
|
protected override double GetBonusScoreChange(JudgementResult result) => base.GetBonusScoreChange(result) * strongScaleValue(result);
|
2022-03-10 01:26:09 +00:00
|
|
|
|
|
2023-05-19 05:37:26 +00:00
|
|
|
|
protected override double GetComboScoreChange(JudgementResult result)
|
2023-05-09 10:33:33 +00:00
|
|
|
|
{
|
2023-12-21 05:58:23 +00:00
|
|
|
|
return GetBaseScoreForResult(result.Type)
|
2023-05-19 05:37:26 +00:00
|
|
|
|
* Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base))
|
|
|
|
|
* strongScaleValue(result);
|
2023-05-09 10:33:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-21 05:58:23 +00:00
|
|
|
|
public override int GetBaseScoreForResult(HitResult result)
|
2023-12-19 04:50:46 +00:00
|
|
|
|
{
|
2023-12-20 11:23:43 +00:00
|
|
|
|
switch (result)
|
2023-12-19 04:50:46 +00:00
|
|
|
|
{
|
|
|
|
|
case HitResult.Ok:
|
|
|
|
|
return 150;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-21 05:58:23 +00:00
|
|
|
|
return base.GetBaseScoreForResult(result);
|
2023-12-19 04:50:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 05:37:26 +00:00
|
|
|
|
private double strongScaleValue(JudgementResult result)
|
2023-05-09 10:33:33 +00:00
|
|
|
|
{
|
|
|
|
|
if (result.HitObject is StrongNestedHitObject strong)
|
2023-05-19 05:37:26 +00:00
|
|
|
|
return strong.Parent is DrumRollTick ? 3 : 7;
|
2023-05-09 10:33:33 +00:00
|
|
|
|
|
2023-05-19 05:37:26 +00:00
|
|
|
|
return 1;
|
2023-05-09 10:33:33 +00:00
|
|
|
|
}
|
2017-03-16 03:40:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|