mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Make drum rolls and swells optional with Classic
mod
This commit is contained in:
@ -9,6 +9,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public class TaikoDrumRollJudgement : TaikoJudgement
|
public class TaikoDrumRollJudgement : TaikoJudgement
|
||||||
{
|
{
|
||||||
|
public bool IsBonus = false;
|
||||||
|
|
||||||
|
public override HitResult MaxResult => IsBonus ? HitResult.LargeBonus : HitResult.Great;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
// Drum rolls can be ignored with no health penalty
|
// Drum rolls can be ignored with no health penalty
|
||||||
|
@ -9,7 +9,9 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public class TaikoDrumRollTickJudgement : TaikoJudgement
|
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)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
|
@ -9,6 +9,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
public class TaikoSwellJudgement : TaikoJudgement
|
public class TaikoSwellJudgement : TaikoJudgement
|
||||||
{
|
{
|
||||||
|
public bool IsBonus = false;
|
||||||
|
|
||||||
|
public override HitResult MaxResult => IsBonus ? HitResult.LargeBonus : HitResult.Great;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Rulesets.Taiko.UI;
|
using osu.Game.Rulesets.Taiko.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Mods
|
namespace osu.Game.Rulesets.Taiko.Mods
|
||||||
{
|
{
|
||||||
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IUpdatableByPlayfield
|
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IUpdatableByPlayfield, IApplicableToHitObject
|
||||||
{
|
{
|
||||||
private DrawableTaikoRuleset drawableTaikoRuleset;
|
private DrawableTaikoRuleset drawableTaikoRuleset;
|
||||||
|
|
||||||
@ -20,6 +21,14 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
drawableTaikoRuleset.LockPlayfieldAspect.Value = false;
|
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)
|
public void Update(Playfield playfield)
|
||||||
{
|
{
|
||||||
// Classic taiko scrolls at a constant 100px per 1000ms. More notes become visible as the playfield is lengthened.
|
// Classic taiko scrolls at a constant 100px per 1000ms. More notes become visible as the playfield is lengthened.
|
||||||
|
@ -144,7 +144,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
if (countHit >= HitObject.RequiredGoodHits)
|
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
|
else
|
||||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||||
|
@ -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);
|
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint);
|
||||||
|
|
||||||
if (numHits == HitObject.RequiredHits)
|
if (numHits == HitObject.RequiredHits)
|
||||||
ApplyResult(r => r.Type = HitResult.Great);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -222,7 +222,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
tick.TriggerResult(false);
|
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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,11 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double RequiredGreatHits { get; protected set; }
|
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>
|
/// <summary>
|
||||||
/// The length (in milliseconds) between ticks of this drumroll.
|
/// The length (in milliseconds) between ticks of this drumroll.
|
||||||
/// <para>Half of this value is the hit window of the ticks.</para>
|
/// <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;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
|
|
||||||
|
@ -27,7 +27,12 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double HitWindow => TickSpacing / 2;
|
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;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
|
|
||||||
|
@ -26,6 +26,16 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int RequiredHits = 10;
|
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)
|
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
base.CreateNestedHitObjects(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;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
}
|
}
|
||||||
|
@ -295,6 +295,15 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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 =>
|
judgementContainer.Add(judgementPools[result.Type].Get(j =>
|
||||||
{
|
{
|
||||||
j.Apply(result, judgedObject);
|
j.Apply(result, judgedObject);
|
||||||
|
Reference in New Issue
Block a user