mirror of
https://github.com/ppy/osu.git
synced 2026-05-15 05:02:33 +08:00
Compare commits
5 Commits
2020.710.0
...
2020.712.0
@@ -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)
|
||||
|
||||
@@ -252,6 +252,12 @@ namespace osu.Game.Rulesets.Scoring
|
||||
HighestCombo.Value = 0;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
hitEvents.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a score populated with data for the current play this processor is responsible for.
|
||||
/// </summary>
|
||||
@@ -269,7 +275,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
|
||||
score.Statistics[result] = GetStatistic(result);
|
||||
|
||||
score.HitEvents = new List<HitEvent>(hitEvents);
|
||||
score.HitEvents = hitEvents;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user