Skip to content

Commit

Permalink
Merge pull request ppy#16475 from bdach/taiko-not-completing
Browse files Browse the repository at this point in the history
Fix gameplay not completing on some taiko maps
  • Loading branch information
smoogipoo authored Jan 17, 2022
2 parents 4ac8830 + 34e9996 commit e83c83a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
36 changes: 36 additions & 0 deletions osu.Game.Rulesets.Taiko.Tests/TestSceneDrumRollJudgements.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Taiko.Objects;

namespace osu.Game.Rulesets.Taiko.Tests
{
public class TestSceneDrumRollJudgements : TestSceneTaikoPlayer
{
[Test]
public void TestStrongDrumRollFullyJudgedOnKilled()
{
AddUntilStep("gameplay finished", () => Player.ScoreProcessor.HasCompleted.Value);
AddAssert("all judgements are misses", () => Player.Results.All(r => r.Type == r.Judgement.MinResult));
}

protected override bool Autoplay => false;

protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new Beatmap<TaikoHitObject>
{
BeatmapInfo = { Ruleset = new TaikoRuleset().RulesetInfo },
HitObjects =
{
new DrumRoll
{
StartTime = 1000,
Duration = 1000,
IsStrong = true
}
}
};
}
}
8 changes: 8 additions & 0 deletions osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
ApplyResult(r => r.Type = ParentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult);
}

public override void OnKilled()
{
base.OnKilled();

if (Time.Current > ParentHitObject.HitObject.GetEndTime() && !Judged)
ApplyResult(r => r.Type = r.Judgement.MinResult);
}

public override bool OnPressed(KeyBindingPressEvent<TaikoAction> e) => false;
}
}
Expand Down
17 changes: 17 additions & 0 deletions osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using JetBrains.Annotations;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Skinning.Default;
using osu.Game.Skinning;
Expand Down Expand Up @@ -52,6 +53,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}

public override void OnKilled()
{
base.OnKilled();

if (Time.Current > HitObject.GetEndTime() && !Judged)
ApplyResult(r => r.Type = r.Judgement.MinResult);
}

protected override void UpdateHitStateTransforms(ArmedState state)
{
switch (state)
Expand Down Expand Up @@ -92,6 +101,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
ApplyResult(r => r.Type = ParentHitObject.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult);
}

public override void OnKilled()
{
base.OnKilled();

if (Time.Current > ParentHitObject.HitObject.GetEndTime() && !Judged)
ApplyResult(r => r.Type = r.Judgement.MinResult);
}

public override bool OnPressed(KeyBindingPressEvent<TaikoAction> e) => false;
}
}
Expand Down

0 comments on commit e83c83a

Please sign in to comment.