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

Move HealthIncreaseFor to Judgement

This commit is contained in:
Ivan Pavluk 2018-12-06 15:09:42 +07:00
parent 881a00f4a8
commit 1b6658f4ee
10 changed files with 35 additions and 37 deletions

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
}
}
protected override float HealthIncreaseFor(HitResult result)
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
}
}
protected override float HealthIncreaseFor(HitResult result)
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
/// </summary>
/// <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>
protected virtual float HealthIncreaseFor(HitResult result)
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{
@ -38,13 +38,6 @@ namespace osu.Game.Rulesets.Catch.Judgements
}
}
/// <summary>
/// Retrieves the numeric health increase of a <see cref="JudgementResult"/>.
/// </summary>
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric health increase for.</param>
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
public float HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type);
/// <summary>
/// Whether fruit on the platter should explode or drop.
/// Note that this is only checked if the owning object is also <see cref="IHasComboInformation.LastInCombo" />

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
}
}
protected override float HealthIncreaseFor(HitResult result)
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{

View File

@ -9,8 +9,16 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public override bool AffectsCombo => false;
protected override int NumericResultFor(HitResult result) => 0;
protected override double HealthIncreaseFor(HitResult result) => 0;
protected override double HealthIncreaseFor(HitResult result)
{
//Drum rolls can be ignored with no health penalty
switch (result)
{
case HitResult.Miss:
return 0;
default:
return base.HealthIncreaseFor(result);
}
}
}
}

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
switch(result)
{
case HitResult.Great:
return 0.0000003;
return 0.15;
default:
return 0;
}

View File

@ -10,11 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public override HitResult MaxResult => HitResult.Great;
/// <summary>
/// Computes the numeric result value for the combo portion of the score.
/// </summary>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
protected override int NumericResultFor(HitResult result)
{
switch (result)
@ -28,12 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
}
}
/// <summary>
/// Retrieves the numeric health increase of a <see cref="HitResult"/>.
/// </summary>
/// <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>
protected virtual double HealthIncreaseFor(HitResult result)
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)
{
@ -47,12 +37,5 @@ namespace osu.Game.Rulesets.Taiko.Judgements
return 0;
}
}
/// <summary>
/// Retrieves the numeric health increase of a <see cref="JudgementResult"/>.
/// </summary>
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric health increase for.</param>
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type);
}
}

View File

@ -12,8 +12,6 @@ namespace osu.Game.Rulesets.Taiko.Objects
{
public class DrumRoll : TaikoHitObject, IHasEndTime
{
public override Judgement CreateJudgement() => new TaikoDrumRollJudgement();
/// <summary>
/// Drum roll distance that results in a duration of 1 speed-adjusted beat length.
/// </summary>
@ -85,5 +83,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
first = false;
}
}
public override Judgement CreateJudgement() => new TaikoDrumRollJudgement();
}
}

View File

@ -10,8 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Objects
{
public class Swell : TaikoHitObject, IHasEndTime
{
public override Judgement CreateJudgement() => new TaikoSwellJudgement();
public double EndTime => StartTime + Duration;
public double Duration { get; set; }
@ -30,5 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
for (int i = 0; i < RequiredHits; i++)
AddNested(new SwellTick());
}
public override Judgement CreateJudgement() => new TaikoSwellJudgement();
}
}

View File

@ -44,5 +44,19 @@ namespace osu.Game.Rulesets.Judgements
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric score representation for.</param>
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
public int NumericResultFor(JudgementResult result) => NumericResultFor(result.Type);
/// <summary>
/// Retrieves the numeric health increase of a <see cref="HitResult"/>.
/// </summary>
/// <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>
protected virtual double HealthIncreaseFor(HitResult result) => 0;
/// <summary>
/// Retrieves the numeric health increase of a <see cref="JudgementResult"/>.
/// </summary>
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric health increase for.</param>
/// <returns>The numeric health increase of <paramref name="result"/>.</returns>
public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type);
}
}