1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Implement approximate hp increase for catch

This commit is contained in:
smoogipoo 2019-04-22 16:59:14 +09:00
parent fbb4e9df04
commit d7919544fe
5 changed files with 14 additions and 18 deletions

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
default:
return 0;
case HitResult.Perfect:
return 8;
return 0.08;
}
}

View File

@ -23,9 +23,9 @@ namespace osu.Game.Rulesets.Catch.Judgements
switch (result)
{
default:
return 0;
return base.HealthIncreaseFor(result);
case HitResult.Perfect:
return 7;
return 0.07;
}
}
}

View File

@ -27,9 +27,9 @@ namespace osu.Game.Rulesets.Catch.Judgements
switch (result)
{
default:
return 0;
return -0.02;
case HitResult.Perfect:
return 10.2;
return 0.01;
}
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
default:
return 0;
case HitResult.Perfect:
return 4;
return 0.004;
}
}
}

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Judgements;
@ -27,20 +26,17 @@ namespace osu.Game.Rulesets.Catch.Scoring
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
}
private const double harshness = 0.01;
protected override void ApplyResult(JudgementResult result)
protected override double HpFactorFor(Judgement judgement, HitResult result)
{
base.ApplyResult(result);
if (result.Type == HitResult.Miss)
switch (result)
{
if (!result.Judgement.IsBonus)
Health.Value -= hpDrainRate * (harshness * 2);
return;
case HitResult.Miss when judgement.IsBonus:
return 0;
case HitResult.Miss:
return hpDrainRate;
default:
return 10 - hpDrainRate; // Award less HP as drain rate is increased
}
Health.Value += Math.Max(result.Judgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness;
}
public override HitWindows CreateHitWindows() => new CatchHitWindows();