1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Fix strong hits not being visualised

This commit is contained in:
smoogipoo 2018-08-06 13:01:27 +09:00
parent 60c94a8ea3
commit 5c4c2dff09
2 changed files with 29 additions and 12 deletions

View File

@ -39,8 +39,10 @@ namespace osu.Game.Rulesets.Taiko.Tests
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
AddStep("Hit!", () => addHitJudgement(false)); AddStep("Hit", () => addHitJudgement(false));
AddStep("Strong hit", () => addStrongHitJudgement(false));
AddStep("Kiai hit", () => addHitJudgement(true)); AddStep("Kiai hit", () => addHitJudgement(true));
AddStep("Strong kiai hit", () => addStrongHitJudgement(true));
AddStep("Miss :(", addMissJudgement); AddStep("Miss :(", addMissJudgement);
AddStep("DrumRoll", () => addDrumRoll(false)); AddStep("DrumRoll", () => addDrumRoll(false));
AddStep("Strong DrumRoll", () => addDrumRoll(true)); AddStep("Strong DrumRoll", () => addDrumRoll(true));
@ -130,10 +132,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
HitResult hitResult = RNG.Next(2) == 0 ? HitResult.Good : HitResult.Great; HitResult hitResult = RNG.Next(2) == 0 ? HitResult.Good : HitResult.Great;
var cpi = new ControlPointInfo(); var cpi = new ControlPointInfo();
cpi.EffectPoints.Add(new EffectControlPoint cpi.EffectPoints.Add(new EffectControlPoint { KiaiMode = kiai });
{
KiaiMode = kiai
});
Hit hit = new Hit(); Hit hit = new Hit();
hit.ApplyDefaults(cpi, new BeatmapDifficulty()); hit.ApplyDefaults(cpi, new BeatmapDifficulty());
@ -141,12 +140,22 @@ namespace osu.Game.Rulesets.Taiko.Tests
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) }; var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult }); ((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
}
if (RNG.Next(10) == 0) private void addStrongHitJudgement(bool kiai)
{ {
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult }); HitResult hitResult = RNG.Next(2) == 0 ? HitResult.Good : HitResult.Great;
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
} var cpi = new ControlPointInfo();
cpi.EffectPoints.Add(new EffectControlPoint { KiaiMode = kiai });
Hit hit = new Hit();
hit.ApplyDefaults(cpi, new BeatmapDifficulty());
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new TestStrongHandler(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
} }
private void addMissJudgement() private void addMissJudgement()
@ -217,6 +226,16 @@ namespace osu.Game.Rulesets.Taiko.Tests
rulesetContainer.Playfield.Add(new DrawableRimHit(h)); rulesetContainer.Playfield.Add(new DrawableRimHit(h));
} }
private class TestStrongHandler : DrawableStrongHandler
{
public TestStrongHandler(DrawableHitObject mainObject)
: base(null, mainObject)
{
}
public override bool OnPressed(TaikoAction action) => false;
}
private class DrawableTestHit : DrawableHitObject<TaikoHitObject> private class DrawableTestHit : DrawableHitObject<TaikoHitObject>
{ {
public DrawableTestHit(TaikoHitObject hitObject) public DrawableTestHit(TaikoHitObject hitObject)

View File

@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary> /// </summary>
public abstract class DrawableStrongHandler : DrawableTaikoHitObject public abstract class DrawableStrongHandler : DrawableTaikoHitObject
{ {
public override bool DisplayResult => false;
public readonly DrawableHitObject MainObject; public readonly DrawableHitObject MainObject;
protected DrawableStrongHandler(StrongHitObject strong, DrawableHitObject mainObject) protected DrawableStrongHandler(StrongHitObject strong, DrawableHitObject mainObject)