1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 17:47:18 +08:00

Make drum rolls and swells optional with Classic mod

This commit is contained in:
sw1tchbl4d3 2022-06-19 02:10:23 +02:00
parent d0c9788a4a
commit a5bf16e873
10 changed files with 81 additions and 8 deletions

View File

@ -9,6 +9,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public class TaikoDrumRollJudgement : TaikoJudgement
{
public bool IsBonus = false;
public override HitResult MaxResult => IsBonus ? HitResult.LargeBonus : HitResult.Great;
protected override double HealthIncreaseFor(HitResult result)
{
// Drum rolls can be ignored with no health penalty

View File

@ -9,7 +9,9 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public class TaikoDrumRollTickJudgement : TaikoJudgement
{
public override HitResult MaxResult => HitResult.SmallTickHit;
public bool IsBonus = false;
public override HitResult MaxResult => IsBonus ? HitResult.LargeBonus : HitResult.SmallTickHit;
protected override double HealthIncreaseFor(HitResult result)
{

View File

@ -9,6 +9,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public class TaikoSwellJudgement : TaikoJudgement
{
public bool IsBonus = false;
public override HitResult MaxResult => IsBonus ? HitResult.LargeBonus : HitResult.Great;
protected override double HealthIncreaseFor(HitResult result)
{
switch (result)

View File

@ -4,13 +4,14 @@
#nullable disable
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IUpdatableByPlayfield
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IUpdatableByPlayfield, IApplicableToHitObject
{
private DrawableTaikoRuleset drawableTaikoRuleset;
@ -20,6 +21,14 @@ namespace osu.Game.Rulesets.Taiko.Mods
drawableTaikoRuleset.LockPlayfieldAspect.Value = false;
}
public void ApplyToHitObject(HitObject hitObject)
{
if (hitObject is DrumRoll drumRoll)
drumRoll.SetBonus(true);
else if (hitObject is Swell swell)
swell.SetBonus(true);
}
public void Update(Playfield playfield)
{
// Classic taiko scrolls at a constant 100px per 1000ms. More notes become visible as the playfield is lengthened.

View File

@ -144,7 +144,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
if (countHit >= HitObject.RequiredGoodHits)
{
ApplyResult(r => r.Type = countHit >= HitObject.RequiredGreatHits ? HitResult.Great : HitResult.Ok);
ApplyResult(r =>
{
// With the Classic mod, don't award points for a finished drum roll, only for ticks.
if (r.Judgement.MaxResult == HitResult.LargeBonus)
r.Type = HitResult.IgnoreMiss;
else
r.Type = countHit >= HitObject.RequiredGreatHits ? HitResult.Great : HitResult.Ok;
});
}
else
ApplyResult(r => r.Type = r.Judgement.MinResult);

View File

@ -201,7 +201,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint);
if (numHits == HitObject.RequiredHits)
ApplyResult(r => r.Type = HitResult.Great);
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}
else
{
@ -222,7 +222,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
tick.TriggerResult(false);
}
ApplyResult(r => r.Type = numHits > HitObject.RequiredHits / 2 ? HitResult.Ok : r.Judgement.MinResult);
ApplyResult(r =>
{
// With the Classic mod, don't award combo or accuracy for a finished swell.
if (r.Judgement.MaxResult == HitResult.LargeBonus)
r.Type = numHits > HitObject.RequiredHits / 2 ? HitResult.LargeBonus : r.Judgement.MinResult;
else
r.Type = numHits > HitObject.RequiredHits / 2 ? HitResult.Ok : r.Judgement.MinResult;
});
}
}

View File

@ -52,6 +52,11 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary>
public double RequiredGreatHits { get; protected set; }
/// <summary>
/// Defines if drum rolls are affected by the Classic mod, making them bonus only.
/// </summary>
private bool isBonus;
/// <summary>
/// The length (in milliseconds) between ticks of this drumroll.
/// <para>Half of this value is the hit window of the ticks.</para>
@ -106,7 +111,18 @@ namespace osu.Game.Rulesets.Taiko.Objects
}
}
public override Judgement CreateJudgement() => new TaikoDrumRollJudgement();
public void SetBonus(bool bonus)
{
isBonus = bonus;
foreach (HitObject hitObject in NestedHitObjects)
{
if (hitObject is DrumRollTick drumRollTick)
drumRollTick.IsBonus = bonus;
}
}
public override Judgement CreateJudgement() => new TaikoDrumRollJudgement { IsBonus = isBonus };
protected override HitWindows CreateHitWindows() => HitWindows.Empty;

View File

@ -27,7 +27,12 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary>
public double HitWindow => TickSpacing / 2;
public override Judgement CreateJudgement() => new TaikoDrumRollTickJudgement();
/// <summary>
/// Defines if ticks are affected by the Classic mod, making them bonus only.
/// </summary>
public bool IsBonus = false;
public override Judgement CreateJudgement() => new TaikoDrumRollTickJudgement { IsBonus = IsBonus };
protected override HitWindows CreateHitWindows() => HitWindows.Empty;

View File

@ -26,6 +26,16 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary>
public int RequiredHits = 10;
/// <summary>
/// Defines if swells are affected by the Classic mod, making them bonus only.
/// </summary>
private bool isBonus;
public void SetBonus(bool bonus)
{
isBonus = bonus;
}
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{
base.CreateNestedHitObjects(cancellationToken);
@ -37,7 +47,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
}
}
public override Judgement CreateJudgement() => new TaikoSwellJudgement();
public override Judgement CreateJudgement() => new TaikoSwellJudgement { IsBonus = isBonus };
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
}

View File

@ -295,6 +295,15 @@ namespace osu.Game.Rulesets.Taiko.UI
break;
default:
// Don't draw judgement results for bonus sliderticks with the Classic mod.
switch (result.Type)
{
case HitResult.IgnoreHit:
case HitResult.IgnoreMiss:
case HitResult.LargeBonus:
return;
}
judgementContainer.Add(judgementPools[result.Type].Get(j =>
{
j.Apply(result, judgedObject);