1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:23:20 +08:00

Split AffectsCombo into IsBonus

This commit is contained in:
Crusensis 2018-06-09 18:14:33 -07:00
parent 808118e4d4
commit fbc0cd6f5f
9 changed files with 33 additions and 10 deletions

View File

@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
public class CatchBananaJudgement : CatchJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
protected override int NumericResultFor(HitResult result)
{

View File

@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
public class CatchBananaShowerJudgement : CatchJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
public CatchBananaShowerJudgement()
{

View File

@ -8,6 +8,8 @@ namespace osu.Game.Rulesets.Mania.Judgements
public class HoldNoteJudgement : ManiaJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
protected override int NumericResultFor(HitResult result) => 0;
}
}

View File

@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mania.Judgements
public class HoldNoteTickJudgement : ManiaJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
protected override int NumericResultFor(HitResult result) => 20;
}

View File

@ -8,6 +8,8 @@ namespace osu.Game.Rulesets.Osu.Judgements
public class OsuSliderTailJudgement : OsuJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
protected override int NumericResultFor(HitResult result) => 0;
}
}

View File

@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
public class TaikoDrumRollTickJudgement : TaikoJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
protected override int NumericResultFor(HitResult result)
{

View File

@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
public class TaikoStrongHitJudgement : TaikoJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
public TaikoStrongHitJudgement()
{

View File

@ -46,10 +46,14 @@ namespace osu.Game.Rulesets.Judgements
/// <summary>
/// Whether the <see cref="Result"/> should affect the combo portion of the score.
/// If false, the <see cref="Result"/> will be considered for the bonus portion of the score.
/// </summary>
public virtual bool AffectsCombo => true;
/// <summary>
/// Whether the <see cref="Result"/> should be counted as base or bonus score.
/// </summary>
public virtual bool IsBonus => false;
/// <summary>
/// The numeric representation for the result achieved.
/// </summary>

View File

@ -256,13 +256,19 @@ namespace osu.Game.Rulesets.Scoring
break;
}
baseScore += judgement.NumericResult;
rollingMaxBaseScore += judgement.MaxNumericResult;
JudgedHits++;
}
else if (judgement.IsHit)
bonusScore += judgement.NumericResult;
if (judgement.IsBonus)
{
if (judgement.IsHit)
bonusScore += judgement.NumericResult;
}
else
{
baseScore += judgement.NumericResult;
rollingMaxBaseScore += judgement.MaxNumericResult;
}
}
/// <summary>
@ -275,14 +281,18 @@ namespace osu.Game.Rulesets.Scoring
HighestCombo.Value = judgement.HighestComboAtJudgement;
if (judgement.AffectsCombo)
JudgedHits--;
if (judgement.IsBonus)
{
if (judgement.IsHit)
bonusScore -= judgement.NumericResult;
}
else
{
baseScore -= judgement.NumericResult;
rollingMaxBaseScore -= judgement.MaxNumericResult;
JudgedHits--;
}
else if (judgement.IsHit)
bonusScore -= judgement.NumericResult;
}
private void updateScore()