mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 00:37:20 +08:00
Add test scenarios for same-frame judgements
This commit is contained in:
parent
9496cdf42b
commit
986f4fa407
@ -83,13 +83,18 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddRepeatStep(@"increase hp with flash", delegate
|
||||
{
|
||||
healthProcessor.Health.Value += 0.1f;
|
||||
healthProcessor.ApplyResult(new JudgementResult(new HitCircle(), new OsuJudgement())
|
||||
{
|
||||
Type = HitResult.Perfect
|
||||
});
|
||||
applyPerfectHit();
|
||||
}, 3);
|
||||
}
|
||||
|
||||
private void applyPerfectHit()
|
||||
{
|
||||
healthProcessor.ApplyResult(new JudgementResult(new HitCircle(), new OsuJudgement())
|
||||
{
|
||||
Type = HitResult.Perfect
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLateMissAfterConsequentMisses()
|
||||
{
|
||||
@ -124,6 +129,29 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMissThenHitAtSameUpdateFrame()
|
||||
{
|
||||
AddUntilStep("wait for health", () => healthDisplay.Current.Value == 1);
|
||||
AddStep("set half health", () => healthProcessor.Health.Value = 0.5f);
|
||||
AddStep("apply miss and hit", () =>
|
||||
{
|
||||
applyMiss();
|
||||
applyMiss();
|
||||
applyPerfectHit();
|
||||
applyPerfectHit();
|
||||
});
|
||||
AddWaitStep("wait", 3);
|
||||
AddStep("apply miss and cancel with hit", () =>
|
||||
{
|
||||
applyMiss();
|
||||
applyPerfectHit();
|
||||
applyPerfectHit();
|
||||
applyPerfectHit();
|
||||
applyPerfectHit();
|
||||
});
|
||||
}
|
||||
|
||||
private void applyMiss()
|
||||
{
|
||||
healthProcessor.ApplyResult(new JudgementResult(new HitObject(), new Judgement()) { Type = HitResult.Miss });
|
||||
|
Loading…
x
Reference in New Issue
Block a user