mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Merge pull request #9528 from smoogipoo/fix-bonus-judgement-hp
This commit is contained in:
commit
213eb24831
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
||||
return 0;
|
||||
|
||||
case HitResult.Perfect:
|
||||
return 0.01;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,24 @@ namespace osu.Game.Tests.Gameplay
|
||||
assertHealthNotEqualTo(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBonusObjectsExcludedFromDrain()
|
||||
{
|
||||
var beatmap = new Beatmap
|
||||
{
|
||||
BeatmapInfo = { BaseDifficulty = { DrainRate = 10 } },
|
||||
};
|
||||
|
||||
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 0 });
|
||||
for (double time = 0; time < 5000; time += 100)
|
||||
beatmap.HitObjects.Add(new JudgeableHitObject(false) { StartTime = time });
|
||||
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 5000 });
|
||||
|
||||
createProcessor(beatmap);
|
||||
setTime(4900); // Get close to the second combo-affecting object
|
||||
assertHealthNotEqualTo(0);
|
||||
}
|
||||
|
||||
private Beatmap createBeatmap(double startTime, double endTime, params BreakPeriod[] breaks)
|
||||
{
|
||||
var beatmap = new Beatmap
|
||||
@ -197,8 +215,25 @@ namespace osu.Game.Tests.Gameplay
|
||||
|
||||
private class JudgeableHitObject : HitObject
|
||||
{
|
||||
public override Judgement CreateJudgement() => new Judgement();
|
||||
private readonly bool affectsCombo;
|
||||
|
||||
public JudgeableHitObject(bool affectsCombo = true)
|
||||
{
|
||||
this.affectsCombo = affectsCombo;
|
||||
}
|
||||
|
||||
public override Judgement CreateJudgement() => new TestJudgement(affectsCombo);
|
||||
protected override HitWindows CreateHitWindows() => new HitWindows();
|
||||
|
||||
private class TestJudgement : Judgement
|
||||
{
|
||||
public override bool AffectsCombo { get; }
|
||||
|
||||
public TestJudgement(bool affectsCombo)
|
||||
{
|
||||
AffectsCombo = affectsCombo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,9 @@ namespace osu.Game.Rulesets.Scoring
|
||||
protected override void ApplyResultInternal(JudgementResult result)
|
||||
{
|
||||
base.ApplyResultInternal(result);
|
||||
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
|
||||
|
||||
if (!result.Judgement.IsBonus)
|
||||
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
|
||||
}
|
||||
|
||||
protected override void Reset(bool storeResults)
|
||||
|
Loading…
Reference in New Issue
Block a user