mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:12:57 +08:00
Add perfect and ok values, move to base Judgement
This commit is contained in:
parent
0454c5022d
commit
3b07c3913d
@ -8,11 +8,6 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
|||||||
{
|
{
|
||||||
public class OsuJudgement : Judgement
|
public class OsuJudgement : Judgement
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The health increase for a maximum judgement result.
|
|
||||||
/// </summary>
|
|
||||||
protected const double MAX_HEALTH_INCREASE = 0.05;
|
|
||||||
|
|
||||||
public override HitResult MaxResult => HitResult.Great;
|
public override HitResult MaxResult => HitResult.Great;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result)
|
protected override int NumericResultFor(HitResult result)
|
||||||
@ -32,26 +27,5 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
|||||||
return 300;
|
return 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
|
||||||
{
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
case HitResult.Miss:
|
|
||||||
return -MAX_HEALTH_INCREASE;
|
|
||||||
|
|
||||||
case HitResult.Meh:
|
|
||||||
return -MAX_HEALTH_INCREASE * 0.05;
|
|
||||||
|
|
||||||
case HitResult.Good:
|
|
||||||
return MAX_HEALTH_INCREASE * 0.3;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
|
||||||
return MAX_HEALTH_INCREASE;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,12 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class Judgement
|
public class Judgement
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The default health increase for a maximum judgement, as a proportion of total health.
|
||||||
|
/// By default, each maximum judgement restores 5% of total health.
|
||||||
|
/// </summary>
|
||||||
|
protected const double DEFAULT_MAX_HEALTH_INCREASE = 0.05;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum <see cref="HitResult"/> that can be achieved.
|
/// The maximum <see cref="HitResult"/> that can be achieved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -55,7 +61,32 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="result">The <see cref="HitResult"/> to find the numeric health increase for.</param>
|
/// <param name="result">The <see cref="HitResult"/> to find the numeric health increase for.</param>
|
||||||
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
|
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
|
||||||
protected virtual double HealthIncreaseFor(HitResult result) => 0;
|
protected virtual double HealthIncreaseFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
return -DEFAULT_MAX_HEALTH_INCREASE;
|
||||||
|
|
||||||
|
case HitResult.Meh:
|
||||||
|
return -DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||||
|
|
||||||
|
case HitResult.Ok:
|
||||||
|
return -DEFAULT_MAX_HEALTH_INCREASE * 0.01;
|
||||||
|
|
||||||
|
case HitResult.Good:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE * 0.3;
|
||||||
|
|
||||||
|
case HitResult.Great:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||||
|
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return DEFAULT_MAX_HEALTH_INCREASE * 1.05;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the numeric health increase of a <see cref="JudgementResult"/>.
|
/// Retrieves the numeric health increase of a <see cref="JudgementResult"/>.
|
||||||
|
Loading…
Reference in New Issue
Block a user