1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Fix transition out of clear state

This commit is contained in:
Bartłomiej Dach 2020-04-30 22:16:25 +02:00
parent 5cfc05e12a
commit db4c8b2ba5
2 changed files with 6 additions and 4 deletions

View File

@ -144,15 +144,16 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Good }, TaikoMascotAnimationState.Clear); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Good }, TaikoMascotAnimationState.Clear);
} }
[TestCase(true)] [TestCase(true, TaikoMascotAnimationState.Kiai)]
[TestCase(false)] [TestCase(false, TaikoMascotAnimationState.Idle)]
public void TestClearStateOnClearedSwell(bool kiai) public void TestClearStateOnClearedSwell(bool kiai, TaikoMascotAnimationState expectedStateAfterClear)
{ {
AddStep("set beatmap", () => setBeatmap(kiai)); AddStep("set beatmap", () => setBeatmap(kiai));
createDrawableRuleset(); createDrawableRuleset();
assertStateAfterResult(new JudgementResult(new Swell(), new TaikoSwellJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Clear); assertStateAfterResult(new JudgementResult(new Swell(), new TaikoSwellJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Clear);
AddUntilStep($"state reverts to {expectedStateAfterClear.ToString().ToLower()}", () => allMascotsIn(expectedStateAfterClear));
} }
private void setBeatmap(bool kiai = false) private void setBeatmap(bool kiai = false)

View File

@ -61,7 +61,8 @@ namespace osu.Game.Rulesets.Taiko.UI
if (triggerComboClear(result) || triggerSwellClear(result)) if (triggerComboClear(result) || triggerSwellClear(result))
{ {
state.Value = TaikoMascotAnimationState.Clear; state.Value = TaikoMascotAnimationState.Clear;
return; // never play fail immediately after clear.
lastObjectHit = true;
} }
if (!result.Judgement.AffectsCombo) if (!result.Judgement.AffectsCombo)