mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into no-gameplay-clock-editor-offset
This commit is contained in:
@ -119,8 +119,20 @@ namespace osu.Game.Rulesets.Scoring
|
||||
[EnumMember(Value = "ignore_hit")]
|
||||
[Order(12)]
|
||||
IgnoreHit,
|
||||
|
||||
/// <summary>
|
||||
/// A special result used as a padding value for legacy rulesets. It is a hit type and affects combo, but does not affect the base score (does not affect accuracy).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// DO NOT USE.
|
||||
/// </remarks>
|
||||
[EnumMember(Value = "legacy_combo_increase")]
|
||||
[Order(99)]
|
||||
[Obsolete("Do not use.")]
|
||||
LegacyComboIncrease = 99
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618
|
||||
public static class HitResultExtensions
|
||||
{
|
||||
/// <summary>
|
||||
@ -150,6 +162,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
case HitResult.Perfect:
|
||||
case HitResult.LargeTickHit:
|
||||
case HitResult.LargeTickMiss:
|
||||
case HitResult.LegacyComboIncrease:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@ -161,13 +174,25 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// Whether a <see cref="HitResult"/> affects the accuracy portion of the score.
|
||||
/// </summary>
|
||||
public static bool AffectsAccuracy(this HitResult result)
|
||||
=> IsScorable(result) && !IsBonus(result);
|
||||
{
|
||||
// LegacyComboIncrease is a special type which is neither a basic, tick, bonus, or accuracy-affecting result.
|
||||
if (result == HitResult.LegacyComboIncrease)
|
||||
return false;
|
||||
|
||||
return IsScorable(result) && !IsBonus(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> is a non-tick and non-bonus result.
|
||||
/// </summary>
|
||||
public static bool IsBasic(this HitResult result)
|
||||
=> IsScorable(result) && !IsTick(result) && !IsBonus(result);
|
||||
{
|
||||
// LegacyComboIncrease is a special type which is neither a basic, tick, bonus, or accuracy-affecting result.
|
||||
if (result == HitResult.LegacyComboIncrease)
|
||||
return false;
|
||||
|
||||
return IsScorable(result) && !IsTick(result) && !IsBonus(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> should be counted as a tick.
|
||||
@ -225,12 +250,19 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> is scorable.
|
||||
/// </summary>
|
||||
public static bool IsScorable(this HitResult result) => result >= HitResult.Miss && result < HitResult.IgnoreMiss;
|
||||
public static bool IsScorable(this HitResult result)
|
||||
{
|
||||
// LegacyComboIncrease is not actually scorable (in terms of usable by rulesets for that purpose), but needs to be defined as such to be correctly included in statistics output.
|
||||
if (result == HitResult.LegacyComboIncrease)
|
||||
return true;
|
||||
|
||||
return result >= HitResult.Miss && result < HitResult.IgnoreMiss;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An array of all scorable <see cref="HitResult"/>s.
|
||||
/// </summary>
|
||||
public static readonly HitResult[] ALL_TYPES = ((HitResult[])Enum.GetValues(typeof(HitResult))).ToArray();
|
||||
public static readonly HitResult[] ALL_TYPES = ((HitResult[])Enum.GetValues(typeof(HitResult))).Except(new[] { HitResult.LegacyComboIncrease }).ToArray();
|
||||
|
||||
/// <summary>
|
||||
/// Whether a <see cref="HitResult"/> is valid within a given <see cref="HitResult"/> range.
|
||||
@ -251,4 +283,5 @@ namespace osu.Game.Rulesets.Scoring
|
||||
return result > minResult && result < maxResult;
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
}
|
||||
|
@ -61,6 +61,11 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <param name="result">The <see cref="JudgementResult"/> to apply.</param>
|
||||
public void ApplyResult(JudgementResult result)
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
if (result.Type == HitResult.LegacyComboIncrease)
|
||||
throw new ArgumentException(@$"A {nameof(HitResult.LegacyComboIncrease)} hit result cannot be applied.");
|
||||
#pragma warning restore CS0618
|
||||
|
||||
JudgedHits++;
|
||||
lastAppliedResult = result;
|
||||
|
||||
|
@ -536,6 +536,9 @@ namespace osu.Game.Rulesets.Scoring
|
||||
{
|
||||
extractScoringValues(scoreInfo.Statistics, out current, out maximum);
|
||||
current.MaxCombo = scoreInfo.MaxCombo;
|
||||
|
||||
if (scoreInfo.MaximumStatistics.Count > 0)
|
||||
extractScoringValues(scoreInfo.MaximumStatistics, out _, out maximum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -591,7 +594,8 @@ namespace osu.Game.Rulesets.Scoring
|
||||
|
||||
if (result.IsBonus())
|
||||
current.BonusScore += count * Judgement.ToNumericResult(result);
|
||||
else
|
||||
|
||||
if (result.AffectsAccuracy())
|
||||
{
|
||||
// The maximum result of this judgement if it wasn't a miss.
|
||||
// E.g. For a GOOD judgement, the max result is either GREAT/PERFECT depending on which one the ruleset uses (osu!: GREAT, osu!mania: PERFECT).
|
||||
|
Reference in New Issue
Block a user