1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:02:55 +08:00

Merge pull request #26561 from peppy/fix-catch-banana-health-bar

Fix argon health bar showing "miss" bar for bananas
This commit is contained in:
Bartłomiej Dach 2024-01-16 11:04:38 +01:00 committed by GitHub
commit cde0c0b2ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -94,6 +94,11 @@ namespace osu.Game.Rulesets.Judgements
/// </summary>
public bool IsHit => Type.IsHit();
/// <summary>
/// The increase in health resulting from this judgement result.
/// </summary>
public double HealthIncrease => Judgement.HealthIncreaseFor(this);
/// <summary>
/// Creates a new <see cref="JudgementResult"/>.
/// </summary>

View File

@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
/// <param name="result">The <see cref="JudgementResult"/>.</param>
/// <returns>The health increase.</returns>
protected virtual double GetHealthIncreaseFor(JudgementResult result) => result.Judgement.HealthIncreaseFor(result);
protected virtual double GetHealthIncreaseFor(JudgementResult result) => result.HealthIncrease;
/// <summary>
/// The default conditions for failing.

View File

@ -136,7 +136,12 @@ namespace osu.Game.Screens.Play.HUD
BarHeight.BindValueChanged(_ => updateContentSize(), true);
}
private void onNewJudgement(JudgementResult result) => pendingMissAnimation |= !result.IsHit;
private void onNewJudgement(JudgementResult result)
{
// Check the health increase because cases like osu!catch bananas fire `IgnoreMiss`,
// which counts as a miss but doesn't actually subtract any health.
pendingMissAnimation |= !result.IsHit && result.HealthIncrease < 0;
}
protected override void Update()
{