mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Simplify DT/HT/NC/DC
This commit is contained in:
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override void ApplyToClock(IAdjustableClock clock)
|
public override void ApplyToClock(IAdjustableClock clock)
|
||||||
{
|
{
|
||||||
if (clock is IHasPitchAdjust pitchAdjust)
|
if (clock is IHasPitchAdjust pitchAdjust)
|
||||||
pitchAdjust.PitchAdjust = 0.75;
|
pitchAdjust.PitchAdjust *= RateAdjust;
|
||||||
else
|
else
|
||||||
base.ApplyToClock(clock);
|
base.ApplyToClock(clock);
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Timing;
|
using System.Linq;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public abstract class ModDoubleTime : Mod, IApplicableToClock
|
public abstract class ModDoubleTime : ModTimeAdjust, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Double Time";
|
public override string Name => "Double Time";
|
||||||
public override string Acronym => "DT";
|
public override string Acronym => "DT";
|
||||||
@ -15,11 +15,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Zoooooooooom...";
|
public override string Description => "Zoooooooooom...";
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime), typeof(ModTimeRamp) };
|
|
||||||
|
|
||||||
public virtual void ApplyToClock(IAdjustableClock clock)
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModHalfTime)).ToArray();
|
||||||
{
|
|
||||||
clock.Rate = 1.5;
|
protected override double RateAdjust => 1.5;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Timing;
|
using System.Linq;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public abstract class ModHalfTime : Mod, IApplicableToClock
|
public abstract class ModHalfTime : ModTimeAdjust, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Half Time";
|
public override string Name => "Half Time";
|
||||||
public override string Acronym => "HT";
|
public override string Acronym => "HT";
|
||||||
@ -15,11 +15,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "Less zoom...";
|
public override string Description => "Less zoom...";
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModTimeRamp) };
|
|
||||||
|
|
||||||
public virtual void ApplyToClock(IAdjustableClock clock)
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModDoubleTime)).ToArray();
|
||||||
{
|
|
||||||
clock.Rate = 0.75;
|
protected override double RateAdjust => 0.75;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override void ApplyToClock(IAdjustableClock clock)
|
public override void ApplyToClock(IAdjustableClock clock)
|
||||||
{
|
{
|
||||||
if (clock is IHasPitchAdjust pitchAdjust)
|
if (clock is IHasPitchAdjust pitchAdjust)
|
||||||
pitchAdjust.PitchAdjust = 1.5;
|
pitchAdjust.PitchAdjust *= RateAdjust;
|
||||||
else
|
else
|
||||||
base.ApplyToClock(clock);
|
base.ApplyToClock(clock);
|
||||||
}
|
}
|
||||||
|
24
osu.Game/Rulesets/Mods/ModTimeAdjust.cs
Normal file
24
osu.Game/Rulesets/Mods/ModTimeAdjust.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// 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;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mods
|
||||||
|
{
|
||||||
|
public abstract class ModTimeAdjust : Mod
|
||||||
|
{
|
||||||
|
public override Type[] IncompatibleMods => new[] { typeof(ModTimeRamp) };
|
||||||
|
|
||||||
|
protected abstract double RateAdjust { get; }
|
||||||
|
|
||||||
|
public virtual void ApplyToClock(IAdjustableClock clock)
|
||||||
|
{
|
||||||
|
if (clock is IHasTempoAdjust tempo)
|
||||||
|
tempo.TempoAdjust *= RateAdjust;
|
||||||
|
else
|
||||||
|
clock.Rate *= RateAdjust;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user