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: default:
return 0; return 0;
case HitResult.Perfect: case HitResult.Perfect:
return 8; return 0.08;
} }
} }

View File

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

View File

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

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
default: default:
return 0; return 0;
case HitResult.Perfect: 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. // 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. // See the LICENCE file in the repository root for full licence text.
using System;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
@ -27,20 +26,17 @@ namespace osu.Game.Rulesets.Catch.Scoring
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate; hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
} }
private const double harshness = 0.01; protected override double HpFactorFor(Judgement judgement, HitResult result)
protected override void ApplyResult(JudgementResult result)
{ {
base.ApplyResult(result); switch (result)
if (result.Type == HitResult.Miss)
{ {
if (!result.Judgement.IsBonus) case HitResult.Miss when judgement.IsBonus:
Health.Value -= hpDrainRate * (harshness * 2); return 0;
return; 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(); public override HitWindows CreateHitWindows() => new CatchHitWindows();