Make BasePortion and ComboPortion constants

This commit is contained in:
smoogipooo 2017-09-13 16:13:27 +09:00
parent e472518e4f
commit e146bcacf1
4 changed files with 6 additions and 13 deletions

View File

@ -89,9 +89,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
/// </summary>
private double hpMultiplier = 1;
protected override double BasePortion => 0.8;
protected override double ComboPortion => 0.2;
public ManiaScoreProcessor()
{
}

View File

@ -16,9 +16,6 @@ namespace osu.Game.Rulesets.Osu.Scoring
{
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject>
{
protected override double BasePortion => 0.3;
protected override double ComboPortion => 0.7;
public OsuScoreProcessor()
{
}

View File

@ -55,9 +55,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring
/// </summary>
public override bool HasFailed => Hits == MaxHits && Health.Value <= 0.5;
protected override double BasePortion => 0.8;
protected override double ComboPortion => 0.2;
private double hpIncreaseTick;
private double hpIncreaseGreat;
private double hpIncreaseGood;

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Diagnostics;
using osu.Framework.Configuration;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
@ -150,15 +151,14 @@ namespace osu.Game.Rulesets.Scoring
public abstract class ScoreProcessor<TObject> : ScoreProcessor
where TObject : HitObject
{
private const double base_portion = 0.3;
private const double combo_portion = 0.7;
private const double max_score = 1000000;
public readonly Bindable<ScoringMode> Mode = new Bindable<ScoringMode>();
protected sealed override bool HasCompleted => Hits == MaxHits;
protected virtual double BasePortion => 0.5f;
protected virtual double ComboPortion => 0.5f;
protected int MaxHits { get; private set; }
protected int Hits { get; private set; }
@ -174,6 +174,8 @@ namespace osu.Game.Rulesets.Scoring
protected ScoreProcessor(RulesetContainer<TObject> rulesetContainer)
{
Debug.Assert(base_portion + combo_portion == 1.0);
rulesetContainer.OnJudgement += AddJudgement;
SimulateAutoplay(rulesetContainer.Beatmap);
@ -231,7 +233,7 @@ namespace osu.Game.Rulesets.Scoring
switch (Mode.Value)
{
case ScoringMode.Standardised:
TotalScore.Value = max_score * (BasePortion * baseScore / maxBaseScore + ComboPortion * HighestCombo / maxHighestCombo) + bonusScore;
TotalScore.Value = max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
break;
case ScoringMode.Exponential:
TotalScore.Value = (baseScore + bonusScore) * Math.Log(HighestCombo + 1, 2);